diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
new file mode 100644
index 00000000..3a29068d
--- /dev/null
+++ b/.idea/kotlinc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt b/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt
index f94c4ea7..1885545b 100644
--- a/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt
+++ b/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt
@@ -230,9 +230,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
).apply {
/** 插入 xposed_init 代码 */
write(
- ("@file:Suppress(\"OPT_IN_USAGE\", \"EXPERIMENTAL_API_USAGE\")\n" +
- "\n" +
- "package $packageName\n" +
+ ("package $packageName\n" +
"\n" +
"import androidx.annotation.Keep\n" +
"import com.highcapable.yukihookapi.YukiHookAPI\n" +
@@ -243,6 +241,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
"import de.robv.android.xposed.XposedHelpers\n" +
"import de.robv.android.xposed.XposedBridge\n" +
"import de.robv.android.xposed.callbacks.XC_LoadPackage\n" +
+ "import com.highcapable.yukihookapi.annotation.DoNotUseAPI\n" +
"import $packageName.$className\n" +
"\n" +
"/**\n" +
@@ -257,6 +256,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
" * Powered by YukiHookAPI (C) HighCapable 2022\n" +
" */\n" +
"@Keep\n" +
+ "@DoNotUseAPI\n" +
"class $className$xposedClassShortName : IXposedHookLoadPackage {\n" +
"\n" +
" override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {\n" +
diff --git a/yukihookapi/build.gradle b/yukihookapi/build.gradle
index 87e8aebe..3dc6d499 100644
--- a/yukihookapi/build.gradle
+++ b/yukihookapi/build.gradle
@@ -18,7 +18,14 @@ javadoc {
if (JavaVersion.current().isJava9Compatible()) options.addBooleanOption('html5', true)
}
-kotlin { sourceSets.main { kotlin.srcDir("src/api/kotlin") } }
+kotlin {
+ sourceSets.main { kotlin.srcDir("src/api/kotlin") }
+ sourceSets { all { languageSettings { optIn('com.highcapable.yukihookapi.annotation.DoNotUseAPI') } } }
+}
+
+tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
+ kotlinOptions { freeCompilerArgs += "-opt-in=com.highcapable.yukihookapi.annotation.DoNotUseAPI" }
+}
dependencies {
// Used 82 API Version
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt
index f9645139..7202d086 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/YukiHookAPI.kt
@@ -25,7 +25,7 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("MemberVisibilityCanBePrivate", "unused", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("MemberVisibilityCanBePrivate", "unused")
package com.highcapable.yukihookapi
@@ -33,8 +33,7 @@ import android.app.Application
import android.content.Context
import com.highcapable.yukihookapi.YukiHookAPI.configs
import com.highcapable.yukihookapi.YukiHookAPI.encase
-import com.highcapable.yukihookapi.annotation.DoNotUseField
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.core.finder.ConstructorFinder
import com.highcapable.yukihookapi.hook.core.finder.FieldFinder
import com.highcapable.yukihookapi.hook.core.finder.MethodFinder
@@ -84,7 +83,7 @@ object YukiHookAPI {
* - ❗此变量为私有功能性 API - 你不应该手动调用此变量
* @return [Boolean]
*/
- @DoNotUseField
+ @DoNotUseAPI
val isXposedCallbackSetUp
get() = !isXposedInitialized && packageParamCallback != null
@@ -93,7 +92,7 @@ object YukiHookAPI {
*
* - ❗这是私有 API - 请勿手动修改 - 会引发未知异常
*/
- @DoNotUseField
+ @DoNotUseAPI
var isModulePackageXposedEnv = false
/**
@@ -101,7 +100,7 @@ object YukiHookAPI {
*
* - ❗这是私有 API - 请勿手动修改 - 会引发未知异常
*/
- @DoNotUseField
+ @DoNotUseAPI
var modulePackageName = ""
/**
@@ -214,7 +213,7 @@ object YukiHookAPI {
*
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
*/
- @DoNotUseMethod
+ @DoNotUseAPI
fun onXposedInitialized() {
isXposedInitialized = true
}
@@ -225,7 +224,7 @@ object YukiHookAPI {
* - ❗装载代码将自动生成 - 你不应该手动使用此方法装载 Xposed 模块事件
* @param lpparam Xposed [XC_LoadPackage.LoadPackageParam]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
fun onXposedLoaded(lpparam: XC_LoadPackage.LoadPackageParam) =
packageParamCallback?.invoke(
PackageParam(
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseField.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseAPI.kt
similarity index 81%
rename from yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseField.kt
rename to yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseAPI.kt
index 04c062f4..65a2fc1f 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseField.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseAPI.kt
@@ -23,15 +23,19 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
- * This file is Created by fankes on 2022/2/2.
+ * This file is Created by fankes on 2022/4/3.
*/
@file:Suppress("OPT_IN_IS_NOT_ENABLED", "EXPERIMENTAL_IS_NOT_ENABLED")
package com.highcapable.yukihookapi.annotation
-@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
+@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
@MustBeDocumented
@Target(
+ AnnotationTarget.CLASS,
+ AnnotationTarget.CONSTRUCTOR,
+ AnnotationTarget.FUNCTION,
+ AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.PROPERTY,
AnnotationTarget.FIELD,
AnnotationTarget.LOCAL_VARIABLE,
@@ -42,10 +46,8 @@ package com.highcapable.yukihookapi.annotation
)
@Retention(AnnotationRetention.BINARY)
/**
- * -️ ❗警告方法外部调用声明
+ * - ❗不可在非指定区域被使用的隐藏 API
*
- * 此方法除继承和接口外不应该在这里被调用
- *
- * 如果调用此方法可能会出现错误或 APP 发生异常
+ * 此功能除继承和接口外不应该在这里被调用
*/
-annotation class DoNotUseField
\ No newline at end of file
+annotation class DoNotUseAPI
\ No newline at end of file
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseClass.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseClass.kt
deleted file mode 100644
index b37e9c42..00000000
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseClass.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * YukiHookAPI - An efficient Kotlin version of the Xposed Hook API.
- * Copyright (C) 2019-2022 HighCapable
- * https://github.com/fankes/YukiHookAPI
- *
- * MIT License
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * This file is Created by fankes on 2022/2/2.
- */
-@file:Suppress("OPT_IN_IS_NOT_ENABLED", "EXPERIMENTAL_IS_NOT_ENABLED")
-
-package com.highcapable.yukihookapi.annotation
-
-@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
-@MustBeDocumented
-@Target(
- AnnotationTarget.CLASS,
- AnnotationTarget.ANNOTATION_CLASS
-)
-@Retention(AnnotationRetention.BINARY)
-/**
- * - ❗警告方法外部调用声明
- *
- * 此方法除继承和接口外不应该在这里被调用
- *
- * 如果调用此方法可能会出现错误或 APP 发生异常
- */
-annotation class DoNotUseClass
\ No newline at end of file
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseMethod.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseMethod.kt
deleted file mode 100644
index 8402c73e..00000000
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/annotation/DoNotUseMethod.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * YukiHookAPI - An efficient Kotlin version of the Xposed Hook API.
- * Copyright (C) 2019-2022 HighCapable
- * https://github.com/fankes/YukiHookAPI
- *
- * MIT License
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * This file is Created by fankes on 2022/2/2.
- */
-@file:Suppress("OPT_IN_IS_NOT_ENABLED", "EXPERIMENTAL_IS_NOT_ENABLED")
-
-package com.highcapable.yukihookapi.annotation
-
-@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
-@MustBeDocumented
-@Target(
- AnnotationTarget.CONSTRUCTOR,
- AnnotationTarget.FUNCTION
-)
-@Retention(AnnotationRetention.BINARY)
-/**
- * - ❗警告方法外部调用声明
- *
- * 此方法除继承和接口外不应该在这里被调用
- *
- * 如果调用此方法可能会出现错误或 APP 发生异常
- */
-annotation class DoNotUseMethod
\ No newline at end of file
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt
index 0471ccdd..59028533 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt
@@ -25,13 +25,13 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("MemberVisibilityCanBePrivate", "unused", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("MemberVisibilityCanBePrivate", "unused")
package com.highcapable.yukihookapi.hook.core
import android.os.SystemClock
import com.highcapable.yukihookapi.YukiHookAPI
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.bean.HookClass
import com.highcapable.yukihookapi.hook.core.finder.ConstructorFinder
import com.highcapable.yukihookapi.hook.core.finder.FieldFinder
@@ -96,7 +96,7 @@ class YukiHookCreater(private val packageParam: PackageParam, private val hookCl
* @throws IllegalStateException 如果必要参数没有被设置
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
fun hook(): Result {
if (YukiHookAPI.hasXposedBridge.not()) return Result()
return if (hookMembers.isEmpty()) error("Hook Members is empty,hook aborted")
@@ -370,7 +370,7 @@ class YukiHookCreater(private val packageParam: PackageParam, private val hookCl
* - ❗此功能交由方法体自动完成 - 你不应该手动调用此方法
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
fun build() = Result()
/**
@@ -378,7 +378,7 @@ class YukiHookCreater(private val packageParam: PackageParam, private val hookCl
*
* - ❗此功能交由方法体自动完成 - 你不应该手动调用此方法
*/
- @DoNotUseMethod
+ @DoNotUseAPI
fun hook() {
if (YukiHookAPI.hasXposedBridge.not() || isDisableMemberRunHook) return
if (hookClass.instance == null) {
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt
index c7fe7be0..0e9f9d0a 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt
@@ -25,14 +25,11 @@
*
* This file is Created by fankes on 2022/2/4.
*/
-@file:Suppress(
- "unused", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE",
- "MemberVisibilityCanBePrivate", "UNCHECKED_CAST", "KotlinConstantConditions"
-)
+@file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST", "KotlinConstantConditions")
package com.highcapable.yukihookapi.hook.core.finder
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.core.YukiHookCreater
import com.highcapable.yukihookapi.hook.core.finder.base.BaseFinder
import com.highcapable.yukihookapi.hook.core.finder.type.ModifierRules
@@ -150,7 +147,7 @@ class ConstructorFinder(
* - ❗此功能交由方法体自动完成 - 你不应该手动调用此方法
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun build(isBind: Boolean) = try {
if (classSet != null) {
runBlocking {
@@ -171,7 +168,7 @@ class ConstructorFinder(
* @param throwable 异常
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun failure(throwable: Throwable?) = Result(isNoSuch = true, throwable)
/**
@@ -200,7 +197,7 @@ class ConstructorFinder(
*
* - ❗此功能交由方法体自动完成 - 你不应该手动调用此方法
*/
- @DoNotUseMethod
+ @DoNotUseAPI
internal fun build() {
if (classSet == null) return
if (remedyPlans.isNotEmpty()) run {
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt
index 2d4f5eee..74f218b8 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/FieldFinder.kt
@@ -25,12 +25,12 @@
*
* This file is Created by fankes on 2022/2/4.
*/
-@file:Suppress("unused", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused", "UNCHECKED_CAST", "MemberVisibilityCanBePrivate")
package com.highcapable.yukihookapi.hook.core.finder
import android.os.SystemClock
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.core.YukiHookCreater
import com.highcapable.yukihookapi.hook.core.finder.base.BaseFinder
import com.highcapable.yukihookapi.hook.core.finder.type.ModifierRules
@@ -123,7 +123,7 @@ class FieldFinder(
* @return [Result]
* @throws IllegalStateException 如果 [name] 没有被设置
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun build(isBind: Boolean) = try {
if (classSet != null) {
runBlocking {
@@ -147,7 +147,7 @@ class FieldFinder(
* @param throwable 异常
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun failure(throwable: Throwable?) = Result(isNoSuch = true, throwable)
/**
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt
index 00dd6267..179614fb 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt
@@ -25,14 +25,11 @@
*
* This file is Created by fankes on 2022/2/4.
*/
-@file:Suppress(
- "unused", "MemberVisibilityCanBePrivate",
- "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE", "UNCHECKED_CAST", "KotlinConstantConditions"
-)
+@file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST", "KotlinConstantConditions")
package com.highcapable.yukihookapi.hook.core.finder
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.core.YukiHookCreater
import com.highcapable.yukihookapi.hook.core.finder.base.BaseFinder
import com.highcapable.yukihookapi.hook.core.finder.type.ModifierRules
@@ -195,7 +192,7 @@ class MethodFinder(
* @param isBind 是否将结果设置到目标 [YukiHookCreater.MemberHookCreater]
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun build(isBind: Boolean) = try {
if (classSet != null) {
runBlocking {
@@ -216,7 +213,7 @@ class MethodFinder(
* @param throwable 异常
* @return [Result]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
override fun failure(throwable: Throwable?) = Result(isNoSuch = true, throwable)
/**
@@ -246,7 +243,7 @@ class MethodFinder(
*
* - ❗此功能交由方法体自动完成 - 你不应该手动调用此方法
*/
- @DoNotUseMethod
+ @DoNotUseAPI
internal fun build() {
if (classSet == null) return
if (remedyPlans.isNotEmpty()) run {
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/BaseFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/BaseFinder.kt
index 2f9a222a..f1be9487 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/BaseFinder.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/BaseFinder.kt
@@ -29,7 +29,7 @@ package com.highcapable.yukihookapi.hook.core.finder.base
import android.os.SystemClock
import com.highcapable.yukihookapi.YukiHookAPI
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.core.YukiHookCreater
import com.highcapable.yukihookapi.hook.log.yLoggerE
import com.highcapable.yukihookapi.hook.log.yLoggerI
@@ -164,7 +164,7 @@ abstract class BaseFinder(
* @param isBind 是否将结果设置到目标 [YukiHookCreater.MemberHookCreater]
* @return [Any]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
abstract fun build(isBind: Boolean = false): Any
/**
@@ -174,6 +174,6 @@ abstract class BaseFinder(
* @param throwable 异常
* @return [Any]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
abstract fun failure(throwable: Throwable?): Any
}
\ No newline at end of file
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/entity/YukiBaseHooker.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/entity/YukiBaseHooker.kt
index ab31fbf4..6cf3edab 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/entity/YukiBaseHooker.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/entity/YukiBaseHooker.kt
@@ -28,7 +28,7 @@
package com.highcapable.yukihookapi.hook.entity
import com.highcapable.yukihookapi.YukiHookAPI
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
import com.highcapable.yukihookapi.hook.param.PackageParam
import com.highcapable.yukihookapi.hook.xposed.proxy.YukiHookXposedInitProxy
@@ -58,7 +58,7 @@ abstract class YukiBaseHooker : PackageParam() {
* - ❗此方法为私有功能性 API - 你不应该手动调用此方法
* @param packageParam 需要使用的 [PackageParam]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
internal fun assignInstance(packageParam: PackageParam) {
baseAssignInstance(packageParam)
onHook()
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.kt
index c6aa7d21..a01aa745 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.kt
@@ -25,7 +25,7 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("unused", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused")
package com.highcapable.yukihookapi.hook.factory
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/YukiHookFactory.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/YukiHookFactory.kt
index 9285d264..11e005af 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/YukiHookFactory.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/YukiHookFactory.kt
@@ -25,7 +25,7 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("unused", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused")
package com.highcapable.yukihookapi.hook.factory
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt
index ff8b9d03..55d391f3 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt
@@ -25,7 +25,7 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST")
package com.highcapable.yukihookapi.hook.param
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/PackageParam.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/PackageParam.kt
index 0af94971..40d61424 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/PackageParam.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/PackageParam.kt
@@ -25,13 +25,13 @@
*
* This file is Created by fankes on 2022/2/2.
*/
-@file:Suppress("unused", "MemberVisibilityCanBePrivate", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused", "MemberVisibilityCanBePrivate")
package com.highcapable.yukihookapi.hook.param
import android.app.Application
import android.content.pm.ApplicationInfo
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.bean.HookClass
import com.highcapable.yukihookapi.hook.bean.VariousClass
import com.highcapable.yukihookapi.hook.core.YukiHookCreater
@@ -109,7 +109,7 @@ open class PackageParam(private var wrapper: PackageParamWrapper? = null) {
* - ❗此方法为私有功能性 API - 你不应该手动调用此方法
* @param anotherParam 另一个 [PackageParam]
*/
- @DoNotUseMethod
+ @DoNotUseAPI
internal fun baseAssignInstance(anotherParam: PackageParam) {
thisParam.wrapper = anotherParam.wrapper
}
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/HookParamWrapper.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/HookParamWrapper.kt
index 09161857..67f85aee 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/HookParamWrapper.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/HookParamWrapper.kt
@@ -27,7 +27,7 @@
*/
package com.highcapable.yukihookapi.hook.param.wrapper
-import com.highcapable.yukihookapi.annotation.DoNotUseClass
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.param.HookParam
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedBridge
@@ -39,7 +39,7 @@ import java.lang.reflect.Member
* - ❗这是一个私有 API - 请不要在外部使用
* @param baseParam 对接 [XC_MethodHook.MethodHookParam]
*/
-@DoNotUseClass
+@DoNotUseAPI
class HookParamWrapper(private val baseParam: XC_MethodHook.MethodHookParam) {
/**
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/PackageParamWrapper.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/PackageParamWrapper.kt
index 82ef9edb..303f8e22 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/PackageParamWrapper.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/wrapper/PackageParamWrapper.kt
@@ -25,12 +25,12 @@
*
* This file is Created by fankes on 2022/2/7.
*/
-@file:Suppress("unused", "MemberVisibilityCanBePrivate", "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
+@file:Suppress("unused", "MemberVisibilityCanBePrivate")
package com.highcapable.yukihookapi.hook.param.wrapper
import android.content.pm.ApplicationInfo
-import com.highcapable.yukihookapi.annotation.DoNotUseClass
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.param.PackageParam
/**
@@ -42,7 +42,7 @@ import com.highcapable.yukihookapi.hook.param.PackageParam
* @param appClassLoader APP [ClassLoader]
* @param appInfo APP [ApplicationInfo]
*/
-@DoNotUseClass
+@DoNotUseAPI
class PackageParamWrapper(
var packageName: String,
var processName: String,
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt
index b84b91fd..2c8dc3c3 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/utils/UtilsFactory.kt
@@ -25,19 +25,16 @@
*
* This file is Created by fankes on 2022/2/5.
*/
-@file:Suppress("OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE")
-
package com.highcapable.yukihookapi.hook.utils
-import com.highcapable.yukihookapi.annotation.DoNotUseClass
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
/**
* 计算方法执行耗时
* @param block 方法块
* @return [RunBlockResult]
*/
-@DoNotUseMethod
+@DoNotUseAPI
inline fun runBlocking(block: () -> R): RunBlockResult {
val start = System.currentTimeMillis()
block()
@@ -48,7 +45,7 @@ inline fun runBlocking(block: () -> R): RunBlockResult {
* 构造耗时计算结果类
* @param after 耗时
*/
-@DoNotUseClass
+@DoNotUseAPI
class RunBlockResult(private val after: Long) {
/**
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/YukiHookModuleStatus.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/YukiHookModuleStatus.kt
index 0eab1d59..b7f13d68 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/YukiHookModuleStatus.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/YukiHookModuleStatus.kt
@@ -29,7 +29,7 @@ package com.highcapable.yukihookapi.hook.xposed
import android.app.Activity
import androidx.annotation.Keep
-import com.highcapable.yukihookapi.annotation.DoNotUseMethod
+import com.highcapable.yukihookapi.annotation.DoNotUseAPI
import com.highcapable.yukihookapi.hook.factory.isModuleActive
import com.highcapable.yukihookapi.hook.factory.isTaiChiModuleActive
import com.highcapable.yukihookapi.hook.factory.isXposedModuleActive
@@ -92,7 +92,7 @@ object YukiHookModuleStatus {
* @return [Boolean]
*/
@Keep
- @DoNotUseMethod
+ @DoNotUseAPI
@JvmName(IS_ACTIVE_METHOD_NAME)
internal fun isActive(): Boolean {
yLoggerD(msg = IS_ACTIVE_METHOD_NAME, isDisableLog = true)
diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt
index f7cb9a40..56371179 100644
--- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt
+++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt
@@ -25,10 +25,7 @@
*
* This file is Created by fankes on 2022/2/8.
*/
-@file:Suppress(
- "OPT_IN_USAGE", "EXPERIMENTAL_API_USAGE", "SetWorldReadable", "CommitPrefEdits",
- "DEPRECATION", "WorldReadableFiles", "unused"
-)
+@file:Suppress("SetWorldReadable", "CommitPrefEdits", "DEPRECATION", "WorldReadableFiles", "unused")
package com.highcapable.yukihookapi.hook.xposed.prefs