Apktool
Apktool copied to clipboard
[BUG] Decode fails with "Could not decode arsc file"
Information
- Apktool Version (
apktool -version) - 2.7.0 - Operating System (Mac, Linux, Windows) - Windows 10
- APK From? (Playstore, ROM, Other) - direct download from author site
Stacktrace/Logcat
java -jar apktool_2.7.0.jar -f decode android-li-arm64-v8a-prod-v6.15.0-Offical.apk
I: Using Apktool 2.7.0 on android-li-arm64-v8a-prod-v6.15.0-Offical.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:780)
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:74)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:251)
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.IOException: Expected: 0x001c0001, got: 0x4b545353
at brut.util.ExtDataInput.skipCheckChunkTypeInt(ExtDataInput.java:72)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:42)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:79)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:51)
... 8 more
Steps to Reproduce
apktool decode
Frameworks
(i don't know)
APK
https://disk.yandex.ru/d/xSadE2cL79NIzw
Questions to ask before submission
- Have you tried
apktool d,apktool bwithout changing anything? - If you are trying to install a modified apk, did you resign it?
- Are you using the latest apktool version?
Similar error on Facebook 402.1.0.24.84 APK (latest version downloaded from the Play Store for me):
I: Using Apktool 2.7.0 on base.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:780)
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:74)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:251)
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.IOException: Expected: 0x00000008, got: 0x0000000b
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:53)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:399)
at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:324)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:309)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:224)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:133)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:85)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:51)
... 8 more```
@wilco375 same for messenger too.
Marking other responses are off-topic as the original issue and Facebook, while they look the same are not. I replicate this, so adding "bug" label and backlogging.
Open for PRs or investigations for this. Thanks!
Putting up a PR for this. The header chunk is lying about its reported size.
➜ 2989 apktool d 2989.apk -f
I: Using Apktool 2.8.1-c744dd-SNAPSHOT on 2989.apk
I: Loading resource table...
W: Chunk header size (16), read (12). Exceeding bytes: 0x5353544B.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
➜ 2989