File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -236,8 +236,10 @@ export async function interceptAndroidFridaTarget(
236
236
console . log ( `Intercepting ${ appId } via Android Frida on ${ hostId } ...` ) ;
237
237
const deviceClient = adbClient . getDevice ( hostId ) ;
238
238
239
- await createPersistentReverseTunnel ( deviceClient , proxyPort , proxyPort )
240
- . catch ( ( ) => { } ) ; // If we can't tunnel that's OK - we'll use wifi/etc instead
239
+ // We try to tunnel the proxy over ADB, but if we can't then that's OK - we'll use wifi/etc instead
240
+ const tunnelCreated = await createPersistentReverseTunnel ( deviceClient , proxyPort , proxyPort )
241
+ . then ( ( ) => true )
242
+ . catch ( ( ) => false )
241
243
242
244
const fridaStream = await getFridaStream ( hostId , deviceClient ) ;
243
245
@@ -255,6 +257,13 @@ export async function interceptAndroidFridaTarget(
255
257
'127.0.0.1' ,
256
258
...EMULATOR_HOST_IPS ,
257
259
]
260
+ } ) . catch ( ( e ) => {
261
+ console . warn ( `Failed to select proxy address for ${ appId } on ${ hostId } : ${ e . message ?? e } ` ) ;
262
+
263
+ // This can be flaky in some weird cases - when all else fails, we always fallback to the
264
+ // ADB reverse tunnel if that's available
265
+ if ( tunnelCreated ) return '127.0.0.1'
266
+ else throw e ;
258
267
} ) ;
259
268
260
269
const interceptionScript = await buildAndroidFridaScript (
You can’t perform that action at this time.
0 commit comments