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

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

View File

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

View File

@@ -295,11 +295,11 @@ encase {
```kotlin
encase {
// 错误的使用方法,不能直接开始 Hook
// 错误的使用方法,不能直接开始 Hook
findClass(name = "com.example.demo.DemoClass").hook {
// ...
}
// 错误的使用方法,不能直接开始 Hook
// 错误的使用方法,不能直接开始 Hook
resources().hook {
// ...
}
@@ -324,7 +324,7 @@ object HookEntry : IYukiHookXposedInit {
object CustomHooker : YukiBaseHooker() {
override fun onHook() {
// 错误的使用方法,由于外层没有任何判断对象,不能直接开始 Hook
// 错误的使用方法,由于外层没有任何判断对象,不能直接开始 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 {
override fun onInit() {
// 错误的使用方法
// 错误的使用方法
YukiHookAPI.encase {
// Your code here.
}
}
override fun onXposedEvent() {
// 错误的使用方法
// 错误的使用方法
YukiHookAPI.encase {
// Your code here.
}
@@ -363,15 +363,15 @@ Method/Constructor/Field match type "**TYPE**" not allowed
```kotlin
// 查找一个方法
method {
// 设置了无效的类型举例
// 设置了无效的类型举例
param(false, 1, 0)
// 设置了无效的类型举例
// 设置了无效的类型举例
returnType = false
}
// 查找一个变量
field {
// 设置了无效的类型举例
// 设置了无效的类型举例
type = false
}
```
@@ -893,7 +893,7 @@ This proxy \[**TYPE**\] type is not allowed
> 示例如下
```kotlin
// 这里填入的内容仅为举例,其中 proxy 填入了不能理解的无效参数
// 这里填入的内容仅为举例,其中 proxy 填入了不能理解的无效参数
registerModuleAppActivities(proxy = false)
```
@@ -1182,7 +1182,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) {
// 不能在这种情况下使用 prefs
// 不能在这种情况下使用 prefs
prefs.getBoolean("test_data")
}
super.attachBaseContext(base)
@@ -1238,7 +1238,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) {
// 不能在这种情况下使用 dataChannel
// 不能在这种情况下使用 dataChannel
dataChannel.wait(key = "test_data") {
// ...
}
@@ -1287,7 +1287,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 错误的使用方法
// 错误的使用方法
// 构造方法已在 API 1.0.88 及以后的版本中设置为 private
YukiHookPrefsBridge().getBoolean("test_data")
}

View File

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