-
Notifications
You must be signed in to change notification settings - Fork 5k
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 support for xapk files #2064
Conversation
Allows for better Kotlin support
jadx-plugins/jadx-xapk-input/src/main/java/jadx/plugins/input/xapk/XapkInputPlugin.kt
Show resolved
Hide resolved
@iscle thanks!
|
Yeah I agree, Kotlin will "accept" the parameter without an explicit null check if we skip the annotation, but it complains in some situations. However, in this case, it will work just fine!
Your solution looks good! I wanted to discuss this in the PR comment but I completely forgot. |
@iscle can you please quick check my changes, especially resources display 🙂 |
Sure, I'll check them a bit later. |
Just checked, I see that now each APK is shown in the tree. Nice! I only have one question, how will jadx handle the multiple AndroidManifest.xml when, for example, using the "Go to main Activity" button? Will it search through all of them until it finds the launch intent, or get the last one loaded? In the xapk manifest.json we do have an unused field which indicates this, which could be used to avoid searching all the manifests. However, I think it's better not to use it so that we can also handle the case where a user drags multiple .apk files into jadx from a split apk app. |
Hm, now it uses first one found (code here), order same as zip entries. So this can be any other manifest. Not sure how fix this right now, because logic all over jadx didn't expect several manifests or resources.arsc files 😭 |
Well, since this particular issue is not part of xapk support itself, I think the PR can be merged and this fixed in another PR. |
There are also .apkm files shipped by apkmirror and .apks which is the default format for Google, and the format which SAI (Split APK Installer) backups bundled applications to. Anyway the unzipping idea is the same, and the naming I'd the apks too: You have a base.apk which contains the base APK |
The main activity is only in the base.apk AndroidManifest.xml. And you don't need all the apks in jadx. It doesn't do anything with the libs, so the architecture splits can be ignored. It needs the base.apk because that contains the main code, including the activities, services, etc. The locale split for strings, here it can load only the en one. And if really needs, 1 of the DPI spits like contains different drawables for each DPI type |
And this is the format of a split APK file, not base.apk
|
Hi @nitanmarcel, Could you provide sample files for each case? Thanks, |
This PR adds support for xapk loading. It handles both: code and resources.
In order to load code, the xapk plugin makes use of the existing dex-input plugin instance by retrieving it from the plugin manager.
Some existing interfaces have been annotated with
@NotNull
tags for better Kotlin compatibility.This fixes issue #1597