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
// Exclude Class names belonging to the Host App
// 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
ModuleClassLoader.excludeHostClasses(
"androidx.core.app.ActivityCompat",
@@ -335,7 +335,7 @@ ModuleClassLoader.excludeHostClasses(
)
// Exclude Class names belonging to the Module App
// 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
ModuleClassLoader.excludeModuleClasses(
"com.demo.entry.HookEntry",

View File

@@ -1170,7 +1170,7 @@ instance.current {
name = "stop"
emptyParam()
}.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
instance.current().current()
```
@@ -1697,7 +1697,7 @@ In find conditions you can only use **index** function once except **order**.
method {
name = "test"
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)
}
```
@@ -1838,7 +1838,7 @@ The following is the wrong way to use it.
field {
name = "test"
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.

View File

@@ -298,11 +298,11 @@ Below are two **error** examples.
```kotlin
encase {
// Wrong usage, can't start Hook directly
// Wrong usage, can't start Hook directly
findClass(name = "com.example.demo.DemoClass").hook {
// ...
}
// Wrong usage, can't start Hook directly
// Wrong usage, can't start Hook directly
resources().hook {
// ...
}
@@ -327,7 +327,7 @@ object HookEntry : IYukiHookXposedInit {
object CustomHooker : YukiBaseHooker() {
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
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 {
override fun onInit() {
// Wrong usage
// Wrong usage
YukiHookAPI.encase {
// Your code here.
}
}
override fun onXposedEvent() {
// Wrong usage
// Wrong usage
YukiHookAPI.encase {
// Your code here.
}
@@ -379,15 +379,15 @@ A disallowed parameter type was set when looking up methods, constructors, and v
```kotlin
// Find a method
method {
// Invalid type example is set
// Invalid type example is set
param(false, 1, 0)
// Invalid type example is set
// Invalid type example is set
returnType = false
}
// Find a variable
field {
// Invalid type example is set
// Invalid type example is set
type = false
}
```
@@ -941,7 +941,7 @@ Invalid parameters were filled in when injecting Module App's `Activity` using `
> The following example
```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
registerModuleAppActivities(proxy = false)
```
@@ -1241,7 +1241,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) {
// Can't use prefs in this case
// Can't use prefs in this case
prefs.getBoolean("test_data")
}
super.attachBaseContext(base)
@@ -1299,7 +1299,7 @@ class MyApplication : Application() {
override fun attachBaseContext(base: Context?) {
YukiHookAPI.encase(base) {
// dataChannel cannot be used in this case
// dataChannel cannot be used in this case
dataChannel.wait(key = "test_data") {
// ...
}
@@ -1348,7 +1348,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Wrong usage
// Wrong usage
// Constructor has been set to private in API 1.0.88 and later
YukiHookPrefsBridge().getBoolean("test_data")
}

View File

@@ -44,7 +44,7 @@ Add the repositories and dependencies in your project's `SweetDependency` config
```yaml
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:
url: https://api.xposed.info/
# MavenCentral has a 2-hour cache,
@@ -52,13 +52,13 @@ repositories:
sonatype-oss-releases:
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:
version: +
...
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:
api:
version: 82
@@ -67,7 +67,7 @@ libraries:
com.highcapable.yukihookapi:
api:
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:
version-ref: <this>::api
...
@@ -81,7 +81,7 @@ Next, deploy plugins in your project `build.gradle.kts`.
```kotlin
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)
// ...
}
@@ -95,9 +95,9 @@ Then, deploy dependencies in your project `build.gradle.kts`.
dependencies {
// Basic dependencies
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)
// 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)
}
```
@@ -112,7 +112,7 @@ Add repositories in your project `build.gradle.kts` or `build.gradle`.
repositories {
google()
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/") }
// 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/") }
@@ -125,7 +125,7 @@ repositories {
repositories {
google()
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/' }
// 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/' }
@@ -138,7 +138,7 @@ Add plugins in your project `build.gradle.kts` or `build.gradle`.
```kotlin
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>"
}
```
@@ -147,7 +147,7 @@ plugins {
```groovy
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>'
}
```
@@ -160,9 +160,9 @@ Add dependencies in your project `build.gradle.kts` or `build.gradle`.
dependencies {
// Basic dependency
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")
// 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>")
}
```
@@ -173,9 +173,9 @@ dependencies {
dependencies {
// Basic dependency
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'
// 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>'
}
```