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] Can't decompile altered version of Azur Lane #3503

Open
USS-Corvan opened this issue Jan 31, 2024 · 5 comments
Open

[BUG] Can't decompile altered version of Azur Lane #3503

USS-Corvan opened this issue Jan 31, 2024 · 5 comments
Assignees
Labels
java Pull requests that update Java code

Comments

@USS-Corvan
Copy link

Information

  1. Apktool Version (apktool -version) - 2.9.3
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - Other
  4. Java Version (java --version) - 18.0.2 2022-07-19

Stacktrace/Logcat

>apktool -f d com.YoStarJP.AzurLane1.apk --only-main-classes
I: Using Apktool 2.9.3 on com.YoStarJP.AzurLane1.apk
I: Loading resource table...
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\Estro\AppData\Local\apktool\framework\1.apk
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Baksmaling classes6.dex...
I: Baksmaling classes7.dex...
I: Baksmaling classes8.dex...
I: Baksmaling classes9.dex...
I: Baksmaling classes10.dex...
I: Baksmaling classes11.dex...
I: Baksmaling classes12.dex...
I: Baksmaling classes13.dex...
Exception in thread "main" com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: 00 00 00 00 00 00 00 00
        at com.android.tools.smali.dexlib2.util.DexUtil.verifyDexHeader(DexUtil.java:92)
        at com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile.getVersion(DexBackedDexFile.java:172)
        at com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:96)
        at com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:199)
        at com.android.tools.smali.dexlib2.dexbacked.ZipDexContainer$1.getDexFile(ZipDexContainer.java:180)
        at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:88)
        at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:36)
        at brut.androlib.ApkDecoder.decodeSourcesSmali(ApkDecoder.java:220)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:147)
        at brut.apktool.Main.cmdDecode(Main.java:217)
        at brut.apktool.Main.main(Main.java:92)

Steps to Reproduce

  1. apktool d [apk]

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.
signed version:
https://apkadmin.com/zv80h7ocyuw0/com.YoStarJP.AzurLane_7.1.12_signed_mod_YasKashije_platinmods.com.apk.html
unsigned version:
https://apkadmin.com/sec0yz8f9fyz/com.YoStarJP.AzurLane_7.1.12_unsigned_mod_YasKashije_platinmods.com.apk.html

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?
    Couldn't finish decoding.

  2. If you are trying to install a modified apk, did you resign it?
    I tried both the signed and unsigned version, both failed.

  3. Are you using the latest apktool version?
    Yes.

@USS-Corvan
Copy link
Author

USS-Corvan commented Jan 31, 2024

I 've tried searching and found #3251 , I believe the apk mentioned there is created by the same author. The issue mentioned in #3251 still exist in 2.9.3 on my side, I don't know whether it's related with java version or something else like the apk itself.
Furthermore, I have tried apktool -f d com.YoStarJP.AzurLane1.apk --only-main-classes . The log is the same with or without the parameter "--only-main-classes".

@su1216
Copy link

su1216 commented Jan 31, 2024

I 've tried searching and found #3251 , I believe the apk mentioned there is created by the same author. The issue mentioned in #3251 still exist in 2.9.3 on my side, I don't know whether it's related with java version or something else like the apk itself. Furthermore, I have tried apktool -f d com.YoStarJP.AzurLane1.apk --only-main-classes . The log is the same with or without the parameter "--only-main-classes".

classes13.dex is not a real dex file, you can check it with notepad++. It's not work when you're using parameter "--only-main-classes", because classes in the classes13.dex are all main classes.

@iBotPeaches
Copy link
Owner

Thanks for report. I believe we could get away with adding handling for detecting NotADexFile, but then we need to adjust build support to have a mix of raw and disassembled files.

@iBotPeaches iBotPeaches added the java Pull requests that update Java code label Feb 5, 2024
@YasKashije

This comment was marked as abuse.

@iBotPeaches
Copy link
Owner

I worked a patch to skip dex disassembly errors, but there are many in this application.

  • classes1.dex - invalid dex
  • classes13.dex - just an empty dex file.

I opened an issue upstream at smali for first while I debate what to do. Since after I skipped disassembly of failures then corresponding build method failed badly. Apktool had never had a mix of original/disassembled for dex files so this is a bigger can of worms than I thought.

@iBotPeaches iBotPeaches self-assigned this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code
Projects
None yet
Development

No branches or pull requests

4 participants