mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
更改隐藏 HD 实现方法
* 以及压缩 dex
This commit is contained in:
@@ -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'
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user