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

[FEAT] Please update ARSCDecoder #2714

Closed
pashamcr opened this issue Dec 13, 2021 · 4 comments · Fixed by #2743
Closed

[FEAT] Please update ARSCDecoder #2714

pashamcr opened this issue Dec 13, 2021 · 4 comments · Fixed by #2743
Labels

Comments

@pashamcr
Copy link
Contributor

When decompiling a new api 32 framework, I get an error:
Exception in thread "main" brut.androlib.AndrolibException: Invalid chunk type: expected=0x00000200, got=0x00000206
Added resources to this framework: PUBLIC STAGED_ID = 0x01fe0000
This type is not present in ARSCDecoder

        public final static short TYPE_NONE = -1, TYPE_TABLE = 0x0002,
                TYPE_PACKAGE = 0x0200, TYPE_TYPE = 0x0201, TYPE_SPEC_TYPE = 0x0202, TYPE_LIBRARY = 0x0203;

It is probably worth updating the types as in ResourceTypes.h https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/libs/androidfw/include/androidfw/ResourceTypes.h#250
for example add TYPE_STAGED_ALIAS = 0x0206

android.zip

@iBotPeaches
Copy link
Owner

O god. Spec changes.

Will need the exact commits that introduced all the new properties which I can grab when free.

@budsz
Copy link

budsz commented Mar 15, 2022

$ apktool d -s Fouad.Whats9.25_By_FouadMODS.apk -f
I: Using Apktool 2.6.1-dirty on Fouad.Whats9.25_By_FouadMODS.apk
I: Loading resource table...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -64261 out of bounds for length 22
        at brut.androlib.res.decoder.StringBlock.getStyle(StringBlock.java:344)
        at brut.androlib.res.decoder.StringBlock.getHTML(StringBlock.java:277)
        at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:366)
        at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:285)
        at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:261)
        at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:184)
        at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:135)
        at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:84)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:50)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:783)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:64)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:56)
        at brut.androlib.Androlib.getResTable(Androlib.java:70)
        at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:247)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:109)
        at brut.apktool.Main.cmdDecode(Main.java:175)
        at brut.apktool.Main.main(Main.java:79)

$ java -version
openjdk version "17-internal" 2021-09-14
OpenJDK Runtime Environment (build 17-internal+0-adhoc..src)
OpenJDK 64-Bit Server VM (build 17-internal+0-adhoc..src, mixed mode)

Could be same issues?

@PatrykMis
Copy link

@budsz already fixed in master. Just Build it yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants