Gh0u1L5 / WechatSpellbook

Wechat Spellbook 是一个使用Kotlin编写的开源微信插件框架,底层需要 Xposed 或 VirtualXposed 等Hooking框架的支持,而顶层可以轻松对接Java、Kotlin、Scala等JVM系语言。让程序员能够在几分钟内编写出简单的微信插件,随意揉捏微信的内部逻辑。
MIT License
1.7k stars 444 forks source link

使用WeChatSpellBook框架会出现空指针问题 #22

Open Rindiaco opened 6 years ago

Rindiaco commented 6 years ago

10-08 14:15:12.378 11021-11060/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Classes$MsgInfoStorage$2.invoke(Classes.kt:22) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Classes$MsgInfoStorage$2.invoke(Classes.kt:12) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Classes.getMsgInfoStorage(Classes.kt) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:16) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:12) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods.getMsgInfoStorage_insert(Methods.kt) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:42) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:16) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$2.invoke(XposedUtil.kt:35) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$2.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil$tryAsynchronously$1.invoke(BasicUtil.kt:33) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil$tryAsynchronously$1.invoke(BasicUtil.kt:9) at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18)

xfx761 commented 6 years ago

我也出现空指针 2018-10-30 17:59:41.822 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.Classes$MMBaseAdapter$2.invoke(Classes.kt:25) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.Classes$MMBaseAdapter$2.invoke(Classes.kt:11) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.Classes.getMMBaseAdapter(Unknown Source:7) at com.gh0u1l5.wechatmagician.spellbook.hookers.ListViewHider$MMBaseAdapterHooker$1.invoke(ListViewHider.kt:86) at com.gh0u1l5.wechatmagician.spellbook.hookers.ListViewHider$MMBaseAdapterHooker$1.invoke(ListViewHider.kt:17) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.823 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes$MMListPopupWindow$2.invoke(Classes.kt:10) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes$MMListPopupWindow$2.invoke(Classes.kt:8) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes.getMMListPopupWindow(Unknown Source:7) at com.gh0u1l5.wechatmagician.spellbook.hookers.MenuAppender$onMMListPopupWindowShowHooker$1.invoke(MenuAppender.kt:50) at com.gh0u1l5.wechatmagician.spellbook.hookers.MenuAppender$onMMListPopupWindowShowHooker$1.invoke(MenuAppender.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.824 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes$MMListPopupWindow$2.invoke(Classes.kt:10) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes$MMListPopupWindow$2.invoke(Classes.kt:8) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.ui.base.Classes.getMMListPopupWindow(Unknown Source:7) at com.gh0u1l5.wechatmagician.spellbook.hookers.MenuAppender$onMMListPopupWindowDismissHooker$1.invoke(MenuAppender.kt:69) at com.gh0u1l5.wechatmagician.spellbook.hookers.MenuAppender$onMMListPopupWindowDismissHooker$1.invoke(MenuAppender.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.825 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.blanke.wechatbotxposed.hook.Classes$ChattingFooterEventImpl$2.invoke(Classes.kt:13) at com.blanke.wechatbotxposed.hook.Classes$ChattingFooterEventImpl$2.invoke(Classes.kt:10) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.blanke.wechatbotxposed.hook.Classes.getChattingFooterEventImpl(Unknown Source:7) at com.blanke.wechatbotxposed.hook.SendMsgHooker$chattingFooterEventImplHook$1.invoke(SendMsgHooker.kt:46) at com.blanke.wechatbotxposed.hook.SendMsgHooker$chattingFooterEventImplHook$1.invoke(SendMsgHooker.kt:8) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.826 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.blanke.wechatbotxposed.hook.Classes$NetSceneSendMsg$2.invoke(Classes.kt:21) at com.blanke.wechatbotxposed.hook.Classes$NetSceneSendMsg$2.invoke(Classes.kt:10) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.blanke.wechatbotxposed.hook.Classes.getNetSceneSendMsg(Unknown Source:7) at com.blanke.wechatbotxposed.hook.SendMsgHooker$netSceneSendMsgHook$1.invoke(SendMsgHooker.kt:18) at com.blanke.wechatbotxposed.hook.SendMsgHooker$netSceneSendMsgHook$1.invoke(SendMsgHooker.kt:8) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.827 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:15) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:12) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods.getMsgInfoStorage_insert(Unknown Source:7) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:42) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:16) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65) 2018-10-30 17:59:41.827 18987-19275/? E/Xposed: kotlin.KotlinNullPointerException at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:15) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods$MsgInfoStorage_insert$2.invoke(Methods.kt:12) at com.gh0u1l5.wechatmagician.spellbook.WechatGlobal$wxLazy$2.invoke(WechatGlobal.kt:72) at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131) at com.gh0u1l5.wechatmagician.spellbook.mirror.com.tencent.mm.storage.Methods.getMsgInfoStorage_insert(Unknown Source:7) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:42) at com.gh0u1l5.wechatmagician.spellbook.hookers.Storage$onMessageStorageInsertHooker$1.invoke(Storage.kt:16) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:50) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$tryHook$1.invoke(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.BasicUtil.tryVerbosely(BasicUtil.kt:21) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.tryHook(XposedUtil.kt:34) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil.access$tryHook(XposedUtil.kt:14) at com.gh0u1l5.wechatmagician.spellbook.util.XposedUtil$postHooker$1.run(XposedUtil.kt:45) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:187) at android.os.HandlerThread.run(HandlerThread.java:65)

Rindiaco commented 6 years ago

貌似是因为微信版本不一样所以劫持的方法的方法找不到了

skys215 commented 5 years ago

我也出现了NullPointerException。不过是Preference.kt,BaseUtil tryAsynchornously那里。