diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 729f103..1775f39 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") + id("com.google.devtools.ksp") } android { @@ -27,11 +28,17 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" + freeCompilerArgs = listOf("-Xno-param-assertions", + "-Xno-call-assertions", + "-Xno-receiver-assertions") + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.0" } } @@ -40,7 +47,15 @@ dependencies { implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.appcompat:appcompat:1.6.1") implementation("com.google.android.material:material:1.8.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.4") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + + // 基础依赖 + implementation("com.highcapable.yukihookapi:api:1.1.11") + // ❗作为 Xposed 模块使用务必添加,其它情况可选 + compileOnly("de.robv.android.xposed:api:82") + // ❗作为 Xposed 模块使用务必添加,其它情况可选 + ksp("com.highcapable.yukihookapi:ksp-xposed:1.1.11") } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 38b14a8..d9128d6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,8 @@ + + + tools:targetApi="31"> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/dev/coderpwh/fuck/MainActivity.kt b/app/src/main/java/dev/coderpwh/fuck/MainActivity.kt new file mode 100644 index 0000000..24aad82 --- /dev/null +++ b/app/src/main/java/dev/coderpwh/fuck/MainActivity.kt @@ -0,0 +1,11 @@ +package dev.coderpwh.fuck + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + } +} \ No newline at end of file diff --git a/app/src/main/java/dev/coderpwh/fuck/hook/HookEntry.kt b/app/src/main/java/dev/coderpwh/fuck/hook/HookEntry.kt new file mode 100644 index 0000000..dea0d4f --- /dev/null +++ b/app/src/main/java/dev/coderpwh/fuck/hook/HookEntry.kt @@ -0,0 +1,27 @@ +package dev.coderpwh.fuck.hook + +import android.hardware.SensorManager +import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed +import com.highcapable.yukihookapi.hook.factory.configs +import com.highcapable.yukihookapi.hook.factory.encase +import com.highcapable.yukihookapi.hook.xposed.proxy.IYukiHookXposedInit + +@InjectYukiHookWithXposed(modulePackageName = "dev.coderpwh.fuck.hook") +object HookEntry:IYukiHookXposedInit { + + override fun onInit() = configs { + isDebug = false + } + + override fun onHook() = encase { + SensorManager::class.java.hook { + injectMember { + method { + name = "registerListener" + paramCount = 3 + } + replaceToTrue() + } + } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..0b15a20 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 6d9d338..bbf98bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,4 +2,5 @@ plugins { id("com.android.application") version "8.1.1" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false + id("com.google.devtools.ksp") version "1.9.0-1.0.11" apply false } \ No newline at end of file