REAndroid / APKEditor

Powerful android apk editor - aapt/aapt2 independent
Apache License 2.0
645 stars 95 forks source link

java.io.IOException: Can not decode without package #70

Closed kiber-io closed 9 months ago

kiber-io commented 9 months ago

Describe the bug I created the simplest possible "empty" application. When trying to decompile it in xml mode, apkeditor crashes :( In json mode everything is ok.

To Reproduce Steps to reproduce the behavior:

  1. Used version: 1.3.1
  2. Operating system: WSL Ubuntu 22.04
  3. Command: java -jar apkeditor.jar d -i app.apk -t xml

Log/Stacktrace

...
00.179 I: [DECOMPILE] Decoding: AndroidManifest.xml

ERROR:
java.io.IOException: Can not decode without package
        at com.reandroid.arsc.chunk.xml.ResXmlDocument.serialize(ResXmlDocument.java:456)
        at com.reandroid.apk.ApkModuleXmlDecoder.serializeXml(ApkModuleXmlDecoder.java:241)
        at com.reandroid.apk.ApkModuleXmlDecoder.decodeAndroidManifestXml(ApkModuleXmlDecoder.java:220)
        at com.reandroid.apk.ApkModuleXmlDecoder.decodeAndroidManifest(ApkModuleXmlDecoder.java:203)
        at com.reandroid.apk.ApkModuleDecoder.decode(ApkModuleDecoder.java:47)
        at com.reandroid.apkeditor.decompile.Decompiler.run(Decompiler.java:62)
        at com.reandroid.apkeditor.decompile.Decompiler.execute(Decompiler.java:127)
        at com.reandroid.apkeditor.Main.execute(Main.java:81)
        at com.reandroid.apkeditor.Main.execute(Main.java:64)
        at com.reandroid.apkeditor.Main.main(Main.java:36)

Used apk file Attach/share your apk