From 1686a296707a7d60e69eada65e13dfb790771c40 Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Sat, 12 Feb 2022 00:09:56 +0800 Subject: [PATCH] ... --- .../yukihookapi/hook/core/finder/FieldFinder.kt | 2 +- .../yukihookapi/hook/utils/ReflectionUtils.java | 3 +++ .../com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt index 6f57717a..172df37f 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt @@ -25,7 +25,7 @@ * * This file is Created by fankes on 2022/2/4. */ -@file:Suppress("unused", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate") +@file:Suppress("unused", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "EXPERIMENTAL_API_USAGE") package com.highcapable.yukihookapi.hook.core.finder diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/ReflectionUtils.java b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/ReflectionUtils.java index 78362a1e..effe04bc 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/ReflectionUtils.java +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/ReflectionUtils.java @@ -30,6 +30,8 @@ package com.highcapable.yukihookapi.hook.utils; import android.text.TextUtils; +import com.highcapable.yukihookapi.annotation.DoNotUseClass; + import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -38,6 +40,7 @@ import java.util.HashMap; import de.robv.android.xposed.XposedHelpers; @SuppressWarnings("ALL") +@DoNotUseClass public class ReflectionUtils { private static final HashMap fieldCache = new HashMap<>(); diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt index 1ca64dc4..dfdd96bd 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt @@ -25,13 +25,19 @@ * * This file is Created by fankes on 2022/2/5. */ +@file:Suppress("EXPERIMENTAL_API_USAGE") + package com.highcapable.yukihookapi.hook.utils +import com.highcapable.yukihookapi.annotation.DoNotUseClass +import com.highcapable.yukihookapi.annotation.DoNotUseMethod + /** * 计算方法执行耗时 * @param block 方法块 * @return [RunBlockResult] */ +@DoNotUseMethod inline fun runBlocking(block: () -> R): RunBlockResult { val start = System.currentTimeMillis() block() @@ -42,6 +48,7 @@ inline fun runBlocking(block: () -> R): RunBlockResult { * 构造耗时计算结果类 * @param after 耗时 */ +@DoNotUseClass class RunBlockResult(private val after: Long) { /**