-
Notifications
You must be signed in to change notification settings - Fork 2
UI焕新,修复各种bug #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI焕新,修复各种bug #9
Changes from all commits
8c7fdf8
6d5fd71
58342b5
e5c2546
ab4a009
76386db
4a626b9
7df3975
8285d34
644ce49
9218040
051d362
7c15067
99a11bc
9ef7749
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,79 +1,127 @@ | ||
| import java.util.Properties | ||
|
|
||
| plugins { | ||
| id("com.android.application") | ||
| kotlin("android") | ||
| } | ||
|
|
||
| val keystorePropertiesFile = rootProject.file("keystore.properties") | ||
| val keystoreProperties = Properties().apply { | ||
| if (keystorePropertiesFile.exists()) { | ||
| keystorePropertiesFile.inputStream().use { load(it) } | ||
| } | ||
| } | ||
|
|
||
| android { | ||
| namespace = "io.github.recloudstudio.sleepyxposed" | ||
| compileSdk = 34 | ||
|
|
||
| import java.util.Properties | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
|
||
| plugins { | ||
| id("com.android.application") | ||
| kotlin("android") | ||
| id("org.jetbrains.kotlin.plugin.compose") | ||
| } | ||
|
|
||
| val keystorePropertiesFile = rootProject.file("keystore.properties") | ||
| val keystoreProperties = Properties().apply { | ||
| if (keystorePropertiesFile.exists()) { | ||
| keystorePropertiesFile.inputStream().use { load(it) } | ||
| } | ||
| } | ||
|
|
||
| android { | ||
| namespace = "io.github.recloudstudio.sleepyxposed" | ||
| compileSdk = 36 | ||
|
|
||
| defaultConfig { | ||
| applicationId = "io.github.recloudstudio.sleepyxposed" | ||
| minSdk = 24 | ||
| targetSdk = 34 | ||
| versionCode = 2 | ||
| targetSdk = 35 | ||
| versionCode = 2 | ||
| versionName = "2.0" | ||
| buildConfigField("int", "XPOSED_API", "101") | ||
| buildConfigField("String", "MODULE_CHANNEL", "\"release\"") | ||
|
|
||
| // Phones only — drop x86 emulator ABIs from the APK | ||
| ndk { | ||
| abiFilters += listOf("armeabi-v7a", "arm64-v8a") | ||
| } | ||
| } | ||
|
|
||
| signingConfigs { | ||
| if (keystorePropertiesFile.exists()) { | ||
| create("release") { | ||
| storeFile = rootProject.file(keystoreProperties["storeFile"] as String) | ||
| storePassword = keystoreProperties["storePassword"] as String | ||
| keyAlias = keystoreProperties["keyAlias"] as String | ||
| keyPassword = keystoreProperties["keyPassword"] as String | ||
| } | ||
| } | ||
| } | ||
| signingConfigs { | ||
| if (keystorePropertiesFile.exists()) { | ||
| create("release") { | ||
| storeFile = rootProject.file(keystoreProperties["storeFile"] as String) | ||
| storePassword = keystoreProperties["storePassword"] as String | ||
| keyAlias = keystoreProperties["keyAlias"] as String | ||
| keyPassword = keystoreProperties["keyPassword"] as String | ||
| } | ||
| } | ||
| } | ||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = false | ||
| if (keystorePropertiesFile.exists()) { | ||
| signingConfig = signingConfigs.getByName("release") | ||
| } | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro" | ||
| ) | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
| kotlinOptions { | ||
| jvmTarget = "1.8" | ||
|
|
||
| buildTypes { | ||
| debug { | ||
| // Still shrink so debug APKs used for sideload stay small/fast. | ||
| isMinifyEnabled = true | ||
| isShrinkResources = true | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro" | ||
| ) | ||
| } | ||
| release { | ||
| isMinifyEnabled = true | ||
| isShrinkResources = true | ||
| if (keystorePropertiesFile.exists()) { | ||
| signingConfig = signingConfigs.getByName("release") | ||
| } | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| buildFeatures { | ||
| compose = true | ||
| buildConfig = true | ||
| } | ||
|
|
||
| packaging { | ||
| resources { | ||
| merges += "META-INF/xposed/*" | ||
| excludes += | ||
| setOf( | ||
| "/META-INF/{AL2.0,LGPL2.1}", | ||
| "META-INF/*.kotlin_module", | ||
| "META-INF/*.version", | ||
| "META-INF/LICENSE*", | ||
| "META-INF/NOTICE*", | ||
| "DebugProbesKt.bin", | ||
| "kotlin-tooling-metadata.json" | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation("androidx.core:core-ktx:1.12.0") | ||
| implementation("androidx.appcompat:appcompat:1.6.1") | ||
| implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0") | ||
| implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1") | ||
|
|
||
| implementation("com.squareup.okhttp3:okhttp:4.12.0") | ||
|
|
||
| compileOnly("io.github.libxposed:api:101.0.1") | ||
|
|
||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget.set(JvmTarget.JVM_17) | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| val composeBom = platform("androidx.compose:compose-bom:2025.02.00") | ||
| implementation(composeBom) | ||
|
|
||
| implementation("androidx.core:core-ktx:1.15.0") | ||
| implementation("androidx.activity:activity-compose:1.9.3") | ||
| // Prefer lighter lifecycle API used via ProcessLifecycle / Activity — compose helper is tiny | ||
| implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7") | ||
|
|
||
| implementation("androidx.compose.ui:ui") | ||
| implementation("androidx.compose.foundation:foundation") | ||
| implementation("androidx.compose.runtime:runtime") | ||
| implementation("androidx.compose.material3:material3") | ||
| // IMPORTANT: do NOT add material-icons-extended (tens of MB of icon vectors in DEX) | ||
|
|
||
| implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0") | ||
| implementation("com.squareup.okhttp3:okhttp:4.12.0") | ||
|
|
||
| compileOnly("io.github.libxposed:api:101.0.1") | ||
| compileOnly("de.robv.android.xposed:api:82") | ||
|
|
||
| testImplementation("junit:junit:4.13.2") | ||
| } | ||
|
|
||
| debugImplementation("androidx.compose.ui:ui-tooling") | ||
| debugImplementation("androidx.compose.ui:ui-tooling-preview") | ||
| testImplementation("junit:junit:4.13.2") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,38 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
|
|
||
| # Keep Xposed API | ||
| -keep class de.robv.android.xposed.** { *; } | ||
|
|
||
| # Keep our module class | ||
| -keep class io.github.recloudstudio.sleepyxposed.** { *; } | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile | ||
| # ---- SleepyXposed R8 rules ---- | ||
| # Do NOT keep the whole app package; that prevents shrinking Compose / Material. | ||
|
|
||
| # libxposed / legacy Xposed entry (compileOnly — names kept for runtime) | ||
| -keep class io.github.recloudstudio.sleepyxposed.ModuleMain { *; } | ||
| -keep class * extends io.github.libxposed.api.XposedModule { *; } | ||
|
|
||
|
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 3 \
'ModuleMain|XposedProbe|XposedModule|xposed_init' \
app/src app/proguard-rules.pro || true
rg -n -C 3 \
'android:name="[^"]*(MainActivity|ConfigContentProvider|MediaListenerService)' \
app/src || trueRepository: ReCloudStudio/SleepyXposed Length of output: 9128 🏁 Script executed: set -euo pipefail
printf '%s\n' '== APK and build artifacts =='
find . -type f \( -iname '*.apk' -o -iname '*.aab' \) -print
printf '%s\n' '== Xposed-related declarations and release configuration =='
rg -n -C 4 \
'java_init\.list|xposed_init|ModuleMain|XposedModule|XposedProbe|proguardFiles|minifyEnabled|shrinkResources|release' \
app build.gradle* settings.gradle* gradle.properties 2>/dev/null || true
printf '%s\n' '== Resource and manifest files =='
git ls-files 'app/src/main/resources/**' 'app/src/main/AndroidManifest.xml' 'app/proguard-rules.pro'Repository: ReCloudStudio/SleepyXposed Length of output: 11774 🏁 Script executed: set -euo pipefail
printf '%s\n' '== Xposed metadata =='
for f in app/src/main/resources/META-INF/xposed/java_init.list \
app/src/main/resources/META-INF/xposed/module.prop \
app/src/main/resources/META-INF/xposed/scope.list; do
echo "--- $f"
cat -n "$f"
done
printf '%s\n' '== Manifest =='
cat -n app/src/main/AndroidManifest.xml
printf '%s\n' '== All Xposed declarations in tracked files =='
git grep -n -E 'java_init|xposed_init|XposedModule|ModuleMain|XposedProbe|META-INF/xposed|xposed' -- \
':!*.md' ':!*.lock' || trueRepository: ReCloudStudio/SleepyXposed Length of output: 16113 🏁 Script executed: set -euo pipefail
printf '%s\n' '== ProGuard rules =='
cat -n app/proguard-rules.pro
printf '%s\n' '== Legacy Xposed entry =='
cat -n app/src/main/java/io/github/recloudstudio/sleepyxposed/LegacyEntry.kt
printf '%s\n' '== Resource packaging configuration =='
sed -n '70,90p' app/build.gradle.kts
printf '%s\n' '== LegacyEntry keep coverage =='
rg -n -C 2 \
'LegacyEntry|IXposedHookLoadPackage|implements| -keep' \
app/proguard-rules.pro app/src/main/java app/src/main/resources app/src/main/assets || trueRepository: ReCloudStudio/SleepyXposed Length of output: 5082 保留
🤖 Prompt for AI Agents |
||
| # Components declared in the manifest | ||
| -keep class io.github.recloudstudio.sleepyxposed.MainActivity { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.ConfigContentProvider { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.MediaListenerService { *; } | ||
|
|
||
| # Optional hook target for LSPosed (must keep signature) | ||
| -keep class io.github.recloudstudio.sleepyxposed.XposedProbe { | ||
| public static boolean isModuleActive(); | ||
| } | ||
|
|
||
| # Config model used across processes / JSON | ||
| -keepclassmembers class io.github.recloudstudio.sleepyxposed.SleepyConfig { *; } | ||
| -keepclassmembers class io.github.recloudstudio.sleepyxposed.MediaMethod { *; } | ||
|
|
||
| # Hook / system-server logic must not be stripped (reflection + Xposed) | ||
| -keep class io.github.recloudstudio.sleepyxposed.ConfigManager { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.ForegroundAppMonitor { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.MediaStatusMonitor { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.SleepyApiClient { *; } | ||
| -keep class io.github.recloudstudio.sleepyxposed.RomDetector { *; } | ||
|
|
||
| # Reflection in ConfigManager (XSharedPreferences) | ||
| -dontwarn de.robv.android.xposed.** | ||
| -dontwarn io.github.libxposed.** | ||
|
|
||
| # Compose / Kotlin | ||
| -dontwarn org.jetbrains.annotations.** | ||
|
|
||
| # Keep line numbers for crash logs (small cost) | ||
| -keepattributes SourceFile,LineNumberTable | ||
| -renamesourcefileattribute SourceFile | ||
Uh oh!
There was an error while loading. Please reload this page.