Closed rkba closed 4 years ago
Even when using patch-apk this fails with this exception:
Unable to determine the launchable activity using aapt, trying to manually parse the AndroidManifest for activity aliases...
Cannot manually parse the AndroidManifest.xml when --skip-resources is set, remove this and try again.
Traceback (most recent call last):
File "/usr/local/bin/objection", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/objection/console/cli.py", line 371, in patchapk
patch_android_apk(**locals())
File "/usr/local/lib/python3.7/site-packages/objection/commands/mobile_packages.py", line 200, in patch_android_apk
patcher.inject_load_library(target_class=target_class)
File "/usr/local/lib/python3.7/site-packages/objection/utils/patchers/android.py", line 782, in inject_load_library
target_class if target_class else self._get_launchable_activity())
File "/usr/local/lib/python3.7/site-packages/objection/utils/patchers/android.py", line 341, in _get_launchable_activity
manifest = self._get_android_manifest()
File "/usr/local/lib/python3.7/site-packages/objection/utils/patchers/android.py", line 287, in _get_android_manifest
raise Exception('Cannot --skip-resources when trying to manually parse the AndroidManifest.xml')
Exception: Cannot --skip-resources when trying to manually parse the AndroidManifest.xml
Full log: https://gist.github.com/rkba/7aa3c157e7ea6bedb23fc46e618e3dce
Is this some kind of anti-reverse-engineering tool being used here or a bug in ojection or so for parsing the AndroidManifest.xml
?
frida.TransportError: the connection is closed
These are usually pretty hard to debug straight out of objection. I would suggest you remove the complexity objection adds here and give raw Frida a try first. Attaching Frida and performing some simple instrumentation should be enough to see what's happening. It could very well be that there is some anti-frida that you need to bypass.
Unable to determine the launchable activity using aapt, trying to manually parse the AndroidManifest for activity aliases... Cannot manually parse the AndroidManifest.xml when --skip-resources is set, remove this and try again.
The --skip-resources flag wont decode the AndroidManifest, so because aapt
cant find a launchable activity it will try and parse the AndroidManifiest. However, with skip-resources, this is not decoded so it can't do that. I suggest you manually unpack the APK, check which class in the manifest you want to patch and specify that with the --target-class
flag on the Android patcher command.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Just do
objection --debug --gadget "*****" explore
Similar issues see "Application"
Expected behavior A clear and concise description of what you expected to happen.
Evidence / Logs / Screenshots Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the
--debug
flag so that errors from the agent are verbose enough to debug. For example:Environment (please complete the following information):
Application I can find some split config in the data dir of the app, so maybe it is related to #358? Does objection crash, if it tries to use a split APK.