This is a follow up to https://github.com/sensepost/objection/issues/340 which was closed, and I considered reopening, but this is a separate issue seemingly so I thought a new bug report would be better.
Still trying to get objection working as per the docs.
My versions
objection version
objection: 1.9.0
apktool --version
2.4.1
javac -version
javac 1.8.0_172
java -version
openjdk version "1.8.0_172"
OpenJDK Runtime Environment (Zulu 8.30.0.1-macosx) (build 1.8.0_172-b01)
OpenJDK 64-Bit Server VM (Zulu 8.30.0.1-macosx) (build 25.172-b01, mixed mode)
adb --version
Android Debug Bridge version 1.0.41
Version 29.0.6-6198805
Installed as /Users/coltonidle/Development/Android/SDK/platform-tools/adb
As per the docs I got the path then:
adb shell pm path com.ubercab
package:/data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/base.apk
package:/data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/split_config.arm64_v8a.apk
package:/data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/split_config.xxhdpi.apk
then
adb pull /data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/base.apk
adb pull /data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/split_config.arm64_v8a.apk
adb pull /data/app/com.ubercab-7XGjq2gMXVpmTgo_g7gA==/split_config.xxhdpi.apk
then I tried running objection patchapk --source base.apk
but it failed, so I then tried objection patchapk -D --source base.apk
(I found that in a random github issue, not sure exactly why it works) and that seemed to work. I now have 4 apks (1 of them is the base.objection.apk)
I then follow your previous instructions of calling adb install-multiple.
adb install-multiple base.objection.apk split_config.arm64_v8a.apk split_config.xxhdpi.apk
adb: failed to finalize session
Failure [INSTALL_FAILED_INVALID_APK: /data/app/vmdl248531366.tmp/split_config.arm64_v8a.apk signatures are inconsistent]
So it seems as though the signatures are different now because base.objection.apk
is patched (not sure if that's intended, first time using objection/apktool).
Not sure what to do next. I did try to patch the other split_config apks, via something like objection patchapk -D --source split_config.arm64_v8a.apk
but that failed with
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 12.8.19
Patcher will be using Gadget version: 12.8.19
Detected apktool version as: 2.4.1
Running apktool empty-framework-dir...
I: Removing 1.apk framework file...
Unpacking split_config.arm64_v8a.apk
Cannot patch an APK for Internet permission 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 358, in patchapk
patch_android_apk(**locals())
File "/usr/local/lib/python3.7/site-packages/objection/commands/mobile_packages.py", line 181, in patch_android_apk
patcher.inject_internet_permission(skip_resources=skip_resources)
File "/usr/local/lib/python3.7/site-packages/objection/utils/patchers/android.py", line 427, in inject_internet_permission
raise Exception('Cannot --skip-resources with no Internet permission')
Exception: Cannot --skip-resources with no Internet permission
Cleaning up temp files...
Failed to cleanup with error: [Errno 2] No such file or directory: '/var/folders/25/hs76h2h56tj7m4xhlbtfj7640000gn/T/tmpkaqm5qfm.apktemp.objection.apk'
Then I tried objection patchapk --source split_config.arm64_v8a.apk
and got
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 12.8.19
Patcher will be using Gadget version: 12.8.19
Detected apktool version as: 2.4.1
Running apktool empty-framework-dir...
Unpacking split_config.arm64_v8a.apk
Injecting permission: android.permission.INTERNET
Writing new Android manifest...
Target class not specified, searching for launchable activity instead...
Unable to determine the launchable activity using aapt, trying to manually parse the AndroidManifest for activity aliases...
Unable to determine the launchable activity for this app.
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 358, in patchapk
patch_android_apk(**locals())
File "/usr/local/lib/python3.7/site-packages/objection/commands/mobile_packages.py", line 189, 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 750, 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 362, in _get_launchable_activity
raise Exception('Unable to determine launchable activity')
Exception: Unable to determine launchable activity
Cleaning up temp files...
Failed to cleanup with error: [Errno 2] No such file or directory: '/var/folders/25/hs76h2h56tj7m4xhlbtfj7640000gn/T/tmph_za7zx1.apktemp.objection.apk'
apps