mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
docs(style): optimize symbols
This commit is contained in:
@@ -173,7 +173,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added `generic` function to reflect and call generics, you can use it in `Class` or `CurrentClass`
|
||||
- obsolete the `buildOfAny` method, now use the `buildOf` method directly (without generics) to use the constructor to create a new object and get the result `Any`
|
||||
- Fixed the issue of null pointer exception when using `hasExtends`
|
||||
- `CurrentClass` added non-`lambda` method of calling
|
||||
- `CurrentClass` added non-**lambda** method of calling
|
||||
- `CurrentClass` adds `name` and `simpleName` functions
|
||||
- Completely rewrite the core method of `ReflectionTool`, sorting and classifying different search conditions
|
||||
- Fixed the problem that `Member` obtained by directly calling `declared` in `ReflectionTool` throws an exception
|
||||
@@ -302,7 +302,7 @@ Time zone of version release date: **UTC+8**
|
||||
- ~~`YukiHookXposedInitProxy`~~ renamed to `IYukiHookXposedInit`, the original interface name has been invalidated and will be deleted directly in subsequent versions
|
||||
- Added `initZygote` and Resources Hook functions to support Hook Layout
|
||||
- Added `onXposedEvent` method to listen to all events of native Xposed API
|
||||
- Perform `inline` processing on the `lambda` of the Hook function to avoid generating excessively broken anonymous classes and improve the running performance after compilation
|
||||
- Perform `inline` processing on the **lambda** of the Hook function to avoid generating excessively broken anonymous classes and improve the running performance after compilation
|
||||
- Fixed `PrefsData` compiled method body copy is too large
|
||||
- Added `XSharePreference` readability test, which will automatically print a warning log if it fails
|
||||
- `PackageParam` adds `appResources`, `moduleAppResources`, `moduleAppFilePath` functions
|
||||
@@ -330,7 +330,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Fixed `YukiHookModulePrefs` working in `New XSharePreference` mode
|
||||
- Added `ModulePreferenceFragment`, now you can completely replace `PreferenceFragmentCompat` and start using the new functionality
|
||||
- Adapt the Sp data storage solution of `PreferenceFragmentCompat`, thanks to [mahoshojoHCG](https://github.com/mahoshojoHCG) for feedback
|
||||
- Update autohandlers and `Kotlin` dependencies to the latest version
|
||||
- Update autohandlers and Kotlin dependencies to the latest version
|
||||
- Fixed some bugs in documentation and code comments
|
||||
|
||||
### 1.0.77 | 2022.04.15  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
@@ -421,7 +421,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added `MethodFinder` and `FieldFinder` new return value calling methods
|
||||
- Fixed possible problems and fix possible problems during the use of Tai Chi
|
||||
- Fixed possible problems with auto-generated Xposed entry classes
|
||||
- Added `android` type and `java` type in `type`
|
||||
- Added `android` type and Java type in `type`
|
||||
|
||||
### 1.0.6 | 2022.03.20  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
@@ -438,7 +438,7 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
- Fixed an annotation error
|
||||
- Temporarily fix a bug
|
||||
- Added a large number of `android` types in `type` and a small number of `java` types
|
||||
- Added a large number of `android` types in `type` and a small number of Java types
|
||||
- Fixed compatibility issues between new and old Kotlin APIs
|
||||
|
||||
### 1.0.5 | 2022.03.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
@@ -474,7 +474,7 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
- `RemedyPlan` adds `onFind` function
|
||||
- Integrate and modify some reflection API code
|
||||
- Added `java` type in `type`
|
||||
- Added Java type in `type`
|
||||
- Fixed the issue that ignored errors still output in the console
|
||||
|
||||
### 1.0 | 2022.02.14  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
@@ -46,4 +46,4 @@ We have provided the Xposed native API listening interface, you can find or view
|
||||
|
||||
As an API, currently only docking `XposedBridge` as a compatibility layer still has certain limitations.
|
||||
|
||||
Most `inline hook` do not have a `Java` compatibility layer, and the `Java` compatibility layer adaptation of `native hook` may be considered later.
|
||||
Most `inline hook` do not have a Java compatibility layer, and the Java compatibility layer adaptation of `native hook` may be considered later.
|
@@ -538,7 +538,7 @@ inline fun configs(initiate: Configs.() -> Unit)
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 对 `Configs` 类实现了一个 `lambda` 方法体。
|
||||
> 对 `Configs` 类实现了一个 **lambda** 方法体。
|
||||
|
||||
你可以轻松地调用它进行配置。
|
||||
|
||||
|
@@ -736,7 +736,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用此方法为 `Result` 类创建 `lambda` 方法体。
|
||||
你可以使用此方法为 `Result` 类创建 **lambda** 方法体。
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -350,7 +350,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -467,7 +467,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -352,7 +352,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -494,7 +494,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -611,7 +611,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -536,7 +536,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**Function Example**
|
||||
|
||||
我们要获取一个 `Class` 在 `Kotlin` 下不通过反射时应该这样做。
|
||||
我们要获取一个 `Class` 在 Kotlin 下不通过反射时应该这样做。
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -22,7 +22,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是 `YukiHookAPI` 相关 `lambda` 方法的封装类以及部分 API 用法。
|
||||
> 这是 `YukiHookAPI` 相关 **lambda** 方法的封装类以及部分 API 用法。
|
||||
|
||||
## IYukiHookXposedInit.configs <span class="symbol">- ext-method</span>
|
||||
|
||||
|
@@ -412,7 +412,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
@@ -422,7 +422,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `loadApp` 的 `lambda` 方法体形式或直接装载一个 Hooker。
|
||||
你可以使用 `loadApp` 的 **lambda** 方法体形式或直接装载一个 Hooker。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -507,7 +507,7 @@ fun loadZygote(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载 APP Zygote 事件。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadSystem <span class="symbol">- method</span>
|
||||
|
||||
@@ -535,7 +535,7 @@ fun loadSystem(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 系统框架。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## withProcess <span class="symbol">- method</span>
|
||||
|
||||
@@ -567,7 +567,7 @@ fun withProcess(name: String, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook APP 的指定进程。
|
||||
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadHooker <span class="symbol">- method</span>
|
||||
|
||||
|
@@ -18,6 +18,6 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Java` 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
> 这是一个预置反射类型的常量类,主要为 Java 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.kt) 进行查看。
|
@@ -1865,7 +1865,7 @@ field {
|
||||
}
|
||||
```
|
||||
|
||||
Expressing the type of `Boolean::class.javaPrimitiveType` in `Kotlin` is very long and inconvenient.
|
||||
Expressing the type of `Boolean::class.javaPrimitiveType` in Kotlin is very long and inconvenient.
|
||||
|
||||
Therefore, `YukiHookAPI` encapsulates common type calls for developers, including Android related types and Java common types and **primitive type keywords**.
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
fun configs(initiate: Configs.() -> Unit)
|
||||
```
|
||||
|
||||
The `configs` method implements a `lambda` method body on the `Configs` class, which you can easily call for configuration.
|
||||
The `configs` method implements a **lambda** method body on the `Configs` class, which you can easily call for configuration.
|
||||
|
||||
::: tip
|
||||
|
||||
|
@@ -608,7 +608,7 @@ For more functions, please refer to [PackageParam.withProcess](../api/public/com
|
||||
|
||||
## Writing Optimization
|
||||
|
||||
To make the code more concise, you can omit the name of `YukiHookAPI` and write your `onHook` entry as `lambda`.
|
||||
To make the code more concise, you can omit the name of `YukiHookAPI` and write your `onHook` entry as **lambda**.
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
## Background
|
||||
|
||||
This is an efficient Hook API rebuilt based on the Xposed API using `Kotlin`, and creates rich function extensions for the development of Xposed Modules.
|
||||
This is an efficient Hook API rebuilt based on the Xposed API using Kotlin, and creates rich function extensions for the development of Xposed Modules.
|
||||
|
||||
The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016).
|
||||
|
||||
@@ -12,15 +12,15 @@ Formerly the Innocent Xposed API used in [Development Learning Project](https://
|
||||
|
||||
## Usage
|
||||
|
||||
`YukiHookAPI` is built entirely with `Kotlin` `lambda` syntax.
|
||||
`YukiHookAPI` is built entirely with Kotlin **lambda** syntax.
|
||||
|
||||
Abandoning the original less friendly `XposedHelpers`, you can use it to easily create Xposed Modules and easily implement custom Hook API.
|
||||
|
||||
## Language Requirement
|
||||
|
||||
Please use `Kotlin`, the framework part of the code composition is also compatible with `Java` but the implementation of the basic Hook scene **may not work at all**.
|
||||
Please use Kotlin, the framework part of the code composition is also compatible with Java but the implementation of the basic Hook scene **may not work at all**.
|
||||
|
||||
All demo code in this document will be described using `Kotlin`, if you don't know how to use `Kotlin` then you may not be able to use `YukiHookAPI`.
|
||||
All demo code in this document will be described using Kotlin, if you don't know how to use Kotlin then you may not be able to use `YukiHookAPI`.
|
||||
|
||||
Part of the Java Demo code can be found [here](https://github.com/fankes/YukiHookAPI/tree/master/samples/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/java), but not recommended.
|
||||
|
||||
@@ -30,7 +30,7 @@ Previously, when we built an Xposed Module, we first needed to create an `xposed
|
||||
|
||||
Then, manually fill in your own entry class name into the file and use `XposedHelpers` to implement our Hook logic.
|
||||
|
||||
Since `Kotlin` is the main Android development language, this API is really not very elegant to use.
|
||||
Since Kotlin is the main Android development language, this API is really not very elegant to use.
|
||||
|
||||
Is there any **easy to use, light, elegant** solution?
|
||||
|
||||
@@ -38,7 +38,7 @@ With this idea, `YukiHookAPI` was born.
|
||||
|
||||
Now, we only need to write a small amount of code, and all the time and expense are handed over to automation.
|
||||
|
||||
With `Kotlin`'s elegant `lambda` writing and `YukiHookAPI`, you can make your Hook logic more beautiful and clear.
|
||||
With Kotlin's elegant **lambda** writing and `YukiHookAPI`, you can make your Hook logic more beautiful and clear.
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -66,7 +66,7 @@ The Root-free frameworks mentioned above are [LSPatch](https://github.com/LSPose
|
||||
|
||||
### What YukiHookAPI does
|
||||
|
||||
Since Xposed appeared until now, apart from `XposedHelpers`, which is well known to developers, there is still no set of syntactic sugar for `Kotlin` and API with complete usage encapsulation.
|
||||
Since Xposed appeared until now, apart from `XposedHelpers`, which is well known to developers, there is still no set of syntactic sugar for Kotlin and API with complete usage encapsulation.
|
||||
|
||||
The birth of this API framework is to hope that in the current era of Xposed, more capable Xposed Module developers can avoid detours and complete the entire development process more easily and simply.
|
||||
|
||||
|
@@ -10,7 +10,7 @@ This document can help you quickly migrate from the Hook APIs you are familiar w
|
||||
|
||||
> Migrated from `XC_LoadPackage.LoadPackageParam` to `PackageParam`.
|
||||
|
||||
`YukiHookAPI` implements the `lambda` method body `this` usage for `PackageParam`, and the `PackageParam` object can be obtained globally in the `encase` method body.
|
||||
`YukiHookAPI` implements the **lambda** method body `this` usage for `PackageParam`, and the `PackageParam` object can be obtained globally in the `encase` method body.
|
||||
|
||||
> The API function differences are compared as follows
|
||||
|
||||
@@ -107,7 +107,7 @@ override fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPa
|
||||
|
||||
#### Before/After Hook
|
||||
|
||||
`YukiHookAPI` also implements the `lambda` method body `this` usage for `HookParam`, and the `HookParam` object can be obtained globally in the method bodies such as `beforeHook` and `afterHook`.
|
||||
`YukiHookAPI` also implements the **lambda** method body `this` usage for `HookParam`, and the `HookParam` object can be obtained globally in the method bodies such as `beforeHook` and `afterHook`.
|
||||
|
||||
> The API function differences are compared as follows
|
||||
|
||||
|
@@ -30,7 +30,7 @@ If you don't want to use automated build tools, you can still manually configure
|
||||
|
||||
### Create Project
|
||||
|
||||
Use `Android Studio` or `IntelliJ IDEA` to create a new Android project and select `Kotlin` in the `Language` column to automatically add basic dependencies.
|
||||
Use `Android Studio` or `IntelliJ IDEA` to create a new Android project and select Kotlin in the `Language` column to automatically add basic dependencies.
|
||||
|
||||
### Integration Dependencies
|
||||
|
||||
|
@@ -165,7 +165,7 @@
|
||||
- 新增 `generic` 功能,可对泛型进行反射和调用,你可以在 `Class` 或 `CurrentClass` 中使用它
|
||||
- 作废 `buildOfAny` 方法,现在请直接使用 `buildOf` 方法 (不带泛型) 来使用构造方法创建新对象并得到结果 `Any`
|
||||
- 修复 `hasExtends` 使用过程发生空指针异常的问题
|
||||
- `CurrentClass` 新增非 `lambda` 方式的调用方法
|
||||
- `CurrentClass` 新增非 **lambda** 方式的调用方法
|
||||
- `CurrentClass` 新增 `name` 与 `simpleName` 功能
|
||||
- 完全重写 `ReflectionTool` 的核心方法,将不同的查找条件进行了整理分类
|
||||
- 修复 `ReflectionTool` 中可能的直接调用 `declared` 获取的 `Member` 抛出异常的问题
|
||||
@@ -294,7 +294,7 @@
|
||||
- ~~`YukiHookXposedInitProxy`~~ 更名为 `IYukiHookXposedInit`,原接口名称已作废,将在后续版本中直接被删除
|
||||
- 新增 `initZygote` 与 Resources Hook 功能,支持 Hook Layout
|
||||
- 新增 `onXposedEvent` 方法,可监听原生 Xposed API 的全部事件
|
||||
- 对 Hook 功能的 `lambda` 进行 `inline` 处理,避免生成过碎的匿名类,提升编译后的运行性能
|
||||
- 对 Hook 功能的 **lambda** 进行 `inline` 处理,避免生成过碎的匿名类,提升编译后的运行性能
|
||||
- 修复 `PrefsData` 编译后的方法体复制过大的问题
|
||||
- 增加 `XSharePreference` 可读性测试,失败后会自动打印警告日志
|
||||
- `PackageParam` 新增 `appResources`、`moduleAppResources`、`moduleAppFilePath` 功能
|
||||
@@ -322,7 +322,7 @@
|
||||
- 修复 `YukiHookModulePrefs` 在 `New XSharePreference` 模式下工作的部分问题
|
||||
- 新增 `ModulePreferenceFragment`,现在,你可以完全替换掉 `PreferenceFragmentCompat` 并开始使用新的功能
|
||||
- 适配 `PreferenceFragmentCompat` 的 Sp 数据存储解决方案,感谢 [mahoshojoHCG](https://github.com/mahoshojoHCG) 的反馈
|
||||
- 更新自动处理程序以及 `Kotlin` 依赖到最新版本
|
||||
- 更新自动处理程序以及 Kotlin 依赖到最新版本
|
||||
- 修正部分文档和代码注释中的错误
|
||||
|
||||
### 1.0.77 | 2022.04.15  <Badge type="danger" text="过期" vertical="middle" />
|
||||
@@ -413,7 +413,7 @@
|
||||
- 增加 `MethodFinder` 与 `FieldFinder` 新的返回值调用方法
|
||||
- 修复可能存在的问题,并修复太极使用过程中可能存在的问题
|
||||
- 修复自动生成 Xposed 入口类可能发生的问题
|
||||
- 增加了 `type` 中的 `android` 类型以及 `java` 类型
|
||||
- 增加了 `type` 中的 `android` 类型以及 Java 类型
|
||||
|
||||
### 1.0.6 | 2022.03.20  <Badge type="danger" text="过期" vertical="middle" />
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
|
||||
- 修正一处注释错误
|
||||
- 临时修复一个 BUG
|
||||
- 增加了 `type` 中的大量 `android` 类型以及少量 `java` 类型
|
||||
- 增加了 `type` 中的大量 `android` 类型以及少量 Java 类型
|
||||
- 修复新版与旧版 Kotlin APIs 的兼容性问题
|
||||
|
||||
### 1.0.5 | 2022.03.18  <Badge type="danger" text="过期" vertical="middle" />
|
||||
@@ -466,7 +466,7 @@
|
||||
|
||||
- `RemedyPlan` 增加 `onFind` 功能
|
||||
- 整合并修改了部分反射 API 代码
|
||||
- 增加了 `type` 中的 `java` 类型
|
||||
- 增加了 `type` 中的 Java 类型
|
||||
- 修复忽略错误在控制台仍然输出的问题
|
||||
|
||||
### 1.0 | 2022.02.14  <Badge type="danger" text="过期" vertical="middle" />
|
||||
|
@@ -40,4 +40,4 @@ API 已经提供了 Xposed 原生 API 监听接口,你可以 [在这里](../co
|
||||
|
||||
作为 API 来讲,目前仅仅对接 `XposedBridge` 作为兼容层,还是有一定的局限性。
|
||||
|
||||
大部分 `inline hook` 没有 `Java` 兼容层,后期可能会考虑 `native hook` 的 `Java` 兼容层适配。
|
||||
大部分 `inline hook` 没有 Java 兼容层,后期可能会考虑 `native hook` 的 Java 兼容层适配。
|
@@ -530,7 +530,7 @@ inline fun configs(initiate: Configs.() -> Unit)
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 对 `Configs` 类实现了一个 `lambda` 方法体。
|
||||
> 对 `Configs` 类实现了一个 **lambda** 方法体。
|
||||
|
||||
你可以轻松地调用它进行配置。
|
||||
|
||||
|
@@ -728,7 +728,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用此方法为 `Result` 类创建 `lambda` 方法体。
|
||||
你可以使用此方法为 `Result` 类创建 **lambda** 方法体。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -342,7 +342,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -459,7 +459,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -344,7 +344,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -486,7 +486,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -603,7 +603,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -528,7 +528,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**功能示例**
|
||||
|
||||
我们要获取一个 `Class` 在 `Kotlin` 下不通过反射时应该这样做。
|
||||
我们要获取一个 `Class` 在 Kotlin 下不通过反射时应该这样做。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -14,7 +14,7 @@ pageClass: code-page
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 这是 `YukiHookAPI` 相关 `lambda` 方法的封装类以及部分 API 用法。
|
||||
> 这是 `YukiHookAPI` 相关 **lambda** 方法的封装类以及部分 API 用法。
|
||||
|
||||
## IYukiHookXposedInit.configs <span class="symbol">- ext-method</span>
|
||||
|
||||
|
@@ -404,7 +404,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
@@ -414,7 +414,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `loadApp` 的 `lambda` 方法体形式或直接装载一个 Hooker。
|
||||
你可以使用 `loadApp` 的 **lambda** 方法体形式或直接装载一个 Hooker。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -499,7 +499,7 @@ fun loadZygote(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载 APP Zygote 事件。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadSystem <span class="symbol">- method</span>
|
||||
|
||||
@@ -527,7 +527,7 @@ fun loadSystem(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 系统框架。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## withProcess <span class="symbol">- method</span>
|
||||
|
||||
@@ -559,7 +559,7 @@ fun withProcess(name: String, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook APP 的指定进程。
|
||||
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadHooker <span class="symbol">- method</span>
|
||||
|
||||
|
@@ -10,6 +10,6 @@ pageClass: code-page
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Java` 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
> 这是一个预置反射类型的常量类,主要为 Java 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.kt) 进行查看。
|
@@ -1804,7 +1804,7 @@ field {
|
||||
}
|
||||
```
|
||||
|
||||
在 `Kotlin` 中表达出 `Boolean::class.javaPrimitiveType` 这个类型的写法很长,感觉并不方便。
|
||||
在 Kotlin 中表达出 `Boolean::class.javaPrimitiveType` 这个类型的写法很长,感觉并不方便。
|
||||
|
||||
因此,`YukiHookAPI` 为开发者封装了常见的类型调用,其中包含了 Android 的相关类型和 Java 的常见类型与**原始类型关键字**。
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
fun configs(initiate: Configs.() -> Unit)
|
||||
```
|
||||
|
||||
`configs` 方法对 `Configs` 类实现了一个 `lambda` 方法体,你可以轻松地调用它进行配置。
|
||||
`configs` 方法对 `Configs` 类实现了一个 **lambda** 方法体,你可以轻松地调用它进行配置。
|
||||
|
||||
::: tip
|
||||
|
||||
|
@@ -608,7 +608,7 @@ withProcess(name = "$packageName:tool") {
|
||||
|
||||
## 写法优化
|
||||
|
||||
为了使代码更加简洁,你可以删去 `YukiHookAPI` 的名称,将你的 `onHook` 入口写作 `lambda` 形式。
|
||||
为了使代码更加简洁,你可以删去 `YukiHookAPI` 的名称,将你的 `onHook` 入口写作 **lambda** 形式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
## 背景
|
||||
|
||||
这是一个使用 `Kotlin` 基于 Xposed API 重新构建的高效 Hook API,同时为 Xposed 模块的开发打造了丰富的功能扩展。
|
||||
这是一个使用 Kotlin 基于 Xposed API 重新构建的高效 Hook API,同时为 Xposed 模块的开发打造了丰富的功能扩展。
|
||||
|
||||
名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)。
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
## 用途
|
||||
|
||||
`YukiHookAPI` 完全采用 `Kotlin` `lambda` 语法构建。
|
||||
`YukiHookAPI` 完全采用 Kotlin **lambda** 语法构建。
|
||||
|
||||
抛弃原始不太友好的 `XposedHelpers`,你可以使用它来轻松创建 Xposed 模块以及轻松实现自定义 Hook API。
|
||||
|
||||
## 语言要求
|
||||
|
||||
请使用 `Kotlin`,框架部分代码构成同样兼容 `Java` 但基础 Hook 场景的实现**可能完全无法使用**。
|
||||
请使用 Kotlin,框架部分代码构成同样兼容 Java 但基础 Hook 场景的实现**可能完全无法使用**。
|
||||
|
||||
文档全部的 Demo 示例代码都将使用 `Kotlin` 进行描述,如果你完全不会使用 `Kotlin` 那你将有可能无法使用 `YukiHookAPI`。
|
||||
文档全部的 Demo 示例代码都将使用 Kotlin 进行描述,如果你完全不会使用 Kotlin 那你将有可能无法使用 `YukiHookAPI`。
|
||||
|
||||
部分 Java Demo 代码可在 [这里](https://github.com/fankes/YukiHookAPI/tree/master/samples/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/java) 找到,但不推荐使用。
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
然后,将自己的入口类名手动填入文件中,使用 `XposedHelpers` 去实现我们的 Hook 逻辑。
|
||||
|
||||
自 `Kotlin` 作为 Android 主要开发语言以来,这套 API 用起来确实已经不是很优雅了。
|
||||
自 Kotlin 作为 Android 主要开发语言以来,这套 API 用起来确实已经不是很优雅了。
|
||||
|
||||
有没有什么 **好用、轻量、优雅** 的解决办法呢?
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
现在,我们只需要编写少量的代码,一切时间开销和花费交给自动化处理。
|
||||
|
||||
借助 `Kotlin` 优雅的 `lambda` 写法以及 `YukiHookAPI`,可以让你的 Hook 逻辑更加美观清晰。
|
||||
借助 Kotlin 优雅的 **lambda** 写法以及 `YukiHookAPI`,可以让你的 Hook 逻辑更加美观清晰。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -62,7 +62,7 @@ App's Environment
|
||||
|
||||
### YukiHookAPI 做了什么
|
||||
|
||||
自从 Xposed 出现到现在为止,除了开发者人人皆知的 `XposedHelpers`,依然没有一套针对 `Kotlin` 打造的语法糖以及用法封装十分完善的 API。
|
||||
自从 Xposed 出现到现在为止,除了开发者人人皆知的 `XposedHelpers`,依然没有一套针对 Kotlin 打造的语法糖以及用法封装十分完善的 API。
|
||||
|
||||
本 API 框架的诞生就是希望在 Xposed 的如今时代,能让更多有动手能力的 Xposed 模块开发者少走弯路,更容易、更简单地完成整个开发流程。
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
> 从 `XC_LoadPackage.LoadPackageParam` 迁移至 `PackageParam`。
|
||||
|
||||
`YukiHookAPI` 对 `PackageParam` 实现了 `lambda` 方法体 `this` 用法,在 `encase` 方法体内即可全局得到 `PackageParam` 对象。
|
||||
`YukiHookAPI` 对 `PackageParam` 实现了 **lambda** 方法体 `this` 用法,在 `encase` 方法体内即可全局得到 `PackageParam` 对象。
|
||||
|
||||
> API 功能差异对比如下
|
||||
|
||||
@@ -107,7 +107,7 @@ override fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPa
|
||||
|
||||
#### Before/After Hook
|
||||
|
||||
`YukiHookAPI` 同样对 `HookParam` 实现了 `lambda` 方法体 `this` 用法,在 `beforeHook`、`afterHook` 等方法体内即可全局得到 `HookParam` 对象。
|
||||
`YukiHookAPI` 同样对 `HookParam` 实现了 **lambda** 方法体 `this` 用法,在 `beforeHook`、`afterHook` 等方法体内即可全局得到 `HookParam` 对象。
|
||||
|
||||
> API 功能差异对比如下
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
### 创建项目
|
||||
|
||||
使用 `Android Studio` 或 `IntelliJ IDEA` 创建新的 Android 项目,并在 `Language` 一栏选择 `Kotlin` 以自动添加基础依赖。
|
||||
使用 `Android Studio` 或 `IntelliJ IDEA` 创建新的 Android 项目,并在 `Language` 一栏选择 Kotlin 以自动添加基础依赖。
|
||||
|
||||
### 集成依赖
|
||||
|
||||
|
Reference in New Issue
Block a user