diff --git a/app/build.gradle b/app/build.gradle index 5952d86..4f96d76 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,9 +15,9 @@ android { //targetSdkVersion compileSdkVersion targetSdkVersion 30 // 版本号:发布日期 - versionCode 20210529 + versionCode 20210530 // 版本名说明: R3.x.y.z (R3:Refactoring 第三次重构,z:Quick Fix序号) - versionName 'R3.8.6.2' + versionName 'R3.8.7' resConfigs "en", "zh-rCN" buildConfigField 'String', 'BUILD_TIME', '\"' + new Date() + '\"' @@ -100,16 +100,17 @@ dependencies { implementation "dev.rikka.shizuku:api:$shizuku_version" implementation "dev.rikka.shizuku:provider:$shizuku_version" - implementation 'github.ryuunoakaihitomi.poweract:poweract:1.4.4' + implementation 'github.ryuunoakaihitomi.poweract:poweract:1.4.5' implementation 'github.ryuunoakaihitomi.retoast:retoast:1.4.1' implementation 'com.github.GrenderG:Toasty:1.5.0' implementation 'com.github.topjohnwu.libsu:core:3.1.2' implementation 'commons-io:commons-io:2.8.0' + implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.drakeet.about:about:2.4.1' implementation 'com.google.zxing:core:3.4.1' implementation 'org.cyanogenmod:platform.sdk:5.0.1' - implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:1.1' + implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:2.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7' debugImplementation 'com.github.whataa:pandora:androidx_v2.1.0' } diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/MyApplication.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/MyApplication.kt index 5cbe87d..48be4ca 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/MyApplication.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/MyApplication.kt @@ -19,7 +19,7 @@ class MyApplication : Application() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { println("Happy hacking!") // println不会触发Timber的lint - val result = HiddenApiBypass.setHiddenApiExemptions("L") + val result = HiddenApiBypass.addHiddenApiExemptions("L") println("HiddenApiBypass success: $result") ShutdownReceiver.register(this) diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/OpenSourceLibDependencyActivity.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/OpenSourceLibDependencyActivity.kt index 616bfe8..bcccefd 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/OpenSourceLibDependencyActivity.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/OpenSourceLibDependencyActivity.kt @@ -42,6 +42,7 @@ class OpenSourceLibDependencyActivity : AbsAboutActivity() { L("Markwon", "Dimitry Ivanov", AL2, "https://noties.io/Markwon"), L("about-page", "Drakeet", AL2, ghl("PureWriter", "about-page")), L("Commons IO", "Apache", AL2, "http://commons.apache.org/proper/commons-io"), + L("Commons Lang", "Apache", AL2, "https://commons.apache.org/proper/commons-lang"), L("Timber", "Jake Wharton", AL2, ghl("JakeWharton", "timber")), L("ZXing", "Google LLC", AL2, ghl("zxing")), ) diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/MainActivity.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/MainActivity.kt index 9e1af98..69d4fc0 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/MainActivity.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/MainActivity.kt @@ -342,7 +342,6 @@ private fun View.hideSysUi() = apply { // 作用同ui flag的immersive systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE } - } else { @Suppress("DEPRECATION") // 假阳性 systemUiVisibility = diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/util/BlackMagic.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/util/BlackMagic.kt index d3ed234..0002c5f 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/util/BlackMagic.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/util/BlackMagic.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.app.AlertDialog import android.app.Application import android.widget.TextView +import org.apache.commons.lang3.reflect.FieldUtils import java.lang.Class as C object BlackMagic { @@ -18,7 +19,8 @@ object BlackMagic { val mAlert = AlertDialog::class.java.getDeclaredField("mAlert") mAlert.isAccessible = true val mAlertController = mAlert[alertDialog] - val mMessageView = mAlertController.javaClass.getDeclaredField("mMessageView") + // 为Wear OS中使用的MicroAlertController做适配 + val mMessageView = FieldUtils.getField(mAlertController.javaClass, "mMessageView", true) mMessageView.isAccessible = true return mMessageView[mAlertController] as TextView }