refactor: remove "" and other comments

This commit is contained in:
2023-09-27 18:17:45 +08:00
parent 418fd9de00
commit 18172145ef
47 changed files with 415 additions and 451 deletions

View File

@@ -327,7 +327,7 @@ The exclusion list determines whether these `Class` need to be loaded by the Mod
```kotlin ```kotlin
// Exclude Class names belonging to the Host App // Exclude Class names belonging to the Host App
// They will be loaded by the Host App's ClassLoader // They will be loaded by the Host App's ClassLoader
// The following content is for demonstration only // The following content is for demonstration only
// DO NOT USE IT DIRECTLY, please refer to your actual situation // DO NOT USE IT DIRECTLY, please refer to your actual situation
ModuleClassLoader.excludeHostClasses( ModuleClassLoader.excludeHostClasses(
"androidx.core.app.ActivityCompat", "androidx.core.app.ActivityCompat",
@@ -335,7 +335,7 @@ ModuleClassLoader.excludeHostClasses(
) )
// Exclude Class names belonging to the Module App // Exclude Class names belonging to the Module App
// They will be loaded by the ClassLoader of the Module App (the current Hook process) // They will be loaded by the ClassLoader of the Module App (the current Hook process)
// The following content is for demonstration only // The following content is for demonstration only
// DO NOT USE IT DIRECTLY, please refer to your actual situation // DO NOT USE IT DIRECTLY, please refer to your actual situation
ModuleClassLoader.excludeModuleClasses( ModuleClassLoader.excludeModuleClasses(
"com.demo.entry.HookEntry", "com.demo.entry.HookEntry",

View File

@@ -1170,7 +1170,7 @@ instance.current {
name = "stop" name = "stop"
emptyParam() emptyParam()
}.call() }.call()
// Note that because current() returns the CurrentClass object itself // Note that because current() returns the CurrentClass object itself
// It CANNOT BE CALLED like the following // It CANNOT BE CALLED like the following
instance.current().current() instance.current().current()
``` ```
@@ -1697,7 +1697,7 @@ In find conditions you can only use **index** function once except **order**.
method { method {
name = "test" name = "test"
param(BooleanType).index(num = 2) param(BooleanType).index(num = 2)
// Wrong usage, please keep only one index method // Wrong usage, please keep only one index method
returnType(StringClass).index(num = 1) returnType(StringClass).index(num = 1)
} }
``` ```
@@ -1838,7 +1838,7 @@ The following is the wrong way to use it.
field { field {
name = "test" name = "test"
type = BooleanType type = BooleanType
}.get().string() // Wrong usage, must be cast to the bytecode target type }.get().string() // Wrong usage, must be cast to the bytecode target type
``` ```
The following is the correct way to use it. The following is the correct way to use it.

View File

@@ -298,11 +298,11 @@ Below are two **error** examples.
```kotlin ```kotlin
encase { encase {
// Wrong usage, can't start Hook directly // Wrong usage, can't start Hook directly
findClass(name = "com.example.demo.DemoClass").hook { findClass(name = "com.example.demo.DemoClass").hook {
// ... // ...
} }
// Wrong usage, can't start Hook directly // Wrong usage, can't start Hook directly
resources().hook { resources().hook {
// ... // ...
} }
@@ -327,7 +327,7 @@ object HookEntry : IYukiHookXposedInit {
object CustomHooker : YukiBaseHooker() { object CustomHooker : YukiBaseHooker() {
override fun onHook() { override fun onHook() {
// Wrong method of use // Wrong method of use
// Because there is no judgment object in the outer layer, you cannot start Hook directly // Because there is no judgment object in the outer layer, you cannot start Hook directly
findClass(name = "com.example.demo.DemoClass").hook { findClass(name = "com.example.demo.DemoClass").hook {
// ... // ...

View File

@@ -46,14 +46,14 @@ You try to load the `encase` method in the `onInit` or `onXposedEvent` method of
object HookEntry : IYukiHookXposedInit { object HookEntry : IYukiHookXposedInit {
override fun onInit() { override fun onInit() {
// Wrong usage // Wrong usage
YukiHookAPI.encase { YukiHookAPI.encase {
// Your code here. // Your code here.
} }
} }
override fun onXposedEvent() { override fun onXposedEvent() {
// Wrong usage // Wrong usage
YukiHookAPI.encase { YukiHookAPI.encase {
// Your code here. // Your code here.
} }
@@ -379,15 +379,15 @@ A disallowed parameter type was set when looking up methods, constructors, and v
```kotlin ```kotlin
// Find a method // Find a method
method { method {
// Invalid type example is set // Invalid type example is set
param(false, 1, 0) param(false, 1, 0)
// Invalid type example is set // Invalid type example is set
returnType = false returnType = false
} }
// Find a variable // Find a variable
field { field {
// Invalid type example is set // Invalid type example is set
type = false type = false
} }
``` ```
@@ -941,7 +941,7 @@ Invalid parameters were filled in when injecting Module App's `Activity` using `
> The following example > The following example
```kotlin ```kotlin
// The content filled in here is just an example // The content filled in here is just an example
// And the proxy is filled with invalid parameters that cannot be understood // And the proxy is filled with invalid parameters that cannot be understood
registerModuleAppActivities(proxy = false) registerModuleAppActivities(proxy = false)
``` ```
@@ -1241,7 +1241,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) { YukiHookAPI.encase(base) {
// Can't use prefs in this case // Can't use prefs in this case
prefs.getBoolean("test_data") prefs.getBoolean("test_data")
} }
super.attachBaseContext(base) super.attachBaseContext(base)
@@ -1299,7 +1299,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) { YukiHookAPI.encase(base) {
// dataChannel cannot be used in this case // dataChannel cannot be used in this case
dataChannel.wait(key = "test_data") { dataChannel.wait(key = "test_data") {
// ... // ...
} }
@@ -1348,7 +1348,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
// Wrong usage // Wrong usage
// Constructor has been set to private in API 1.0.88 and later // Constructor has been set to private in API 1.0.88 and later
YukiHookPrefsBridge().getBoolean("test_data") YukiHookPrefsBridge().getBoolean("test_data")
} }

View File

@@ -44,7 +44,7 @@ Add the repositories and dependencies in your project's `SweetDependency` config
```yaml ```yaml
repositories: repositories:
# Must be added when used as an Xposed Module, otherwise optional # Must be added when used as an Xposed Module, otherwise optional
rovo89-xposed-api: rovo89-xposed-api:
url: https://api.xposed.info/ url: https://api.xposed.info/
# MavenCentral has a 2-hour cache, # MavenCentral has a 2-hour cache,
@@ -52,13 +52,13 @@ repositories:
sonatype-oss-releases: sonatype-oss-releases:
plugins: plugins:
# Must be added when used as an Xposed Module, otherwise optional # Must be added when used as an Xposed Module, otherwise optional
com.google.devtools.ksp: com.google.devtools.ksp:
version: + version: +
... ...
libraries: libraries:
# Must be added when used as an Xposed Module, otherwise optional # Must be added when used as an Xposed Module, otherwise optional
de.robv.android.xposed: de.robv.android.xposed:
api: api:
version: 82 version: 82
@@ -67,7 +67,7 @@ libraries:
com.highcapable.yukihookapi: com.highcapable.yukihookapi:
api: api:
version: + version: +
# Must be added when used as an Xposed Module, otherwise optional # Must be added when used as an Xposed Module, otherwise optional
ksp-xposed: ksp-xposed:
version-ref: <this>::api version-ref: <this>::api
... ...
@@ -81,7 +81,7 @@ Next, deploy plugins in your project `build.gradle.kts`.
```kotlin ```kotlin
plugins { plugins {
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
autowire(libs.plugins.com.google.devtools.ksp) autowire(libs.plugins.com.google.devtools.ksp)
// ... // ...
} }
@@ -95,9 +95,9 @@ Then, deploy dependencies in your project `build.gradle.kts`.
dependencies { dependencies {
// Basic dependencies // Basic dependencies
implementation(com.highcapable.yukihookapi.api) implementation(com.highcapable.yukihookapi.api)
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
compileOnly(de.robv.android.xposed.api) compileOnly(de.robv.android.xposed.api)
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
ksp(com.highcapable.yukihookapi.ksp.xposed) ksp(com.highcapable.yukihookapi.ksp.xposed)
} }
``` ```
@@ -112,7 +112,7 @@ Add repositories in your project `build.gradle.kts` or `build.gradle`.
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
maven { url("https://api.xposed.info/") } maven { url("https://api.xposed.info/") }
// MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") } maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
@@ -125,7 +125,7 @@ repositories {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
maven { url 'https://api.xposed.info/' } maven { url 'https://api.xposed.info/' }
// MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
@@ -138,7 +138,7 @@ Add plugins in your project `build.gradle.kts` or `build.gradle`.
```kotlin ```kotlin
plugins { plugins {
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
id("com.google.devtools.ksp") version "<ksp-version>" id("com.google.devtools.ksp") version "<ksp-version>"
} }
``` ```
@@ -147,7 +147,7 @@ plugins {
```groovy ```groovy
plugins { plugins {
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
id 'com.google.devtools.ksp' version '<ksp-version>' id 'com.google.devtools.ksp' version '<ksp-version>'
} }
``` ```
@@ -160,9 +160,9 @@ Add dependencies in your project `build.gradle.kts` or `build.gradle`.
dependencies { dependencies {
// Basic dependency // Basic dependency
implementation("com.highcapable.yukihookapi:api:<yuki-version>") implementation("com.highcapable.yukihookapi:api:<yuki-version>")
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
compileOnly("de.robv.android.xposed:api:82") compileOnly("de.robv.android.xposed:api:82")
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
ksp("com.highcapable.yukihookapi:ksp-xposed:<yuki-version>") ksp("com.highcapable.yukihookapi:ksp-xposed:<yuki-version>")
} }
``` ```
@@ -173,9 +173,9 @@ dependencies {
dependencies { dependencies {
// Basic dependency // Basic dependency
implementation 'com.highcapable.yukihookapi:api:<yuki-version>' implementation 'com.highcapable.yukihookapi:api:<yuki-version>'
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
compileOnly 'de.robv.android.xposed:api:82' compileOnly 'de.robv.android.xposed:api:82'
// Must be added when used as an Xposed Module, otherwise optional // Must be added when used as an Xposed Module, otherwise optional
ksp 'com.highcapable.yukihookapi:ksp-xposed:<yuki-version>' ksp 'com.highcapable.yukihookapi:ksp-xposed:<yuki-version>'
} }
``` ```

View File

@@ -311,14 +311,14 @@ injectMember {
```kotlin ```kotlin
// 排除属于宿主的 Class 类名 // 排除属于宿主的 Class 类名
// 它们将会被宿主的 ClassLoader 装载 // 它们将会被宿主的 ClassLoader 装载
// 以下内容仅供演示,不要直接使用,请以你的实际情况为准 // 以下内容仅供演示,不要直接使用,请以你的实际情况为准
ModuleClassLoader.excludeHostClasses( ModuleClassLoader.excludeHostClasses(
"androidx.core.app.ActivityCompat", "androidx.core.app.ActivityCompat",
"com.demo.Test" "com.demo.Test"
) )
// 排除属于模块的 Class 类名 // 排除属于模块的 Class 类名
// 它们将会被模块 (当前 Hook 进程) 的 ClassLoader 装载 // 它们将会被模块 (当前 Hook 进程) 的 ClassLoader 装载
// 以下内容仅供演示,不要直接使用,请以你的实际情况为准 // 以下内容仅供演示,不要直接使用,请以你的实际情况为准
ModuleClassLoader.excludeModuleClasses( ModuleClassLoader.excludeModuleClasses(
"com.demo.entry.HookEntry", "com.demo.entry.HookEntry",
"com.demo.controller.ModuleController" "com.demo.controller.ModuleController"

View File

@@ -1120,7 +1120,7 @@ instance.current {
name = "stop" name = "stop"
emptyParam() emptyParam()
}.call() }.call()
// 注意,因为 current() 返回的是 CurrentClass 自身对象,所以不能像下面这样调用 // 注意,因为 current() 返回的是 CurrentClass 自身对象,所以不能像下面这样调用
instance.current().current() instance.current().current()
``` ```
@@ -1638,7 +1638,7 @@ TestGeneric::class.java.generic()?.argument()?.method {
method { method {
name = "test" name = "test"
param(BooleanType).index(num = 2) param(BooleanType).index(num = 2)
// 错误的使用方法,请仅保留一个 index 方法 // 错误的使用方法,请仅保留一个 index 方法
returnType(StringClass).index(num = 1) returnType(StringClass).index(num = 1)
} }
``` ```
@@ -1777,7 +1777,7 @@ TestFoo::class.java.constructor()
field { field {
name = "test" name = "test"
type = BooleanType type = BooleanType
}.get().string() // 错误的使用方法,必须 cast 为字节码目标类型 }.get().string() // 错误的使用方法,必须 cast 为字节码目标类型
``` ```
以下是正确的使用方法。 以下是正确的使用方法。

View File

@@ -295,11 +295,11 @@ encase {
```kotlin ```kotlin
encase { encase {
// 错误的使用方法,不能直接开始 Hook // 错误的使用方法,不能直接开始 Hook
findClass(name = "com.example.demo.DemoClass").hook { findClass(name = "com.example.demo.DemoClass").hook {
// ... // ...
} }
// 错误的使用方法,不能直接开始 Hook // 错误的使用方法,不能直接开始 Hook
resources().hook { resources().hook {
// ... // ...
} }
@@ -324,7 +324,7 @@ object HookEntry : IYukiHookXposedInit {
object CustomHooker : YukiBaseHooker() { object CustomHooker : YukiBaseHooker() {
override fun onHook() { override fun onHook() {
// 错误的使用方法,由于外层没有任何判断对象,不能直接开始 Hook // 错误的使用方法,由于外层没有任何判断对象,不能直接开始 Hook
findClass(name = "com.example.demo.DemoClass").hook { findClass(name = "com.example.demo.DemoClass").hook {
// ... // ...
} }

View File

@@ -46,14 +46,14 @@ You cannot load a hooker in "onInit" or "onXposedEvent" method! Aborted
object HookEntry : IYukiHookXposedInit { object HookEntry : IYukiHookXposedInit {
override fun onInit() { override fun onInit() {
// 错误的使用方法 // 错误的使用方法
YukiHookAPI.encase { YukiHookAPI.encase {
// Your code here. // Your code here.
} }
} }
override fun onXposedEvent() { override fun onXposedEvent() {
// 错误的使用方法 // 错误的使用方法
YukiHookAPI.encase { YukiHookAPI.encase {
// Your code here. // Your code here.
} }
@@ -363,15 +363,15 @@ Method/Constructor/Field match type "**TYPE**" not allowed
```kotlin ```kotlin
// 查找一个方法 // 查找一个方法
method { method {
// 设置了无效的类型举例 // 设置了无效的类型举例
param(false, 1, 0) param(false, 1, 0)
// 设置了无效的类型举例 // 设置了无效的类型举例
returnType = false returnType = false
} }
// 查找一个变量 // 查找一个变量
field { field {
// 设置了无效的类型举例 // 设置了无效的类型举例
type = false type = false
} }
``` ```
@@ -893,7 +893,7 @@ This proxy \[**TYPE**\] type is not allowed
> 示例如下 > 示例如下
```kotlin ```kotlin
// 这里填入的内容仅为举例,其中 proxy 填入了不能理解的无效参数 // 这里填入的内容仅为举例,其中 proxy 填入了不能理解的无效参数
registerModuleAppActivities(proxy = false) registerModuleAppActivities(proxy = false)
``` ```
@@ -1182,7 +1182,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) { YukiHookAPI.encase(base) {
// 不能在这种情况下使用 prefs // 不能在这种情况下使用 prefs
prefs.getBoolean("test_data") prefs.getBoolean("test_data")
} }
super.attachBaseContext(base) super.attachBaseContext(base)
@@ -1238,7 +1238,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) { YukiHookAPI.encase(base) {
// 不能在这种情况下使用 dataChannel // 不能在这种情况下使用 dataChannel
dataChannel.wait(key = "test_data") { dataChannel.wait(key = "test_data") {
// ... // ...
} }
@@ -1287,7 +1287,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
// 错误的使用方法 // 错误的使用方法
// 构造方法已在 API 1.0.88 及以后的版本中设置为 private // 构造方法已在 API 1.0.88 及以后的版本中设置为 private
YukiHookPrefsBridge().getBoolean("test_data") YukiHookPrefsBridge().getBoolean("test_data")
} }

View File

@@ -44,20 +44,20 @@
```yaml ```yaml
repositories: repositories:
#作为 Xposed 模块使用务必添加,其它情况可选 # 作为 Xposed 模块使用务必添加,其它情况可选
rovo89-xposed-api: rovo89-xposed-api:
url: https://api.xposed.info/ url: https://api.xposed.info/
# MavenCentral 有 2 小时缓存,若无法集成最新版本请添加 # MavenCentral 有 2 小时缓存,若无法集成最新版本请添加
sonatype-oss-releases: sonatype-oss-releases:
plugins: plugins:
#作为 Xposed 模块使用务必添加,其它情况可选 # 作为 Xposed 模块使用务必添加,其它情况可选
com.google.devtools.ksp: com.google.devtools.ksp:
version: + version: +
... ...
libraries: libraries:
#作为 Xposed 模块使用务必添加,其它情况可选 # 作为 Xposed 模块使用务必添加,其它情况可选
de.robv.android.xposed: de.robv.android.xposed:
api: api:
version: 82 version: 82
@@ -66,7 +66,7 @@ libraries:
com.highcapable.yukihookapi: com.highcapable.yukihookapi:
api: api:
version: + version: +
#作为 Xposed 模块使用务必添加,其它情况可选 # 作为 Xposed 模块使用务必添加,其它情况可选
ksp-xposed: ksp-xposed:
version-ref: <this>::api version-ref: <this>::api
... ...
@@ -80,7 +80,7 @@ libraries:
```kotlin ```kotlin
plugins { plugins {
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
autowire(libs.plugins.com.google.devtools.ksp) autowire(libs.plugins.com.google.devtools.ksp)
// ... // ...
} }
@@ -94,9 +94,9 @@ plugins {
dependencies { dependencies {
// 基础依赖 // 基础依赖
implementation(com.highcapable.yukihookapi.api) implementation(com.highcapable.yukihookapi.api)
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
compileOnly(de.robv.android.xposed.api) compileOnly(de.robv.android.xposed.api)
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
ksp(com.highcapable.yukihookapi.ksp.xposed) ksp(com.highcapable.yukihookapi.ksp.xposed)
} }
``` ```
@@ -111,7 +111,7 @@ dependencies {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
maven { url("https://api.xposed.info/") } maven { url("https://api.xposed.info/") }
// MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址 // MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") } maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
@@ -124,7 +124,7 @@ repositories {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
maven { url 'https://api.xposed.info/' } maven { url 'https://api.xposed.info/' }
// MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址 // MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
@@ -137,7 +137,7 @@ repositories {
```kotlin ```kotlin
plugins { plugins {
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
id("com.google.devtools.ksp") version "<ksp-version>" id("com.google.devtools.ksp") version "<ksp-version>"
} }
``` ```
@@ -146,7 +146,7 @@ plugins {
```groovy ```groovy
plugins { plugins {
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
id 'com.google.devtools.ksp' version '<ksp-version>' id 'com.google.devtools.ksp' version '<ksp-version>'
} }
``` ```
@@ -159,9 +159,9 @@ plugins {
dependencies { dependencies {
// 基础依赖 // 基础依赖
implementation("com.highcapable.yukihookapi:api:<yuki-version>") implementation("com.highcapable.yukihookapi:api:<yuki-version>")
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
compileOnly("de.robv.android.xposed:api:82") compileOnly("de.robv.android.xposed:api:82")
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
ksp("com.highcapable.yukihookapi:ksp-xposed:<yuki-version>") ksp("com.highcapable.yukihookapi:ksp-xposed:<yuki-version>")
} }
``` ```
@@ -172,9 +172,9 @@ dependencies {
dependencies { dependencies {
// 基础依赖 // 基础依赖
implementation 'com.highcapable.yukihookapi:api:<yuki-version>' implementation 'com.highcapable.yukihookapi:api:<yuki-version>'
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
compileOnly 'de.robv.android.xposed:api:82' compileOnly 'de.robv.android.xposed:api:82'
// 作为 Xposed 模块使用务必添加,其它情况可选 // 作为 Xposed 模块使用务必添加,其它情况可选
ksp 'com.highcapable.yukihookapi:ksp-xposed:<yuki-version>' ksp 'com.highcapable.yukihookapi:ksp-xposed:<yuki-version>'
} }
``` ```

View File

@@ -83,9 +83,9 @@ object YukiHookAPI {
/** /**
* 版本名称 * 版本名称
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [VERSION] * - 请现在迁移到 [VERSION]
*/ */
@Deprecated(message = "不再区分版本名称和版本号", ReplaceWith("VERSION")) @Deprecated(message = "不再区分版本名称和版本号", ReplaceWith("VERSION"))
const val API_VERSION_NAME = VERSION const val API_VERSION_NAME = VERSION
@@ -93,9 +93,9 @@ object YukiHookAPI {
/** /**
* 版本号 * 版本号
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [VERSION] * - 请现在迁移到 [VERSION]
*/ */
@Deprecated(message = "不再区分版本名称和版本号", ReplaceWith("VERSION")) @Deprecated(message = "不再区分版本名称和版本号", ReplaceWith("VERSION"))
const val API_VERSION_CODE = -1 const val API_VERSION_CODE = -1
@@ -120,9 +120,9 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 名称 * 获取当前 Hook Framework 名称
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [Executor.name] * - 请现在迁移到 [Executor.name]
* @return [String] * @return [String]
*/ */
@Deprecated( @Deprecated(
@@ -134,9 +134,9 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 版本 * 获取当前 Hook Framework 版本
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [Executor.apiLevel]、[Executor.versionName]、[Executor.versionCode] * - 请现在迁移到 [Executor.apiLevel]、[Executor.versionName]、[Executor.versionCode]
* @return [Int] * @return [Int]
*/ */
@Deprecated( @Deprecated(
@@ -148,11 +148,11 @@ object YukiHookAPI {
/** /**
* 判断模块是否在 Xposed 或太极、无极中激活 * 判断模块是否在 Xposed 或太极、无极中激活
* *
* - 在模块环境中你需要将 [Application] 继承于 [ModuleApplication] * - 在模块环境中你需要将 [Application] 继承于 [ModuleApplication]
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* *
* - 在 (Xposed) 宿主环境中仅返回非 [isTaiChiModuleActive] 的激活状态 * - 在 (Xposed) 宿主环境中仅返回非 [isTaiChiModuleActive] 的激活状态
* @return [Boolean] 是否激活 * @return [Boolean] 是否激活
*/ */
val isModuleActive get() = isXposedEnvironment || YukiXposedModuleStatus.isActive || isTaiChiModuleActive val isModuleActive get() = isXposedEnvironment || YukiXposedModuleStatus.isActive || isTaiChiModuleActive
@@ -160,9 +160,9 @@ object YukiHookAPI {
/** /**
* 仅判断模块是否在 Xposed 中激活 * 仅判断模块是否在 Xposed 中激活
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* *
* - 在 (Xposed) 宿主环境中始终返回 true * - 在 (Xposed) 宿主环境中始终返回 true
* @return [Boolean] 是否激活 * @return [Boolean] 是否激活
*/ */
val isXposedModuleActive get() = isXposedEnvironment || YukiXposedModuleStatus.isActive val isXposedModuleActive get() = isXposedEnvironment || YukiXposedModuleStatus.isActive
@@ -170,9 +170,9 @@ object YukiHookAPI {
/** /**
* 仅判断模块是否在太极、无极中激活 * 仅判断模块是否在太极、无极中激活
* *
* - 在模块环境中你需要将 [Application] 继承于 [ModuleApplication] * - 在模块环境中你需要将 [Application] 继承于 [ModuleApplication]
* *
* - 在 (Xposed) 宿主环境中始终返回 false * - 在 (Xposed) 宿主环境中始终返回 false
* @return [Boolean] 是否激活 * @return [Boolean] 是否激活
*/ */
val isTaiChiModuleActive get() = isXposedEnvironment.not() && (ModuleApplication.currentContext?.isTaiChiModuleActive ?: false) val isTaiChiModuleActive get() = isXposedEnvironment.not() && (ModuleApplication.currentContext?.isTaiChiModuleActive ?: false)
@@ -180,11 +180,11 @@ object YukiHookAPI {
/** /**
* 判断当前 Hook Framework 是否支持资源钩子(Resources Hook) * 判断当前 Hook Framework 是否支持资源钩子(Resources Hook)
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* *
* - 在 (Xposed) 宿主环境中可能会延迟等待事件回调后才会返回 true * - 在 (Xposed) 宿主环境中可能会延迟等待事件回调后才会返回 true
* *
* - 请注意你需要确保 [InjectYukiHookWithXposed.isUsingResourcesHook] 已启用 - 否则始终返回 false * - 请注意你需要确保 [InjectYukiHookWithXposed.isUsingResourcesHook] 已启用 - 否则始终返回 false
* @return [Boolean] 是否支持 * @return [Boolean] 是否支持
*/ */
val isSupportResourcesHook val isSupportResourcesHook
@@ -198,7 +198,7 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 名称 * 获取当前 Hook Framework 名称
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* @return [String] 无法获取会返回 unknown - 获取失败会返回 invalid * @return [String] 无法获取会返回 unknown - 获取失败会返回 invalid
*/ */
val name val name
@@ -211,7 +211,7 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 类型 * 获取当前 Hook Framework 类型
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* @return [ExecutorType] * @return [ExecutorType]
*/ */
val type get() = HookApiProperty.type.takeIf { isXposedEnvironment } ?: HookApiProperty.type(YukiXposedModuleStatus.executorName) val type get() = HookApiProperty.type.takeIf { isXposedEnvironment } ?: HookApiProperty.type(YukiXposedModuleStatus.executorName)
@@ -219,7 +219,7 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 的 API 版本 * 获取当前 Hook Framework 的 API 版本
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* @return [Int] 无法获取会返回 -1 * @return [Int] 无法获取会返回 -1
*/ */
val apiLevel get() = HookApiProperty.apiLevel.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorApiLevel val apiLevel get() = HookApiProperty.apiLevel.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorApiLevel
@@ -227,7 +227,7 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 版本名称 * 获取当前 Hook Framework 版本名称
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* @return [String] 无法获取会返回 unknown - 不支持会返回 unsupported * @return [String] 无法获取会返回 unknown - 不支持会返回 unsupported
*/ */
val versionName get() = HookApiProperty.versionName.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorVersionName val versionName get() = HookApiProperty.versionName.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorVersionName
@@ -235,7 +235,7 @@ object YukiHookAPI {
/** /**
* 获取当前 Hook Framework 版本号 * 获取当前 Hook Framework 版本号
* *
* - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus] * - 在模块环境中需要启用 [Configs.isEnableHookModuleStatus]
* @return [Int] 无法获取会返回 -1 - 不支持会返回 0 * @return [Int] 无法获取会返回 -1 - 不支持会返回 0
*/ */
val versionCode get() = HookApiProperty.versionCode.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorVersionCode val versionCode get() = HookApiProperty.versionCode.takeIf { isXposedEnvironment } ?: YukiXposedModuleStatus.executorVersionCode
@@ -256,9 +256,9 @@ object YukiHookAPI {
/** /**
* 这是一个调试日志的全局标识 * 这是一个调试日志的全局标识
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [debugLog] 并使用 [YukiHookLogger.Configs.tag] * - 请现在迁移到 [debugLog] 并使用 [YukiHookLogger.Configs.tag]
*/ */
@Deprecated(message = "请使用新方式来实现此功能") @Deprecated(message = "请使用新方式来实现此功能")
var debugTag var debugTag
@@ -283,9 +283,9 @@ object YukiHookAPI {
/** /**
* 是否启用调试日志的输出功能 * 是否启用调试日志的输出功能
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [debugLog] 并使用 [YukiHookLogger.Configs.isEnable] * - 请现在迁移到 [debugLog] 并使用 [YukiHookLogger.Configs.isEnable]
*/ */
@Deprecated(message = "请使用新方式来实现此功能") @Deprecated(message = "请使用新方式来实现此功能")
var isAllowPrintingLogs var isAllowPrintingLogs
@@ -297,9 +297,9 @@ object YukiHookAPI {
/** /**
* 是否启用 [YukiHookPrefsBridge] 的键值缓存功能 * 是否启用 [YukiHookPrefsBridge] 的键值缓存功能
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [isEnablePrefsBridgeCache] * - 请现在迁移到 [isEnablePrefsBridgeCache]
*/ */
@Deprecated(message = "请使用新的命名方法来实现此功能", ReplaceWith("isEnablePrefsBridgeCache")) @Deprecated(message = "请使用新的命名方法来实现此功能", ReplaceWith("isEnablePrefsBridgeCache"))
var isEnableModulePrefsCache = false var isEnableModulePrefsCache = false
@@ -307,9 +307,9 @@ object YukiHookAPI {
/** /**
* 是否启用 [YukiHookPrefsBridge] 的键值缓存功能 * 是否启用 [YukiHookPrefsBridge] 的键值缓存功能
* *
* - 此方法及功能已被移除 - 在之后的版本中将直接被删除 * - 此方法及功能已被移除 - 在之后的版本中将直接被删除
* *
* - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题 * - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题
*/ */
@Deprecated(message = "此方法及功能已被移除,请删除此方法") @Deprecated(message = "此方法及功能已被移除,请删除此方法")
var isEnablePrefsBridgeCache = false var isEnablePrefsBridgeCache = false
@@ -319,7 +319,7 @@ object YukiHookAPI {
* *
* - 为防止内存复用过高问题 - 此功能默认启用 * - 为防止内存复用过高问题 - 此功能默认启用
* *
* - 关闭后每次使用 [PackageParam.moduleAppResources] 都会重新创建 - 可能会造成运行缓慢 * - 关闭后每次使用 [PackageParam.moduleAppResources] 都会重新创建 - 可能会造成运行缓慢
* *
* 你可以手动调用 [PackageParam.refreshModuleAppResources] 来刷新缓存 * 你可以手动调用 [PackageParam.refreshModuleAppResources] 来刷新缓存
*/ */
@@ -330,7 +330,7 @@ object YukiHookAPI {
* *
* - 为原生支持 Xposed 模块激活状态检测 - 此功能默认启用 * - 为原生支持 Xposed 模块激活状态检测 - 此功能默认启用
* *
* - 关闭后你将不能再在模块环境中使用 [YukiHookAPI.Status] 中的功能 * - 关闭后你将不能再在模块环境中使用 [YukiHookAPI.Status] 中的功能
*/ */
var isEnableHookModuleStatus = true var isEnableHookModuleStatus = true
@@ -339,7 +339,7 @@ object YukiHookAPI {
* *
* 启用后将在模块启动时强制将 [SharedPreferences] 文件权限调整为 [Context.MODE_WORLD_READABLE] (0664) * 启用后将在模块启动时强制将 [SharedPreferences] 文件权限调整为 [Context.MODE_WORLD_READABLE] (0664)
* *
* - 这是一个可选的实验性功能 - 此功能默认不启用 * - 这是一个可选的实验性功能 - 此功能默认不启用
* *
* - 仅用于修复某些系统可能会出现在启用了 New XSharedPreferences 后依然出现文件权限错误问题 - 若你能正常使用 [YukiHookPrefsBridge] 就不建议启用此功能 * - 仅用于修复某些系统可能会出现在启用了 New XSharedPreferences 后依然出现文件权限错误问题 - 若你能正常使用 [YukiHookPrefsBridge] 就不建议启用此功能
*/ */
@@ -357,9 +357,9 @@ object YukiHookAPI {
/** /**
* 是否启用 [Member] 缓存功能 * 是否启用 [Member] 缓存功能
* *
* - 此方法及功能已被移除 - 在之后的版本中将直接被删除 * - 此方法及功能已被移除 - 在之后的版本中将直接被删除
* *
* - [Member] 的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题 * - [Member] 的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题
*/ */
@Deprecated(message = "此方法及功能已被移除,请删除此方法") @Deprecated(message = "此方法及功能已被移除,请删除此方法")
var isEnableMemberCache = false var isEnableMemberCache = false

View File

@@ -46,7 +46,7 @@ package com.highcapable.yukihookapi.annotation
) )
@Retention(AnnotationRetention.BINARY) @Retention(AnnotationRetention.BINARY)
/** /**
* - 标记为不规范使用可能会引发问题的 API * - 标记为不规范使用可能会引发问题的 API
* *
* 此功能用于规范代码调用域 - 非调用域内的 API 将会在 IDE 中显示警告 * 此功能用于规范代码调用域 - 非调用域内的 API 将会在 IDE 中显示警告
* *

View File

@@ -44,11 +44,11 @@ import de.robv.android.xposed.IXposedHookInitPackageResources
* *
* - 为了防止模块包名无法正常被识别 - 自定义 [modulePackageName] 会在编译时产生警告 * - 为了防止模块包名无法正常被识别 - 自定义 [modulePackageName] 会在编译时产生警告
* *
* - 最后这一点很重要:请不要随意修改项目 ../[sourcePath]/assets/xposed_init 中的内容 - 否则可能会导致模块无法装载 * - 最后这一点很重要:请不要随意修改项目 ../[sourcePath]/assets/xposed_init 中的内容 - 否则可能会导致模块无法装载
* *
* - 你必须将被注解的类继承于 [IYukiHookXposedInit] 接口实现 [IYukiHookXposedInit.onHook] 方法 - 否则编译会报错 * - 你必须将被注解的类继承于 [IYukiHookXposedInit] 接口实现 [IYukiHookXposedInit.onHook] 方法 - 否则编译会报错
* *
* - 只能拥有一个 Hook 入口 - 若存在多个注解编译会报错 * - 只能拥有一个 Hook 入口 - 若存在多个注解编译会报错
* *
* 详情请参考 [InjectYukiHookWithXposed 注解](https://fankes.github.io/YukiHookAPI/zh-cn/config/xposed-using#injectyukihookwithxposed-%E6%B3%A8%E8%A7%A3) * 详情请参考 [InjectYukiHookWithXposed 注解](https://fankes.github.io/YukiHookAPI/zh-cn/config/xposed-using#injectyukihookwithxposed-%E6%B3%A8%E8%A7%A3)
* *

View File

@@ -99,7 +99,7 @@ class CurrentClass internal constructor(private val classSet: Class<*>, internal
/** /**
* 当前类的父类实例的类操作对象 * 当前类的父类实例的类操作对象
* *
* - 请使用 [superClass] 方法来获取 [SuperClass] * - 请使用 [superClass] 方法来获取 [SuperClass]
* @param superClassSet 父类 [Class] 对象 * @param superClassSet 父类 [Class] 对象
*/ */
inner class SuperClass internal constructor(private val superClassSet: Class<*>) { inner class SuperClass internal constructor(private val superClassSet: Class<*>) {

View File

@@ -121,7 +121,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 得到当前被 Hook 的 [Class] * 得到当前被 Hook 的 [Class]
* *
* - 不推荐直接使用 - 万一得不到 [Class] 对象则会无法处理异常导致崩溃 * - 不推荐直接使用 - 万一得不到 [Class] 对象则会无法处理异常导致崩溃
* @return [Class] * @return [Class]
* @throws IllegalStateException 如果当前 [Class] 未被正确装载 * @throws IllegalStateException 如果当前 [Class] 未被正确装载
*/ */
@@ -145,7 +145,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
* *
* 你还需要在整个调用域中声明注解 [CauseProblemsApi] 以消除警告 * 你还需要在整个调用域中声明注解 [CauseProblemsApi] 以消除警告
* *
* - 若你不知道允许此功能会带来何种后果 - 请勿使用 * - 若你不知道允许此功能会带来何种后果 - 请勿使用
* @param option 操作选项内容 * @param option 操作选项内容
*/ */
@CauseProblemsApi @CauseProblemsApi
@@ -305,9 +305,9 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
* *
* 你可以调用 [instanceClass] 来手动查找要 Hook 的 [Method]、[Constructor] * 你可以调用 [instanceClass] 来手动查找要 Hook 的 [Method]、[Constructor]
* *
* - 不建议使用此方法设置目标需要 Hook 的 [Member] 对象 - 你可以使用 [method] or [constructor] 方法 * - 不建议使用此方法设置目标需要 Hook 的 [Member] 对象 - 你可以使用 [method] or [constructor] 方法
* *
* - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换 * - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换
* @param member 要指定的 [Member] or [Member] 数组 * @param member 要指定的 [Member] or [Member] 数组
* @throws IllegalStateException 如果 [member] 参数为空 * @throws IllegalStateException 如果 [member] 参数为空
*/ */
@@ -320,9 +320,9 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 查找并 Hook [hookClass] 中指定 [name] 的全部 [Method] * 查找并 Hook [hookClass] 中指定 [name] 的全部 [Method]
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [MethodFinder] or [allMembers] * - 请现在迁移到 [MethodFinder] or [allMembers]
* @param name 方法名称 * @param name 方法名称
* @return [ArrayList]<[MethodFinder.Result.Instance]> * @return [ArrayList]<[MethodFinder.Result.Instance]>
*/ */
@@ -332,9 +332,9 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 查找并 Hook [hookClass] 中的全部 [Constructor] * 查找并 Hook [hookClass] 中的全部 [Constructor]
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [ConstructorFinder] or [allMembers] * - 请现在迁移到 [ConstructorFinder] or [allMembers]
* @return [ArrayList]<[ConstructorFinder.Result.Instance]> * @return [ArrayList]<[ConstructorFinder.Result.Instance]>
*/ */
@Deprecated( @Deprecated(
@@ -346,11 +346,11 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 查找并 Hook [hookClass] 中的全部 [Method]、[Constructor] * 查找并 Hook [hookClass] 中的全部 [Method]、[Constructor]
* *
* - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换 * - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换
* *
* - 警告:无法准确处理每个 [Member] 的返回值和 param - 建议使用 [method] or [constructor] 对每个 [Member] 单独 Hook * - 警告:无法准确处理每个 [Member] 的返回值和 param - 建议使用 [method] or [constructor] 对每个 [Member] 单独 Hook
* *
* - 如果 [hookClass] 中没有 [Member] 可能会发生错误 * - 如果 [hookClass] 中没有 [Member] 可能会发生错误
* @param type 过滤 [Member] 类型 - 默认为 [MembersType.ALL] * @param type 过滤 [Member] 类型 - 默认为 [MembersType.ALL]
*/ */
fun allMembers(type: MembersType = MembersType.ALL) { fun allMembers(type: MembersType = MembersType.ALL) {
@@ -365,7 +365,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 查找 [hookClass] 需要 Hook 的 [Method] * 查找 [hookClass] 需要 Hook 的 [Method]
* *
* - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换 * - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换
* @param initiate 方法体 * @param initiate 方法体
* @return [MethodFinder.Process] * @return [MethodFinder.Process]
*/ */
@@ -380,7 +380,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 查找 [hookClass] 需要 Hook 的 [Constructor] * 查找 [hookClass] 需要 Hook 的 [Constructor]
* *
* - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换 * - 在同一个 [injectMember] 中你只能使用一次 [members]、[allMembers]、[method]、[constructor] 方法 - 否则结果会被替换
* @param initiate 方法体 * @param initiate 方法体
* @return [ConstructorFinder.Process] * @return [ConstructorFinder.Process]
*/ */
@@ -494,7 +494,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 拦截并替换 [Member] 返回值为 true * 拦截并替换 [Member] 返回值为 true
* *
* - 确保替换 [Member] 的返回对象为 [Boolean] * - 确保替换 [Member] 的返回对象为 [Boolean]
* *
* - 不可与 [beforeHook]、[afterHook] 同时使用 * - 不可与 [beforeHook]、[afterHook] 同时使用
*/ */
@@ -506,7 +506,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 拦截并替换 [Member] 返回值为 false * 拦截并替换 [Member] 返回值为 false
* *
* - 确保替换 [Member] 的返回对象为 [Boolean] * - 确保替换 [Member] 的返回对象为 [Boolean]
* *
* - 不可与 [beforeHook]、[afterHook] 同时使用 * - 不可与 [beforeHook]、[afterHook] 同时使用
*/ */
@@ -518,9 +518,9 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 拦截此 [Member] * 拦截此 [Member]
* *
* - 这将会禁止此 [Member] 执行并返回 null * - 这将会禁止此 [Member] 执行并返回 null
* *
* - 注意:例如 [Int]、[Long]、[Boolean] 常量返回值的 [Member] 一旦被设置为 null 可能会造成 Hook APP 抛出异常 * - 注意:例如 [Int]、[Long]、[Boolean] 常量返回值的 [Member] 一旦被设置为 null 可能会造成 Hook APP 抛出异常
* *
* - 不可与 [beforeHook]、[afterHook] 同时使用 * - 不可与 [beforeHook]、[afterHook] 同时使用
*/ */
@@ -532,7 +532,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 移除当前注入的 Hook [Method]、[Constructor] (解除 Hook) * 移除当前注入的 Hook [Method]、[Constructor] (解除 Hook)
* *
* - 你只能在 Hook 回调方法中使用此功能 * - 你只能在 Hook 回调方法中使用此功能
* @param result 回调是否成功 * @param result 回调是否成功
*/ */
fun removeSelf(result: (Boolean) -> Unit = {}) = this.result?.remove(result) ?: result(false) fun removeSelf(result: (Boolean) -> Unit = {}) = this.result?.remove(result) ?: result(false)
@@ -756,7 +756,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 监听 [members] 重复 Hook 的回调方法 * 监听 [members] 重复 Hook 的回调方法
* *
* - 同一个 [hookClass] 中的同一个 [members] 不会被 API 重复 Hook - 若由于各种原因重复 Hook 会回调此方法 * - 同一个 [hookClass] 中的同一个 [members] 不会被 API 重复 Hook - 若由于各种原因重复 Hook 会回调此方法
* @param result 回调被重复 Hook 的 [Member] * @param result 回调被重复 Hook 的 [Member]
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@@ -832,7 +832,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
/** /**
* 移除当前注入的 Hook [Method]、[Constructor] (解除 Hook) * 移除当前注入的 Hook [Method]、[Constructor] (解除 Hook)
* *
* - 你只能在 Hook 成功后才能解除 Hook - 可监听 [onHooked] 事件 * - 你只能在 Hook 成功后才能解除 Hook - 可监听 [onHooked] 事件
* @param result 回调是否成功 * @param result 回调是否成功
*/ */
fun remove(result: (Boolean) -> Unit = {}) { fun remove(result: (Boolean) -> Unit = {}) {

View File

@@ -126,14 +126,14 @@ class YukiResourcesHookCreator internal constructor(internal val packageParam: P
/** /**
* 替换指定 Resources 为 true * 替换指定 Resources 为 true
* *
* - 确保目标替换 Resources 的类型为 [Boolean] * - 确保目标替换 Resources 的类型为 [Boolean]
*/ */
fun replaceToTrue() = replaceTo(any = true) fun replaceToTrue() = replaceTo(any = true)
/** /**
* 替换指定 Resources 为 false * 替换指定 Resources 为 false
* *
* - 确保目标替换 Resources 的类型为 [Boolean] * - 确保目标替换 Resources 的类型为 [Boolean]
*/ */
fun replaceToFalse() = replaceTo(any = false) fun replaceToFalse() = replaceTo(any = false)

View File

@@ -75,7 +75,7 @@ abstract class BaseFinder {
/** /**
* 字节码、数组下标排序实现类 * 字节码、数组下标排序实现类
* *
* - 请使用 [index] 方法来获取 [IndexTypeConditionSort] * - 请使用 [index] 方法来获取 [IndexTypeConditionSort]
*/ */
inner class IndexTypeConditionSort internal constructor() { inner class IndexTypeConditionSort internal constructor() {
@@ -117,7 +117,7 @@ abstract class BaseFinder {
/** /**
* 返回结果实现类 * 返回结果实现类
* *
* - 此功能交由方法体自动完成 - 你不应该手动调用此方法 * - 此功能交由方法体自动完成 - 你不应该手动调用此方法
* @return [BaseResult] * @return [BaseResult]
*/ */
internal abstract fun build(): BaseResult internal abstract fun build(): BaseResult
@@ -125,7 +125,7 @@ abstract class BaseFinder {
/** /**
* 返回只有异常的结果实现类 * 返回只有异常的结果实现类
* *
* - 此功能交由方法体自动完成 - 你不应该手动调用此方法 * - 此功能交由方法体自动完成 - 你不应该手动调用此方法
* @param throwable 异常 * @param throwable 异常
* @return [BaseResult] * @return [BaseResult]
*/ */
@@ -134,7 +134,7 @@ abstract class BaseFinder {
/** /**
* 查找结果实现、处理类接口 * 查找结果实现、处理类接口
* *
* - 此功能交由方法体自动完成 - 你不应该手动继承此接口 * - 此功能交由方法体自动完成 - 你不应该手动继承此接口
*/ */
internal interface BaseResult internal interface BaseResult
} }

View File

@@ -120,7 +120,7 @@ abstract class MemberBaseFinder internal constructor(private val tag: String, in
/** /**
* 返回结果处理类并设置到目标 [YukiMemberHookCreator.MemberHookCreator] * 返回结果处理类并设置到目标 [YukiMemberHookCreator.MemberHookCreator]
* *
* - 此功能交由方法体自动完成 - 你不应该手动调用此方法 * - 此功能交由方法体自动完成 - 你不应该手动调用此方法
* @return [BaseFinder.BaseResult] * @return [BaseFinder.BaseResult]
*/ */
internal abstract fun process(): BaseResult internal abstract fun process(): BaseResult
@@ -128,7 +128,7 @@ abstract class MemberBaseFinder internal constructor(private val tag: String, in
/** /**
* 返回只有异常的结果处理类并作用于目标 [YukiMemberHookCreator.MemberHookCreator] * 返回只有异常的结果处理类并作用于目标 [YukiMemberHookCreator.MemberHookCreator]
* *
* - 此功能交由方法体自动完成 - 你不应该手动调用此方法 * - 此功能交由方法体自动完成 - 你不应该手动调用此方法
* @param throwable 异常 * @param throwable 异常
* @return [BaseFinder.BaseResult] * @return [BaseFinder.BaseResult]
*/ */

View File

@@ -115,7 +115,7 @@ class ModifierRules private constructor(private val instance: Any) {
* *
* ^^^ * ^^^
* *
* - 注意 Kotlin → Jvm 后的 object 类中的方法并不是静态的 * - 注意 Kotlin → Jvm 后的 object 类中的方法并不是静态的
* @return [Boolean] * @return [Boolean]
*/ */
val isStatic get() = Modifier.isStatic(modifiers).also { templates.add("<isStatic> ($it)") } val isStatic get() = Modifier.isStatic(modifiers).also { templates.add("<isStatic> ($it)") }
@@ -129,7 +129,7 @@ class ModifierRules private constructor(private val instance: Any) {
* *
* ^^^ * ^^^
* *
* - 注意 Kotlin → Jvm 后没有 open 标识的 [Class]、[Member] 和没有任何关联的 [Class]、[Member] 都将为 final * - 注意 Kotlin → Jvm 后没有 open 标识的 [Class]、[Member] 和没有任何关联的 [Class]、[Member] 都将为 final
* @return [Boolean] * @return [Boolean]
*/ */
val isFinal get() = Modifier.isFinal(modifiers).also { templates.add("<isFinal> ($it)") } val isFinal get() = Modifier.isFinal(modifiers).also { templates.add("<isFinal> ($it)") }

View File

@@ -64,7 +64,7 @@ import java.lang.reflect.Method
* *
* 可使用 [BaseDexClassLoader] 通过指定条件查找指定 [Class] 或一组 [Class] * 可使用 [BaseDexClassLoader] 通过指定条件查找指定 [Class] 或一组 [Class]
* *
* - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进 * - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进
* @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存必须启用 [async] * @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存必须启用 [async]
* @param async 是否启用异步 * @param async 是否启用异步
* @param loaderSet 当前使用的 [ClassLoader] 实例 * @param loaderSet 当前使用的 [ClassLoader] 实例
@@ -172,7 +172,7 @@ class DexClassFinder internal constructor(
* *
* com.demo.test.demo * com.demo.test.demo
* *
* - 建议设置此参数指定查找范围 - 否则 [Class] 过多时将会非常慢 * - 建议设置此参数指定查找范围 - 否则 [Class] 过多时将会非常慢
* @param name 指定包名 * @param name 指定包名
* @return [FromPackageRules] 可设置 [FromPackageRules.absolute] 标识包名绝对匹配 * @return [FromPackageRules] 可设置 [FromPackageRules.absolute] 标识包名绝对匹配
*/ */
@@ -313,7 +313,7 @@ class DexClassFinder internal constructor(
* *
* 此时 [Class] 只应该继承于 [Any] * 此时 [Class] 只应该继承于 [Any]
* *
* - 设置此条件后 [extends] 将失效 * - 设置此条件后 [extends] 将失效
*/ */
fun noExtends() { fun noExtends() {
rulesData.isNoExtendsClass = true rulesData.isNoExtendsClass = true
@@ -322,7 +322,7 @@ class DexClassFinder internal constructor(
/** /**
* 设置 [Class] 没有任何接口 * 设置 [Class] 没有任何接口
* *
* - 设置此条件后 [implements] 将失效 * - 设置此条件后 [implements] 将失效
*/ */
fun noImplements() { fun noImplements() {
rulesData.isNoImplementsClass = true rulesData.isNoImplementsClass = true
@@ -333,7 +333,7 @@ class DexClassFinder internal constructor(
* *
* 此时 [Class] 只应该继承于 [Any] * 此时 [Class] 只应该继承于 [Any]
* *
* - 设置此条件后 [extends] 与 [implements] 将失效 * - 设置此条件后 [extends] 与 [implements] 将失效
*/ */
fun noSuper() { fun noSuper() {
noExtends() noExtends()
@@ -534,7 +534,7 @@ class DexClassFinder internal constructor(
* *
* - 在查找条件找不到任何结果的时候将返回 null * - 在查找条件找不到任何结果的时候将返回 null
* *
* - 若你设置了 [async] 请使用 [wait] 方法 * - 若你设置了 [async] 请使用 [wait] 方法
* @return [Class] or null * @return [Class] or null
*/ */
fun get() = all().takeIf { it.isNotEmpty() }?.first() fun get() = all().takeIf { it.isNotEmpty() }?.first()
@@ -546,7 +546,7 @@ class DexClassFinder internal constructor(
* *
* - 在查找条件找不到任何结果的时候将返回空的 [HashSet] * - 在查找条件找不到任何结果的时候将返回空的 [HashSet]
* *
* - 若你设置了 [async] 请使用 [waitAll] 方法 * - 若你设置了 [async] 请使用 [waitAll] 方法
* @return [HashSet]<[Class]> * @return [HashSet]<[Class]>
*/ */
fun all() = classInstances fun all() = classInstances
@@ -558,7 +558,7 @@ class DexClassFinder internal constructor(
* *
* - 在查找条件找不到任何结果的时候将不会执行 * - 在查找条件找不到任何结果的时候将不会执行
* *
* - 若你设置了 [async] 请使用 [waitAll] 方法 * - 若你设置了 [async] 请使用 [waitAll] 方法
* @param result 回调每个结果 * @param result 回调每个结果
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@@ -574,7 +574,7 @@ class DexClassFinder internal constructor(
* *
* - 在查找条件找不到任何结果的时候将回调 null * - 在查找条件找不到任何结果的时候将回调 null
* *
* - 你需要设置 [async] 后此方法才会被回调 - 否则请使用 [get] 方法 * - 你需要设置 [async] 后此方法才会被回调 - 否则请使用 [get] 方法
* @param result 回调 - ([Class] or null) * @param result 回调 - ([Class] or null)
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@@ -590,7 +590,7 @@ class DexClassFinder internal constructor(
* *
* - 在查找条件找不到任何结果的时候将回调空的 [HashSet] * - 在查找条件找不到任何结果的时候将回调空的 [HashSet]
* *
* - 你需要设置 [async] 后此方法才会被回调 - 否则请使用 [all] 方法 * - 你需要设置 [async] 后此方法才会被回调 - 否则请使用 [all] 方法
* @param result 回调 - ([HashSet]<[Class]>) * @param result 回调 - ([HashSet]<[Class]>)
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@@ -613,7 +613,7 @@ class DexClassFinder internal constructor(
/** /**
* 忽略异常并停止打印任何错误日志 * 忽略异常并停止打印任何错误日志
* *
* - 此时若要监听异常结果 - 你需要手动实现 [onNoClassDefFoundError] 方法 * - 此时若要监听异常结果 - 你需要手动实现 [onNoClassDefFoundError] 方法
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
fun ignored(): Result { fun ignored(): Result {

View File

@@ -94,10 +94,10 @@ class ConstructorRules internal constructor(private val rulesData: ConstructorRu
* param(StringType, BooleanType, VagueType, IntType) * param(StringType, BooleanType, VagueType, IntType)
* ``` * ```
* *
* - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件 * - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass] * @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass]
*/ */
fun param(vararg paramType: Any) { fun param(vararg paramType: Any) {
if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead") if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead")
@@ -114,9 +114,9 @@ class ConstructorRules internal constructor(private val rulesData: ConstructorRu
* param { it[1] == StringClass || it[2].name == "java.lang.String" } * param { it[1] == StringClass || it[2].name == "java.lang.String" }
* ``` * ```
* *
* - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件 * - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* @param conditions 条件方法体 * @param conditions 条件方法体
*/ */
fun param(conditions: ObjectsConditions) { fun param(conditions: ObjectsConditions) {

View File

@@ -55,7 +55,7 @@ class FieldRules internal constructor(private val rulesData: FieldRulesData) : B
/** /**
* 设置 [Field] 类型 * 设置 [Field] 类型
* *
* - 只能是 [Class]、[String]、[VariousClass] * - 只能是 [Class]、[String]、[VariousClass]
* *
* - 可不填写类型 * - 可不填写类型
* @return [Any] or null * @return [Any] or null

View File

@@ -75,7 +75,7 @@ class MethodRules internal constructor(private val rulesData: MethodRulesData) :
/** /**
* 设置 [Method] 返回值 * 设置 [Method] 返回值
* *
* - 只能是 [Class]、[String]、[VariousClass] * - 只能是 [Class]、[String]、[VariousClass]
* *
* - 可不填写返回值 * - 可不填写返回值
* @return [Any] or null * @return [Any] or null
@@ -120,10 +120,10 @@ class MethodRules internal constructor(private val rulesData: MethodRulesData) :
* param(StringType, BooleanType, VagueType, IntType) * param(StringType, BooleanType, VagueType, IntType)
* ``` * ```
* *
* - 无参 [Method] 请使用 [emptyParam] 设置查找条件 * - 无参 [Method] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass] * @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass]
*/ */
fun param(vararg paramType: Any) { fun param(vararg paramType: Any) {
if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead") if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead")
@@ -140,9 +140,9 @@ class MethodRules internal constructor(private val rulesData: MethodRulesData) :
* param { it[1] == StringClass || it[2].name == "java.lang.String" } * param { it[1] == StringClass || it[2].name == "java.lang.String" }
* ``` * ```
* *
* - 无参 [Method] 请使用 [emptyParam] 设置查找条件 * - 无参 [Method] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* @param conditions 条件方法体 * @param conditions 条件方法体
*/ */
fun param(conditions: ObjectsConditions) { fun param(conditions: ObjectsConditions) {

View File

@@ -93,7 +93,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
/** /**
* 设置 [Constructor] 标识符筛选条件 * 设置 [Constructor] 标识符筛选条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -128,12 +128,12 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* param(StringType, BooleanType, VagueType, IntType) * param(StringType, BooleanType, VagueType, IntType)
* ``` * ```
* *
* - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件 * - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass] * @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass]
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
fun param(vararg paramType: Any): IndexTypeCondition { fun param(vararg paramType: Any): IndexTypeCondition {
@@ -151,11 +151,11 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* param { it[1] == StringClass || it[2].name == "java.lang.String" } * param { it[1] == StringClass || it[2].name == "java.lang.String" }
* ``` * ```
* *
* - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件 * - 无参 [Constructor] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -177,7 +177,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* 若参数个数小于零则忽略并使用 [param] * 若参数个数小于零则忽略并使用 [param]
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param num 个数 * @param num 个数
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -197,7 +197,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* paramCount(1..5) * paramCount(1..5)
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param numRange 个数范围 * @param numRange 个数范围
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -217,7 +217,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* paramCount { it >= 5 || it.isZero() } * paramCount { it >= 5 || it.isZero() }
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -229,7 +229,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
/** /**
* 设置在 [classSet] 的所有父类中查找当前 [Constructor] * 设置在 [classSet] 的所有父类中查找当前 [Constructor]
* *
* - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类 * - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类
* @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效 * @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效
*/ */
fun superClass(isOnlySuperClass: Boolean = false) { fun superClass(isOnlySuperClass: Boolean = false) {
@@ -437,9 +437,9 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* - 若有多个 [Constructor] 结果只会返回第一个 * - 若有多个 [Constructor] 结果只会返回第一个
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 若你设置了 [remedys] 请使用 [wait] 回调结果方法 * - 若你设置了 [remedys] 请使用 [wait] 回调结果方法
* @return [Instance] * @return [Instance]
*/ */
fun get() = Instance(give()) fun get() = Instance(give())
@@ -449,9 +449,9 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* - 返回全部查找条件匹配的多个 [Constructor] 实例结果 * - 返回全部查找条件匹配的多个 [Constructor] 实例结果
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法 * - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法
* @return [ArrayList]<[Instance]> * @return [ArrayList]<[Instance]>
*/ */
fun all() = arrayListOf<Instance>().apply { giveAll().takeIf { it.isNotEmpty() }?.forEach { add(Instance(it)) } } fun all() = arrayListOf<Instance>().apply { giveAll().takeIf { it.isNotEmpty() }?.forEach { add(Instance(it)) } }
@@ -481,9 +481,9 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* - 若有多个 [Constructor] 结果只会返回第一个 * - 若有多个 [Constructor] 结果只会返回第一个
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param initiate 回调 [Instance] * @param initiate 回调 [Instance]
*/ */
fun wait(initiate: Instance.() -> Unit) { fun wait(initiate: Instance.() -> Unit) {
@@ -496,9 +496,9 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* - 返回全部查找条件匹配的多个 [Constructor] 实例结果 * - 返回全部查找条件匹配的多个 [Constructor] 实例结果
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param initiate 回调 [ArrayList]<[Instance]> * @param initiate 回调 [ArrayList]<[Instance]>
*/ */
fun waitAll(initiate: ArrayList<Instance>.() -> Unit) { fun waitAll(initiate: ArrayList<Instance>.() -> Unit) {
@@ -538,7 +538,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略 * - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略
* *
* - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchConstructor] 方法 * - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchConstructor] 方法
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
fun ignored(): Result { fun ignored(): Result {
@@ -549,9 +549,9 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
/** /**
* 忽略异常并停止打印任何错误日志 * 忽略异常并停止打印任何错误日志
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [ignored] * - 请现在迁移到 [ignored]
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
@@ -562,7 +562,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>? =
* *
* 调用与创建目标实例类对象 * 调用与创建目标实例类对象
* *
* - 请使用 [get]、[wait]、[all]、[waitAll] 方法来获取 [Instance] * - 请使用 [get]、[wait]、[all]、[waitAll] 方法来获取 [Instance]
* @param constructor 当前 [Constructor] 实例对象 * @param constructor 当前 [Constructor] 实例对象
*/ */
inner class Instance internal constructor(private val constructor: Constructor<*>?) { inner class Instance internal constructor(private val constructor: Constructor<*>?) {

View File

@@ -77,7 +77,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Field] 名称 * 设置 [Field] 名称
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* @return [String] * @return [String]
*/ */
var name var name
@@ -89,7 +89,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Field] 类型 * 设置 [Field] 类型
* *
* - 只能是 [Class]、[String]、[VariousClass] * - 只能是 [Class]、[String]、[VariousClass]
* *
* - 可不填写类型 * - 可不填写类型
* @return [Any] or null * @return [Any] or null
@@ -105,7 +105,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 可不设置筛选条件 * - 可不设置筛选条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -123,9 +123,9 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Field] 名称 * 设置 [Field] 名称
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param value 名称 * @param value 名称
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -137,9 +137,9 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Field] 名称条件 * 设置 [Field] 名称条件
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -153,8 +153,8 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 可不填写类型 * - 可不填写类型
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param value 类型 - 只能是 [Class]、[String]、[VariousClass] * @param value 类型 - 只能是 [Class]、[String]、[VariousClass]
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
fun type(value: Any): IndexTypeCondition { fun type(value: Any): IndexTypeCondition {
@@ -173,7 +173,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* type { it == StringClass || it.name == "java.lang.String" } * type { it == StringClass || it.name == "java.lang.String" }
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -185,7 +185,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置在 [classSet] 的所有父类中查找当前 [Field] * 设置在 [classSet] 的所有父类中查找当前 [Field]
* *
* - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类 * - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类
* @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效 * @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效
*/ */
fun superClass(isOnlySuperClass: Boolean = false) { fun superClass(isOnlySuperClass: Boolean = false) {
@@ -328,11 +328,11 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若有多个 [Field] 结果只会返回第一个 * - 若有多个 [Field] 结果只会返回第一个
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 如果目标对象不是静态 - 你必须设置 [instance] * - 如果目标对象不是静态 - 你必须设置 [instance]
* *
* - 若你设置了 [remedys] 请使用 [wait] 回调结果方法 * - 若你设置了 [remedys] 请使用 [wait] 回调结果方法
* @param instance [Field] 所在的实例对象 - 如果是静态可不填 - 默认 null * @param instance [Field] 所在的实例对象 - 如果是静态可不填 - 默认 null
* @return [Instance] * @return [Instance]
*/ */
@@ -343,11 +343,11 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 返回全部查找条件匹配的多个 [Field] 实例结果 * - 返回全部查找条件匹配的多个 [Field] 实例结果
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 如果目标对象不是静态 - 你必须设置 [instance] * - 如果目标对象不是静态 - 你必须设置 [instance]
* *
* - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法 * - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法
* @param instance [Field] 所在的实例对象 - 如果是静态可不填 - 默认 null * @param instance [Field] 所在的实例对象 - 如果是静态可不填 - 默认 null
* @return [ArrayList]<[Instance]> * @return [ArrayList]<[Instance]>
*/ */
@@ -379,9 +379,9 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若有多个 [Field] 结果只会返回第一个 * - 若有多个 [Field] 结果只会返回第一个
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param instance 所在实例 * @param instance 所在实例
* @param initiate 回调 [Instance] * @param initiate 回调 [Instance]
*/ */
@@ -395,9 +395,9 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 返回全部查找条件匹配的多个 [Field] 实例结果 * - 返回全部查找条件匹配的多个 [Field] 实例结果
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param instance 所在实例 * @param instance 所在实例
* @param initiate 回调 [ArrayList]<[Instance]> * @param initiate 回调 [ArrayList]<[Instance]>
*/ */
@@ -440,7 +440,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略 * - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略
* *
* - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchField] 方法 * - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchField] 方法
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
fun ignored(): Result { fun ignored(): Result {
@@ -451,9 +451,9 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 忽略异常并停止打印任何错误日志 * 忽略异常并停止打印任何错误日志
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [ignored] * - 请现在迁移到 [ignored]
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
@@ -462,7 +462,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* [Field] 实例处理类 * [Field] 实例处理类
* *
* - 请使用 [get]、[all] 方法来获取 [Instance] * - 请使用 [get]、[all] 方法来获取 [Instance]
* @param instance 当前 [Field] 所在类的实例对象 * @param instance 当前 [Field] 所在类的实例对象
* @param field 当前 [Field] 实例对象 * @param field 当前 [Field] 实例对象
*/ */
@@ -500,7 +500,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Byte] 实例 * 得到当前 [Field] 的 [Byte] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回 null * - 请确认目标 [Field] 的类型 - 发生错误会返回 null
* @return [Byte] or null * @return [Byte] or null
*/ */
fun byte() = cast<Byte?>() fun byte() = cast<Byte?>()
@@ -508,7 +508,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Int] 实例 * 得到当前 [Field] 的 [Int] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Int] 取不到返回 0 * @return [Int] 取不到返回 0
*/ */
fun int() = cast() ?: 0 fun int() = cast() ?: 0
@@ -516,7 +516,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Long] 实例 * 得到当前 [Field] 的 [Long] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Long] 取不到返回 0L * @return [Long] 取不到返回 0L
*/ */
fun long() = cast() ?: 0L fun long() = cast() ?: 0L
@@ -524,7 +524,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Short] 实例 * 得到当前 [Field] 的 [Short] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Short] 取不到返回 0 * @return [Short] 取不到返回 0
*/ */
fun short() = cast<Short?>() ?: 0 fun short() = cast<Short?>() ?: 0
@@ -532,7 +532,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Double] 实例 * 得到当前 [Field] 的 [Double] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Double] 取不到返回 0.0 * @return [Double] 取不到返回 0.0
*/ */
fun double() = cast() ?: 0.0 fun double() = cast() ?: 0.0
@@ -540,7 +540,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Float] 实例 * 得到当前 [Field] 的 [Float] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Float] 取不到返回 0f * @return [Float] 取不到返回 0f
*/ */
fun float() = cast() ?: 0f fun float() = cast() ?: 0f
@@ -548,7 +548,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [String] 实例 * 得到当前 [Field] 的 [String] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [String] 取不到返回 "" * @return [String] 取不到返回 ""
*/ */
fun string() = cast() ?: "" fun string() = cast() ?: ""
@@ -556,7 +556,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Char] 实例 * 得到当前 [Field] 的 [Char] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Char] 取不到返回 ' ' * @return [Char] 取不到返回 ' '
*/ */
fun char() = cast() ?: ' ' fun char() = cast() ?: ' '
@@ -564,7 +564,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Boolean] 实例 * 得到当前 [Field] 的 [Boolean] 实例
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回默认值 * - 请确认目标 [Field] 的类型 - 发生错误会返回默认值
* @return [Boolean] 取不到返回 false * @return [Boolean] 取不到返回 false
*/ */
fun boolean() = cast() ?: false fun boolean() = cast() ?: false
@@ -578,7 +578,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [Array] 实例 - 每项类型 [T] * 得到当前 [Field] 的 [Array] 实例 - 每项类型 [T]
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回空数组 * - 请确认目标 [Field] 的类型 - 发生错误会返回空数组
* @return [Array] 取不到返回空数组 * @return [Array] 取不到返回空数组
*/ */
inline fun <reified T> array() = cast() ?: arrayOf<T>() inline fun <reified T> array() = cast() ?: arrayOf<T>()
@@ -586,7 +586,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 得到当前 [Field] 的 [List] 实例 - 每项类型 [T] * 得到当前 [Field] 的 [List] 实例 - 每项类型 [T]
* *
* - 请确认目标 [Field] 的类型 - 发生错误会返回空数组 * - 请确认目标 [Field] 的类型 - 发生错误会返回空数组
* @return [List] 取不到返回空数组 * @return [List] 取不到返回空数组
*/ */
inline fun <reified T> list() = cast() ?: listOf<T>() inline fun <reified T> list() = cast() ?: listOf<T>()
@@ -600,14 +600,14 @@ class FieldFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置当前 [Field] 实例为 true * 设置当前 [Field] 实例为 true
* *
* - 请确保示例对象类型为 [Boolean] * - 请确保示例对象类型为 [Boolean]
*/ */
fun setTrue() = set(true) fun setTrue() = set(true)
/** /**
* 设置当前 [Field] 实例为 true * 设置当前 [Field] 实例为 true
* *
* - 请确保示例对象类型为 [Boolean] * - 请确保示例对象类型为 [Boolean]
*/ */
fun setFalse() = set(false) fun setFalse() = set(false)

View File

@@ -82,7 +82,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Method] 名称 * 设置 [Method] 名称
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* @return [String] * @return [String]
*/ */
var name var name
@@ -108,7 +108,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Method] 返回值 * 设置 [Method] 返回值
* *
* - 只能是 [Class]、[String]、[VariousClass] * - 只能是 [Class]、[String]、[VariousClass]
* *
* - 可不填写返回值 * - 可不填写返回值
* @return [Any] or null * @return [Any] or null
@@ -124,7 +124,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 可不设置筛选条件 * - 可不设置筛选条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -159,12 +159,12 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* param(StringType, BooleanType, VagueType, IntType) * param(StringType, BooleanType, VagueType, IntType)
* ``` * ```
* *
* - 无参 [Method] 请使用 [emptyParam] 设置查找条件 * - 无参 [Method] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass] * @param paramType 参数类型数组 - 只能是 [Class]、[String]、[VariousClass]
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
fun param(vararg paramType: Any): IndexTypeCondition { fun param(vararg paramType: Any): IndexTypeCondition {
@@ -182,11 +182,11 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* param { it[1] == StringClass || it[2].name == "java.lang.String" } * param { it[1] == StringClass || it[2].name == "java.lang.String" }
* ``` * ```
* *
* - 无参 [Method] 请使用 [emptyParam] 设置查找条件 * - 无参 [Method] 请使用 [emptyParam] 设置查找条件
* *
* - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数 * - 有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -204,9 +204,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Method] 名称 * 设置 [Method] 名称
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param value 名称 * @param value 名称
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -218,9 +218,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置 [Method] 名称条件 * 设置 [Method] 名称条件
* *
* - 若不填写名称则必须存在一个其它条件 * - 若不填写名称则必须存在一个其它条件
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -236,7 +236,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* 若参数个数小于零则忽略并使用 [param] * 若参数个数小于零则忽略并使用 [param]
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param num 个数 * @param num 个数
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -256,7 +256,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* paramCount(1..5) * paramCount(1..5)
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param numRange 个数范围 * @param numRange 个数范围
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -276,7 +276,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* paramCount { it >= 5 || it.isZero() } * paramCount { it >= 5 || it.isZero() }
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -290,7 +290,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 可不填写返回值 * - 可不填写返回值
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param value 个数 * @param value 个数
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -310,7 +310,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* returnType { it == StringClass || it.name == "java.lang.String" } * returnType { it == StringClass || it.name == "java.lang.String" }
* ``` * ```
* *
* - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个 * - 存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
* @param conditions 条件方法体 * @param conditions 条件方法体
* @return [BaseFinder.IndexTypeCondition] * @return [BaseFinder.IndexTypeCondition]
*/ */
@@ -322,7 +322,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 设置在 [classSet] 的所有父类中查找当前 [Method] * 设置在 [classSet] 的所有父类中查找当前 [Method]
* *
* - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类 * - 若当前 [classSet] 的父类较多可能会耗时 - API 会自动循环到父类继承是 [Any] 前的最后一个类
* @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效 * @param isOnlySuperClass 是否仅在当前 [classSet] 的父类中查找 - 若父类是 [Any] 则不会生效
*/ */
fun superClass(isOnlySuperClass: Boolean = false) { fun superClass(isOnlySuperClass: Boolean = false) {
@@ -531,9 +531,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若有多个 [Method] 结果只会返回第一个 * - 若有多个 [Method] 结果只会返回第一个
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 若你设置了 [remedys] 请使用 [wait] 回调结果方法 * - 若你设置了 [remedys] 请使用 [wait] 回调结果方法
* @param instance 所在实例 * @param instance 所在实例
* @return [Instance] * @return [Instance]
*/ */
@@ -544,9 +544,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 返回全部查找条件匹配的多个 [Method] 实例结果 * - 返回全部查找条件匹配的多个 [Method] 实例结果
* *
* - 在 [memberInstances] 结果为空时使用此方法将无法获得对象 * - 在 [memberInstances] 结果为空时使用此方法将无法获得对象
* *
* - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法 * - 若你设置了 [remedys] 请使用 [waitAll] 回调结果方法
* @param instance 所在实例 * @param instance 所在实例
* @return [ArrayList]<[Instance]> * @return [ArrayList]<[Instance]>
*/ */
@@ -578,9 +578,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若有多个 [Method] 结果只会返回第一个 * - 若有多个 [Method] 结果只会返回第一个
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param instance 所在实例 * @param instance 所在实例
* @param initiate 回调 [Instance] * @param initiate 回调 [Instance]
*/ */
@@ -594,9 +594,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 返回全部查找条件匹配的多个 [Method] 实例结果 * - 返回全部查找条件匹配的多个 [Method] 实例结果
* *
* - 若你设置了 [remedys] 必须使用此方法才能获得结果 * - 若你设置了 [remedys] 必须使用此方法才能获得结果
* *
* - 若你没有设置 [remedys] 此方法将不会被回调 * - 若你没有设置 [remedys] 此方法将不会被回调
* @param instance 所在实例 * @param instance 所在实例
* @param initiate 回调 [ArrayList]<[Instance]> * @param initiate 回调 [ArrayList]<[Instance]>
*/ */
@@ -639,7 +639,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略 * - 若 [MemberBaseFinder.MemberHookerManager.isNotIgnoredNoSuchMemberFailure] 为 false 则自动忽略
* *
* - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchMethod] 方法 * - 此时若要监听异常结果 - 你需要手动实现 [onNoSuchMethod] 方法
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
fun ignored(): Result { fun ignored(): Result {
@@ -650,9 +650,9 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 忽略异常并停止打印任何错误日志 * 忽略异常并停止打印任何错误日志
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [ignored] * - 请现在迁移到 [ignored]
* @return [Result] 可继续向下监听 * @return [Result] 可继续向下监听
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
@@ -661,7 +661,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* [Method] 实例处理类 * [Method] 实例处理类
* *
* - 请使用 [get]、[wait]、[all]、[waitAll] 方法来获取 [Instance] * - 请使用 [get]、[wait]、[all]、[waitAll] 方法来获取 [Instance]
* @param instance 当前 [Method] 所在类的实例对象 * @param instance 当前 [Method] 所在类的实例对象
* @param method 当前 [Method] 实例对象 * @param method 当前 [Method] 实例对象
*/ */
@@ -675,7 +675,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
* *
* 若当前 [Method] 并未 Hook 则会使用原始的 [Method.invoke] 方法调用 * 若当前 [Method] 并未 Hook 则会使用原始的 [Method.invoke] 方法调用
* *
* - 你只能在 (Xposed) 宿主环境中使用此功能 * - 你只能在 (Xposed) 宿主环境中使用此功能
* @return [Instance] 可继续向下监听 * @return [Instance] 可继续向下监听
*/ */
fun original(): Instance { fun original(): Instance {
@@ -710,7 +710,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Byte] 返回值类型 * 执行 [Method] - 指定 [Byte] 返回值类型
* *
* - 请确认目标变量的类型 - 发生错误会返回 null * - 请确认目标变量的类型 - 发生错误会返回 null
* @param args 方法参数 * @param args 方法参数
* @return [Byte] or null * @return [Byte] or null
*/ */
@@ -719,7 +719,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Int] 返回值类型 * 执行 [Method] - 指定 [Int] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Int] 取不到返回 0 * @return [Int] 取不到返回 0
*/ */
@@ -728,7 +728,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Long] 返回值类型 * 执行 [Method] - 指定 [Long] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Long] 取不到返回 0L * @return [Long] 取不到返回 0L
*/ */
@@ -737,7 +737,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Short] 返回值类型 * 执行 [Method] - 指定 [Short] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Short] 取不到返回 0 * @return [Short] 取不到返回 0
*/ */
@@ -746,7 +746,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Double] 返回值类型 * 执行 [Method] - 指定 [Double] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Double] 取不到返回 0.0 * @return [Double] 取不到返回 0.0
*/ */
@@ -755,7 +755,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Float] 返回值类型 * 执行 [Method] - 指定 [Float] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Float] 取不到返回 0f * @return [Float] 取不到返回 0f
*/ */
@@ -778,7 +778,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Boolean] 返回值类型 * 执行 [Method] - 指定 [Boolean] 返回值类型
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值 * - 请确认目标 [Method] 的返回值 - 发生错误会返回默认值
* @param args 方法参数 * @param args 方法参数
* @return [Boolean] 取不到返回 false * @return [Boolean] 取不到返回 false
*/ */
@@ -787,7 +787,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [Array] 返回值类型 - 每项类型 [T] * 执行 [Method] - 指定 [Array] 返回值类型 - 每项类型 [T]
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回空数组 * - 请确认目标 [Method] 的返回值 - 发生错误会返回空数组
* @return [Array] 取不到返回空数组 * @return [Array] 取不到返回空数组
*/ */
inline fun <reified T> array(vararg args: Any?) = invoke(*args) ?: arrayOf<T>() inline fun <reified T> array(vararg args: Any?) = invoke(*args) ?: arrayOf<T>()
@@ -795,7 +795,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>? = null)
/** /**
* 执行 [Method] - 指定 [List] 返回值类型 - 每项类型 [T] * 执行 [Method] - 指定 [List] 返回值类型 - 每项类型 [T]
* *
* - 请确认目标 [Method] 的返回值 - 发生错误会返回空数组 * - 请确认目标 [Method] 的返回值 - 发生错误会返回空数组
* @return [List] 取不到返回空数组 * @return [List] 取不到返回空数组
*/ */
inline fun <reified T> list(vararg args: Any?) = invoke(*args) ?: listOf<T>() inline fun <reified T> list(vararg args: Any?) = invoke(*args) ?: listOf<T>()

View File

@@ -86,9 +86,9 @@ enum class MembersType {
/** /**
* 写出当前 [ClassLoader] 下所有 [Class] 名称数组 * 写出当前 [ClassLoader] 下所有 [Class] 名称数组
* *
* - 此方法在 [Class] 数量过多时会非常耗时 * - 此方法在 [Class] 数量过多时会非常耗时
* *
* - 若要按指定规则查找一个 [Class] - 请使用 [searchClass] 方法 * - 若要按指定规则查找一个 [Class] - 请使用 [searchClass] 方法
* @return [List]<[String]> * @return [List]<[String]>
* @throws IllegalStateException 如果当前 [ClassLoader] 不是 [BaseDexClassLoader] * @throws IllegalStateException 如果当前 [ClassLoader] 不是 [BaseDexClassLoader]
*/ */
@@ -97,11 +97,11 @@ fun ClassLoader.listOfClasses() = ReflectionTool.findDexClassList(loader = this)
/** /**
* 通过当前 [ClassLoader] 按指定条件查找并得到 Dex 中的 [Class] * 通过当前 [ClassLoader] 按指定条件查找并得到 Dex 中的 [Class]
* *
* - 此方法在 [Class] 数量过多及查找条件复杂时会非常耗时 * - 此方法在 [Class] 数量过多及查找条件复杂时会非常耗时
* *
* - 建议启用 [async] 或设置 [name] 参数 - [name] 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率 * - 建议启用 [async] 或设置 [name] 参数 - [name] 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率
* *
* - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进 * - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进
* @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存自动启用 [async] * @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存自动启用 [async]
* @param async 是否启用异步 - 默认否 * @param async 是否启用异步 - 默认否
* @param initiate 方法体 * @param initiate 方法体
@@ -113,11 +113,11 @@ inline fun ClassLoader.searchClass(name: String = "", async: Boolean = false, in
/** /**
* 监听当前 [ClassLoader] 的 [ClassLoader.loadClass] 方法装载 * 监听当前 [ClassLoader] 的 [ClassLoader.loadClass] 方法装载
* *
* - 请注意只有当前 [ClassLoader] 有主动使用 [ClassLoader.loadClass] 事件时才能被捕获 * - 请注意只有当前 [ClassLoader] 有主动使用 [ClassLoader.loadClass] 事件时才能被捕获
* *
* - 这是一个实验性功能 - 一般情况下不会用到此方法 - 不保证不会发生错误 * - 这是一个实验性功能 - 一般情况下不会用到此方法 - 不保证不会发生错误
* *
* - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息 * - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息
* @param result 回调 - ([Class] 实例对象) * @param result 回调 - ([Class] 实例对象)
*/ */
fun ClassLoader.onLoadClass(result: (Class<*>) -> Unit) = AppParasitics.hookClassLoader(loader = this, result) fun ClassLoader.onLoadClass(result: (Class<*>) -> Unit) = AppParasitics.hookClassLoader(loader = this, result)
@@ -224,9 +224,9 @@ fun Class<*>.toJavaPrimitiveType() = when (this) {
/** /**
* 通过字符串类名转换为 [loader] 中的实体类 * 通过字符串类名转换为 [loader] 中的实体类
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [toClass] * - 请现在迁移到 [toClass]
* @return [Class] * @return [Class]
* @throws NoClassDefFoundError 如果找不到 [Class] 或设置了错误的 [ClassLoader] * @throws NoClassDefFoundError 如果找不到 [Class] 或设置了错误的 [ClassLoader]
*/ */
@@ -388,9 +388,9 @@ inline fun <reified T : Any> T.current(ignored: Boolean = false, initiate: Curre
/** /**
* 通过构造方法创建新实例 - 任意类型 [Any] * 通过构造方法创建新实例 - 任意类型 [Any]
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [buildOf] * - 请现在迁移到 [buildOf]
* @return [Any] or null * @return [Any] or null
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("buildOf(*param, initiate)")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("buildOf(*param, initiate)"))

View File

@@ -77,9 +77,9 @@ fun IYukiHookXposedInit.encase(vararg hooker: YukiBaseHooker) = YukiHookAPI.enca
/** /**
* 获取模块的存取对象 * 获取模块的存取对象
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [Context.prefs] 方法 * - 请现在迁移到 [Context.prefs] 方法
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("prefs()")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("prefs()"))
@@ -88,9 +88,9 @@ val Context.modulePrefs get() = prefs()
/** /**
* 获取模块的存取对象 * 获取模块的存取对象
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [Context.prefs] 方法 * - 请现在迁移到 [Context.prefs] 方法
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("prefs(name)")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("prefs(name)"))
@@ -112,7 +112,7 @@ fun Context.prefs(name: String = "") = YukiHookPrefsBridge.from(context = this).
/** /**
* 获取 [YukiHookDataChannel] 对象 * 获取 [YukiHookDataChannel] 对象
* *
* - 只能在模块环境使用此功能 - 其它环境下使用将不起作用 * - 只能在模块环境使用此功能 - 其它环境下使用将不起作用
* @param packageName 目标 Hook APP (宿主) 包名 * @param packageName 目标 Hook APP (宿主) 包名
* @return [YukiHookDataChannel.NameSpace] * @return [YukiHookDataChannel.NameSpace]
*/ */
@@ -143,7 +143,7 @@ val Context.processName
* *
* For English version, see [Inject Module App's Resources](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#inject-module-app-s-resources) * For English version, see [Inject Module App's Resources](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#inject-module-app-s-resources)
* *
* - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息 * - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息
*/ */
fun Context.injectModuleAppResources() = resources?.injectModuleAppResources() fun Context.injectModuleAppResources() = resources?.injectModuleAppResources()
@@ -158,7 +158,7 @@ fun Context.injectModuleAppResources() = resources?.injectModuleAppResources()
* *
* For English version, see [Inject Module App's Resources](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#inject-module-app-s-resources) * For English version, see [Inject Module App's Resources](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#inject-module-app-s-resources)
* *
* - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息 * - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息
*/ */
fun Resources.injectModuleAppResources() = AppParasitics.injectModuleAppResources(hostResources = this) fun Resources.injectModuleAppResources() = AppParasitics.injectModuleAppResources(hostResources = this)
@@ -175,9 +175,9 @@ fun Resources.injectModuleAppResources() = AppParasitics.injectModuleAppResource
* *
* For English version, see [Register Module App's Activity](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#register-module-app-s-activity) * For English version, see [Register Module App's Activity](https://fankes.github.io/YukiHookAPI/en/api/special-features/host-inject#register-module-app-s-activity)
* *
* - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息 * - 只能在 (Xposed) 宿主环境使用此功能 - 其它环境下使用将不生效且会打印警告信息
* *
* - 最低支持 Android 7.0 (API 24) * - 最低支持 Android 7.0 (API 24)
* @param proxy 代理的 [Activity] - 必须存在于宿主的 AndroidMainifest 清单中 - 不填使用默认 [Activity] * @param proxy 代理的 [Activity] - 必须存在于宿主的 AndroidMainifest 清单中 - 不填使用默认 [Activity]
*/ */
@RequiresApi(Build.VERSION_CODES.N) @RequiresApi(Build.VERSION_CODES.N)

View File

@@ -55,9 +55,9 @@ enum class LoggerType {
/** /**
* 仅在 (Xposed) 宿主环境使用 * 仅在 (Xposed) 宿主环境使用
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [XPOSED_ENVIRONMENT] * - 请现在迁移到 [XPOSED_ENVIRONMENT]
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("XPOSED_ENVIRONMENT")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("XPOSED_ENVIRONMENT"))
XPOSEDBRIDGE, XPOSEDBRIDGE,
@@ -65,7 +65,7 @@ enum class LoggerType {
/** /**
* 仅在 (Xposed) 宿主环境使用 * 仅在 (Xposed) 宿主环境使用
* *
* - 只能在 (Xposed) 宿主环境中使用 - 模块环境将不生效 * - 只能在 (Xposed) 宿主环境中使用 - 模块环境将不生效
*/ */
XPOSED_ENVIRONMENT, XPOSED_ENVIRONMENT,
@@ -146,7 +146,7 @@ object YukiHookLogger {
/** /**
* 当前全部已记录的日志数据 * 当前全部已记录的日志数据
* *
* - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的 * - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的
*/ */
val inMemoryData = ArrayList<YukiLoggerData>() val inMemoryData = ArrayList<YukiLoggerData>()
@@ -155,7 +155,7 @@ object YukiHookLogger {
* *
* 如果当前没有已记录的日志会返回空字符串 * 如果当前没有已记录的日志会返回空字符串
* *
* - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的 * - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的
* @return [String] * @return [String]
*/ */
val contents get() = contents() val contents get() = contents()
@@ -165,7 +165,7 @@ object YukiHookLogger {
* *
* 如果当前没有已记录的日志 ([data] 为空) 会返回空字符串 * 如果当前没有已记录的日志 ([data] 为空) 会返回空字符串
* *
* - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的 * - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的
* @param data 日志数据 - 默认为 [inMemoryData] * @param data 日志数据 - 默认为 [inMemoryData]
* @return [String] * @return [String]
*/ */
@@ -186,7 +186,7 @@ object YukiHookLogger {
* *
* 你也可以直接获取 [inMemoryData] 来清除 * 你也可以直接获取 [inMemoryData] 来清除
* *
* - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的 * - 获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的
*/ */
fun clear() = inMemoryData.clear() fun clear() = inMemoryData.clear()
@@ -197,7 +197,7 @@ object YukiHookLogger {
* *
* 日志文件会追加到 [fileName] 的文件结尾 - 若文件不存在会自动创建 * 日志文件会追加到 [fileName] 的文件结尾 - 若文件不存在会自动创建
* *
* - 文件读写权限取决于当前宿主、模块已获取的权限 * - 文件读写权限取决于当前宿主、模块已获取的权限
* @param fileName 完整文件名 - 例如 /data/data/.../files/xxx.log * @param fileName 完整文件名 - 例如 /data/data/.../files/xxx.log
* @param data 日志数据 - 默认为 [inMemoryData] * @param data 日志数据 - 默认为 [inMemoryData]
* @throws ErrnoException 如果目标路径不可写 * @throws ErrnoException 如果目标路径不可写
@@ -261,7 +261,7 @@ object YukiHookLogger {
/** /**
* 是否启用调试日志的输出功能 - 默认启用 * 是否启用调试日志的输出功能 - 默认启用
* *
* - 关闭后将会停用 [YukiHookAPI] 对全部日志的输出 * - 关闭后将会停用 [YukiHookAPI] 对全部日志的输出
* *
* 但是不影响当你手动调用下面这些方法输出日志 * 但是不影响当你手动调用下面这些方法输出日志
* *
@@ -278,7 +278,7 @@ object YukiHookLogger {
* *
* 需要同时启用 [isEnable] 才能有效 * 需要同时启用 [isEnable] 才能有效
* *
* - 过量的日志可能会导致宿主运行缓慢或造成频繁 GC * - 过量的日志可能会导致宿主运行缓慢或造成频繁 GC
* *
* 开启后你可以调用 [YukiHookLogger.saveToFile] 实时保存日志到文件或使用 [YukiHookLogger.contents] 获取实时日志文件 * 开启后你可以调用 [YukiHookLogger.saveToFile] 实时保存日志到文件或使用 [YukiHookLogger.contents] 获取实时日志文件
*/ */

View File

@@ -91,7 +91,7 @@ class HookParam internal constructor(
/** /**
* 获取当前 Hook 实例的对象 * 获取当前 Hook 实例的对象
* *
* - 如果你当前 Hook 的对象是一个静态 - 那么它将不存在实例的对象 * - 如果你当前 Hook 的对象是一个静态 - 那么它将不存在实例的对象
* *
* - 如果你不确定当前实例的对象是否为 null - 你可以使用 [instanceOrNull] * - 如果你不确定当前实例的对象是否为 null - 你可以使用 [instanceOrNull]
* @return [Any] * @return [Any]
@@ -102,7 +102,7 @@ class HookParam internal constructor(
/** /**
* 获取当前 Hook 实例的对象 * 获取当前 Hook 实例的对象
* *
* - 如果你当前 Hook 的对象是一个静态 - 那么它将不存在实例的对象 * - 如果你当前 Hook 的对象是一个静态 - 那么它将不存在实例的对象
* @return [Any] or null * @return [Any] or null
*/ */
val instanceOrNull get() = param?.instance val instanceOrNull get() = param?.instance
@@ -173,7 +173,7 @@ class HookParam internal constructor(
* *
* - 仅会在回调方法的 [MemberHookCreator.beforeHook] or [MemberHookCreator.afterHook] 中生效 * - 仅会在回调方法的 [MemberHookCreator.beforeHook] or [MemberHookCreator.afterHook] 中生效
* *
* - 设置后会同时执行 [resultNull] 方法并将异常抛出给当前 Hook APP * - 设置后会同时执行 [resultNull] 方法并将异常抛出给当前 Hook APP
* @return [Throwable] or null * @return [Throwable] or null
* @throws Throwable * @throws Throwable
*/ */
@@ -253,7 +253,7 @@ class HookParam internal constructor(
/** /**
* 设置当前 Hook 对象方法的 [result] 返回值为 true * 设置当前 Hook 对象方法的 [result] 返回值为 true
* *
* - 请确保 [result] 类型为 [Boolean] * - 请确保 [result] 类型为 [Boolean]
*/ */
fun resultTrue() { fun resultTrue() {
result = true result = true
@@ -262,7 +262,7 @@ class HookParam internal constructor(
/** /**
* 设置当前 Hook 对象方法的 [result] 返回值为 false * 设置当前 Hook 对象方法的 [result] 返回值为 false
* *
* - 请确保 [result] 类型为 [Boolean] * - 请确保 [result] 类型为 [Boolean]
*/ */
fun resultFalse() { fun resultFalse() {
result = false result = false
@@ -271,7 +271,7 @@ class HookParam internal constructor(
/** /**
* 设置当前 Hook 对象方法的 [result] 为 null * 设置当前 Hook 对象方法的 [result] 为 null
* *
* - 此方法将强制设置方法体的 [result] 为 null * - 此方法将强制设置方法体的 [result] 为 null
*/ */
fun resultNull() { fun resultNull() {
result = null result = null
@@ -280,7 +280,7 @@ class HookParam internal constructor(
/** /**
* 对方法参数的数组下标进行实例化类 * 对方法参数的数组下标进行实例化类
* *
* - 请使用第一个 [args] 方法来获取 [ArgsIndexCondition] * - 请使用第一个 [args] 方法来获取 [ArgsIndexCondition]
*/ */
inner class ArgsIndexCondition internal constructor() { inner class ArgsIndexCondition internal constructor() {
@@ -300,7 +300,7 @@ class HookParam internal constructor(
/** /**
* 对方法参数的修改进行实例化类 * 对方法参数的修改进行实例化类
* *
* - 请使用第二个 [args] 方法来获取 [ArgsModifyer] * - 请使用第二个 [args] 方法来获取 [ArgsModifyer]
* @param index 参数对象数组下标 * @param index 参数对象数组下标
*/ */
inner class ArgsModifyer internal constructor(private val index: Int) { inner class ArgsModifyer internal constructor(private val index: Int) {
@@ -314,7 +314,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Byte] * 得到方法参数的实例对象 [Byte]
* *
* - 请确认目标参数的类型 - 发生错误会返回 null * - 请确认目标参数的类型 - 发生错误会返回 null
* @return [Byte] or null * @return [Byte] or null
*/ */
fun byte() = cast<Byte?>() fun byte() = cast<Byte?>()
@@ -322,7 +322,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Int] * 得到方法参数的实例对象 [Int]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Int] 取不到返回 0 * @return [Int] 取不到返回 0
*/ */
fun int() = cast() ?: 0 fun int() = cast() ?: 0
@@ -330,7 +330,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Long] * 得到方法参数的实例对象 [Long]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Long] 取不到返回 0L * @return [Long] 取不到返回 0L
*/ */
fun long() = cast() ?: 0L fun long() = cast() ?: 0L
@@ -338,7 +338,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Short] * 得到方法参数的实例对象 [Short]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Short] 取不到返回 0 * @return [Short] 取不到返回 0
*/ */
fun short() = cast<Short?>() ?: 0 fun short() = cast<Short?>() ?: 0
@@ -346,7 +346,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Double] * 得到方法参数的实例对象 [Double]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Double] 取不到返回 0.0 * @return [Double] 取不到返回 0.0
*/ */
fun double() = cast() ?: 0.0 fun double() = cast() ?: 0.0
@@ -354,7 +354,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Float] * 得到方法参数的实例对象 [Float]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Float] 取不到返回 0f * @return [Float] 取不到返回 0f
*/ */
fun float() = cast() ?: 0f fun float() = cast() ?: 0f
@@ -362,7 +362,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [String] * 得到方法参数的实例对象 [String]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [String] 取不到返回 "" * @return [String] 取不到返回 ""
*/ */
fun string() = cast() ?: "" fun string() = cast() ?: ""
@@ -370,7 +370,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Char] * 得到方法参数的实例对象 [Char]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Char] 取不到返回 ' ' * @return [Char] 取不到返回 ' '
*/ */
fun char() = cast() ?: ' ' fun char() = cast() ?: ' '
@@ -378,7 +378,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Boolean] * 得到方法参数的实例对象 [Boolean]
* *
* - 请确认目标参数的类型 - 发生错误会返回默认值 * - 请确认目标参数的类型 - 发生错误会返回默认值
* @return [Boolean] 取不到返回 false * @return [Boolean] 取不到返回 false
*/ */
fun boolean() = cast() ?: false fun boolean() = cast() ?: false
@@ -392,7 +392,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [Array] - 每项类型 [T] * 得到方法参数的实例对象 [Array] - 每项类型 [T]
* *
* - 请确认目标参数的类型 - 发生错误会返回空数组 * - 请确认目标参数的类型 - 发生错误会返回空数组
* @return [Array] 取不到返回空数组 * @return [Array] 取不到返回空数组
*/ */
inline fun <reified T> array() = cast() ?: arrayOf<T>() inline fun <reified T> array() = cast() ?: arrayOf<T>()
@@ -400,7 +400,7 @@ class HookParam internal constructor(
/** /**
* 得到方法参数的实例对象 [List] - 每项类型 [T] * 得到方法参数的实例对象 [List] - 每项类型 [T]
* *
* - 请确认目标参数的类型 - 发生错误会返回空数组 * - 请确认目标参数的类型 - 发生错误会返回空数组
* @return [List] 取不到返回空数组 * @return [List] 取不到返回空数组
*/ */
inline fun <reified T> list() = cast() ?: listOf<T>() inline fun <reified T> list() = cast() ?: listOf<T>()
@@ -427,14 +427,14 @@ class HookParam internal constructor(
/** /**
* 设置方法参数的实例对象为 true * 设置方法参数的实例对象为 true
* *
* - 请确保目标对象的类型是 [Boolean] 不然会发生意想不到的问题 * - 请确保目标对象的类型是 [Boolean] 不然会发生意想不到的问题
*/ */
fun setTrue() = set(true) fun setTrue() = set(true)
/** /**
* 设置方法参数的实例对象为 false * 设置方法参数的实例对象为 false
* *
* - 请确保目标对象的类型是 [Boolean] 不然会发生意想不到的问题 * - 请确保目标对象的类型是 [Boolean] 不然会发生意想不到的问题
*/ */
fun setFalse() = set(false) fun setFalse() = set(false)

View File

@@ -72,7 +72,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
* *
* 你可以在这里手动设置当前 Hook APP 的 [ClassLoader] - 默认情况下会自动获取 * 你可以在这里手动设置当前 Hook APP 的 [ClassLoader] - 默认情况下会自动获取
* *
* - 如果设置了错误或无效的 [ClassLoader] 会造成功能异常 - 请谨慎操作 * - 如果设置了错误或无效的 [ClassLoader] 会造成功能异常 - 请谨慎操作
* @return [ClassLoader] * @return [ClassLoader]
*/ */
var appClassLoader var appClassLoader
@@ -98,7 +98,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 获取当前 Hook APP 的 [Application] 实例 * 获取当前 Hook APP 的 [Application] 实例
* *
* - 首次装载可能是空的 - 请延迟一段时间再获取或通过设置 [onAppLifecycle] 监听来完成 * - 首次装载可能是空的 - 请延迟一段时间再获取或通过设置 [onAppLifecycle] 监听来完成
* @return [Application] or null * @return [Application] or null
*/ */
val appContext get() = AppParasitics.hostApplication ?: AppParasitics.currentApplication val appContext get() = AppParasitics.hostApplication ?: AppParasitics.currentApplication
@@ -106,7 +106,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 获取当前 Hook APP 的 Resources * 获取当前 Hook APP 的 Resources
* *
* - 你只能在 [HookResources.hook] 方法体内或 [appContext] 装载完毕时进行调用 * - 你只能在 [HookResources.hook] 方法体内或 [appContext] 装载完毕时进行调用
* @return [Resources] or null * @return [Resources] or null
*/ */
val appResources get() = wrapper?.appResources ?: appContext?.resources val appResources get() = wrapper?.appResources ?: appContext?.resources
@@ -149,7 +149,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 获取当前 Xposed 模块自身 APK 文件路径 * 获取当前 Xposed 模块自身 APK 文件路径
* *
* - 作为 Hook API 装载时无法使用 - 会获取到空字符串 * - 作为 Hook API 装载时无法使用 - 会获取到空字符串
* @return [String] * @return [String]
*/ */
val moduleAppFilePath get() = YukiXposedModule.moduleAppFilePath val moduleAppFilePath get() = YukiXposedModule.moduleAppFilePath
@@ -157,7 +157,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 获取当前 Xposed 模块自身 [Resources] * 获取当前 Xposed 模块自身 [Resources]
* *
* - 作为 Hook API 或不支持的 Hook Framework 装载时无法使用 - 会抛出异常 * - 作为 Hook API 或不支持的 Hook Framework 装载时无法使用 - 会抛出异常
* @return [YukiModuleResources] * @return [YukiModuleResources]
* @throws IllegalStateException 如果当前 Hook Framework 不支持此功能 * @throws IllegalStateException 如果当前 Hook Framework 不支持此功能
*/ */
@@ -168,7 +168,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 创建 [YukiHookPrefsBridge] 对象 * 创建 [YukiHookPrefsBridge] 对象
* *
* - 作为 Hook API 装载时无法使用 - 会抛出异常 * - 作为 Hook API 装载时无法使用 - 会抛出异常
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
val prefs get() = YukiHookPrefsBridge.from() val prefs get() = YukiHookPrefsBridge.from()
@@ -176,7 +176,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 创建 [YukiHookPrefsBridge] 对象 * 创建 [YukiHookPrefsBridge] 对象
* *
* - 作为 Hook API 装载时无法使用 - 会抛出异常 * - 作为 Hook API 装载时无法使用 - 会抛出异常
* @param name 自定义 Sp 存储名称 * @param name 自定义 Sp 存储名称
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
@@ -185,7 +185,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 获取 [YukiHookDataChannel] 对象 * 获取 [YukiHookDataChannel] 对象
* *
* - 作为 Hook API 装载时无法使用 - 会抛出异常 * - 作为 Hook API 装载时无法使用 - 会抛出异常
* @return [YukiHookDataChannel.NameSpace] * @return [YukiHookDataChannel.NameSpace]
* @throws IllegalStateException 如果在 [HookEntryType.ZYGOTE] 装载 * @throws IllegalStateException 如果在 [HookEntryType.ZYGOTE] 装载
*/ */
@@ -218,9 +218,9 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 监听当前 Hook APP 生命周期装载事件 * 监听当前 Hook APP 生命周期装载事件
* *
* - 在 [loadZygote] 中不会被装载 - 仅会在 [loadSystem]、[loadApp] 中装载 * - 在 [loadZygote] 中不会被装载 - 仅会在 [loadSystem]、[loadApp] 中装载
* *
* - 作为 Hook API 装载时请使用原生的 [Application] 实现生命周期监听 * - 作为 Hook API 装载时请使用原生的 [Application] 实现生命周期监听
* @param isOnFailureThrowToApp 是否在发生异常时将异常抛出给宿主 - 默认是 * @param isOnFailureThrowToApp 是否在发生异常时将异常抛出给宿主 - 默认是
* @param initiate 方法体 * @param initiate 方法体
*/ */
@@ -436,11 +436,11 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 通过 [appClassLoader] 按指定条件查找并得到当前 Hook APP Dex 中的 [Class] * 通过 [appClassLoader] 按指定条件查找并得到当前 Hook APP Dex 中的 [Class]
* *
* - 此方法在 [Class] 数量过多及查找条件复杂时会非常耗时 * - 此方法在 [Class] 数量过多及查找条件复杂时会非常耗时
* *
* - 建议启用 [async] 或设置 [name] 参数 - [name] 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率 * - 建议启用 [async] 或设置 [name] 参数 - [name] 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率
* *
* - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进 * - 此功能尚在试验阶段 - 性能与稳定性可能仍然存在问题 - 使用过程遇到问题请向我们报告并帮助我们改进
* @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存自动启用 [async] * @param name 标识当前 [Class] 缓存的名称 - 不设置将不启用缓存 - 启用缓存自动启用 [async]
* @param async 是否启用异步 - 默认否 * @param async 是否启用异步 - 默认否
* @param initiate 方法体 * @param initiate 方法体
@@ -452,9 +452,9 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 通过字符串类名转换为当前 Hook APP 的实体类 * 通过字符串类名转换为当前 Hook APP 的实体类
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [toClass] * - 请现在迁移到 [toClass]
* @return [Class] * @return [Class]
* @throws NoClassDefFoundError 如果找不到 [Class] * @throws NoClassDefFoundError 如果找不到 [Class]
*/ */
@@ -465,9 +465,9 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* [VariousClass] 转换为当前 Hook APP 的实体类 * [VariousClass] 转换为当前 Hook APP 的实体类
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [toClass] * - 请现在迁移到 [toClass]
* @return [Class] * @return [Class]
* @throws IllegalStateException 如果任何 [Class] 都没有匹配到 * @throws IllegalStateException 如果任何 [Class] 都没有匹配到
*/ */
@@ -478,9 +478,9 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 通过字符串类名查找是否存在 * 通过字符串类名查找是否存在
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [hasClass] * - 请现在迁移到 [hasClass]
* @return [Boolean] 是否存在 * @return [Boolean] 是否存在
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("hasClass()")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("hasClass()"))
@@ -562,7 +562,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 查找并装载 [HookClass] * 查找并装载 [HookClass]
* *
* - 使用此方法会得到一个 [HookClass] 仅用于 Hook - 若想查找 [Class] 请使用 [toClass] 功能 * - 使用此方法会得到一个 [HookClass] 仅用于 Hook - 若想查找 [Class] 请使用 [toClass] 功能
* @param name 类名 * @param name 类名
* @param loader 当前 [ClassLoader] - 默认使用 [appClassLoader] - 设为 null 使用默认 [ClassLoader] * @param loader 当前 [ClassLoader] - 默认使用 [appClassLoader] - 设为 null 使用默认 [ClassLoader]
* @return [HookClass] * @return [HookClass]
@@ -575,7 +575,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
* *
* 使用此方法查找将会取 [name] 其中命中存在的第一个 [Class] 作为结果 * 使用此方法查找将会取 [name] 其中命中存在的第一个 [Class] 作为结果
* *
* - 使用此方法会得到一个 [HookClass] 仅用于 Hook - 若想查找 [Class] 请使用 [toClass] 功能 * - 使用此方法会得到一个 [HookClass] 仅用于 Hook - 若想查找 [Class] 请使用 [toClass] 功能
* @param name 可填入多个类名 - 自动匹配 * @param name 可填入多个类名 - 自动匹配
* @param loader 当前 [ClassLoader] - 默认使用 [appClassLoader] - 设为 null 使用默认 [ClassLoader] * @param loader 当前 [ClassLoader] - 默认使用 [appClassLoader] - 设为 null 使用默认 [ClassLoader]
* @return [HookClass] * @return [HookClass]
@@ -587,7 +587,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
* *
* - 使用当前 [appClassLoader] 装载目标 [Class] * - 使用当前 [appClassLoader] 装载目标 [Class]
* *
* - 为防止任何字符串都被当做 [Class] 进行 Hook - 推荐优先使用 [findClass] * - 为防止任何字符串都被当做 [Class] 进行 Hook - 推荐优先使用 [findClass]
* @param initiate 方法体 * @param initiate 方法体
* @return [YukiMemberHookCreator.Result] * @return [YukiMemberHookCreator.Result]
*/ */
@@ -598,7 +598,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
* *
* - 自动选择与当前 [Class] 相匹配的 [ClassLoader] - 优先使用 [appClassLoader] * - 自动选择与当前 [Class] 相匹配的 [ClassLoader] - 优先使用 [appClassLoader]
* *
* - 若当前 [Class] 不在 [appClassLoader] 且自动匹配无法找到该 [Class] - 请启用 [isForceUseAbsolute] * - 若当前 [Class] 不在 [appClassLoader] 且自动匹配无法找到该 [Class] - 请启用 [isForceUseAbsolute]
* @param isForceUseAbsolute 是否强制使用绝对实例对象 - 默认否 * @param isForceUseAbsolute 是否强制使用绝对实例对象 - 默认否
* @param initiate 方法体 * @param initiate 方法体
* @return [YukiMemberHookCreator.Result] * @return [YukiMemberHookCreator.Result]
@@ -629,7 +629,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* Hook APP 的 Resources * Hook APP 的 Resources
* *
* - 请注意你需要确保当前 Hook Framework 支持且 [InjectYukiHookWithXposed.isUsingResourcesHook] 已启用 * - 请注意你需要确保当前 Hook Framework 支持且 [InjectYukiHookWithXposed.isUsingResourcesHook] 已启用
* @param initiate 方法体 * @param initiate 方法体
*/ */
inline fun HookResources.hook(initiate: YukiResourcesHookCreator.() -> Unit) = inline fun HookResources.hook(initiate: YukiResourcesHookCreator.() -> Unit) =
@@ -652,7 +652,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
/** /**
* 当前 Hook APP 的生命周期实例处理类 * 当前 Hook APP 的生命周期实例处理类
* *
* - 请使用 [onAppLifecycle] 方法来获取 [AppLifecycle] * - 请使用 [onAppLifecycle] 方法来获取 [AppLifecycle]
* @param isOnFailureThrowToApp 是否在发生异常时将异常抛出给宿主 * @param isOnFailureThrowToApp 是否在发生异常时将异常抛出给宿主
*/ */
inner class AppLifecycle internal constructor(private val isOnFailureThrowToApp: Boolean) { inner class AppLifecycle internal constructor(private val isOnFailureThrowToApp: Boolean) {

View File

@@ -137,7 +137,7 @@ val ActivityManagerNativeClass get() = "android.app.ActivityManagerNative".toCla
/** /**
* 获得 [IActivityTaskManager] 类型 * 获得 [IActivityTaskManager] 类型
* *
* - 在 Android O (26) 及以上系统加入 * - 在 Android O (26) 及以上系统加入
* @return [Class] or null * @return [Class] or null
*/ */
val IActivityTaskManagerClass get() = "android.app.IActivityTaskManager".toClassOrNull() val IActivityTaskManagerClass get() = "android.app.IActivityTaskManager".toClassOrNull()
@@ -145,7 +145,7 @@ val IActivityTaskManagerClass get() = "android.app.IActivityTaskManager".toClass
/** /**
* 获得 [ActivityTaskManager] 类型 * 获得 [ActivityTaskManager] 类型
* *
* - 在 Android O (26) 及以上系统加入 * - 在 Android O (26) 及以上系统加入
* @return [Class] or null * @return [Class] or null
*/ */
val ActivityTaskManagerClass get() = "android.app.ActivityTaskManager".toClassOrNull() val ActivityTaskManagerClass get() = "android.app.ActivityTaskManager".toClassOrNull()
@@ -351,7 +351,7 @@ val ArrayMapClass get() = classOf<ArrayMap<*, *>>()
/** /**
* 获得 [ArraySet] 类型 * 获得 [ArraySet] 类型
* *
* - 在 Android M (23) 及以上系统加入 * - 在 Android M (23) 及以上系统加入
* @return [Class]<[ArraySet]> or null * @return [Class]<[ArraySet]> or null
*/ */
val ArraySetClass get() = if (Build.VERSION.SDK_INT >= 23) classOf<ArraySet<*>>() else null val ArraySetClass get() = if (Build.VERSION.SDK_INT >= 23) classOf<ArraySet<*>>() else null
@@ -395,7 +395,7 @@ val AsyncTaskClass get() = classOf<AsyncTask<*, *, *>>()
/** /**
* 获得 [SimpleDateFormat] 类型 * 获得 [SimpleDateFormat] 类型
* *
* - 在 Android N (24) 及以上系统加入 * - 在 Android N (24) 及以上系统加入
* @return [Class]<[SimpleDateFormat]> or null * @return [Class]<[SimpleDateFormat]> or null
*/ */
val SimpleDateFormatClass_Android get() = if (Build.VERSION.SDK_INT >= 24) classOf<SimpleDateFormat>() else null val SimpleDateFormatClass_Android get() = if (Build.VERSION.SDK_INT >= 24) classOf<SimpleDateFormat>() else null
@@ -415,7 +415,7 @@ val WindowClass get() = classOf<Window>()
/** /**
* 获得 [WindowMetrics] 类型 * 获得 [WindowMetrics] 类型
* *
* - 在 Android R (30) 及以上系统加入 * - 在 Android R (30) 及以上系统加入
* @return [Class]<[WindowMetrics]> or null * @return [Class]<[WindowMetrics]> or null
*/ */
val WindowMetricsClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<WindowMetrics>() else null val WindowMetricsClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<WindowMetrics>() else null
@@ -429,7 +429,7 @@ val WindowInsetsClass get() = classOf<WindowInsets>()
/** /**
* 获得 [WindowInsets.Type] 类型 * 获得 [WindowInsets.Type] 类型
* *
* - 在 Android R (30) 及以上系统加入 * - 在 Android R (30) 及以上系统加入
* @return [Class]<[WindowInsets.Type]> or null * @return [Class]<[WindowInsets.Type]> or null
*/ */
val WindowInsets_TypeClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<WindowInsets.Type>() else null val WindowInsets_TypeClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<WindowInsets.Type>() else null
@@ -647,7 +647,7 @@ val VibratorClass get() = classOf<Vibrator>()
/** /**
* 获得 [VibrationEffect] 类型 * 获得 [VibrationEffect] 类型
* *
* - 在 Android O (26) 及以上系统加入 * - 在 Android O (26) 及以上系统加入
* @return [Class]<[VibrationEffect]> or null * @return [Class]<[VibrationEffect]> or null
*/ */
val VibrationEffectClass get() = if (Build.VERSION.SDK_INT >= 26) classOf<VibrationEffect>() else null val VibrationEffectClass get() = if (Build.VERSION.SDK_INT >= 26) classOf<VibrationEffect>() else null
@@ -655,7 +655,7 @@ val VibrationEffectClass get() = if (Build.VERSION.SDK_INT >= 26) classOf<Vibrat
/** /**
* 获得 [VibrationAttributes] 类型 * 获得 [VibrationAttributes] 类型
* *
* - 在 Android R (30) 及以上系统加入 * - 在 Android R (30) 及以上系统加入
* @return [Class]<[VibrationAttributes]> or null * @return [Class]<[VibrationAttributes]> or null
*/ */
val VibrationAttributesClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<VibrationAttributes>() else null val VibrationAttributesClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<VibrationAttributes>() else null
@@ -687,7 +687,7 @@ val UserHandleClass get() = classOf<UserHandle>()
/** /**
* 获得 [ShortcutInfo] 类型 * 获得 [ShortcutInfo] 类型
* *
* - 在 Android N_MR1 (25) 及以上系统加入 * - 在 Android N_MR1 (25) 及以上系统加入
* @return [Class]<[ShortcutInfo]> or null * @return [Class]<[ShortcutInfo]> or null
*/ */
val ShortcutInfoClass get() = if (Build.VERSION.SDK_INT >= 25) classOf<ShortcutInfo>() else null val ShortcutInfoClass get() = if (Build.VERSION.SDK_INT >= 25) classOf<ShortcutInfo>() else null
@@ -695,7 +695,7 @@ val ShortcutInfoClass get() = if (Build.VERSION.SDK_INT >= 25) classOf<ShortcutI
/** /**
* 获得 [ShortcutManager] 类型 * 获得 [ShortcutManager] 类型
* *
* - 在 Android R (30) 及以上系统加入 * - 在 Android R (30) 及以上系统加入
* @return [Class]<[ShortcutManager]> or null * @return [Class]<[ShortcutManager]> or null
*/ */
val ShortcutManagerClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<ShortcutManager>() else null val ShortcutManagerClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<ShortcutManager>() else null
@@ -703,7 +703,7 @@ val ShortcutManagerClass get() = if (Build.VERSION.SDK_INT >= 30) classOf<Shortc
/** /**
* 获得 [ShortcutQuery] 类型 * 获得 [ShortcutQuery] 类型
* *
* - 在 Android N_MR1 (25) 及以上系统加入 * - 在 Android N_MR1 (25) 及以上系统加入
* @return [Class]<[ShortcutQuery]> or null * @return [Class]<[ShortcutQuery]> or null
*/ */
val ShortcutQueryClass get() = if (Build.VERSION.SDK_INT >= 25) classOf<ShortcutQuery>() else null val ShortcutQueryClass get() = if (Build.VERSION.SDK_INT >= 25) classOf<ShortcutQuery>() else null

View File

@@ -75,7 +75,7 @@ val BitmapClass get() = classOf<Bitmap>()
/** /**
* 获得 [Icon] 类型 * 获得 [Icon] 类型
* *
* - 在 Android M (23) 及以上系统加入 * - 在 Android M (23) 及以上系统加入
* @return [Class]<[Icon]> or null * @return [Class]<[Icon]> or null
*/ */
val IconClass get() = if (Build.VERSION.SDK_INT >= 23) classOf<Icon>() else null val IconClass get() = if (Build.VERSION.SDK_INT >= 23) classOf<Icon>() else null

View File

@@ -71,9 +71,9 @@ fun ArrayClass(type: Class<*>) = JavaArray.newInstance(type, 0).javaClass as Cla
/** /**
* 获得 [Any] 类型 * 获得 [Any] 类型
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [AnyClass] * - 请现在迁移到 [AnyClass]
* @return [Class]<[Any]> * @return [Class]<[Any]>
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("AnyClass")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("AnyClass"))
@@ -242,9 +242,9 @@ val UnitClass get() = classOf<Void>()
/** /**
* 获得 [String] 类型 * 获得 [String] 类型
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [StringClass] * - 请现在迁移到 [StringClass]
* @return [Class]<[String]> * @return [Class]<[String]>
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("StringClass")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("StringClass"))
@@ -253,9 +253,9 @@ val StringType get() = StringClass
/** /**
* 获得 [CharSequence] 类型 * 获得 [CharSequence] 类型
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [CharSequenceClass] * - 请现在迁移到 [CharSequenceClass]
* @return [Class]<[CharSequence]> * @return [Class]<[CharSequence]>
*/ */
@Deprecated(message = "请使用新的命名方法", ReplaceWith("CharSequenceClass")) @Deprecated(message = "请使用新的命名方法", ReplaceWith("CharSequenceClass"))
@@ -326,9 +326,9 @@ val ShortArrayType get() = ArrayClass(ShortType)
/** /**
* 获得 [Short] - [Array] 类型 * 获得 [Short] - [Array] 类型
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [ShortArrayType] * - 请现在迁移到 [ShortArrayType]
* @return [Class]<[JavaArray]> * @return [Class]<[JavaArray]>
*/ */
@Deprecated(message = "请使用修复后的命名方法", ReplaceWith("ShortArrayType")) @Deprecated(message = "请使用修复后的命名方法", ReplaceWith("ShortArrayType"))
@@ -597,7 +597,7 @@ val ThreadClass get() = classOf<Thread>()
/** /**
* 获得 [Base64] 类型 * 获得 [Base64] 类型
* *
* - 在 Android O (26) 及以上系统加入 * - 在 Android O (26) 及以上系统加入
* @return [Class]<[Base64]> or null * @return [Class]<[Base64]> or null
*/ */
val Base64Class_Java get() = if (Build.VERSION.SDK_INT >= 26) classOf<Base64>() else null val Base64Class_Java get() = if (Build.VERSION.SDK_INT >= 26) classOf<Base64>() else null

View File

@@ -37,23 +37,17 @@ import com.highcapable.yukihookapi.hook.xposed.bridge.type.HookEntryType
/** /**
* Xposed 模块核心功能调用类 * Xposed 模块核心功能调用类
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal object YukiXposedModuleCaller { internal object YukiXposedModuleCaller {
/** /**
* 模块是否装载了 Xposed 回调方法 * 模块是否装载了 Xposed 回调方法
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @return [Boolean] * @return [Boolean]
*/ */
internal val isXposedCallbackSetUp get() = YukiXposedModule.isXposedCallbackSetUp internal val isXposedCallbackSetUp get() = YukiXposedModule.isXposedCallbackSetUp
/** /**
* 标识 Xposed 模块开始装载 * 标识 Xposed 模块开始装载
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param packageName 当前 Xposed 模块包名 * @param packageName 当前 Xposed 模块包名
* @param appFilePath 当前 Xposed 模块自身 APK 路径 * @param appFilePath 当前 Xposed 模块自身 APK 路径
*/ */
@@ -61,15 +55,11 @@ internal object YukiXposedModuleCaller {
/** /**
* 标识 Xposed 模块装载完成 * 标识 Xposed 模块装载完成
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
*/ */
internal fun callOnFinishLoadModule() = YukiXposedModule.onFinishLoadModule() internal fun callOnFinishLoadModule() = YukiXposedModule.onFinishLoadModule()
/** /**
* 标识可用的 Hook APP (宿主) 开始装载 * 标识可用的 Hook APP (宿主) 开始装载
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param type 当前正在进行的 Hook 类型 * @param type 当前正在进行的 Hook 类型
* @param packageName 宿主包名 * @param packageName 宿主包名
* @param processName 宿主进程名 * @param processName 宿主进程名
@@ -88,8 +78,6 @@ internal object YukiXposedModuleCaller {
/** /**
* 打印内部 E 级别的日志 * 打印内部 E 级别的日志
*
* - ❗装载代码将自动生成 - 请勿手动调用
* @param msg 日志打印的内容 * @param msg 日志打印的内容
* @param e 异常堆栈信息 - 默认空 * @param e 异常堆栈信息 - 默认空
*/ */

View File

@@ -36,15 +36,11 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
/** /**
* 实现对原生 Xposed API 装载事件监听的回调监听事件处理类 * 实现对原生 Xposed API 装载事件监听的回调监听事件处理类
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal object YukiXposedEventCaller { internal object YukiXposedEventCaller {
/** /**
* 回调 initZygote 事件监听 * 回调 initZygote 事件监听
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param sparam Xposed API 实例 * @param sparam Xposed API 实例
*/ */
internal fun callInitZygote(sparam: IXposedHookZygoteInit.StartupParam?) { internal fun callInitZygote(sparam: IXposedHookZygoteInit.StartupParam?) {
@@ -54,8 +50,6 @@ internal object YukiXposedEventCaller {
/** /**
* 回调 handleLoadPackage 事件监听 * 回调 handleLoadPackage 事件监听
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param lpparam Xposed API 实例 * @param lpparam Xposed API 实例
*/ */
internal fun callHandleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) { internal fun callHandleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
@@ -65,8 +59,6 @@ internal object YukiXposedEventCaller {
/** /**
* 回调 handleInitPackageResources 事件监听 * 回调 handleInitPackageResources 事件监听
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param resparam Xposed API 实例 * @param resparam Xposed API 实例
*/ */
internal fun callHandleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam?) { internal fun callHandleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam?) {

View File

@@ -34,15 +34,11 @@ import com.highcapable.yukihookapi.hook.xposed.bridge.resources.YukiResources
/** /**
* Xposed 模块资源钩子 (Resources Hook) 调用类 * Xposed 模块资源钩子 (Resources Hook) 调用类
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal object YukiXposedResourcesCaller { internal object YukiXposedResourcesCaller {
/** /**
* 从 [XResources] 创建 [YukiResources] * 从 [XResources] 创建 [YukiResources]
*
* - ❗装载代码将自动生成 - 请勿手动调用
* @param xResources [XResources] 实例 * @param xResources [XResources] 实例
* @return [YukiResources] or null * @return [YukiResources] or null
*/ */

View File

@@ -30,8 +30,6 @@ package com.highcapable.yukihookapi.hook.xposed.bridge.type
/** /**
* 当前正在进行的 Hook 类型 * 当前正在进行的 Hook 类型
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal enum class HookEntryType { internal enum class HookEntryType {

View File

@@ -66,7 +66,7 @@ import java.util.concurrent.ConcurrentHashMap
* *
* 模块需要将 [Application] 继承于 [ModuleApplication] 来实现此功能 * 模块需要将 [Application] 继承于 [ModuleApplication] 来实现此功能
* *
* - 模块与宿主需要保持存活状态 - 否则无法建立通讯 * - 模块与宿主需要保持存活状态 - 否则无法建立通讯
* *
* 详情请参考 [API 文档 - YukiHookDataChannel](https://fankes.github.io/YukiHookAPI/zh-cn/api/public/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel) * 详情请参考 [API 文档 - YukiHookDataChannel](https://fankes.github.io/YukiHookAPI/zh-cn/api/public/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel)
* *
@@ -270,7 +270,7 @@ class YukiHookDataChannel private constructor() {
/** /**
* [YukiHookDataChannel] 命名空间 * [YukiHookDataChannel] 命名空间
* *
* - 请使用 [nameSpace] 方法来获取 [NameSpace] * - 请使用 [nameSpace] 方法来获取 [NameSpace]
* @param context 上下文实例 * @param context 上下文实例
* @param packageName 目标 Hook APP (宿主) 的包名 * @param packageName 目标 Hook APP (宿主) 的包名
*/ */
@@ -311,7 +311,7 @@ class YukiHookDataChannel private constructor() {
* *
* - 超出最大数据字节大小后的数据将被自动分段发送 * - 超出最大数据字节大小后的数据将被自动分段发送
* *
* - 警告:请谨慎调整此参数 - 如果超出了系统能够允许的大小会引发 [TransactionTooLargeException] 异常 * - 警告:请谨慎调整此参数 - 如果超出了系统能够允许的大小会引发 [TransactionTooLargeException] 异常
* @return [Int] * @return [Int]
*/ */
var dataMaxByteSize var dataMaxByteSize
@@ -331,7 +331,7 @@ class YukiHookDataChannel private constructor() {
* *
* - 超出最大数据字节大小后的数据将按照此倍数自动划分 [receiverDataMaxByteSize] 的大小 * - 超出最大数据字节大小后的数据将按照此倍数自动划分 [receiverDataMaxByteSize] 的大小
* *
* - 警告:请谨慎调整此参数 - 如果超出了系统能够允许的大小会引发 [TransactionTooLargeException] 异常 * - 警告:请谨慎调整此参数 - 如果超出了系统能够允许的大小会引发 [TransactionTooLargeException] 异常
* @return [Int] * @return [Int]
*/ */
var dataMaxByteCompressionFactor var dataMaxByteCompressionFactor
@@ -347,7 +347,7 @@ class YukiHookDataChannel private constructor() {
* *
* 你还需要在整个调用域中声明注解 [CauseProblemsApi] 以消除警告 * 你还需要在整个调用域中声明注解 [CauseProblemsApi] 以消除警告
* *
* - 若你不知道允许此功能会带来何种后果 - 请勿使用 * - 若你不知道允许此功能会带来何种后果 - 请勿使用
* @return [NameSpace] * @return [NameSpace]
*/ */
@CauseProblemsApi @CauseProblemsApi
@@ -413,7 +413,7 @@ class YukiHookDataChannel private constructor() {
/** /**
* 仅获取监听结果 - 不获取键值数据 * 仅获取监听结果 - 不获取键值数据
* *
* - 仅限使用 [VALUE_WAIT_FOR_LISTENER] 发送的监听才能被接收 * - 仅限使用 [VALUE_WAIT_FOR_LISTENER] 发送的监听才能被接收
* @param key 键值名称 * @param key 键值名称
* @param priority 响应优先级 - 默认不设置 * @param priority 响应优先级 - 默认不设置
* @param callback 回调结果 * @param callback 回调结果
@@ -443,9 +443,9 @@ class YukiHookDataChannel private constructor() {
* *
* 由于模块与宿主处于不同的进程 - 我们可以使用数据通讯桥访问各自的调试日志数据 * 由于模块与宿主处于不同的进程 - 我们可以使用数据通讯桥访问各自的调试日志数据
* *
* - 模块与宿主必须启用 [YukiHookLogger.Configs.isRecord] 才能获取到调试日志数据 * - 模块与宿主必须启用 [YukiHookLogger.Configs.isRecord] 才能获取到调试日志数据
* *
* - 由于 Android 限制了数据传输大小的最大值 - 如果调试日志过多将会自动进行分段发送 - 数据越大速度越慢 * - 由于 Android 限制了数据传输大小的最大值 - 如果调试日志过多将会自动进行分段发送 - 数据越大速度越慢
* @param priority 响应优先级 - 默认不设置 * @param priority 响应优先级 - 默认不设置
* @param result 回调 [ArrayList]<[YukiLoggerData]> * @param result 回调 [ArrayList]<[YukiLoggerData]>
*/ */

View File

@@ -52,7 +52,7 @@ open class ModuleAppActivity : Activity() {
* *
* 留空则使用 [Context.registerModuleAppActivities] 时设置的类名 * 留空则使用 [Context.registerModuleAppActivities] 时设置的类名
* *
* - 代理的 [Activity] 类名必须存在于宿主的 AndroidMainifest 清单中 * - 代理的 [Activity] 类名必须存在于宿主的 AndroidMainifest 清单中
* @return [String] * @return [String]
*/ */
open val proxyClassName get() = "" open val proxyClassName get() = ""

View File

@@ -55,7 +55,7 @@ open class ModuleAppCompatActivity : AppCompatActivity() {
* *
* 留空则使用 [Context.registerModuleAppActivities] 时设置的类名 * 留空则使用 [Context.registerModuleAppActivities] 时设置的类名
* *
* - 代理的 [Activity] 类名必须存在于宿主的 AndroidMainifest 清单中 * - 代理的 [Activity] 类名必须存在于宿主的 AndroidMainifest 清单中
* @return [String] * @return [String]
*/ */
open val proxyClassName get() = "" open val proxyClassName get() = ""

View File

@@ -49,8 +49,6 @@ import com.highcapable.yukihookapi.hook.xposed.parasitic.activity.config.Activit
/** /**
* 代理当前 [Handler.Callback] 调用类 * 代理当前 [Handler.Callback] 调用类
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal object HandlerDelegateCaller { internal object HandlerDelegateCaller {
@@ -62,8 +60,6 @@ internal object HandlerDelegateCaller {
/** /**
* 调用代理的 [Handler.Callback.handleMessage] 方法 * 调用代理的 [Handler.Callback.handleMessage] 方法
*
* - ❗装载代码将自动生成 - 请勿手动调用
* @param baseInstance 原始实例 * @param baseInstance 原始实例
* @param msg 当前消息实例 * @param msg 当前消息实例
* @return [Boolean] * @return [Boolean]

View File

@@ -47,23 +47,17 @@ import java.lang.reflect.Method
/** /**
* 代理当前 [ActivityManager] 调用类 * 代理当前 [ActivityManager] 调用类
*
* - ❗装载代码将自动生成 - 请勿手动调用
*/ */
internal object IActivityManagerProxyCaller { internal object IActivityManagerProxyCaller {
/** /**
* 获取当前使用的 [ClassLoader] * 获取当前使用的 [ClassLoader]
*
* - ❗装载代码将自动生成 - 请勿手动调用
* @return [ClassLoader] * @return [ClassLoader]
*/ */
internal val currentClassLoader get() = AppParasitics.baseClassLoader internal val currentClassLoader get() = AppParasitics.baseClassLoader
/** /**
* 调用代理的 [InvocationHandler.invoke] 方法 * 调用代理的 [InvocationHandler.invoke] 方法
*
* - ❗装载代码将自动生成 - 请勿手动调用
* @param baseInstance 原始实例 * @param baseInstance 原始实例
* @param method 被调用方法 * @param method 被调用方法
* @param args 被调用方法参数 * @param args 被调用方法参数

View File

@@ -60,7 +60,7 @@ class ModuleClassLoader private constructor() : ClassLoader(AppParasitics.baseCl
* *
* 排除列表中的 [Class] 将会使用宿主的 [ClassLoader] 进行装载 * 排除列表中的 [Class] 将会使用宿主的 [ClassLoader] 进行装载
* *
* - 排除列表仅会在 (Xposed) 宿主环境生效 * - 排除列表仅会在 (Xposed) 宿主环境生效
* @param name 需要添加的 [Class] 完整类名 * @param name 需要添加的 [Class] 完整类名
*/ */
fun excludeHostClasses(vararg name: String) { fun excludeHostClasses(vararg name: String) {
@@ -72,7 +72,7 @@ class ModuleClassLoader private constructor() : ClassLoader(AppParasitics.baseCl
* *
* 排除列表中的 [Class] 将会使用模块 (当前宿主环境的模块注入进程) 的 [ClassLoader] 进行装载 * 排除列表中的 [Class] 将会使用模块 (当前宿主环境的模块注入进程) 的 [ClassLoader] 进行装载
* *
* - 排除列表仅会在 (Xposed) 宿主环境生效 * - 排除列表仅会在 (Xposed) 宿主环境生效
* @param name 需要添加的 [Class] 完整类名 * @param name 需要添加的 [Class] 完整类名
*/ */
fun excludeModuleClasses(vararg name: String) { fun excludeModuleClasses(vararg name: String) {

View File

@@ -52,7 +52,7 @@ import java.io.File
* *
* 在不同环境智能选择存取使用的对象 * 在不同环境智能选择存取使用的对象
* *
* - 模块与宿主之前共享数据存储为实验性功能 - 仅在 LSPosed 环境测试通过 - EdXposed 理论也可以使用但不再推荐 * - 模块与宿主之前共享数据存储为实验性功能 - 仅在 LSPosed 环境测试通过 - EdXposed 理论也可以使用但不再推荐
* *
* 对于在模块环境中使用 [PreferenceFragmentCompat] - [YukiHookAPI] 提供了 [ModulePreferenceFragment] 来实现同样的功能 * 对于在模块环境中使用 [PreferenceFragmentCompat] - [YukiHookAPI] 提供了 [ModulePreferenceFragment] 来实现同样的功能
* *
@@ -178,9 +178,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 获取 [XSharedPreferences] 是否可读 * 获取 [XSharedPreferences] 是否可读
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [isPreferencesAvailable] * - 请现在迁移到 [isPreferencesAvailable]
* @return [Boolean] * @return [Boolean]
*/ */
@Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable")) @Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable"))
@@ -189,9 +189,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 获取 [YukiHookPrefsBridge] 是否正处于 EdXposed/LSPosed 的最高权限运行 * 获取 [YukiHookPrefsBridge] 是否正处于 EdXposed/LSPosed 的最高权限运行
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [isPreferencesAvailable] * - 请现在迁移到 [isPreferencesAvailable]
* @return [Boolean] * @return [Boolean]
*/ */
@Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable")) @Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable"))
@@ -227,9 +227,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 忽略缓存直接读取键值 * 忽略缓存直接读取键值
* *
* - 此方法及功能已被移除 - 在之后的版本中将直接被删除 * - 此方法及功能已被移除 - 在之后的版本中将直接被删除
* *
* - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题 * - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
@Deprecated(message = "此方法及功能已被移除,请删除此方法", ReplaceWith("this")) @Deprecated(message = "此方法及功能已被移除,请删除此方法", ReplaceWith("this"))
@@ -385,7 +385,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
* *
* - 智能识别对应环境读取键值数据 * - 智能识别对应环境读取键值数据
* *
* - 每次调用都会获取实时的数据 - 不受缓存控制 - 请勿在高并发场景中使用 * - 每次调用都会获取实时的数据 - 不受缓存控制 - 请勿在高并发场景中使用
* @return [HashMap] 全部类型的键值数组 * @return [HashMap] 全部类型的键值数组
*/ */
fun all() = hashMapOf<String, Any?>().apply { fun all() = hashMapOf<String, Any?>().apply {
@@ -397,9 +397,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 移除全部包含 [key] 的存储数据 * 移除全部包含 [key] 的存储数据
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
*/ */
@Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { remove(key) }")) @Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { remove(key) }"))
@@ -408,9 +408,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 移除 [PrefsData.key] 的存储数据 * 移除 [PrefsData.key] 的存储数据
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param prefs 键值实例 * @param prefs 键值实例
*/ */
@Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { remove(prefs) }")) @Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { remove(prefs) }"))
@@ -419,9 +419,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 移除全部存储数据 * 移除全部存储数据
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
*/ */
@Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { clear() }")) @Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { clear() }"))
fun clear() = edit { clear() } fun clear() = edit { clear() }
@@ -429,9 +429,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [String] 键值 * 存储 [String] 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -441,9 +441,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [Set]<[String]> 键值 * 存储 [Set]<[String]> 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -453,9 +453,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [Boolean] 键值 * 存储 [Boolean] 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -465,9 +465,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [Int] 键值 * 存储 [Int] 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -477,9 +477,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [Float] 键值 * 存储 [Float] 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -489,9 +489,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 存储 [Long] 键值 * 存储 [Long] 键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
* @param key 键值名称 * @param key 键值名称
* @param value 键值数据 * @param value 键值数据
*/ */
@@ -501,9 +501,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 智能存储指定类型的键值 * 智能存储指定类型的键值
* *
* - 此方法已弃用 - 在之后的版本中将直接被删除 * - 此方法已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [edit] 方法 * - 请现在迁移到 [edit] 方法
*/ */
@Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { put(prefs, value) }")) @Deprecated(message = "此方法因为性能问题已被作废,请迁移到新用法", ReplaceWith("edit { put(prefs, value) }"))
inline fun <reified T> put(prefs: PrefsData<T>, value: T) = edit { put(prefs, value) } inline fun <reified T> put(prefs: PrefsData<T>, value: T) = edit { put(prefs, value) }
@@ -513,7 +513,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
* *
* - 在模块环境中或启用了 [isUsingNativeStorage] 后使用 * - 在模块环境中或启用了 [isUsingNativeStorage] 后使用
* *
* - 在 (Xposed) 宿主环境下只读 - 无法使用 * - 在 (Xposed) 宿主环境下只读 - 无法使用
* @return [Editor] * @return [Editor]
*/ */
fun edit() = Editor() fun edit() = Editor()
@@ -525,7 +525,7 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
* *
* - 在模块环境中或启用了 [isUsingNativeStorage] 后使用 * - 在模块环境中或启用了 [isUsingNativeStorage] 后使用
* *
* - 在 (Xposed) 宿主环境下只读 - 无法使用 * - 在 (Xposed) 宿主环境下只读 - 无法使用
* @param initiate 方法体 * @param initiate 方法体
*/ */
fun edit(initiate: Editor.() -> Unit) = edit().apply(initiate).apply() fun edit(initiate: Editor.() -> Unit) = edit().apply(initiate).apply()
@@ -533,9 +533,9 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* 清除 [YukiHookPrefsBridge] 中缓存的键值数据 * 清除 [YukiHookPrefsBridge] 中缓存的键值数据
* *
* - 此方法及功能已被移除 - 在之后的版本中将直接被删除 * - 此方法及功能已被移除 - 在之后的版本中将直接被删除
* *
* - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题 * - 键值的直接缓存功能已被移除 - 因为其存在内存溢出 (OOM) 问题
* @return [YukiHookPrefsBridge] * @return [YukiHookPrefsBridge]
*/ */
@Deprecated(message = "此方法及功能已被移除,请删除此方法") @Deprecated(message = "此方法及功能已被移除,请删除此方法")
@@ -545,11 +545,11 @@ class YukiHookPrefsBridge private constructor(private var context: Context? = nu
/** /**
* [YukiHookPrefsBridge] 的存储代理类 * [YukiHookPrefsBridge] 的存储代理类
* *
* - 请使用 [edit] 方法来获取 [Editor] * - 请使用 [edit] 方法来获取 [Editor]
* *
* - 在模块环境中或启用了 [isUsingNativeStorage] 后使用 * - 在模块环境中或启用了 [isUsingNativeStorage] 后使用
* *
* - 在 (Xposed) 宿主环境下只读 - 无法使用 * - 在 (Xposed) 宿主环境下只读 - 无法使用
*/ */
inner class Editor internal constructor() { inner class Editor internal constructor() {

View File

@@ -39,7 +39,7 @@ import com.highcapable.yukihookapi.hook.xposed.bridge.event.YukiXposedEvent
/** /**
* [YukiHookAPI] 的 Xposed 装载 API 调用接口 * [YukiHookAPI] 的 Xposed 装载 API 调用接口
* *
* - 请在此类上添加注解 [InjectYukiHookWithXposed] 标记模块 Hook 入口 * - 请在此类上添加注解 [InjectYukiHookWithXposed] 标记模块 Hook 入口
* *
* [YukiHookAPI] 初始化时将自动调用 [onInit] 方法 * [YukiHookAPI] 初始化时将自动调用 [onInit] 方法
* *
@@ -60,7 +60,7 @@ interface IYukiHookXposedInit {
/** /**
* 配置 [YukiHookAPI.Configs] 的初始化方法 * 配置 [YukiHookAPI.Configs] 的初始化方法
* *
* - 在这里只能进行初始化配置 - 不能进行 Hook 操作 * - 在这里只能进行初始化配置 - 不能进行 Hook 操作
* *
* 此方法可选 - 你也可以选择不对 [YukiHookAPI.Configs] 进行配置 * 此方法可选 - 你也可以选择不对 [YukiHookAPI.Configs] 进行配置
*/ */
@@ -90,7 +90,7 @@ interface IYukiHookXposedInit {
* *
* [YukiXposedEvent.onHandleInitPackageResources] * [YukiXposedEvent.onHandleInitPackageResources]
* *
* - 此接口仅供监听和实现原生 Xposed API 的功能 - 请不要在这里操作 [YukiHookAPI] * - 此接口仅供监听和实现原生 Xposed API 的功能 - 请不要在这里操作 [YukiHookAPI]
*/ */
fun onXposedEvent() {} fun onXposedEvent() {}
} }

View File

@@ -35,25 +35,25 @@ import com.highcapable.yukihookapi.hook.log.yLoggerW
/** /**
* [YukiHookAPI] 的 Xposed 装载 API 调用接口 * [YukiHookAPI] 的 Xposed 装载 API 调用接口
* *
* - 此接口已弃用 - 在之后的版本中将直接被删除 * - 此接口已弃用 - 在之后的版本中将直接被删除
* *
* - 请现在迁移到 [IYukiHookXposedInit] 否则此接口的声明将在自动处理程序中被拦截 * - 请现在迁移到 [IYukiHookXposedInit] 否则此接口的声明将在自动处理程序中被拦截
*/ */
@Deprecated(message = "此接口的命名和功能已被弃用", ReplaceWith("IYukiHookXposedInit"), level = DeprecationLevel.ERROR) @Deprecated(message = "此接口的命名和功能已被弃用", ReplaceWith("IYukiHookXposedInit"), level = DeprecationLevel.ERROR)
interface YukiHookXposedInitProxy { interface YukiHookXposedInitProxy {
/** /**
* - 此方法已过时 * - 此方法已过时
* *
* - 请将接口迁移到 [IYukiHookXposedInit] * - 请将接口迁移到 [IYukiHookXposedInit]
*/ */
@Deprecated(message = "请将接口迁移到 IYukiHookXposedInit", level = DeprecationLevel.ERROR) @Deprecated(message = "请将接口迁移到 IYukiHookXposedInit", level = DeprecationLevel.ERROR)
fun onInit() = yLoggerW(msg = "YukiHookXposedInitProxy was deprecated") fun onInit() = yLoggerW(msg = "YukiHookXposedInitProxy was deprecated")
/** /**
* - 此方法已过时 * - 此方法已过时
* *
* - 请将接口迁移到 [IYukiHookXposedInit] * - 请将接口迁移到 [IYukiHookXposedInit]
*/ */
@Deprecated(message = "请将接口迁移到 IYukiHookXposedInit", level = DeprecationLevel.ERROR) @Deprecated(message = "请将接口迁移到 IYukiHookXposedInit", level = DeprecationLevel.ERROR)
fun onHook() = yLoggerW(msg = "YukiHookXposedInitProxy was deprecated") fun onHook() = yLoggerW(msg = "YukiHookXposedInitProxy was deprecated")