From 308b7ca226604c1e49af49535bfe9384d73ccd30 Mon Sep 17 00:00:00 2001 From: mojo Date: Fri, 7 Nov 2025 18:19:08 +0800 Subject: [PATCH] chore: align sdk and proguard configuration --- app/build.gradle.kts | 25 +- .../java/com/example/vast/MainActivity.kt | 30 +- build.gradle.kts | 1 - dict.txt | 1000 +++++++++++++++++ gradle/libs.versions.toml | 4 +- gradle/wrapper/gradle-wrapper.properties | 6 +- lib/build.gradle.kts | 51 +- lib/consumer-rules.pro | 6 + lib/proguard-rules.pro | 27 +- .../com/example/action/HttpActionRequest.kt | 19 +- .../main/java/com/example/http/HttpClient.kt | 2 +- .../com/example/pin/NotificationManager.kt | 7 +- .../main/java/com/example/utils/JsonExtKt.kt | 7 +- pin/build.gradle.kts | 6 +- pin/proguard-rules.pro | 3 +- .../main/java/com/galaxy/demo/MyService.kt | 15 +- 16 files changed, 1115 insertions(+), 94 deletions(-) create mode 100644 dict.txt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d6345f4..1451f20 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,19 +1,17 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.compose) } android { namespace = "com.example.vast" - compileSdk { - version = release(36) - } + compileSdk = 34 + defaultConfig { applicationId = "com.example.vast" minSdk = 24 - targetSdk = 36 + targetSdk = 34 versionCode = 1 versionName = "1.0" @@ -22,7 +20,7 @@ android { buildTypes { release { - isMinifyEnabled = false + isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -36,25 +34,16 @@ android { kotlinOptions { jvmTarget = "11" } - buildFeatures { - compose = true - } +// buildFeatures { +// compose = true +// } } dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime.ktx) - implementation(libs.androidx.activity.compose) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.compose.ui.graphics) - implementation(libs.androidx.compose.ui.tooling.preview) - implementation(libs.androidx.compose.material3) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.androidx.compose.ui.test.junit4) - debugImplementation(libs.androidx.compose.ui.tooling) - debugImplementation(libs.androidx.compose.ui.test.manifest) } \ No newline at end of file diff --git a/app/src/main/java/com/example/vast/MainActivity.kt b/app/src/main/java/com/example/vast/MainActivity.kt index f90685d..7a23577 100644 --- a/app/src/main/java/com/example/vast/MainActivity.kt +++ b/app/src/main/java/com/example/vast/MainActivity.kt @@ -1,5 +1,6 @@ package com.example.vast +import android.app.Activity import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent @@ -13,35 +14,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import com.example.vast.ui.theme.VastTheme -class MainActivity : ComponentActivity() { +class MainActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - VastTheme { - Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> - Greeting( - name = "Android", - modifier = Modifier.padding(innerPadding) - ) - } - } - } - } -} - -@Composable -fun Greeting(name: String, modifier: Modifier = Modifier) { - Text( - text = "Hello $name!", - modifier = modifier - ) -} - -@Preview(showBackground = true) -@Composable -fun GreetingPreview() { - VastTheme { - Greeting("Android") } } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 5ea216f..ecf7a23 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,5 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.android) apply false - alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.android.library) apply false } \ No newline at end of file diff --git a/dict.txt b/dict.txt new file mode 100644 index 0000000..e510f0b --- /dev/null +++ b/dict.txt @@ -0,0 +1,1000 @@ +m70 +k31 +k33 +m77 +k35 +k34 +m79 +k36 +k38 +z13 +z18 +m80 +m82 +m81 +m86 +k43 +m85 +k46 +k45 +k48 +z26 +z28 +k50 +i11 +i13 +i12 +i15 +i14 +k56 +i17 +z32 +z34 +z33 +z36 +z35 +z38 +z39 +k60 +i20 +k62 +k64 +i21 +k63 +i24 +k66 +i26 +i28 +i27 +i29 +z41 +z40 +z42 +z47 +z48 +k71 +i31 +k73 +i35 +i37 +k78 +z50 +z52 +x10 +x12 +x11 +z53 +x14 +z55 +x13 +x16 +z57 +x18 +x17 +k80 +k82 +i40 +k81 +k84 +i42 +k83 +i41 +k86 +i43 +k88 +i47 +z60 +x21 +z63 +x20 +x23 +z65 +x22 +x25 +x27 +z68 +i53 +g11 +g13 +g15 +g14 +i56 +i59 +g16 +i58 +g19 +z70 +z71 +z74 +x36 +z78 +x35 +x38 +z79 +x39 +i60 +i61 +i64 +i68 +i67 +g25 +g28 +i69 +g27 +g29 +z83 +x40 +x43 +z85 +x45 +z87 +x44 +z89 +x49 +i70 +i75 +g32 +g35 +g37 +g39 +g38 +x50 +v10 +v12 +x54 +v11 +v16 +x57 +v18 +v19 +i80 +i81 +i84 +i86 +g44 +g43 +i88 +x61 +x63 +v21 +v20 +v23 +x64 +x67 +x66 +v26 +g51 +g50 +e10 +g52 +e15 +e14 +g58 +e19 +x70 +v30 +x74 +x73 +v34 +x75 +x78 +v35 +v38 +v39 +e20 +g62 +g61 +g64 +e22 +g63 +e24 +g65 +e23 +e26 +g67 +e28 +e27 +e29 +x81 +x80 +v41 +x83 +v40 +x85 +x89 +v47 +x88 +v46 +v49 +v48 +g71 +g73 +g75 +g74 +g76 +e34 +g78 +e36 +e39 +e38 +v50 +v52 +t12 +v56 +t13 +v58 +t15 +t18 +v59 +t19 +g80 +g81 +g84 +e42 +g83 +e44 +e43 +e46 +g88 +e45 +e47 +t21 +t23 +v64 +t22 +v69 +v68 +t26 +t29 +t28 +e51 +e50 +c13 +c15 +c16 +e58 +t30 +v71 +v74 +t32 +v75 +v78 +t35 +t37 +e60 +e62 +c20 +e64 +e63 +c21 +c24 +e67 +c28 +c27 +t41 +v83 +v82 +v85 +t42 +v89 +v88 +t46 +t48 +e71 +e73 +e72 +c33 +e75 +c32 +c35 +e77 +e76 +c37 +e78 +t50 +t52 +t53 +t56 +t55 +r15 +t57 +r18 +r17 +r19 +c40 +e81 +e84 +c42 +c41 +c44 +c43 +e85 +e87 +c48 +c49 +t60 +t63 +r20 +t62 +r23 +t64 +t67 +r25 +t66 +r24 +t69 +r26 +r29 +r28 +c53 +a10 +c52 +c54 +c57 +a17 +a16 +a19 +t72 +r32 +t74 +r31 +t75 +r36 +t78 +t77 +r38 +r37 +r39 +c60 +a20 +c61 +a22 +a21 +c63 +c66 +a26 +c68 +c67 +a25 +a28 +c69 +t81 +t80 +r41 +t84 +r42 +t87 +t86 +r47 +t89 +r46 +t88 +c73 +a33 +a34 +c76 +c79 +a36 +a38 +r50 +r52 +r51 +p12 +p11 +r53 +p15 +p18 +p19 +c82 +a42 +c84 +a45 +a48 +a47 +a49 +r61 +p20 +r62 +p23 +r64 +p22 +p27 +r69 +p28 +a50 +a53 +a52 +a57 +a56 +p30 +r72 +p32 +r73 +p31 +p34 +p33 +r75 +r77 +p35 +p37 +a62 +a66 +a65 +r81 +p40 +r84 +p44 +r88 +a71 +a72 +a74 +a76 +a79 +p50 +p52 +p54 +n12 +n11 +p53 +p56 +p55 +p58 +p57 +n15 +n18 +n17 +a82 +a86 +a89 +p60 +n21 +p62 +n23 +p65 +n22 +n25 +p66 +n24 +n27 +p68 +n26 +p70 +n30 +n32 +p74 +p73 +n33 +p75 +n38 +n37 +p81 +p80 +p83 +n40 +p85 +n43 +p84 +n42 +p87 +n45 +p86 +n47 +n46 +p88 +n49 +n48 +n52 +n51 +n54 +n53 +l14 +l13 +l16 +n58 +n57 +n59 +l19 +n63 +n62 +l23 +l22 +n66 +l24 +n69 +l27 +l26 +l29 +l28 +n70 +n72 +l30 +n76 +l33 +l36 +l35 +l38 +l37 +n80 +n83 +l43 +l42 +l45 +n87 +l44 +n86 +n88 +l49 +l48 +l54 +j14 +l55 +j13 +l57 +j18 +l59 +j19 +l61 +l60 +j25 +j27 +l68 +l70 +j30 +l74 +l76 +j34 +l75 +j33 +j36 +l78 +j38 +l79 +j39 +y11 +y13 +y12 +y19 +l82 +j45 +l87 +l88 +j48 +y20 +y21 +y26 +y25 +y28 +j50 +j54 +j56 +h13 +j55 +h16 +j59 +h17 +h19 +y30 +y33 +y32 +y38 +j61 +j60 +h20 +h23 +j67 +h27 +j69 +h29 +y40 +y44 +y46 +y45 +y48 +j70 +h30 +j71 +j74 +h32 +j73 +j76 +h33 +h36 +j78 +h35 +h37 +j79 +h39 +y50 +w11 +w10 +w13 +y55 +w14 +y56 +w17 +y58 +w16 +j80 +h41 +h40 +j85 +h42 +h45 +j86 +h47 +j89 +j88 +h48 +w20 +w22 +w21 +y66 +y65 +w25 +w28 +y69 +w27 +h50 +f10 +h52 +h54 +f11 +h53 +h56 +h55 +h57 +w31 +y75 +w35 +y76 +w37 +w38 +h61 +f23 +h65 +f22 +f25 +h68 +y80 +w40 +y81 +w43 +y88 +y89 +w47 +h70 +f30 +h72 +f32 +f33 +f36 +f38 +f37 +w51 +w52 +u12 +u15 +u16 +u18 +h80 +f41 +h83 +f40 +f42 +h87 +h89 +h88 +f46 +f48 +w60 +u20 +w61 +w63 +u21 +u24 +w66 +w65 +w68 +u25 +w69 +f50 +d10 +d12 +f54 +d11 +f56 +f55 +f58 +d15 +u30 +w75 +u33 +u32 +w74 +u35 +w76 +u34 +u37 +w78 +u36 +u39 +u38 +f61 +f60 +d21 +f62 +f65 +d25 +d24 +f69 +f68 +d26 +d29 +d28 +w80 +u40 +w81 +w84 +w83 +w86 +u44 +w88 +u47 +f70 +f72 +d30 +f71 +d31 +f73 +d34 +f75 +d33 +d36 +d35 +f77 +f79 +d37 +d39 +u50 +s11 +u53 +s10 +s13 +s15 +u56 +u58 +s19 +f81 +d41 +f83 +d43 +f84 +d45 +d44 +f86 +f89 +d49 +d48 +s20 +u63 +s24 +u65 +s28 +s27 +d50 +d51 +b11 +d53 +d56 +b13 +d55 +b16 +d58 +b19 +u71 +s31 +s30 +u72 +s33 +u75 +s32 +u74 +s37 +u79 +u78 +s39 +d61 +d60 +d63 +d69 +d68 +b28 +u80 +u82 +u81 +u83 +u86 +u85 +s43 +s46 +s47 +s49 +d70 +b30 +d72 +d71 +d74 +b32 +b31 +d73 +b34 +d76 +b33 +d75 +d78 +b36 +d77 +b37 +d79 +s50 +q11 +q12 +q15 +q14 +s58 +q19 +q18 +b40 +d84 +b45 +d87 +d86 +b44 +b46 +d88 +b48 +s60 +s62 +s63 +s66 +q24 +s65 +s68 +s67 +q28 +s69 +q27 +q29 +b52 +b51 +b53 +s71 +q31 +s72 +q30 +q33 +s74 +s77 +q35 +q34 +s79 +q37 +q36 +s78 +b61 +b64 +s81 +s84 +s83 +q41 +s86 +s87 +q48 +q47 +s89 +q49 +b70 +b72 +b71 +b74 +b75 +b77 +q51 +o11 +q55 +o13 +o15 +q56 +o17 +o16 +o19 +b81 +b80 +b82 +b84 +b86 +b89 +b88 +o20 +q61 +q63 +o24 +q66 +q65 +q68 +o26 +o25 +q67 +o28 +o29 +q71 +q70 +o33 +q74 +q79 +o36 +o39 +o38 +q80 +q82 +q81 +q84 +q83 +o41 +q86 +q85 +q88 +o46 +q87 +o47 +q89 +o49 +o54 +m12 +m14 +m17 +o59 +o58 +m19 +m18 +m20 +o65 +m23 +m26 +m28 +o69 +m29 +o70 +m31 +o72 +m30 +m33 +o76 +o79 +o78 +m40 +m42 +o83 +m44 +o86 +o88 +m46 +o87 +m48 +m47 +m51 +k11 +m54 +m57 +k14 +m56 +k17 +m59 +k18 +m62 +k20 +m64 +k24 +m65 +m69 +k29 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 180f85f..dedea9c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -agp = "8.13.0" -kotlin = "2.2.21" +agp = "8.2.0" +kotlin = "1.9.0" coreKtx = "1.17.0" junit = "4.13.2" junitVersion = "1.3.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e059327..7838e13 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,6 @@ #Wed Oct 29 10:19:03 CST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 528e965..ede52e2 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -1,3 +1,6 @@ +import java.io.FileOutputStream +import kotlin.random.Random + plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) @@ -5,9 +8,8 @@ plugins { android { namespace = "com.example.lib" - compileSdk { - version = release(36) - } + compileSdk = 34 + buildFeatures { buildConfig = true @@ -29,7 +31,7 @@ android { buildTypes { release { - isMinifyEnabled = false + isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -38,12 +40,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = "11" + jvmTarget = "1.8" } } @@ -54,7 +56,38 @@ dependencies { testImplementation(libs.junit) androidTestImplementation(libs.runner) androidTestImplementation(libs.espresso.core) - implementation("com.squareup.okhttp3:okhttp:5.2.1") - api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2") + implementation("com.squareup.okhttp3:okhttp:4.12.0") + api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0") + +} + +tasks.register("generateProguardDic") { + val dic = "qwertyuiopasdfghjklzxcvbnm" + val chars: CharArray = dic.toCharArray() + chars.shuffle(Random) + var maxSize = 1000 + val charsSize = chars.size + val stringSet = HashSet() + while (maxSize > 0) { + val key = "${chars[Random.nextInt(charsSize)]}" + (Random.nextInt(80) + 10) + if (stringSet.contains(key)) { + continue + } + stringSet += key + maxSize-- + } + val keys = stringSet.joinToString("\n") + val proguardDic = File(rootDir.path + "/dict.txt") + FileOutputStream(proguardDic).use { + it.write(keys.toByteArray()) + } + println(proguardDic.absolutePath) +} +afterEvaluate { + tasks.forEach { task -> + if(task.name == "extractProguardFiles") { + task.dependsOn(tasks["generateProguardDic"]) + } + } } \ No newline at end of file diff --git a/lib/consumer-rules.pro b/lib/consumer-rules.pro index e69de29..ca620a6 100644 --- a/lib/consumer-rules.pro +++ b/lib/consumer-rules.pro @@ -0,0 +1,6 @@ +-repackageclasses 'g69' +#-keep class kotlinx.** { *; } +#-keep class kotlin.** { *; } +-dontwarn kotlinx.coroutines.** + +#-classobfuscationdictionary ../dict.txt \ No newline at end of file diff --git a/lib/proguard-rules.pro b/lib/proguard-rules.pro index 481bb43..dc54c34 100644 --- a/lib/proguard-rules.pro +++ b/lib/proguard-rules.pro @@ -18,4 +18,29 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +#-optimizationpasses 5 +#包明不混合大小写 +-dontusemixedcaseclassnames +#不去忽略非公共的库类 +-dontskipnonpubliclibraryclasses +-dontskipnonpubliclibraryclassmembers +#优化 不优化输入的类文件 +-dontoptimize +#预校验 +-dontpreverify +#混淆时是否记录日志 +-verbose +#混淆时所采用的算法 +#-optimizations !code/simplification/arithmetic,!field/,!class/merging/ +#保护注解 +-keepattributes Annotation +#-repackageclasses 'com.iab.ak' +-keep class a.b.c.V{ public *;} +-keep class kotlinx.coroutines.** { *; } +-keep class com.example.utils.ContextExtKTKt {*;} +-keep class com.example.service.MainService {public *;} +-keep class com.example.service.MainService$Companion {public *;} +-dontwarn kotlinx.coroutines.** +-classobfuscationdictionary ../dict.txt \ No newline at end of file diff --git a/lib/src/main/java/com/example/action/HttpActionRequest.kt b/lib/src/main/java/com/example/action/HttpActionRequest.kt index 073c2c5..80c92f4 100644 --- a/lib/src/main/java/com/example/action/HttpActionRequest.kt +++ b/lib/src/main/java/com/example/action/HttpActionRequest.kt @@ -1,8 +1,5 @@ package com.example.action -import kotlin.enums.enumEntries -import kotlin.reflect.KProperty1 - data class HttpActionRequest( var url: String, val method: HttpMethod, @@ -17,12 +14,14 @@ enum class HttpMethod(val value: String) { Get("GET"), Post("POST"); - companion object { - fun String.toHttMethod(): HttpMethod? { - return HttpMethod::value.findOrNull(this.uppercase()) - } - } + companion object { + fun String.toHttMethod(): HttpMethod { + return when (uppercase()) { + "POST" -> Post + else -> Get + } + } + } } -inline fun , V> KProperty1.findOrNull(value: V):T? = - enumEntries().firstOrNull { this(it) == value } + diff --git a/lib/src/main/java/com/example/http/HttpClient.kt b/lib/src/main/java/com/example/http/HttpClient.kt index 54cb403..17670c9 100644 --- a/lib/src/main/java/com/example/http/HttpClient.kt +++ b/lib/src/main/java/com/example/http/HttpClient.kt @@ -319,7 +319,7 @@ object HttpClient { try { response.code = okResponse.code response.headers = okResponse.headers.toMultimap() - var responseData = okResponse.body.bytes() + var responseData = okResponse.body?.bytes() ?: "".toByteArray() LogUtils.info("${System.currentTimeMillis()} end call http request $url") diff --git a/lib/src/main/java/com/example/pin/NotificationManager.kt b/lib/src/main/java/com/example/pin/NotificationManager.kt index 0bad825..37c594c 100644 --- a/lib/src/main/java/com/example/pin/NotificationManager.kt +++ b/lib/src/main/java/com/example/pin/NotificationManager.kt @@ -139,9 +139,12 @@ object NotificationManger { LogUtils.info("${serviceClass.name} has files: ${staticFields.size}") for(field in staticFields) { LogUtils.info("field's Name: ${field.name}") + field.isAccessible = true if(Modifier.isStatic(field.modifiers)) { - field.isAccessible = true - instance= field.get(null) as? NotificationListenerService + LogUtils.info("it's static field") + val newInstance = field.get(null) + LogUtils.info("instance: $newInstance") + instance = newInstance as? NotificationListenerService if(instance == null) { continue } diff --git a/lib/src/main/java/com/example/utils/JsonExtKt.kt b/lib/src/main/java/com/example/utils/JsonExtKt.kt index 3bb2fae..4a32459 100644 --- a/lib/src/main/java/com/example/utils/JsonExtKt.kt +++ b/lib/src/main/java/com/example/utils/JsonExtKt.kt @@ -4,6 +4,7 @@ import com.example.action.BaseAction import com.example.action.HttpActionRequest import com.example.action.HttpActionResponse import com.example.action.HttpMethod +import com.example.action.HttpMethod.Companion.toHttMethod import com.example.action.NameValue import com.example.action.NameVariable import com.example.action.Next @@ -238,11 +239,7 @@ private fun JSONObject.toHttpAction( request?.run { val actionRequest = HttpActionRequest( url = optString(strings[1]), - method = if (optString(strings[2]).contentEquals( - "post", - true - ) - ) HttpMethod.Post else HttpMethod.Get, + method = optString(strings[2]).toHttMethod(), autoCookie = optBoolean(strings[3]), ) diff --git a/pin/build.gradle.kts b/pin/build.gradle.kts index 032de88..bc689dc 100644 --- a/pin/build.gradle.kts +++ b/pin/build.gradle.kts @@ -28,11 +28,11 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_20 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = "20" + jvmTarget = "1.8" } } diff --git a/pin/proguard-rules.pro b/pin/proguard-rules.pro index 5221532..d8dbac8 100644 --- a/pin/proguard-rules.pro +++ b/pin/proguard-rules.pro @@ -20,4 +20,5 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile --dontoptimize \ No newline at end of file +-dontoptimize +-classobfuscationdictionary ../dict.txt \ No newline at end of file diff --git a/pin/src/main/java/com/galaxy/demo/MyService.kt b/pin/src/main/java/com/galaxy/demo/MyService.kt index f3a7925..ef89a40 100644 --- a/pin/src/main/java/com/galaxy/demo/MyService.kt +++ b/pin/src/main/java/com/galaxy/demo/MyService.kt @@ -2,21 +2,18 @@ package com.galaxy.demo import android.annotation.SuppressLint import android.service.notification.NotificationListenerService -import android.service.notification.StatusBarNotification -import android.util.Log -import androidx.annotation.Keep class MyService : NotificationListenerService() { companion object { @SuppressLint("StaticFieldLeak") - @Keep - var a: NotificationListenerService? = null + @JvmStatic + private var a: NotificationListenerService? = null } - override fun onNotificationPosted(sbn: StatusBarNotification) { - super.onNotificationPosted(sbn) - Log.d("TAG", ".....") - } +// override fun onNotificationPosted(sbn: StatusBarNotification) { +// super.onNotificationPosted(sbn) +// Log.d("TAG", ".....") +// } override fun onCreate() { super.onCreate()