Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'objection signapk' command to facilitate split APK patching #375

Merged
merged 2 commits into from
Feb 17, 2021

Conversation

mtschirs
Copy link
Contributor

@mtschirs mtschirs commented May 12, 2020

Split APKs consist of a base.apk and additional split_config.*.apk files. In order to use them with objection, the APK which contains the main activity - usually base.apk - has to be patched and the remaining APKs have to be signed (and potentially zipaligned if modified) with objection's signing key.

To simplify this process, I added a new 'objection signapk' command similar to 'objection patchapk'. Handling split APKs is then done as follows:

objection patchapk -s base.apk
objection signapk split_*.apk
adb install-multiple *.objection.apk

@mtschirs mtschirs mentioned this pull request May 12, 2020
@dragouf
Copy link

dragouf commented May 24, 2020

thanks for this PR. It works after installing apksigner:

sudo apt install apksigner

@@ -868,7 +869,7 @@ def zipalign_apk(self):
self.required_commands['zipalign']['location'],
'-p',
'4',
self.apk_temp_frida_patched,
self.apk_temp_frida_patched if os.path.exists(self.apk_temp_frida_patched) else self.apk_source,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will modify the original APK, yeah? I would like to completely avoid modifying the source application.

@leonjza
Copy link
Member

leonjza commented Aug 13, 2020

@mtschirs ping :)

@nicoloboatto
Copy link

Worked like a charm!

@leonjza leonjza merged commit 724019a into sensepost:master Feb 17, 2021
@leonjza
Copy link
Member

leonjza commented Feb 17, 2021

Thanks!

annervisser added a commit to annervisser/patch-apk that referenced this pull request Jan 2, 2022
- This was added to objection specifically for split apks:
sensepost/objection#375
- Required to install patched apk on android 11+
https://developer.android.com/about/versions/11/behavior-changes-11#minimum-signature-scheme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants