-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Support applications with multiple packages. #2514
Comments
The apk I'im trying on : https://drive.google.com/file/d/17BtPR8A9OwkUrEvO82m8NP8lwUx3JqMX/view?usp=sharing |
Best way to check if any changes can be made in an apk is , decompile and try to recompile , if recompile fails without any changes in the code of apk then apktool will never be able to recompile that apk no matter what you do . |
I would believe it, you are disassembling an application and trying to remake it. That isn't easy but any stretch of the imagination. @archos-sa - Your error is not related. If we take the bugged resource.
It looks bad. That isn't a valid reference.
So lets check aapt.
Hmm, its a reference to a resourceId. Lets look for it.
We could not decode that resource which explains all of this.
|
Okay, this is a bug with our handling of multiple package apks. We always assumed manifest resources were on 7F, but these are on 7E. However, we don't properly load enough data into the attribute parser for manifest at that point in the code to have a mapping of pkgId to name, so this will take some changes. |
Yeah no way I see easily to resolve this without major research. Multiple packages in one resources.arsc. If we store them differently, they have the same resources. So we'd need to overhaul extraction code to isolate to one package. I can fix the decoding error and properly resolve the reference, but then we get:
aapt2 can't build it since its a non-standard framework. |
tldr - need to research dynamic refs more and how these function.
|
This works perfectly for Twitter, given the following patch above.
The way this works is that Apktool extracts needed frameworks (1, 126) as requirements but skips 127 ( This of course is highly dependent on having the old application which true app builders do not. I've been messing around with Instant apps like the discussion here - #2524 and trying to figure out how to make Android Studio be very verbose with all its commands to gradle/aapt2 so I can figure out the steps that it does to produce a binary from source. With that knowledge, I could tweak Apktool to meet that behavior. TLDR - Ongoing. |
I'm pretty sure the same issue occurs with the latest Snapchat apk: Console output
Apktool Version - 2.5.1-baf8bb-SNAPSHOT Operating System - Windows APK From? - Playstore Following the patch you mentioned: |
Hi @iBotPeaches I'm very excited about the patch and can not wait to try it, although it's a draft now.
I cannot find any artifact file as
How should I do this, and how will it help because it won't impact the APK file (which I will decode in the next step)?
I think I will be fine perform these steps. But if you have any tips that would be helpful Thank you so much |
@iBotPeaches whats the status of this bug? Is a fix for this possible on the 3.0.0 milestone horizon? Is there any additional research that can be done from people experiencing this bug? I am experiencing this as well, though unlike @Sunep-source, using the patch #2517 produced the same error as did v2.6.0.
I unfortunately cannot share the apk in question |
@iBotPeaches can we do something to help you on this issue ? Is it planned to be fixed in the next version or any upcoming versions ? Thanks. |
Hi @iBotPeaches , Do you think it makes sense to prioritize this issue? |
@Nogias9x - I don't see this as something to prioritize, but you are welcome to continue from the research I have to come to a solution. I believe the Android 12/12L issues are more important at this time. |
@iBotPeaches what do |
That is a feature I have planned for a future version to only disassemble the Manifest without needing to decode the entire resources.asrc file. It however, will not allow compilation. Unsure what that has to do with this ticket though. |
that would be so amazing when it's happening. |
hi, any updates to this? I'm facing the same issues right now |
Same issue on popular app, @iBotPeaches, I would be very grateful if you could find a solution to this problem :) |
Just to pass the error replace <meta-data android:name="com.android.vending.splits" android:resource="@12345"/> with <meta-data android:name="com.android.vending.splits" android:value="base"/> It's possibly the similar this as here: |
This comment was marked as off-topic.
This comment was marked as off-topic.
is it possible to move resources from splitted package into main one? |
in case you stuck with this - I fixed broken resources manually and it works. replaced null with required resource and moved appripriate file into base apk resources |
Could you please give me an example what you've exactly done, please? Currently when I try to recompile the untouched application, it fails with the following error: I can see that it doesn't find the "accessibilityPaneTitle"
Attaching the AndroidManifests.xml and material_timepicker_dialog.xml file, base & split_en & split_xxhdpi files Thank you for your help! |
bump? Where is this work-around-patch written about in the comments here? I have been unable to find it. Thank you! |
Apktool Latest
OS is linux
Believe it or not , if i decompile an apk and try to recompile it again without any changes in code it fails .
I try using a twitter apk file .
I will leave here the link :
https://www.mediafire.com/file/82w10791m4xrjaf/Twitter.apk/file
You can decompile it , but you are unable to recompile it again even if no changes were made in the code .
Update , forgot to write the logs , here they are :
The log :
The text was updated successfully, but these errors were encountered: