然后将dex修复后放入apk中,签名安装apk成功。但是打开app一直闪退,显示Unfortunately, crackme0502 has stopped
通过Logcat查看到如下错误:
2017-01-10 12:29:54.003 12392-12392/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.droider.crackme0502, PID: 12392
java.lang.VerifyError: Verifier rejected class com.droider.crackme0502.MainActivity$SNChecker: boolean com.droider.crackme0502.MainActivity$SNChecker.isRegistered() failed to verify: boolean com.droider.crackme0502.MainActivity$SNChecker.isRegistered(): [0x2] register v9 has type Imprecise Constant: 127 but expected Boolean return-1nr on invalid register v9 (declaration of 'com.droider.crackme0502.MainActivity$SNChecker' appears in /data/app/com.droider.crackme0502-1/base.apk)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at com.droider.crackme0502.MyApp.onCreate(MyApp.java:19)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5405)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
关键在于
register v9 has type Imprecise Constant: 127 but expected Boolean return-1nr on invalid register v9