更改隐藏 HD 实现方法

* 以及压缩 dex
This commit is contained in:
YuKongA
2022-02-18 16:00:10 +08:00
parent 1d917f607d
commit be4e4a0414
2 changed files with 21 additions and 9 deletions

View File

@@ -29,6 +29,11 @@ android {
buildFeatures {
viewBinding true
}
packagingOptions {
dex {
useLegacyPackaging true
}
}
android.applicationVariants.all {
variant ->
variant.outputs.all {
@@ -39,6 +44,6 @@ android {
dependencies {
compileOnly 'de.robv.android.xposed:api:82'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'com.google.android.material:material:1.5.0'
}

View File

@@ -6,6 +6,8 @@ import android.content.Intent
import android.os.Handler
import android.provider.Settings
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.lt2333.simplicitytools.BuildConfig
import de.robv.android.xposed.*
@@ -261,33 +263,38 @@ class SystemUI : IXposedHookLoadPackage {
//隐藏HD
try {
val classIfExists = XposedHelpers.findClassIfExists(
"com.android.systemui.statusbar.policy.MobileSignalController",
"com.android.systemui.statusbar.StatusBarMobileView",
lpparam.classLoader
)
XposedHelpers.findAndHookMethod(
classIfExists,
"setVolte", Boolean::class.java,
"initViewState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
override fun afterHookedMethod(param: MethodHookParam) {
if (prefs.hasFileChanged()) {
prefs.reload()
}
if (prefs.getBoolean("hide_hd_icon", false)) {
param.args[0] = false
val smallHd = XposedHelpers.getObjectField(param.thisObject, "mSmallHd") as ImageView
val bigHd = XposedHelpers.getObjectField(param.thisObject, "mVolte") as ImageView
smallHd.visibility = View.GONE
bigHd.visibility = View.GONE
}
}
})
XposedHelpers.findAndHookMethod(
classIfExists,
"updateVoiceIcon",
"updateState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
override fun afterHookedMethod(param: MethodHookParam) {
if (prefs.hasFileChanged()) {
prefs.reload()
}
if (prefs.getBoolean("hide_hd_icon", false)) {
param.result = null
val smallHd = XposedHelpers.getObjectField(param.thisObject, "mSmallHd") as ImageView
val bigHd = XposedHelpers.getObjectField(param.thisObject, "mVolte") as ImageView
smallHd.visibility = View.GONE
bigHd.visibility = View.GONE
}
}
})