From 337d2c15ffbd1789f82ccae2f4cab72be83a794a Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Sun, 27 Mar 2022 23:26:25 +0800 Subject: [PATCH] Added new function --- .../yukihookapi/hook/core/finder/ConstructorFinder.kt | 6 ++++++ .../yukihookapi/hook/core/finder/MethodFinder.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt index b4442606..17b81f8c 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt @@ -247,6 +247,12 @@ class ConstructorFinder( */ fun get() = Instance() + /** + * 得到构造方法本身 + * @return [Constructor] or null + */ + fun give() = memberInstance as? Constructor<*>? + /** * 获得 [Constructor] 实例处理类 * diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt index 3dac9686..e78abe36 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt @@ -271,6 +271,12 @@ class MethodFinder( */ fun get(instance: Any? = null) = Instance(instance) + /** + * 得到方法本身 + * @return [Method] or null + */ + fun give() = memberInstance as? Method? + /** * 获得 [Method] 实例处理类 *