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] 实例处理类 *