rovo89 / Xposed

The native part of the Xposed framework (mainly the modified app_process binary).
Other
7.44k stars 1.47k forks source link

Xposed work well, bug log shows error #244

Open zjns opened 7 years ago

zjns commented 7 years ago

device: xiaomi mi3w system: lineage 14.1 xposed version: v88 offical wiped dalvik-cache after flash xposed framwork: yes xposed module: twitter adfree, weiboxposed app: Twiiter, weibo the problem I found it exist on some xposed modules. like twitter adfree, weiboxposed, the modules work well on cm13 with v87 xposed framework and haven't any error. but on lineage14.1, there has some error but should not being here.

log about twitter adfree: 10-09 01:57:56.104 I/Xposed ( 5641): TwitterAdfree: Successfully hooked Twitter 7.16.0 with module version 1.2 10-09 01:57:57.287 I/Xposed ( 5750): TwitterAdfree: Twitter 7.16.0 is incompatible with module version 1.2 10-09 01:57:57.288 E/Xposed ( 5750): de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.twitter.tweetview.TweetView 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:69) 10-09 01:57:57.288 E/Xposed ( 5750): at ma.wanam.twitteradfree.XTwitter.handleLoadPackage(XTwitter.java:43) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:34) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:61) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:106) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.XposedInit$2.beforeHookedMethod(XposedInit.java:123) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:317) 10-09 01:57:57.288 E/Xposed ( 5750): at android.app.ActivityThread.handleBindApplication() 10-09 01:57:57.288 E/Xposed ( 5750): at android.app.ActivityThread.-wrap2(ActivityThread.java) 10-09 01:57:57.288 E/Xposed ( 5750): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1564) 10-09 01:57:57.288 E/Xposed ( 5750): at android.os.Handler.dispatchMessage(Handler.java:102) 10-09 01:57:57.288 E/Xposed ( 5750): at android.os.Looper.loop(Looper.java:154) 10-09 01:57:57.288 E/Xposed ( 5750): at android.app.ActivityThread.main(ActivityThread.java:6186) 10-09 01:57:57.288 E/Xposed ( 5750): at java.lang.reflect.Method.invoke(Native Method) 10-09 01:57:57.288 E/Xposed ( 5750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) 10-09 01:57:57.288 E/Xposed ( 5750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103) 10-09 01:57:57.288 E/Xposed ( 5750): Caused by: java.lang.ClassNotFoundException: com.twitter.tweetview.TweetView 10-09 01:57:57.288 E/Xposed ( 5750): at java.lang.Class.classForName(Native Method) 10-09 01:57:57.288 E/Xposed ( 5750): at java.lang.Class.forName(Class.java:400) 10-09 01:57:57.288 E/Xposed ( 5750): at external.org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:823) 10-09 01:57:57.288 E/Xposed ( 5750): at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:67) 10-09 01:57:57.288 E/Xposed ( 5750): ... 16 more 10-09 01:57:57.288 E/Xposed ( 5750): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.twitter.tweetview.TweetView" on path: DexPathList[[zip file "/data/app/com.google.android.webview-2/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.webview-2/lib/arm, /data/app/com.google.android.webview-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]] 10-09 01:57:57.288 E/Xposed ( 5750): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-09 01:57:57.288 E/Xposed ( 5750): at java.lang.ClassLoader.loadClass(ClassLoader.java:380) 10-09 01:57:57.288 E/Xposed ( 5750): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 10-09 01:57:57.288 E/Xposed ( 5750): ... 20 more

log about weiboxposed: 10-09 02:23:51.773 I/Xposed (23218): [WeiboXposed] loaded 10-09 02:23:51.779 E/Xposed (23218): de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.sina.weibo.models.MBlogListBaseObject 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:69) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:258) 10-09 02:23:51.779 E/Xposed (23218): at moe.reimu.weiboxposed.Module.c(Unknown Source) 10-09 02:23:51.779 E/Xposed (23218): at moe.reimu.weiboxposed.Module.f(Unknown Source) 10-09 02:23:51.779 E/Xposed (23218): at moe.reimu.weiboxposed.Module.handleLoadPackage(Unknown Source) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:34) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:61) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:106) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedInit$2.beforeHookedMethod(XposedInit.java:123) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:317) 10-09 02:23:51.779 E/Xposed (23218): at android.app.ActivityThread.handleBindApplication() 10-09 02:23:51.779 E/Xposed (23218): at android.app.ActivityThread.-wrap2(ActivityThread.java) 10-09 02:23:51.779 E/Xposed (23218): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1564) 10-09 02:23:51.779 E/Xposed (23218): at android.os.Handler.dispatchMessage(Handler.java:102) 10-09 02:23:51.779 E/Xposed (23218): at android.os.Looper.loop(Looper.java:154) 10-09 02:23:51.779 E/Xposed (23218): at android.app.ActivityThread.main(ActivityThread.java:6186) 10-09 02:23:51.779 E/Xposed (23218): at java.lang.reflect.Method.invoke(Native Method) 10-09 02:23:51.779 E/Xposed (23218): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) 10-09 02:23:51.779 E/Xposed (23218): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103) 10-09 02:23:51.779 E/Xposed (23218): Caused by: java.lang.ClassNotFoundException: com.sina.weibo.models.MBlogListBaseObject 10-09 02:23:51.779 E/Xposed (23218): at java.lang.Class.classForName(Native Method) 10-09 02:23:51.779 E/Xposed (23218): at java.lang.Class.forName(Class.java:400) 10-09 02:23:51.779 E/Xposed (23218): at external.org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:823) 10-09 02:23:51.779 E/Xposed (23218): at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:67) 10-09 02:23:51.779 E/Xposed (23218): ... 19 more 10-09 02:23:51.779 E/Xposed (23218): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sina.weibo.models.MBlogListBaseObject" on path: DexPathList[[zip file "/data/app/com.google.android.webview-2/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.webview-2/lib/arm, /data/app/com.google.android.webview-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]] 10-09 02:23:51.779 E/Xposed (23218): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 10-09 02:23:51.779 E/Xposed (23218): at java.lang.ClassLoader.loadClass(ClassLoader.java:380) 10-09 02:23:51.779 E/Xposed (23218): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 10-09 02:23:51.779 E/Xposed (23218): ... 23 more 10-09 02:23:51.799 E/Xposed (23218): android.content.res.Resources$NotFoundException: com.sina.weibo:dimen/feed_title_specialbg_width 10-09 02:23:51.799 E/Xposed (23218): at android.content.res.XResources.setReplacement(XResources.java:499) 10-09 02:23:51.799 E/Xposed (23218): at moe.reimu.weiboxposed.Module.handleInitPackageResources(Unknown Source) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.IXposedHookInitPackageResources$Wrapper.handleInitPackageResources(IXposedHookInitPackageResources.java:33) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.callbacks.XC_InitPackageResources.call(XC_InitPackageResources.java:55) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:106) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedInit.cloneToXResources(XposedInit.java:371) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedInit.access$100(XposedInit.java:52) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedInit$7.afterHookedMethod(XposedInit.java:260) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:351) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ResourcesManager.getOrCreateResources() 10-09 02:23:51.799 E/Xposed (23218): at android.app.ResourcesManager.getResources(ResourcesManager.java:676) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1884) 10-09 02:23:51.799 E/Xposed (23218): at android.app.LoadedApk.getResources(LoadedApk.java:766) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ContextImpl.(ContextImpl.java:2038) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ContextImpl.createAppContext(ContextImpl.java:1983) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5339) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) 10-09 02:23:51.799 E/Xposed (23218): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:337) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread.handleBindApplication() 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread.-wrap2(ActivityThread.java) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1564) 10-09 02:23:51.799 E/Xposed (23218): at android.os.Handler.dispatchMessage(Handler.java:102) 10-09 02:23:51.799 E/Xposed (23218): at android.os.Looper.loop(Looper.java:154) 10-09 02:23:51.799 E/Xposed (23218): at android.app.ActivityThread.main(ActivityThread.java:6186) 10-09 02:23:51.799 E/Xposed (23218): at java.lang.reflect.Method.invoke(Native Method) 10-09 02:23:51.799 E/Xposed (23218): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)

in fact, the class “com.sina.weibo.models.MBlogListBaseObject” is existed, but log shows it can't be find. the module works well bug log shows error. so I think this is a problem about xposed framework.

rovo89 commented 7 years ago

Please contact the module developer. These errors are most likely from incompatible modules, e.g. because the apps they're hooking has changed. The class lookup mechanism is standard Java stuff, not Xposed-specific.

If you are the module developer, please link to the relevant code of the module which is doing the hook. And show the smali of the exact version of the app that you're trying to hook.

zjns commented 7 years ago

OK, I'll contact the author of "WeiboXposed" to solve the problem together. BTW, why "ClassNotFoundException" of the two apps all aim to the "com.google.android.webview", not the apps themselves.

rovo89 commented 7 years ago

Good catch. It's possible that the wrong class loader is used here. And yes, then there's a chance that this is actually caused by the framework giving you the wrong classloader.

pikrzysztof commented 7 years ago

@rovo89 full logs disable XPosed (it fails to run) and everything fails to work, so while this particular bug (I mean WeiboXposed errors) is not XPosed problem, it showed another one.

zjns commented 7 years ago

I think the problem probably caused by time point when hook a method. eg. when open an app, maybe some classes will not load immediately, but Xposed module's hook function is going, so log shows not find class, just because of hook time point is too early. So this problem is caused by Xposed module, not caused by Xposed. And I think this maybe have some connection with Nougat art, not same with Marshmallow art; so Marshmallow Xposed didn't shows error, but Nougat Xposed shows error when use some Xposed modules.

zjns commented 7 years ago

@rovo89 I fond what thing cause the errors finally, the solve way is to close option "Multiprocess Webview" in "developer options". I am so excited to find it.

zjns commented 7 years ago

@rovo89 the issue could be closed.

aviraxp commented 6 years ago

Sorry, but any updates on this issue? This makes my module almost 100% broken.

wanam commented 6 years ago

I am the author of Twitter Adfree module, unfortunately i did not manage to reproduce that error. Disabling a feature under developer options is not a solution, As rovo89 said maybe the used classloader is wrong, no idea how it may get the wrong one, the class loader is assigned here.

And it is the same one i'm using:

    @Override
    public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
        if (lpparam.packageName.equals(COM_TWITTER)) {

            Class<?> mTweetView = null;
            try {
                mTweetView = XposedHelpers.findClass("com.twitter.tweetview.TweetView", lpparam.classLoader);
                XposedHelpers.findAndHookMethod(mTweetView, "e", boolean.class, new XC_MethodHook() {

                    @Override
                    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                        // promoted_badge visibility
                        boolean visibility = (Boolean) param.args[0];

                        // if badge is going to be visible, just hide
                        // the tweet
                        if (visibility) {
                            ViewGroup vg = (ViewGroup) param.thisObject;
                            vg.setVisibility(View.GONE);
                            param.setResult(null);
                            return;
                        }
                    }
                });
            } catch (Throwable e) {
                XposedBridge.log(e);
            }
        }
    }