Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
teble committed Nov 29, 2023
1 parent 9ef306c commit f956443
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public class MainHook implements IXposedHookLoadPackage {
// Strings used by all methods in the class
.usingStrings("PlayActivity", "onClick", "onCreate")
)
).firstOrThrow(() -> new IllegalStateException("No class found"));
).singleOrThrow(() -> new IllegalStateException("No class found"));
// Print the found class: org.luckypray.dexkit.demo.PlayActivity
System.out.println(classData.getName());
// Get the corresponding class instance
Expand Down Expand Up @@ -370,7 +370,7 @@ class MainHook : IXposedHookLoadPackage {
// Strings used by all methods in the class
usingStrings("PlayActivity", "onClick", "onCreate")
}
}.firstOrNull() ?: error("Not found class")
}.singleOrNull() ?: error("Not found class")
// Print the found class: org.luckypray.dexkit.demo.PlayActivity
println(classData.name)
// Get the corresponding class instance
Expand Down
4 changes: 2 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public class MainHook implements IXposedHookLoadPackage {
// 类中所有方法使用的字符串
.usingStrings("PlayActivity", "onClick", "onCreate")
)
).firstOrThrow(() -> new IllegalStateException("No class found"));
).singleOrThrow(() -> new IllegalStateException("No class found"));
// 打印找到的类:org.luckypray.dexkit.demo.PlayActivity
System.out.println(classData.getName());
// 获取对应的类实例
Expand Down Expand Up @@ -362,7 +362,7 @@ class MainHook : IXposedHookLoadPackage {
// 类中所有方法使用的字符串
usingStrings("PlayActivity", "onClick", "onCreate")
}
}.firstOrNull() ?: error("Not found class")
}.singleOrNull() ?: error("Not found class")
// 打印找到的类:org.luckypray.dexkit.demo.PlayActivity
println(classData.name)
// Get the corresponding class instance
Expand Down
2 changes: 1 addition & 1 deletion doc-source/src/en/guide/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private fun findPlayActivity(bridge: DexKitBridge) {
// Strings used by all methods in the class
usingStrings("PlayActivity", "onClick", "onCreate")
}
}.firstOrNull() ?: error("Not found class")
}.single()
println(classData.name)
}
```
Expand Down
4 changes: 2 additions & 2 deletions doc-source/src/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AppHooker {
paramCount = 0
usingStrings("VipCheckUtil", "userInfo:")
}
}.firstOrNull() ?: error("method not found")
}.single()
val method: Method = methodData.getMethodInstance(hostClassLoader)
XposedBridge.hookMethod(method, XC_MethodReplacement.returnConstant(true))
}
Expand Down Expand Up @@ -123,7 +123,7 @@ class AppHooker {
.returnType("boolean")
.usingStrings("VipCheckUtil", "userInfo:")
)
).firstOrThrow(() -> new RuntimeException("Method not found"));
).single();
Method method = methodData.getMethodInstance(hostClassLoader);
XposedBridge.hookMethod(method, XC_MethodReplacement.returnConstant(true));
}
Expand Down
2 changes: 1 addition & 1 deletion doc-source/src/zh-cn/guide/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private fun findPlayActivity(bridge: DexKitBridge) {
// 类中所有方法使用的字符串
usingStrings("PlayActivity", "onClick", "onCreate")
}
}.firstOrNull() ?: error("Not found class")
}.single()
println(classData.name)
}
```
Expand Down
4 changes: 2 additions & 2 deletions doc-source/src/zh-cn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AppHooker {
paramCount = 0
usingStrings("VipCheckUtil", "userInfo:")
}
}.firstOrNull() ?: error("method not found")
}.single()
val method: Method = methodData.getMethodInstance(hostClassLoader)
XposedBridge.hookMethod(method, XC_MethodReplacement.returnConstant(true))
}
Expand Down Expand Up @@ -118,7 +118,7 @@ class AppHooker {
.returnType("boolean")
.usingStrings("VipCheckUtil", "userInfo:")
)
).firstOrThrow(() -> new RuntimeException("Method not found"));
).single();
Method method = methodData.getMethodInstance(hostClassLoader);
XposedBridge.hookMethod(method, XC_MethodReplacement.returnConstant(true));
}
Expand Down

0 comments on commit f956443

Please sign in to comment.