日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Smali文件添加try/catch语句,出现“invalid use of move-exception”异常

發布時間:2025/7/25 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Smali文件添加try/catch语句,出现“invalid use of move-exception”异常 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

插入代碼如下:

? ?

捕獲到以下異常:

2019-03-18 21:09:35.431 8272-8272/com.xxxx.xxxx E/AndroidRuntime: FATAL EXCEPTION: main

Process: com.xxxx.xxxx, PID: 8272

java.lang.VerifyError: Verifier rejected class com.xxxx.xxxx.MainActivity: void com.xxxx.xxxx.MainActivity.downloadApp() failed to verify: void com.xxxx.xxxx.MainActivity.downloadApp(): [0x48] invalid use of move-exception (declaration of 'com.xxxx.xxxx.MainActivity' appears in /data/app/com.xxxx.xxxx-diGqKGProB4hO0iuLwrVhQ==/base.apk!classes80.dex)

at java.lang.Class.newInstance(Native Method)

at android.app.Instrumentation.newActivity(Instrumentation.java:1174)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)

at android.app.ActivityThread.-wrap11(Unknown Source:0)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)

at android.os.Handler.dispatchMessage(Handler.java:106)

at android.os.Looper.loop(Looper.java:164)

at android.app.ActivityThread.main(ActivityThread.java:6494)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108)

? ?

解決方案:

:catch_x偽指令必須添加在方法的末尾/也就是catch區塊的代碼,必須在方法的尾部,執行完異常處理邏輯后,在使用goto指令,跳轉回正常流程。

? ?

如果方法中帶有switch分支,那么:catch_x偽指令應該在switch數據塊的上方:

轉載于:https://www.cnblogs.com/foundkey/p/10555107.html

總結

以上是生活随笔為你收集整理的Smali文件添加try/catch语句,出现“invalid use of move-exception”异常的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。