mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-05 10:15:21 +08:00
Compare commits
7 Commits
1.3.0
...
61c0c5960b
Author | SHA1 | Date | |
---|---|---|---|
61c0c5960b
|
|||
3dbc33a301
|
|||
03304e3c22
|
|||
7c9e84f0ed
|
|||
|
525d716256 | ||
a136832e77
|
|||
243ec6ea1e
|
@@ -31,6 +31,11 @@
|
||||
|
||||
有关支持性的相关信息,你可以直接 [点击这里](https://highcapable.github.io/YukiHookAPI/zh-cn/guide/supportive) 进行查看。
|
||||
|
||||
| <img src="https://github.com/HighCapable/KavaRef/blob/main/img-src/icon.svg?raw=true" width = "30" height = "30" alt="LOGO"/> | [KavaRef](https://github.com/HighCapable/KavaRef) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
|
||||
|
||||
🚀 `YukiHookAPI` 正使用 `KavaRef` 作为反射 API 强力驱动,**点击上方链接 star 这个项目**,你也可以优雅地使用它!
|
||||
|
||||
## 合作项目
|
||||
|
||||
以下是经过合作并稳定使用 `YukiHookAPI` 的项目。
|
||||
|
@@ -32,6 +32,12 @@ Formerly the Innocent Xposed API used in [Development Learning Project](https://
|
||||
|
||||
For supportive related information, you can check it directly [click here](https://highcapable.github.io/YukiHookAPI/en/guide/supportive).
|
||||
|
||||
| <img src="https://github.com/HighCapable/KavaRef/blob/main/img-src/icon.svg?raw=true" width = "30" height = "30" alt="LOGO"/> | [KavaRef](https://github.com/HighCapable/KavaRef) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
|
||||
|
||||
🚀 `YukiHookAPI` is using `KavaRef` as a powerful driver for the reflection API.
|
||||
**Click on the link above star project**, and you can also use it gracefully!
|
||||
|
||||
## Cooperations
|
||||
|
||||
The following are projects that have collaborated and are using `YukiHookAPI`.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Contact Us
|
||||
|
||||
> If you have any questions in use, or have any constructive suggestions, you can contact us.
|
||||
> If you have any questions during usage, or have any constructive suggestions, you can contact us.
|
||||
|
||||
Join our developers group.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Looking for Future
|
||||
# Looking Toward the Future
|
||||
|
||||
> The future is bright and uncertain, let us look forward to the future development space of `YukiHookAPI`.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Introduce
|
||||
# Introduction
|
||||
|
||||
> `YukiHookAPI` is an integrated Hook API Framework, which does not provide any Hook functions, and needs the support of Xposed related basic APIs.
|
||||
|
||||
|
@@ -6,9 +6,9 @@
|
||||
|
||||
The project needs to be created using `Android Studio` or `IntelliJ IDEA` and be of type Android project and have integrated Kotlin environment dependencies.
|
||||
|
||||
- Android Studio (It is recommended to get the latest version [from here](https://developer.android.com/studio))
|
||||
- Android Studio (It is recommended to get the latest version from [here](https://developer.android.com/studio))
|
||||
|
||||
- IntelliJ IDEA (It is recommended to get the latest version [from here](https://www.jetbrains.com/idea))
|
||||
- IntelliJ IDEA (It is recommended to get the latest version from [here](https://www.jetbrains.com/idea))
|
||||
|
||||
- Kotlin 1.9.0+, Gradle 8+, Java 11, 17+, Android Gradle Plugin 8+
|
||||
|
||||
@@ -73,7 +73,7 @@ libraries:
|
||||
|
||||
After adding it, run Gradle Sync and all dependencies will be autowired.
|
||||
|
||||
Next, deploy plugins in your project `build.gradle.kts`.
|
||||
Next, deploy plugins in your project's `build.gradle.kts`.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -85,7 +85,7 @@ plugins {
|
||||
}
|
||||
```
|
||||
|
||||
Then, deploy dependencies in your project `build.gradle.kts`.
|
||||
Then, deploy dependencies in your project's `build.gradle.kts`.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -105,7 +105,7 @@ dependencies {
|
||||
|
||||
#### Version Catalog
|
||||
|
||||
Add repositories in your project `build.gradle.kts`.
|
||||
Add repositories in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
@@ -113,8 +113,8 @@ Add repositories in your project `build.gradle.kts`.
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// Must be added when used as an Xposed Module, otherwise optional
|
||||
maven { url("https://api.xposed.info/") }
|
||||
// Must be added when used as an Xposed Module, otherwise optional
|
||||
maven("https://api.xposed.info/")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -145,7 +145,7 @@ kavaref-extension = { module = "com.highcapable.kavaref:kavaref-extension", vers
|
||||
xposed-api = { module = "de.robv.android.xposed:api", version = "82" }
|
||||
```
|
||||
|
||||
Next, deploy plugins in your project `build.gradle.kts`.
|
||||
Next, deploy plugins in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
@@ -156,7 +156,7 @@ plugins {
|
||||
}
|
||||
```
|
||||
|
||||
Then, deploy dependencies in your project `build.gradle.kts`.
|
||||
Then, deploy dependencies in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
@@ -176,7 +176,7 @@ dependencies {
|
||||
|
||||
#### Traditional Method
|
||||
|
||||
Add repositories in your project `build.gradle.kts`.
|
||||
Add repositories in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
@@ -185,11 +185,11 @@ repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// Must be added when used as an Xposed Module, otherwise optional
|
||||
maven { url("https://api.xposed.info/") }
|
||||
maven("https://api.xposed.info/")
|
||||
}
|
||||
```
|
||||
|
||||
Add plugins in your project `build.gradle.kts`.
|
||||
Add plugins in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
@@ -200,7 +200,7 @@ plugins {
|
||||
}
|
||||
```
|
||||
|
||||
Add dependencies in your project `build.gradle.kts`.
|
||||
Add dependencies in your project's `build.gradle.kts`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
|
@@ -20,7 +20,7 @@ features:
|
||||
details: Natively supports multiple Xposed API usages and natively connects to multiple Xposed APIs, Hook Frameworks within the supported range can be quickly integrated.
|
||||
- title: Obfuscate Support
|
||||
details: The built Xposed Module simply supports R8, obfuscate will not destroy the hook entry point, and no other configuration is required under R8.
|
||||
- title: Quickly Started
|
||||
- title: Quick to Start
|
||||
details: Simple and easy to use it now! Do not need complex configuration and full development experience, Integrate dependencies and enjoy yourself.
|
||||
footer: Apache-2.0 License | Copyright (C) 2019 HighCapable
|
||||
---
|
||||
|
@@ -6,9 +6,9 @@
|
||||
|
||||
项目需要使用 `Android Studio` 或 `IntelliJ IDEA` 创建且类型为 Android 项目并已集成 Kotlin 环境依赖。
|
||||
|
||||
- Android Studio (建议 [从这里](https://developer.android.com/studio) 获取最新版本)
|
||||
- Android Studio (建议从 [这里](https://developer.android.com/studio) 获取最新版本)
|
||||
|
||||
- IntelliJ IDEA (建议 [从这里](https://www.jetbrains.com/idea) 获取最新版本)
|
||||
- IntelliJ IDEA (建议从 [这里](https://www.jetbrains.com/idea) 获取最新版本)
|
||||
|
||||
- Kotlin 1.9.0+、Gradle 8+、Java 11、17+、Android Gradle Plugin 8+
|
||||
|
||||
@@ -114,7 +114,7 @@ repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// 作为 Xposed 模块使用务必添加,其它情况可选
|
||||
maven { url("https://api.xposed.info/") }
|
||||
maven("https://api.xposed.info/")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -185,7 +185,7 @@ repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// 作为 Xposed 模块使用务必添加,其它情况可选
|
||||
maven { url("https://api.xposed.info/") }
|
||||
maven("https://api.xposed.info/")
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -34,7 +34,7 @@ plugins:
|
||||
version-ref: android-application
|
||||
com.vanniktech.maven.publish:
|
||||
alias: maven-publish
|
||||
version: 0.33.0
|
||||
version: 0.34.0
|
||||
|
||||
libraries:
|
||||
de.robv.android.xposed:
|
||||
@@ -56,9 +56,9 @@ libraries:
|
||||
version: 1.2.0
|
||||
com.highcapable.kavaref:
|
||||
kavaref-core:
|
||||
version: 1.0.0
|
||||
version: 1.0.1
|
||||
kavaref-extension:
|
||||
version: 1.0.0
|
||||
version: 1.0.1
|
||||
com.highcapable.hikage:
|
||||
hikage-core:
|
||||
version: 1.0.1
|
||||
@@ -72,11 +72,11 @@ libraries:
|
||||
version: 1.0.0
|
||||
com.highcapable.betterandroid:
|
||||
ui-component:
|
||||
version: 1.0.7
|
||||
version: 1.0.8
|
||||
ui-extension:
|
||||
version: 1.0.6
|
||||
version: 1.0.7
|
||||
system-extension:
|
||||
version: 1.0.2
|
||||
version: 1.0.3
|
||||
androidx.annotation:
|
||||
annotation:
|
||||
version: 1.9.1
|
||||
@@ -85,13 +85,13 @@ libraries:
|
||||
version: 1.2.1
|
||||
androidx.core:
|
||||
core-ktx:
|
||||
version: 1.16.0
|
||||
version: 1.17.0
|
||||
androidx.appcompat:
|
||||
appcompat:
|
||||
version: 1.7.1
|
||||
androidx.lifecycle:
|
||||
lifecycle-viewmodel-ktx:
|
||||
version: 2.9.1
|
||||
version: 2.9.2
|
||||
com.google.android.material:
|
||||
material:
|
||||
version: 1.11.0
|
||||
@@ -101,10 +101,10 @@ libraries:
|
||||
version: 2.2.1
|
||||
androidx.test.ext:
|
||||
junit:
|
||||
version: 1.2.1
|
||||
version: 1.3.0
|
||||
androidx.test.espresso:
|
||||
espresso-core:
|
||||
version: 3.6.1
|
||||
version: 3.7.0
|
||||
junit:
|
||||
junit:
|
||||
version: 4.13.2
|
@@ -25,7 +25,7 @@ import android.graphics.drawable.Drawable
|
||||
import android.util.TypedValue
|
||||
import android.widget.Button
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||
|
||||
/**
|
||||
* Fixed [AlertDialog] dialog button issue after injecting Module App's Resources in some Host Apps
|
||||
@@ -38,9 +38,9 @@ import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
* @return [AlertDialog]
|
||||
*/
|
||||
fun AlertDialog.compatStyle(): AlertDialog {
|
||||
resolve().firstField {
|
||||
asResolver().firstField {
|
||||
name = "mAlert"
|
||||
}.get()?.resolve()?.apply {
|
||||
}.get()?.asResolver()?.apply {
|
||||
listOf(
|
||||
firstField { name = "mButtonPositive" }.get<Button>(),
|
||||
firstField { name = "mButtonNegative" }.get<Button>(),
|
||||
|
@@ -43,6 +43,7 @@ import android.os.UserHandle
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.highcapable.betterandroid.system.extension.component.registerReceiver
|
||||
import com.highcapable.betterandroid.system.extension.tool.SystemVersion
|
||||
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
import com.highcapable.kavaref.extension.classOf
|
||||
import com.highcapable.kavaref.extension.lazyClass
|
||||
@@ -158,9 +159,9 @@ internal object AppParasitics {
|
||||
name = "currentActivityThread"
|
||||
emptyParameters()
|
||||
}?.invoke()
|
||||
val currentScope = current?.resolve()?.optional(silent = true)
|
||||
val currentScope = current?.asResolver()?.optional(silent = true)
|
||||
val mBoundApplication = currentScope?.firstFieldOrNull { name = "mBoundApplication" }?.get()
|
||||
val appScope = mBoundApplication?.resolve()?.optional(silent = true)
|
||||
val appScope = mBoundApplication?.asResolver()?.optional(silent = true)
|
||||
appScope?.firstFieldOrNull { name = "appInfo" }?.get<ApplicationInfo>()
|
||||
}
|
||||
|
||||
@@ -402,7 +403,7 @@ internal object AppParasitics {
|
||||
if (YukiXposedModule.isXposedEnvironment) runCatching {
|
||||
if (currentPackageName == YukiXposedModule.modulePackageName)
|
||||
return YLog.innerE("You cannot inject module resources into yourself")
|
||||
hostResources.assets.resolve()
|
||||
hostResources.assets.asResolver()
|
||||
.processor(AndroidHiddenApiBypassResolver.get())
|
||||
.optional(silent = true)
|
||||
.firstMethodOrNull {
|
||||
@@ -457,17 +458,17 @@ internal object AppParasitics {
|
||||
.optional(silent = true)
|
||||
.firstFieldOrNull { name = "sCurrentActivityThread" }
|
||||
?.get()
|
||||
val instrumentation = sCurrentActivityThread?.resolve()
|
||||
val instrumentation = sCurrentActivityThread?.asResolver()
|
||||
?.processor(AndroidHiddenApiBypassResolver.get())
|
||||
?.optional(silent = true)
|
||||
?.firstMethodOrNull { name = "getInstrumentation" }
|
||||
?.invoke<Instrumentation>() ?: error("Could not found Instrumentation in ActivityThread")
|
||||
sCurrentActivityThread.resolve()
|
||||
sCurrentActivityThread.asResolver()
|
||||
.processor(AndroidHiddenApiBypassResolver.get())
|
||||
.optional(silent = true)
|
||||
.firstFieldOrNull { name = "mInstrumentation" }
|
||||
?.set(InstrumentationDelegate.wrapper(instrumentation))
|
||||
val mH = sCurrentActivityThread.resolve()
|
||||
val mH = sCurrentActivityThread.asResolver()
|
||||
.processor(AndroidHiddenApiBypassResolver.get())
|
||||
.optional(silent = true)
|
||||
.firstFieldOrNull { name = "mH" }
|
||||
|
@@ -31,6 +31,7 @@ import android.os.Handler
|
||||
import android.os.IBinder
|
||||
import android.os.Message
|
||||
import com.highcapable.betterandroid.system.extension.tool.SystemVersion
|
||||
import com.highcapable.kavaref.KavaRef.Companion.asResolver
|
||||
import com.highcapable.kavaref.KavaRef.Companion.resolve
|
||||
import com.highcapable.kavaref.extension.lazyClass
|
||||
import com.highcapable.yukihookapi.hook.core.api.reflect.AndroidHiddenApiBypassResolver
|
||||
@@ -64,7 +65,7 @@ internal object HandlerDelegateCaller {
|
||||
internal fun callHandleMessage(baseInstance: Handler.Callback?, msg: Message): Boolean {
|
||||
when (msg.what) {
|
||||
LAUNCH_ACTIVITY -> {
|
||||
val intentResolver = msg.obj.resolve()
|
||||
val intentResolver = msg.obj.asResolver()
|
||||
.processor(AndroidHiddenApiBypassResolver.get())
|
||||
.optional(silent = true)
|
||||
.firstFieldOrNull { name = "intent" }
|
||||
@@ -85,7 +86,7 @@ internal object HandlerDelegateCaller {
|
||||
?.invokeQuietly<List<Any>>()
|
||||
?.takeIf { it.isNotEmpty() }
|
||||
callbacks?.filter { it.javaClass.name.contains("LaunchActivityItem") }?.forEach { item ->
|
||||
val itemResolver = item.resolve().optional(silent = true)
|
||||
val itemResolver = item.asResolver().optional(silent = true)
|
||||
.firstFieldOrNull { name = "mIntent" }
|
||||
val intent = itemResolver?.get<Intent>()
|
||||
val mExtras = mExtrasResolver?.copy()?.of(intent)?.getQuietly<Bundle>()
|
||||
@@ -99,19 +100,19 @@ internal object HandlerDelegateCaller {
|
||||
.optional(silent = true)
|
||||
.firstMethodOrNull { name = "currentActivityThread" }
|
||||
?.invoke()
|
||||
val token = msg.obj.resolve()
|
||||
val token = msg.obj.asResolver()
|
||||
.processor(AndroidHiddenApiBypassResolver.get())
|
||||
.optional(silent = true)
|
||||
.firstMethodOrNull { name = "getActivityToken" }
|
||||
?.invokeQuietly()
|
||||
val launchingActivity = currentActivityThread?.resolve()
|
||||
val launchingActivity = currentActivityThread?.asResolver()
|
||||
?.processor(AndroidHiddenApiBypassResolver.get())
|
||||
?.optional(silent = true)
|
||||
?.firstMethodOrNull {
|
||||
name = "getLaunchingActivity"
|
||||
parameters(IBinder::class)
|
||||
}?.invokeQuietly(token)
|
||||
launchingActivity?.resolve()
|
||||
launchingActivity?.asResolver()
|
||||
?.processor(AndroidHiddenApiBypassResolver.get())
|
||||
?.optional(silent = true)
|
||||
?.firstFieldOrNull { name = "intent" }
|
||||
|
Reference in New Issue
Block a user