mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 01:35:17 +08:00
...
This commit is contained in:
@@ -94,6 +94,8 @@ object YukiHookAPI {
|
||||
|
||||
/**
|
||||
* 配置 YukiHookAPI 相关参数
|
||||
*
|
||||
* 详情请参考 [configs 方法](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#configs-%E6%96%B9%E6%B3%95)
|
||||
* @param initiate 方法体
|
||||
* @return [Configs]
|
||||
*/
|
||||
@@ -121,7 +123,9 @@ object YukiHookAPI {
|
||||
/**
|
||||
* 作为模块装载调用入口方法 - Xposed API
|
||||
*
|
||||
* 详情请参考 [API 文档](https://github.com/fankes/YukiHookAPI/wiki/API-%E6%96%87%E6%A1%A3)
|
||||
* 用法请参考 [API 文档](https://github.com/fankes/YukiHookAPI/wiki/API-%E6%96%87%E6%A1%A3)
|
||||
*
|
||||
* 配置请参考 [通过 Lambda 创建](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#%E9%80%9A%E8%BF%87-lambda-%E5%88%9B%E5%BB%BA)
|
||||
* @param initiate Hook 方法体
|
||||
*/
|
||||
fun encase(initiate: PackageParam.() -> Unit) {
|
||||
@@ -132,6 +136,10 @@ object YukiHookAPI {
|
||||
|
||||
/**
|
||||
* 作为模块装载调用入口方法 - Xposed API
|
||||
*
|
||||
* 用法请参考 [API 文档](https://github.com/fankes/YukiHookAPI/wiki/API-%E6%96%87%E6%A1%A3)
|
||||
*
|
||||
* 配置请参考 [通过自定义 Hooker 创建](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#%E9%80%9A%E8%BF%87%E8%87%AA%E5%AE%9A%E4%B9%89-hooker-%E5%88%9B%E5%BB%BA)
|
||||
* @param hooker Hook 子类数组 - 必填不能为空
|
||||
* @throws IllegalStateException 如果 [hooker] 是空的
|
||||
*/
|
||||
@@ -152,6 +160,8 @@ object YukiHookAPI {
|
||||
*
|
||||
* 详情请参考 [作为 Hook API 使用](https://github.com/fankes/YukiHookAPI/wiki#%E4%BD%9C%E4%B8%BA-hook-api-%E4%BD%BF%E7%94%A8)
|
||||
*
|
||||
* 配置请参考 [通过 Lambda 创建](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#%E9%80%9A%E8%BF%87-lambda-%E5%88%9B%E5%BB%BA)
|
||||
*
|
||||
* 用法请参考 [API 文档](https://github.com/fankes/YukiHookAPI/wiki/API-%E6%96%87%E6%A1%A3)
|
||||
* @param baseContext attachBaseContext
|
||||
* @param initiate Hook 方法体
|
||||
@@ -169,6 +179,8 @@ object YukiHookAPI {
|
||||
*
|
||||
* 详情请参考 [作为 Hook API 使用](https://github.com/fankes/YukiHookAPI/wiki#%E4%BD%9C%E4%B8%BA-hook-api-%E4%BD%BF%E7%94%A8)
|
||||
*
|
||||
* 配置请参考 [通过自定义 Hooker 创建](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#%E9%80%9A%E8%BF%87%E8%87%AA%E5%AE%9A%E4%B9%89-hooker-%E5%88%9B%E5%BB%BA)
|
||||
*
|
||||
* 用法请参考 [API 文档](https://github.com/fankes/YukiHookAPI/wiki/API-%E6%96%87%E6%A1%A3)
|
||||
* @param baseContext attachBaseContext
|
||||
* @param hooker Hook 子类数组 - 必填不能为空
|
||||
|
@@ -48,25 +48,7 @@ import com.highcapable.yukihookapi.hook.xposed.proxy.YukiHookXposedInitProxy
|
||||
*
|
||||
* 更多请参考 [InjectYukiHookWithXposed] 中的注释内容
|
||||
*
|
||||
* ....
|
||||
*
|
||||
* 继承类参考示例:
|
||||
*
|
||||
* ....
|
||||
*
|
||||
* class CustomHooker : YukiBaseHooker() {
|
||||
*
|
||||
* ....override fun onHook() {
|
||||
*
|
||||
* ........// Your code here.
|
||||
*
|
||||
* ....}
|
||||
*
|
||||
* }
|
||||
*
|
||||
* ....
|
||||
*
|
||||
* 详情请参考 [API 基本配置](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE)
|
||||
* 详情请参考 [通过自定义 Hooker 创建](https://github.com/fankes/YukiHookAPI/wiki/API-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE#%E9%80%9A%E8%BF%87%E8%87%AA%E5%AE%9A%E4%B9%89-hooker-%E5%88%9B%E5%BB%BA)
|
||||
*/
|
||||
abstract class YukiBaseHooker : PackageParam() {
|
||||
|
||||
|
@@ -111,6 +111,15 @@ open class PackageParam(private var wrapper: PackageParamWrapper? = null) {
|
||||
if (packageName == name) initiate(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 装载并 Hook 指定包名的 APP
|
||||
* @param name 包名
|
||||
* @param hooker Hook 子类
|
||||
*/
|
||||
fun loadApp(name: String, hooker: YukiBaseHooker) {
|
||||
if (packageName == name) loadHooker(hooker)
|
||||
}
|
||||
|
||||
/**
|
||||
* 装载 Hook 子类
|
||||
*
|
||||
|
Reference in New Issue
Block a user