From 87cea81518ddfac340ca048aa26f4f8ae96eb5ba Mon Sep 17 00:00:00 2001 From: HChen Date: Thu, 15 Feb 2024 17:57:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../com/hchen/appretention/mode/Hook.java | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ce56b4e..0ea60bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { minSdk 30 targetSdk 34 //noinspection HighAppVersionCode - versionCode 2024021502 - versionName "4.2.3" + versionCode 2024021503 + versionName "4.2.5" ndk { // noinspection ChromeOsAbiSupport abiFilters 'arm64-v8a', 'armeabi-v7a' diff --git a/app/src/main/java/com/hchen/appretention/mode/Hook.java b/app/src/main/java/com/hchen/appretention/mode/Hook.java index 6743ee7..ebeb6f2 100644 --- a/app/src/main/java/com/hchen/appretention/mode/Hook.java +++ b/app/src/main/java/com/hchen/appretention/mode/Hook.java @@ -190,7 +190,7 @@ protected void beforeHookedMethod(MethodHookParam param) { try { before(param); LogTool.Info info = mLogTool.paramCheck(param); - final LogTool.Info getInfo = mLogTool.getInfo(info.method, info.thisObject); + LogTool.Info getInfo = mLogTool.getInfo(info.method, info.thisObject); /*日志过滤*/ /*logFilter(hookLog(), new String[]{"AthenaApp", "OplusBattery"}, () -> logI(hookLog(), getInfo.thisObject, getInfo.methodProcessed), @@ -402,7 +402,7 @@ public Method getDeclaredMethod(String className, String method, Object... type) } public Method getDeclaredMethod(Class clazz, String method, Object... type) throws NoSuchMethodException { -// String tag = "getDeclaredMethod"; + // String tag = "getDeclaredMethod"; ArrayList haveMethod = new ArrayList<>(); Method hqMethod = null; int methodNum; @@ -503,15 +503,15 @@ public void setDeclaredField(XC_MethodHook.MethodHookParam param, String iNeedSt } } - public void checkLast(String setObject, Object fieldName, Object value, Object last) { + public void checkLast(String method, Object fieldName, Object value, Object last) { if (value != null && last != null) { if (value == last || value.equals(last)) { - logI(tag, setObject + " Success! set " + fieldName + " to " + value); + logI(tag, method + " Success! set " + fieldName + " to " + value); } else { - logE(tag, setObject + " Failed! set " + fieldName + " to " + value + " hope: " + value + " but: " + last); + logE(tag, method + " Failed! set " + fieldName + " to " + value + " hope: " + value + " but: " + last); } } else { - logE(tag, setObject + " Error value: " + value + " or last: " + last + " is null"); + logE(tag, method + " Error value: " + value + " or last: " + last + " is null"); } } @@ -526,7 +526,7 @@ public Object getObjectField(Object obj, String fieldName) { public void setStaticBoolean(Class cl, String fieldName, boolean value) { if (cl == null) { - logE(tag, "SetStaticBoolean class can't is null field: " + fieldName + " value: " + value); + logE(tag, "SetStaticBoolean class can't is null, field: " + fieldName + " value: " + value); return; } checkAndSetField(null, cl, fieldName, @@ -537,24 +537,24 @@ public void setStaticBoolean(Class cl, String fieldName, boolean value) { public void setStaticInt(Class cl, String fieldName, int value) { if (cl == null) { - logE(tag, "SetStaticInt class can't is null field: " + fieldName + " value: " + value); + logE(tag, "SetStaticInt class can't is null, field: " + fieldName + " value: " + value); return; } checkAndSetField(null, cl, fieldName, () -> XposedHelpers.setStaticIntField(cl, fieldName, value), () -> XposedHelpers.getStaticIntField(cl, fieldName), - "SetStaticBoolean", value); + "setStaticInt", value); } public void setStaticObject(Class cl, String fieldName, Object value) { if (cl == null) { - logE(tag, "SetStaticObject class can't is null field: " + fieldName + " value: " + value); + logE(tag, "SetStaticObject class can't is null, field: " + fieldName + " value: " + value); return; } checkAndSetField(null, cl, fieldName, () -> XposedHelpers.setStaticObjectField(cl, fieldName, value), () -> XposedHelpers.getStaticObjectField(cl, fieldName), - "SetStaticBoolean", value); + "setStaticObject", value); } public void setInt(Object obj, String fieldName, int value) {