From 8e22c0120a05f8b0008e0f9e9383d383f02a110a Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Fri, 4 Feb 2022 02:00:13 +0800 Subject: [PATCH] ... --- .../yukihookapi/hook/core/finder/FieldFinder.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt b/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt index 2d178da1..c27b1c92 100644 --- a/yukihookapi/src/main/java/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt +++ b/yukihookapi/src/main/java/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") +@file:Suppress("unused", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate") package com.highcapable.yukihookapi.hook.core.finder @@ -51,7 +51,7 @@ class FieldFinder(private val hookClass: Class<*>) { var type: Class<*>? = null /** - * 得到变量处理结果 + * 得到变量处理结果 - 不能在外部调用 * @return [Result] * @throws NoSuchFieldError 如果找不到变量 */ @@ -76,19 +76,19 @@ class FieldFinder(private val hookClass: Class<*>) { * @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null * @param any 设置的实例内容 */ - fun set(instance: Any? = null, any: Any?) = fieldInstance?.set(instance, any) + fun set(instance: Any? = null, any: Any?) = give()?.set(instance, any) /** * 得到变量实例 * @param instance 变量所在的实例对象 - 如果是静态可不填 - 默认 null * @return [Field] or null */ - fun get(instance: Any? = null) = fieldInstance?.get(instance) as? T? + fun get(instance: Any? = null) = give()?.get(instance) as? T? /** * 得到变量本身 * @return [Field] or null */ - fun find() = fieldInstance + fun give() = fieldInstance } } \ No newline at end of file