This commit is contained in:
2022-02-11 21:41:09 +08:00
parent e4acea3d9b
commit ec9531ae10
6 changed files with 54 additions and 13 deletions

View File

@@ -0,0 +1,44 @@
/*
* 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("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

View File

@@ -32,13 +32,10 @@ package com.highcapable.yukihookapi.annotation
@RequiresOptIn(level = RequiresOptIn.Level.WARNING) @RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@MustBeDocumented @MustBeDocumented
@Target( @Target(
AnnotationTarget.CLASS,
AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY,
AnnotationTarget.FIELD, AnnotationTarget.FIELD,
AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.LOCAL_VARIABLE,
AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.VALUE_PARAMETER,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.TYPEALIAS AnnotationTarget.TYPEALIAS

View File

@@ -32,16 +32,8 @@ package com.highcapable.yukihookapi.annotation
@RequiresOptIn(level = RequiresOptIn.Level.WARNING) @RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@MustBeDocumented @MustBeDocumented
@Target( @Target(
AnnotationTarget.CLASS,
AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.PROPERTY,
AnnotationTarget.LOCAL_VARIABLE,
AnnotationTarget.VALUE_PARAMETER,
AnnotationTarget.CONSTRUCTOR, AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.FUNCTION, AnnotationTarget.FUNCTION
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.TYPEALIAS
) )
@Retention(AnnotationRetention.BINARY) @Retention(AnnotationRetention.BINARY)
/** /**

View File

@@ -25,7 +25,7 @@
* *
* This file is Created by fankes on 2022/2/2. * This file is Created by fankes on 2022/2/2.
*/ */
@file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST") @file:Suppress("unused", "MemberVisibilityCanBePrivate", "UNCHECKED_CAST", "EXPERIMENTAL_API_USAGE")
package com.highcapable.yukihookapi.hook.param package com.highcapable.yukihookapi.hook.param

View File

@@ -27,6 +27,7 @@
*/ */
package com.highcapable.yukihookapi.hook.param.wrapper package com.highcapable.yukihookapi.hook.param.wrapper
import com.highcapable.yukihookapi.annotation.DoNotUseClass
import com.highcapable.yukihookapi.hook.param.HookParam import com.highcapable.yukihookapi.hook.param.HookParam
import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.XposedBridge
@@ -34,8 +35,11 @@ import java.lang.reflect.Member
/** /**
* 用于包装 [HookParam] * 用于包装 [HookParam]
*
* ❗这是一个私有 API - 请不要在外部使用
* @param baseParam 对接 [XC_MethodHook.MethodHookParam] * @param baseParam 对接 [XC_MethodHook.MethodHookParam]
*/ */
@DoNotUseClass
class HookParamWrapper(private val baseParam: XC_MethodHook.MethodHookParam) { class HookParamWrapper(private val baseParam: XC_MethodHook.MethodHookParam) {
/** /**

View File

@@ -30,15 +30,19 @@
package com.highcapable.yukihookapi.hook.param.wrapper package com.highcapable.yukihookapi.hook.param.wrapper
import android.content.pm.ApplicationInfo import android.content.pm.ApplicationInfo
import com.highcapable.yukihookapi.annotation.DoNotUseClass
import com.highcapable.yukihookapi.hook.param.PackageParam import com.highcapable.yukihookapi.hook.param.PackageParam
/** /**
* 用于包装 [PackageParam] * 用于包装 [PackageParam]
*
* ❗这是一个私有 API - 请不要在外部使用
* @param packageName 包名 * @param packageName 包名
* @param processName 当前进程名 * @param processName 当前进程名
* @param appClassLoader APP [ClassLoader] * @param appClassLoader APP [ClassLoader]
* @param appInfo APP [ApplicationInfo] * @param appInfo APP [ApplicationInfo]
*/ */
@DoNotUseClass
class PackageParamWrapper( class PackageParamWrapper(
var packageName: String, var packageName: String,
var processName: String, var processName: String,