Skip to content

Commit 2385017

Browse files
committed
Fix first-run Frida interception
On Android (at least) when an app has never been launched, Socket.connect() never resolves until the app is resumed. In our case, we need to pick an IP & inject the hooks before we can resume, so this is problematic. To handle this, we already fallback to the tunnel IP if it connected OK (should almost always happen) but the 10s timeout means the connection actually breaks before that can happen. Dropping the timeout (connect should really take single-digit milliseconds in normal cases) means we inject the script & resume very quickly in this case.
1 parent b45e338 commit 2385017

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interceptors/frida/frida-integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export async function testAndSelectProxyAddress(
126126

127127
const ipTestScript = await buildIpTestScript(ips, proxyPort);
128128

129-
return await withTimeout(10_000, new Promise<string>(async (resolve, reject) => {
129+
return await withTimeout(1_000, new Promise<string>(async (resolve, reject) => {
130130
try {
131131
session.onMessage((message) => {
132132
if (message.type === 'send') {

0 commit comments

Comments
 (0)