异常
java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageView cannot be cast to androidx.appcompat.widget.AppCompatImageView at com.xiaolang.wechathelper.plugins.Test2BottomBar.getBottomBar(Test2BottomBar.kt:48) at com.xiaolang.wechathelper.plugins.BaseBottomBar.addBottomBar(BaseBottomBar.kt:26) at com.xiaolang.wechathelper.hooker.HomeHooker$onHook$2$1.invoke(HomeHooker.kt:52) at com.xiaolang.wechathelper.hooker.HomeHooker$onHook$2$1.invoke(HomeHooker.kt:46) at com.highcapable.yukihookapi.hook.core.YukiMemberHookCreator$MemberHookCreator$hook$beforeAfterHook$1.afterHookedMember$yukihookapi_core_release( at com.highcapable.yukihookapi.hook.core.api.factory.YukiHookDelegateFactoryKt.callAfterHookedMember(YukiHookDelegateFactory.kt:102) at com.highcapable.yukihookapi.hook.core.api.compat.HookCompatHelper$compat$9.afterHookedMethod(HookCompatHelper.kt:86) at A.BhBfpdEl.eyyOj.qImQN.XposedBridge$LegacyApiSupport.handleAfter(Unknown Source:33) at J.callback(Unknown Source:292) at LSPHooker_.d(Unknown Source:8) at com.tencent.mm.ui.HomeUI.h(Unknown Source:457) at com.tencent.mm.ui.LauncherUI.onResume(Unknown Source:228) at android.app.Instrumentation.callActivityOnResume(Unknown Source:3) at com.highcapable.yukihookapi.hook.xposed.parasitic.activity.delegate.InstrumentationDelegate.callActivityOnResume(InstrumentationDelegate.kt:284) at android.app.Activity.performResume(Unknown Source:68) at android.app.ActivityThread.performResumeActivity(Unknown Source:167) at android.app.ActivityThread.handleResumeActivity(Unknown Source:6) at android.app.servertransaction.ResumeActivityItem.execute(Unknown Source:12) at android.app.servertransaction.ActivityTransactionItem.execute(Unknown Source:4) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(Unknown Source:32) at android.app.servertransaction.TransactionExecutor.execute(Unknown Source:79) at android.app.ActivityThread$H.handleMessage(Unknown Source:172) at android.os.Handler.dispatchMessage(Unknown Source:19) at android.os.Looper.loopOnce(Unknown Source:182) at android.os.Looper.loop(Unknown Source:82) at android.app.ActivityThread.main(Unknown Source:123) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11) at com.android.internal.os.ZygoteInit.main(Unknown Source:312)
关键代码 context.injectModuleAppResources() ModuleClassLoader.excludeModuleClasses("androidx.appcompat.widget.AppCompatImageView") ModuleClassLoader.excludeHostClasses("androidx.appcompat.widget.AppCompatImageView") val moduleContext = context.applyModuleTheme(androidx.appcompat.R.style.Base_Theme_AppCompat, null) rootView = LayoutInflater.from(moduleContext).inflate(R.layout.test, null) 布局代码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">
异常
java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageView cannot be cast to androidx.appcompat.widget.AppCompatImageView at com.xiaolang.wechathelper.plugins.Test2BottomBar.getBottomBar(Test2BottomBar.kt:48) at com.xiaolang.wechathelper.plugins.BaseBottomBar.addBottomBar(BaseBottomBar.kt:26) at com.xiaolang.wechathelper.hooker.HomeHooker$onHook$2$1.invoke(HomeHooker.kt:52) at com.xiaolang.wechathelper.hooker.HomeHooker$onHook$2$1.invoke(HomeHooker.kt:46) at com.highcapable.yukihookapi.hook.core.YukiMemberHookCreator$MemberHookCreator$hook$beforeAfterHook$1.afterHookedMember$yukihookapi_core_release( at com.highcapable.yukihookapi.hook.core.api.factory.YukiHookDelegateFactoryKt.callAfterHookedMember(YukiHookDelegateFactory.kt:102) at com.highcapable.yukihookapi.hook.core.api.compat.HookCompatHelper$compat$9.afterHookedMethod(HookCompatHelper.kt:86) at A.BhBfpdEl.eyyOj.qImQN.XposedBridge$LegacyApiSupport.handleAfter(Unknown Source:33) at J.callback(Unknown Source:292) at LSPHooker_.d(Unknown Source:8) at com.tencent.mm.ui.HomeUI.h(Unknown Source:457) at com.tencent.mm.ui.LauncherUI.onResume(Unknown Source:228) at android.app.Instrumentation.callActivityOnResume(Unknown Source:3) at com.highcapable.yukihookapi.hook.xposed.parasitic.activity.delegate.InstrumentationDelegate.callActivityOnResume(InstrumentationDelegate.kt:284) at android.app.Activity.performResume(Unknown Source:68) at android.app.ActivityThread.performResumeActivity(Unknown Source:167) at android.app.ActivityThread.handleResumeActivity(Unknown Source:6) at android.app.servertransaction.ResumeActivityItem.execute(Unknown Source:12) at android.app.servertransaction.ActivityTransactionItem.execute(Unknown Source:4) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(Unknown Source:32) at android.app.servertransaction.TransactionExecutor.execute(Unknown Source:79) at android.app.ActivityThread$H.handleMessage(Unknown Source:172) at android.os.Handler.dispatchMessage(Unknown Source:19) at android.os.Looper.loopOnce(Unknown Source:182) at android.os.Looper.loop(Unknown Source:82) at android.app.ActivityThread.main(Unknown Source:123) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11) at com.android.internal.os.ZygoteInit.main(Unknown Source:312)