diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/ApplicationHook.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/ApplicationHook.java index 0de09c235f..34fd9fc86b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/ApplicationHook.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/ApplicationHook.java @@ -53,12 +53,12 @@ public void init() { hookMethod(Application.class, "attach", Context.class, new IHook() { @Override public void before() { - callBackBefore(this, getArgs(0)); + callBackBefore(this, (Context) getArgs(0)); } @Override public void after() { - callBackAfter(this, getArgs(0)); + callBackAfter(this, (Context) getArgs(0)); } }); } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/gallery/UnPrivacyWatermark.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/gallery/UnPrivacyWatermark.java index bdd2907f9a..308dc4916b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/gallery/UnPrivacyWatermark.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/gallery/UnPrivacyWatermark.java @@ -76,13 +76,13 @@ public void drawWatermark(Canvas canvas, String text, int mWidth, int mHeight, i } float min = Math.min(mWidth, mHeight) * 0.02037037f; float f2 = 7.0f * min; - Paint initialPaint = is ? callStaticMethod( + Paint initialPaint = (Paint) (is ? callStaticMethod( "com.miui.gallery.editor.photo.app.privacy.PrivacyWatermarkHelper", "getInitialPaint" ) : callStaticMethod( "com.miui.gallery.privacywatermark.PrivacyWatermarkHelper", "getInitialPaint" - ); + )); Rect rect = new Rect(); initialPaint.setTextSize(min); initialPaint.getTextBounds(text, 0, text.length(), rect); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/ClipboardList.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/ClipboardList.java index 1c97dd5c93..83702f505d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/ClipboardList.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/ClipboardList.java @@ -20,8 +20,6 @@ import static com.hchen.hooktool.tool.CoreTool.getStaticField; import static com.sevtinge.hyperceiler.utils.Helpers.getPackageVersionCode; -import static de.robv.android.xposed.XposedHelpers.getObjectField; -import static de.robv.android.xposed.XposedHelpers.setStaticIntField; import android.annotation.SuppressLint; import android.content.ClipData; @@ -49,7 +47,6 @@ import java.nio.file.Paths; import java.nio.file.attribute.PosixFilePermission; import java.util.ArrayList; -import java.util.List; import java.util.Set; import de.robv.android.xposed.XposedHelpers; @@ -292,7 +289,7 @@ protected void before(MethodHookParam param) throws Throwable { @Override protected void before(MethodHookParam param) throws Throwable { if (mMax == -1) - mMax = getStaticField("com.miui.inputmethod.MiuiClipboardManager", classLoader, + mMax = (int) getStaticField("com.miui.inputmethod.MiuiClipboardManager", classLoader, "MAX_CLIP_CONTENT_SIZE"); if (mMax == -1) mMax = 5000; String string = (String) param.args[0]; diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e0e24000cf..7cf5d90f4a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,7 +26,7 @@ dexkit = "2.0.2" ezxhelper = "2.2.0" hiddenapibypass = "4.3" annotation-processor = "4.4.0" -hooktool = "v.1.0.9" +hooktool = "v.1.1.0" lyricGetterApi = "6.0.0" mmkv = "2.0.1"