REAndroid / APKEditor

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

Xml breaks when recompiling (xml mode) #43

Closed kiber-io closed 1 year ago

kiber-io commented 1 year ago

Describe the bug If the attached apk is decompiled (in xml mode, before that - deobfuscation of resources), and then compiled immediately, then it will no longer work - throws an error:

FATAL EXCEPTION: main
Process: com.perm.kate, PID: 31361
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.perm.kate/com.perm.kate.MainActivity}: android.view.InflateException: Binary XML file line #9 in com.perm.kate:layout/main: For input string: "?2130968955"
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Just deobfuscation of resources does not break anything, the problem appears only after recompilation

To Reproduce Steps to reproduce the behavior:

  1. Used version: APKEditor - 1.2.4, ARSCLib - 1.2.0
  2. Operating system: Ubuntu 22.04 (WSL)

Used apk file https://drive.google.com/file/d/1cnfQrlXlVqHamIYzxkyqp55Sb3Lfze75/view?usp=sharing

REAndroid commented 1 year ago

This looks incomplete apk resource 0x7f04017b is not defined anywhere. I guess you used split apk.

kiber-io commented 1 year ago

No, it's not a split. and this confirms at least that the APK works by itself - install it and see. and there are no links with splits in the manifest

REAndroid commented 1 year ago

Yes I confirm it's bug

REAndroid commented 1 year ago

Fixed on 092f2af Check the latest release

kiber-io commented 1 year ago

yes, the bug has been fixed. thank you!