githubwing / HotXposed

xposed hotfix/dynamic load/no reboot library
231 stars 39 forks source link

热更新不起作用 #1

Closed xmlxin closed 6 years ago

xmlxin commented 7 years ago

gradle task pushDex 任务BUILD SUCCESSFUL,sd卡也有classes.dex文件,但是没有任何效果

githubwing commented 7 years ago

看log有无报错之类的

xmlxin commented 7 years ago

Xposed: java.io.IOException: Unable to open '/storage/sdcard0/classes.dex' : Permission denied at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.(DexFile.java:80) at net.androidwing.hotxposed.HookUtil$1.afterHookedMethod(HookUtil.java:36) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:348) at com.wingsofts.zoomimageheader.HomeActivity.onCreate() at android.app.Activity.performCreate(Activity.java:6100) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614) at android.app.ActivityThread.access$800(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5643) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102) Caused by: java.io.IOException: Failed to open oat file from dex location '/storage/sdcard0/classes.dex' at dalvik.system.DexFile.openDexFileNative(Native Method)  at dalvik.system.DexFile.openDexFile(DexFile.java:295)  at dalvik.system.DexFile.(DexFile.java:80)  at net.androidwing.hotxposed.HookUtil$1.afterHookedMethod(HookUtil.java:36)  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:348)  at com.wingsofts.zoomimageheader.HomeActivity.onCreate()  at android.app.Activity.performCreate(Activity.java:6100)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)  at android.app.ActivityThread.access$800(ActivityThread.java:178)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5643)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102) 

xmlxin commented 7 years ago

添加权限了

pengzhendong commented 7 years ago

解决了吗?遇到了同样的问题,报异常是无法打开 dex 文件,但没有提示缺少权限

xmlxin commented 7 years ago

没有,你呢

pengzhendong commented 7 years ago

后来就放弃这个了,毕竟也只能热更新里面的方法,无法热更新 hook before 成 replace,你可以尝试一下这个项目

wtus commented 7 years ago

一样的问题, Permission denied 加上读的权限还是不行!

---我知道原因了 https://github.com/rovo89/XposedBridge/issues/168

但是我手动把dex放到 data/system/下还是不行,Failed to open dex files from /data/system/classes.dex 错误,不知道为什么,读取其他文件倒是没有问题了

mdalvik commented 7 years ago

DexFile 我这是不行的,发生的问题和大家说的差不多 换个类加载器 将dex文件加载进来就行了

xmlxin commented 7 years ago

@mdalvik 用哪个

githubwing commented 7 years ago

target app 有添加读写sdcard权限吗

githubwing commented 6 years ago

已更新 多谢反馈。