iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
20.33k stars 3.59k forks source link

[BUG]Unexpected container offset in header #3725

Open rashpel77 opened 1 week ago

rashpel77 commented 1 week ago

Information

  1. Apktool Version (apktool -version) - 2.10.1_20241110
  2. Operating System (Mac, Linux, Windows) - Windows 11
  3. APK From? (Playstore, ROM, Other) - ROM
  4. Java Version (java --version) - 21.0.2.0

Stacktrace/Logcat

"Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.smali.dexlib2.util.DexUtil$InvalidFile: Unexpected container offset in header at brut.androlib.ApkDecoder.decode(SourceFile:0) at brut.apktool.Main.main(SourceFile:0) Caused by: java.util.concurrent.ExecutionException: com.android.tools.smali.dexlib2.util.DexUtil$InvalidFile: Unexpected container offset in header at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ... 2 more"

Steps to Reproduce

  1. apktool --use-aapt1 -b -p
  2. apktool --use-aapt1 -d -p

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it. https://cloud.mail.ru/public/WVtg/vofudoRVp

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. If you are trying to install a modified apk, did you resign it?
  3. Are you using the latest apktool version? Yes
iBotPeaches commented 1 week ago

Well thats odd. Mind opening upstream with smali? https://github.com/google/smali

rashpel77 commented 1 week ago

After parsing the application again, this error occurs. Everything comes together the first time. An error occurs if you edit smali. But apktool 2.93 coped with all the tasks.

iBotPeaches commented 1 week ago

Yes why I asked to upstream to smali. We upgraded smali between 2.10 and 2.9 which may be related.