google / smali

Other
175 stars 29 forks source link

[BUG] After smali, Origin method name changes. So runtime error occurs. #60

Open zhongqingsong opened 3 weeks ago

zhongqingsong commented 3 weeks ago

There is an APK, which can be determined by apktool and jadx. One of the game's methods is called: lambda$ensureContextsScheduled$0$com-google-android-datatransport-runtime-scheduling-jobscheduling-WorkInitializer The delimiter of the method name is a horizontal line. But after smali.jar turn smali to dex, this method name changes : lambda$ensureContextsScheduled$1$com_google_android_datatransport_runtime_scheduling_jobscheduling_WorkInitializer The horizontal line becomes underlined. This way, when the APK runs, it will find the error that the method cannot be found. Likes this:

18:03:15.090 AndroidRuntime           E  FATAL EXCEPTION: pool-1-thread-1
                                         Process: com.genbasestudio.adventure, PID: 10094
                                         java.lang.NoSuchMethodError: No virtual method lambda$ensureContextsScheduled$1$com-google-android-datatransport-runtime-scheduling-jobscheduling-WorkInitializer()V in class Lcom/google/android/datatransport/runtime/scheduling/jobscheduling/WorkInitializer; or its super classes (declaration of 'com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer' appears in /data/app/com.genbasestudio.adventure-pJeegMbU41OxReHH1xkjow==/base.apk)
                                            at com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer$$ExternalSyntheticLambda1.run(Unknown Source:2)

By the way, This bug has been around for a long time and I have encountered it for a long time. At that time, I modified smali myself and then solved the problem. But this time, smali was right. But there is a problem with the dex obtained after smali. I can't solve this.

APK: apk is too big, can't upload. So I give old issue link

zhongqingsong commented 3 weeks ago

By the way, APK name is com.genbasestudio.adventure. And "old issue" seems to have solved that problem.