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] ARSCDecoder regression in 2.6.2-SNAPSHOT #2805

Closed
IgorEisberg opened this issue Apr 29, 2022 · 5 comments · Fixed by #2917
Closed

[BUG] ARSCDecoder regression in 2.6.2-SNAPSHOT #2805

IgorEisberg opened this issue Apr 29, 2022 · 5 comments · Fixed by #2917
Milestone

Comments

@IgorEisberg
Copy link
Contributor

Information

  1. Apktool Version - 2.6.2-SNAPSHOT
  2. Operating System - Windows (x64), Debian (x64)
  3. APK From? - ROM

Stacktrace/Logcat

I: Using Apktool 2.6.2-SNAPSHOT on InProcessTethering.apk
I: Loading resource table...
I: Skipping overlay (720065)
I: Skipping overlay (6e0069)
I: Skipping overlay (430067)
I: Skipping overlay (6e006f)
I: Skipping overlay (690066)
I: Skipping overlay (67)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (0)
I: Skipping overlay (100205)
I: Skipping overlay (5c)
I: Skipping overlay (e)
I: Skipping overlay (13)
I: Skipping overlay (7f010000)
I: Skipping overlay (7f010001)
I: Skipping overlay (7f010002)
I: Skipping overlay (7f010003)
I: Skipping overlay (7f010004)
I: Skipping overlay (7f010005)
I: Skipping overlay (7f010006)
I: Skipping overlay (7f010007)
I: Skipping overlay (7f010008)
I: Skipping overlay (7f020000)
I: Skipping overlay (7f020001)
I: Skipping overlay (7f020002)
I: Skipping overlay (7f020003)
I: Skipping overlay (7f040000)
I: Skipping overlay (7f040001)
I: Skipping overlay (7f040002)
I: Skipping overlay (7f050000)
I: Skipping overlay (7f050001)
I: Skipping overlay (7f050002)
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:55)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:787)
        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)
Caused by: java.io.EOFException
        at com.google.common.io.LittleEndianDataInputStream.readAndCheckByte(LittleEndianDataInputStream.java:235)
        at com.google.common.io.LittleEndianDataInputStream.readInt(LittleEndianDataInputStream.java:118)
        at brut.util.DataInputDelegate.readInt(DataInputDelegate.java:58)
        at brut.androlib.res.decoder.ARSCDecoder.readOverlaySpec(ARSCDecoder.java:185)
        at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:138)
        at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:84)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:50)
        ... 8 more

Steps to Reproduce

A normal decompilation with the latest 2.6.2-SNAPSHOT.
This issue is not reproducible with Apktool 2.6.1 or older.

Frameworks

Pre-included framework works fine. No third-party framework needed.

APK

https://drive.google.com/file/d/1S69DCYjG76_vbTHC0Vh9H_IoLz_8QZrO/view?usp=sharing

@iBotPeaches
Copy link
Owner

Not sure how. It skips chunks, so it must be a ton of overlay chunks in a row.

@IgorEisberg
Copy link
Contributor Author

Not sure how. It skips chunks, so it must be a ton of overlay chunks in a row.

Ending up with an Exception, sounds like an issue to me.

@iBotPeaches
Copy link
Owner

True, but I don't see how at the moment.

@iBotPeaches iBotPeaches added this to the v2.6.2 milestone May 7, 2022
@iBotPeaches
Copy link
Owner

Replicated. Marking as bug.

@gramound
Copy link
Contributor

gramound commented Nov 1, 2022

It's a parsing error. (The bytes in the first 6 "Skipping overlay" lines above represent ASCII for "eringConfig".)

It's trying to decode a XML_TYPE_OVERLAY as XML_TYPE_OVERLAY_POLICY.

Correct decode gives overlay name="TetheringConfig" and actor="".

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

Successfully merging a pull request may close this issue.

3 participants