mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 10:45:47 +08:00
...
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* This file is Created by fankes on 2022/2/4.
|
* 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
|
package com.highcapable.yukihookapi.hook.core.finder
|
||||||
|
|
||||||
|
@@ -30,6 +30,8 @@ package com.highcapable.yukihookapi.hook.utils;
|
|||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.highcapable.yukihookapi.annotation.DoNotUseClass;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -38,6 +40,7 @@ import java.util.HashMap;
|
|||||||
import de.robv.android.xposed.XposedHelpers;
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
|
|
||||||
@SuppressWarnings("ALL")
|
@SuppressWarnings("ALL")
|
||||||
|
@DoNotUseClass
|
||||||
public class ReflectionUtils {
|
public class ReflectionUtils {
|
||||||
|
|
||||||
private static final HashMap<String, Field> fieldCache = new HashMap<>();
|
private static final HashMap<String, Field> fieldCache = new HashMap<>();
|
||||||
|
@@ -25,13 +25,19 @@
|
|||||||
*
|
*
|
||||||
* This file is Created by fankes on 2022/2/5.
|
* This file is Created by fankes on 2022/2/5.
|
||||||
*/
|
*/
|
||||||
|
@file:Suppress("EXPERIMENTAL_API_USAGE")
|
||||||
|
|
||||||
package com.highcapable.yukihookapi.hook.utils
|
package com.highcapable.yukihookapi.hook.utils
|
||||||
|
|
||||||
|
import com.highcapable.yukihookapi.annotation.DoNotUseClass
|
||||||
|
import com.highcapable.yukihookapi.annotation.DoNotUseMethod
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算方法执行耗时
|
* 计算方法执行耗时
|
||||||
* @param block 方法块
|
* @param block 方法块
|
||||||
* @return [RunBlockResult]
|
* @return [RunBlockResult]
|
||||||
*/
|
*/
|
||||||
|
@DoNotUseMethod
|
||||||
inline fun <R> runBlocking(block: () -> R): RunBlockResult {
|
inline fun <R> runBlocking(block: () -> R): RunBlockResult {
|
||||||
val start = System.currentTimeMillis()
|
val start = System.currentTimeMillis()
|
||||||
block()
|
block()
|
||||||
@@ -42,6 +48,7 @@ inline fun <R> runBlocking(block: () -> R): RunBlockResult {
|
|||||||
* 构造耗时计算结果类
|
* 构造耗时计算结果类
|
||||||
* @param after 耗时
|
* @param after 耗时
|
||||||
*/
|
*/
|
||||||
|
@DoNotUseClass
|
||||||
class RunBlockResult(private val after: Long) {
|
class RunBlockResult(private val after: Long) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user