ByNameModding / BNM-Android

Modding il2cpp games by classes, methods, field names on Android.
MIT License
196 stars 38 forks source link

App crash using BNM 1.4 #19

Closed nik2143 closed 4 months ago

nik2143 commented 8 months ago

Game tested: Subway Surfers Crash Log

12-09 17:08:24.860 31517 31517 I crash_dump32: performing dump of process 31449 (target tid = 31449)
12-09 17:08:24.863 31517 31517 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-09 17:08:24.863 31517 31517 F DEBUG   : Build fingerprint: 'samsung/beyond1qlteue/beyond1q:9/LMY48Z/901230529:user/release-keys'
12-09 17:08:24.863 31517 31517 F DEBUG   : Revision: '0'
12-09 17:08:24.863 31517 31517 F DEBUG   : ABI: 'x86'
12-09 17:08:24.863 31517 31517 F DEBUG   : pid: 31449, tid: 31449, name: iloo.subwaysurf  >>> com.kiloo.subwaysurf <<<
12-09 17:08:24.863 31517 31517 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
12-09 17:08:24.863 31517 31517 F DEBUG   : Cause: null pointer dereference
12-09 17:08:24.863 31517 31517 F DEBUG   :     eax c9554040  ebx 80000009  ecx 00000001  edx f2df3494
12-09 17:08:24.863 31517 31517 F DEBUG   :     edi 00000004  esi e7987580
12-09 17:08:24.863 31517 31517 F DEBUG   :     ebp ea914760  esp ffd41e90  eip ea2f86a5
12-09 17:08:24.863 31517 31517 F DEBUG   :
12-09 17:08:24.863 31517 31517 F DEBUG   : backtrace:
12-09 17:08:24.863 31517 31517 F DEBUG   :     #00 pc 001366a5  /system/vendor/lib/libhoudini.so
12-09 17:08:25.130  1643  1643 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_13
12-09 17:08:25.136  1801 31533 W ActivityManager:   Force finishing activity com.kiloo.subwaysurf/com.sybogames.chili.multidex.ChiliMultidexSupportActivity
12-09 17:08:25.139  1801 31533 W ActivityManager: Exception thrown during pause
12-09 17:08:25.139  1801 31533 W ActivityManager: android.os.DeadObjectException
12-09 17:08:25.139  1801 31533 W ActivityManager:       at android.os.BinderProxy.transactNative(Native Method)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at android.os.BinderProxy.transact(Binder.java:1129)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at android.app.IApplicationThread$Stub$Proxy.scheduleTransaction(IApplicationThread.java:1777)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at android.app.servertransaction.ClientTransaction.schedule(ClientTransaction.java:129)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ClientLifecycleManager.scheduleTransaction(ClientLifecycleManager.java:47)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ClientLifecycleManager.scheduleTransaction(ClientLifecycleManager.java:69)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1463)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3738)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3680)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityStack.finishTopCrashedActivityLocked(ActivityStack.java:3563)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityStackSupervisor.finishTopCrashedActivitiesLocked(ActivityStackSupervisor.java:2261)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.AppErrors.handleAppCrashLocked(AppErrors.java:747)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.AppErrors.makeAppCrashingLocked(AppErrors.java:579)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:447)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.AppErrors.crashApplication(AppErrors.java:392)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:15468)
12-09 17:08:25.139  1801 31533 W ActivityManager:       at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:85)
BNM-Dev commented 8 months ago

I see that crash happens on emulator, but I don't see any other useful information. You just add BNM v1.4 to project?

nik2143 commented 8 months ago

Yes only adding It make game crash

BNM-Dev commented 8 months ago

You loading it using BNM::TryForceLoadIl2CppByPath?

nik2143 commented 8 months ago

Still crash

BNM-Dev commented 8 months ago

It crash even with BNM_DISABLE_AUTO_LOAD defined and without loading BNM?

nik2143 commented 8 months ago

Yes crash even with BNM_DISABLE_AUTO_LOAD

BNM-Dev commented 8 months ago

So idk, BNM can't crash without doing at least something. And how I tested, it work emulators

nik2143 commented 8 months ago

I put the on loaded event idk If this can make BNM do Something

BNM-Dev commented 8 months ago

Only auto loading, BNM::TryForceLoadIl2CppByPath or any BNM::External method, can make BNM start working. Try remove AddOnLoadedEvent call

nik2143 commented 8 months ago

Removing the call to AddOnLoadedEvent solved the crash but obv don't load anything

BNM-Dev commented 8 months ago

Which emulator you use?

nik2143 commented 8 months ago

Nox Emulator

Creator1A commented 8 months ago

Removing the call to AddOnLoadedEvent solved the crash but obv don't load anything

I am facing the same issue. I had to shift back to using the thread load method. This method works but crashes the game when opening and it's practically just luck for the game to work. Tested on 3 devices, S23U, Redemi, and Bluestacks/Nox

BNM-Dev commented 8 months ago

Removing the call to AddOnLoadedEvent solved the crash but obv don't load anything

I am facing the same issue. I had to shift back to using the thread load method. This method works but crashes the game when opening and it's practically just luck for the game to work. Tested on 3 devices, S23U, Redemi, and Bluestacks/Nox

This is strange, because you can try this mod youtube. It work on all emulators and use BNM 1.4_dev with BNM::TryForceLoadIl2CppByPath and BNM::AddOnLoadedEvent (only some fixes, not related to loading). I will release v1.5 soon, maybe it will fix issue.

Creator1A commented 8 months ago

Commenting out the lines related to events in the BNM.cpp and using thread detach seem to have fixed the crash for me. Using AddOnLoadedEvent still crashes the game no matter what for some reason.

BNM-Dev commented 4 months ago

OnLoadedEvents are fixed in v1.6.