File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -124,8 +124,8 @@ function App() {
124124 console . log ( ex )
125125 }
126126 } ;
127-
128- if ( ! window ?. webkit ) {
127+ // @ts -ignore
128+ if ( ! window ?. webkit && ! window ?. Android ) {
129129 _getServerIpAddress ( ) ;
130130 }
131131 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -183,6 +183,11 @@ const Home = () => {
183183 window ?. webkit ?. messageHandlers [ "stopVPN" ] . postMessage ( null )
184184 setPower ( false ) ;
185185 }
186+ //@ts -ignore
187+ if ( window ?. Android ) {
188+ //@ts -ignore
189+ window . Android ?. sendData ( "" )
190+ }
186191 try {
187192 const response = await stopSilentPass ( ) ;
188193 if ( response . status === 200 ) {
@@ -266,6 +271,13 @@ const Home = () => {
266271 const base64VPNMessage = btoa ( stringifiedVPNMessageObject ) ;
267272 window ?. webkit ?. messageHandlers [ "startVPN" ] . postMessage ( base64VPNMessage )
268273 }
274+ // @ts -ignore
275+ if ( window ?. Android ) {
276+ const stringifiedVPNMessageObject = JSON . stringify ( startVPNMessageObject ) ;
277+ const base64VPNMessage = btoa ( stringifiedVPNMessageObject ) ;
278+ // @ts -ignore
279+ window . Android ?. sendData ( base64VPNMessage )
280+ }
269281 try {
270282 await startSilentPass ( startVPNMessageObject ) ;
271283 } catch ( ex ) {
You can’t perform that action at this time.
0 commit comments