iBotPeaches / Apktool

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

[BUG] Game crashes after recompilation #3422

Open Yehh22 opened 8 months ago

Yehh22 commented 8 months ago

Information

  1. Apktool Version (apktool -version) 2.9.0
  2. Operating System (Mac, Linux, Windows) Windows 11
  3. APK From? (Playstore, ROM, Other) Play Store
  4. Java Version (java --version) "20.0.2" 2023-07-18

So apparently, the app crashes when I recompile it. No modifications were made. I'm certainly the app does not have any protections. The app works fine if I just zipalign and sign original apk directly

Stacktrace/Logcat

11-07 10:16:34.640 E/AndroidRuntime(23934): Caused by: java.lang.RuntimeException: Unable to resume activity {com.goatgames.dhs.gb.gp/com.haowan123.xiyou.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contains(java.lang.CharSequence)' on a null object reference
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3430)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3470)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2733)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.-wrap12(ActivityThread.java)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.os.Handler.dispatchMessage(Handler.java:102)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.os.Looper.loop(Looper.java:154)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.main(ActivityThread.java:6121)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at java.lang.reflect.Method.invoke(Native Method)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
11-07 10:16:34.640 E/AndroidRuntime(23934): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contains(java.lang.CharSequence)' on a null object reference
11-07 10:16:34.640 E/AndroidRuntime(23934):     at com.haowan123.xiyou.MainActivity.onResume(MainActivity.java:585)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1269)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.Activity.performResume(Activity.java:6864)
11-07 10:16:34.640 E/AndroidRuntime(23934):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3407)
11-07 10:16:34.640 E/AndroidRuntime(23934):     ... 10 more
11-07 10:16:34.640 W/ActivityManager(  382):   Force finishing activity com.goatgames.dhs.gb.gp/com.haowan123.xiyou.MainActivity
11-07 10:16:34.641 W/ActivityManager(  382):   Force finishing activity com.goatgames.dhs.gb.gp/com.haowan123.xiyou.MainActivity

Steps to Reproduce

  1. apktool d
  2. apktool b
  3. Zipalign
  4. Sign with testkey or whatever

APK

https://apkcombo.com/dungeon-hunter-6/com.goatgames.dhs.gb.gp/download/apk

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. Are you using the latest apktool version? Yes
iBotPeaches commented 8 months ago

If you try with no sources (-s) and then again except with no resources (-r) - how does your test change?

Yehh22 commented 8 months ago

If you try with no sources (-s) and then again except with no resources (-r) - how does your test change?

I tried with both -s and -r, still crashes