This commit is contained in:
2022-02-05 03:53:38 +08:00
parent 5c3335fab3
commit e6bfc181de
44 changed files with 349 additions and 216 deletions

View File

@@ -1,6 +1,7 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.devtools.ksp' version '1.6.10-1.0.2'
}
android {
@@ -32,12 +33,16 @@ android {
}
dependencies {
// Used 82 API Version
compileOnly 'de.robv.android.xposed:api:82'
// Implementation API
implementation project(':yukihookapi')
ksp project(':yukihookapi-ksp-xposed')
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation project(path: ':yukihookapi')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

View File

@@ -0,0 +1 @@
com.highcapable.yukihookapi.demo.InjectTest_YukiHookXposedInit

View File

@@ -36,6 +36,7 @@ import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker
import com.highcapable.yukihookapi.hook.type.BundleClass
import com.highcapable.yukihookapi.hook.type.StringType
// for test
class MainHooker : YukiBaseHooker() {
override fun onHook() =

View File

@@ -35,6 +35,8 @@ import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
import com.highcapable.yukihookapi.demo.BuildConfig
import com.highcapable.yukihookapi.demo.InjectTest
import com.highcapable.yukihookapi.demo.MainActivity
import com.highcapable.yukihookapi.demo.hook.MainHooker
import com.highcapable.yukihookapi.demo.hook.SecondHooker
import com.highcapable.yukihookapi.hook.factory.encase
import com.highcapable.yukihookapi.hook.factory.findMethod
import com.highcapable.yukihookapi.hook.proxy.YukiHookXposedInitProxy
@@ -48,7 +50,7 @@ class MainInjecter : YukiHookXposedInitProxy {
override fun onHook() {
// 方案 1
// encase(BuildConfig.APPLICATION_ID, MainHooker(), SecondHooker())
encase(MainHooker(), SecondHooker())
// 方案 2
encase(BuildConfig.APPLICATION_ID) {
loadApp(name = BuildConfig.APPLICATION_ID) {