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

[BUG] Decompilation error of resources #3702

Open
cpereirarafa opened this issue Sep 23, 2024 · 2 comments
Open

[BUG] Decompilation error of resources #3702

cpereirarafa opened this issue Sep 23, 2024 · 2 comments

Comments

@cpereirarafa
Copy link

cpereirarafa commented Sep 23, 2024

Hello,

I have been trying to decompile an apk, but resources parsing fails.
You'll be able to find the stacktrace below, but I tried to dig into the failing point in apktool, dicovering:

In the when decoding a file, a good decoded attribute comes like this:
image

In the case of the affected attributes, they do not come with the name, rather with an id that I suppose is linked to nowhere:
image

The two attributes shown above are referring to the lines 13 and 14 of this layout (and we can see that JADx also didn't managed to bring the id of this resource):
Screenshot 2024-09-23 at 13 59 09

From my (small) understanding of the flow, the indexes of the tables that brings the attribute values are correct, but the xml parser that deodes the original file may be missing the actual value?

Information
Apktool Version (apktool -version) - 2.9.3
Operating System (Mac, Linux, Windows) - macOS 14.7
APK From? (Playstore, ROM, Other) - Other
Java Version (java --version) - 17.0.9

Stacktrace/Logcat

I: Using Apktool 2.9.3
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: decoded_app/res/animator/2130837504.xml:4: error: not well-formed (invalid token).
W: decoded_app/res/animator/2130837504.xml: error: file failed to compile.
W: decoded_app/res/animator/2130837527.xml:4: error: not well-formed (invalid token).
W: decoded_app/res/animator/2130837527.xml: error: file failed to compile.
W: decoded_app/res/color/2131100411.xml:5: error: not well-formed (invalid token).
W: decoded_app/res/color/2131100411.xml: error: file failed to compile.
W: decoded_app/res/color/2131100412.xml:5: error: not well-formed (invalid token).
W: decoded_app/res/color/2131100412.xml: error: file failed to compile.
W:decoded_app/res/drawable/2131231146.xml:5: error: not well-formed (invalid token).
W: decoded_app/res/drawable/2131231146.xml: error: file failed to compile.
W: decoded_app/res/drawable/2131231148.xml:5: error: not well-formed (invalid token).
W: decoded_app/res/drawable/2131231148.xml: error: file failed to compile.
W: decoded_app/res/font/2131296256.xml:2: error: not well-formed (invalid token).
W: decoded_app/res/font/2131296256.xml: error: file failed to compile.
W: decoded_app/res/font/2131296257.xml:2: error: not well-formed (invalid token).
W: decoded_app/res/font/2131296257.xml: error: file failed to compile.
W: decoded_app/res/font/2131296258.xml:2: error: not well-formed (invalid token).
W: decoded_app/res/font/2131296258.xml: error: file failed to compile.
W: decoded_app/res/font/2131296259.xml:2: error: not well-formed (invalid token).
W: decoded_app/res/font/2131296259.xml: error: file failed to compile.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/38/pd7j36w954b83s1_8zmfrn6m0000gn/T/brut_util_Jar_23304051720274397738368976131288687923.tmp, compile, --dir, decoded_app/res, --legacy, -o, decoded_app/build/resources.zip]

Steps to Reproduce

java -jar apktool.jar d -o tmp/ -f "app.apk"
java -jar apktool.jar java -jar b tmp/ -o "repacked_app.apk"

APK

If this APK can be freely shared, please upload/attach a link to it.
Sent apkpure url by mail

Questions to ask before submission

Have you tried apktool d, apktool b without changing anything?
Yes, decompiling resources fails on build time, with --no-res works well, but for what I need to do is mandatory to decompile it.

If you are trying to install a modified apk, did you resign it?
Yes

Are you using the latest apktool version?
Yes

@cpereirarafa cpereirarafa changed the title [BUG] [BUG] Decompilation error of resources Sep 26, 2024
@cpereirarafa
Copy link
Author

Is this related to #3553 (comment)_ ?

@sevilS
Copy link

sevilS commented Oct 4, 2024

Any update on this?, can we help on how to fix this?

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

No branches or pull requests

2 participants