From f9564439d6980cb979ae62858e7bfb64f30d0a77 Mon Sep 17 00:00:00 2001 From: teble Date: Wed, 29 Nov 2023 18:29:07 +0800 Subject: [PATCH] update doc --- README.md | 4 ++-- README_zh.md | 4 ++-- doc-source/src/en/guide/example.md | 2 +- doc-source/src/en/index.md | 4 ++-- doc-source/src/zh-cn/guide/example.md | 2 +- doc-source/src/zh-cn/index.md | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d5b120c0..2eeea642 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/README_zh.md b/README_zh.md index 4f2b45de..f93eace8 100644 --- a/README_zh.md +++ b/README_zh.md @@ -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()); // 获取对应的类实例 @@ -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 diff --git a/doc-source/src/en/guide/example.md b/doc-source/src/en/guide/example.md index facb2c38..fda9c3d8 100644 --- a/doc-source/src/en/guide/example.md +++ b/doc-source/src/en/guide/example.md @@ -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) } ``` diff --git a/doc-source/src/en/index.md b/doc-source/src/en/index.md index 5f6c2b1b..859f750c 100644 --- a/doc-source/src/en/index.md +++ b/doc-source/src/en/index.md @@ -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)) } @@ -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)); } diff --git a/doc-source/src/zh-cn/guide/example.md b/doc-source/src/zh-cn/guide/example.md index dcdaf2d5..852d2d2b 100644 --- a/doc-source/src/zh-cn/guide/example.md +++ b/doc-source/src/zh-cn/guide/example.md @@ -165,7 +165,7 @@ private fun findPlayActivity(bridge: DexKitBridge) { // 类中所有方法使用的字符串 usingStrings("PlayActivity", "onClick", "onCreate") } - }.firstOrNull() ?: error("Not found class") + }.single() println(classData.name) } ``` diff --git a/doc-source/src/zh-cn/index.md b/doc-source/src/zh-cn/index.md index 279d58eb..aa4921e4 100644 --- a/doc-source/src/zh-cn/index.md +++ b/doc-source/src/zh-cn/index.md @@ -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)) } @@ -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)); }