tweaselORG / cyanoacrylate

Toolkit for large-scale automated traffic analysis of mobile apps on Android and iOS.
MIT License
5 stars 1 forks source link

First releaseable version #7

Closed zner0L closed 1 year ago

zner0L commented 1 year ago

This version of cyanoacrylate is now tested and documented enough to be used. Once we fix https://github.com/tweaselORG/appstraction/issues/32, we should also add an example on how to use the frida capability.

This is based on https://github.com/tweaselORG/appstraction/pull/42, which needs to be merged first.

baltpeter commented 1 year ago

Once we fix https://github.com/tweaselORG/appstraction/issues/32

GitHub misunderstood that. :D

baltpeter commented 1 year ago

Oh no.

❯ tsx examples/multiple-apps.ts appstraction13 clean ~/Downloads/single-apks
{
  app: { id: 'org.fdroid.fdroid', version: '1.10' },
  traffic: { '2023-03-28T13:34:24.876Z': { log: [Object] } }
}
file:///home/benni/coding/JS/tweasel/appstraction/node_modules/execa/lib/error.js:59
        error = new Error(message);
                ^

Error: Command failed with exit code 1: adb shell dumpsys deviceidle whitelist +com.wireguard.android
adb: device offline
    at makeError (file:///home/benni/coding/JS/tweasel/appstraction/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///home/benni/coding/JS/tweasel/appstraction/node_modules/execa/index.js:119:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.setAppBackgroundBatteryUsage (/home/benni/coding/JS/tweasel/appstraction/dist/src/android.ts:352:17)
    at Object.setProxy (/home/benni/coding/JS/tweasel/appstraction/dist/src/android.ts:455:13) {
  shortMessage: 'Command failed with exit code 1: adb shell dumpsys deviceidle whitelist +com.wireguard.android',
  command: 'adb shell dumpsys deviceidle whitelist +com.wireguard.android',
  escapedCommand: 'adb shell dumpsys deviceidle whitelist "+com.wireguard.android"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'adb: device offline',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Node.js v18.15.0
baltpeter commented 1 year ago

Also happens with the changes from appstraction/z_wait-for-adb, I'm afraid. :(

baltpeter commented 1 year ago

Found the problem: You need to await the setProxy(null):

https://github.com/tweaselORG/cyanoacrylate/blob/20ebe09c6666f24b9507b85d18840da3e71f46bc/src/index.ts#L480-L487

The emulator was getting reset before that was done.

baltpeter commented 1 year ago

Huh. Looks like a few of my comments weren't submitted last time…