Sample Header Ad - 728x90

Record manual actions and convert them to adb shell am start intents/actions?

1 vote
0 answers
505 views
## Question Is it possible to record phone inputs and the accompanying intents/actions that are executed within an app, and to reproduce them automatically with adb shell? ## Context I was looking into the output of the:
adb shell "dumpsys package | grep -i 'org.torproject.android'"
Command, which is:
9a8407 org.torproject.android/.OrbotMainActivity
      org.torproject.android.REQUEST_V3_ONION_SERVICE:
        9a8407 org.torproject.android/.OrbotMainActivity
        9a8407 org.torproject.android/.OrbotMainActivity
        da9ed3a org.torproject.android/.core.OnBootReceiver
      org.torproject.android.intent.action.START:
        9f74748 org.torproject.android/.service.StartTorReceiver
        da9ed3a org.torproject.android/.core.OnBootReceiver
        da9ed3a org.torproject.android/.core.OnBootReceiver
        da9ed3a org.torproject.android/.core.OnBootReceiver
        da9ed3a org.torproject.android/.core.OnBootReceiver
        90dcf08 org.torproject.android/.service.OrbotService
  org.torproject.android/.ui.v3onionservice.OnionServiceContentProvider:
    Provider{8d5ddf org.torproject.android/.ui.v3onionservice.OnionServiceContentProvider}
  org.torproject.android/.ui.v3onionservice.clientauth.ClientAuthContentProvider:
    Provider{8dce92e org.torproject.android/.ui.v3onionservice.clientauth.ClientAuthContentProvider}

      applicationInfo=ApplicationInfo{11b6e8d org.torproject.android}

      applicationInfo=ApplicationInfo{11b6e8d org.torproject.android}
  [org.torproject.android]
  Package [org.torproject.android] (650fe6a):
    pkg=Package{dfccf5b org.torproject.android}
    codePath=/data/app/org.torproject.android-SQmMOFFMA1-foIkNqQbMDQ==
    resourcePath=/data/app/org.torproject.android-SQmMOFFMA1-foIkNqQbMDQ==
    legacyNativeLibraryDir=/data/app/org.torproject.android-SQmMOFFMA1-foIkNqQbMDQ==/lib
    applicationInfo=ApplicationInfo{11b6e8d org.torproject.android}
    dataDir=/data/user/0/org.torproject.android
    org.torproject.android/.service.OrbotService: android.permission.BIND_VPN_SERVICE
  [org.torproject.android]
    path: /data/app/org.torproject.android-SQmMOFFMA1-foIkNqQbMDQ==/base.apk
  [org.torproject.android]
And I was analysing that to try to find the right command to start an app and press a button inside that app with:
adb shell am start -a org.torproject.android.intent.action.START -n org.torproject.android/.service.OrbotService
Which returned error: > Starting: Intent { act=org.torproject.android.intent.action.START cmp=org.torproject.android/.service.OrbotService } > Error type 3 > Error: Activity class {org.torproject.android/org.torproject.android.service.OrbotService} does not exist. I assume the syntax is almost correct based on analogue commands in other sources, but that a lack of understanding leads to incorrect commands. Based on the syntax overlap between the am start command, and the dumpsys command, I would expect the adb shell am start commands can be generated automatically based on a set of intents/actions. I assume it is possible to record the intents/actions that are generated by a user by means of input. Such an automation would save quite some time learning how these intents are specified per app. Hence the question. The closest I got so far was:
adb logcat | fgrep -i intent
However, I was not yet able to parse the logs and retrieve the relevant intents from there.
Asked by a.t. (399 rep)
Jan 5, 2023, 01:39 PM
Last activity: Jan 5, 2023, 02:04 PM