From d1edf376465b36621840ac98f73f9b3ba5b39e07 Mon Sep 17 00:00:00 2001 From: Ketal Date: Fri, 7 May 2021 22:27:03 +0800 Subject: [PATCH] Fix get wechat Application in BUGHook --- app/src/main/java/me/kyuubiran/qqcleaner/WeChatHookLoader.kt | 3 +-- .../main/java/me/kyuubiran/qqcleaner/hook/ModuleEntryHook.kt | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/me/kyuubiran/qqcleaner/WeChatHookLoader.kt b/app/src/main/java/me/kyuubiran/qqcleaner/WeChatHookLoader.kt index ed4d59a..8a4edbc 100644 --- a/app/src/main/java/me/kyuubiran/qqcleaner/WeChatHookLoader.kt +++ b/app/src/main/java/me/kyuubiran/qqcleaner/WeChatHookLoader.kt @@ -2,7 +2,6 @@ package me.kyuubiran.qqcleaner import android.annotation.SuppressLint import android.app.Application -import android.content.Context import com.github.kyuubiran.ezxhelper.init.EzXHelperInit import com.github.kyuubiran.ezxhelper.utils.Log import de.robv.android.xposed.callbacks.XC_LoadPackage @@ -34,7 +33,7 @@ class WeChatHookLoader(lpparam: XC_LoadPackage.LoadPackageParam) { private fun doInit(rtLoader: ClassLoader) { if (firstInit) return try { - Application::class.java.getDeclaredMethod("attach", Context::class.java) + Application::class.java.getDeclaredMethod("onCreate") .hookAfter { if (secondInitWeChat) return@hookAfter val ctx = it.thisObject as Application diff --git a/app/src/main/java/me/kyuubiran/qqcleaner/hook/ModuleEntryHook.kt b/app/src/main/java/me/kyuubiran/qqcleaner/hook/ModuleEntryHook.kt index f39445f..1d6a6f0 100644 --- a/app/src/main/java/me/kyuubiran/qqcleaner/hook/ModuleEntryHook.kt +++ b/app/src/main/java/me/kyuubiran/qqcleaner/hook/ModuleEntryHook.kt @@ -11,7 +11,6 @@ import com.github.kyuubiran.ezxhelper.init.InitFields.appContext import com.github.kyuubiran.ezxhelper.utils.* import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XposedBridge -import me.kyuubiran.qqcleaner.R import me.kyuubiran.qqcleaner.activity.SettingsActivity import me.kyuubiran.qqcleaner.data.hostApp import me.kyuubiran.qqcleaner.data.hostInfo