mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
@@ -29,6 +29,11 @@ android {
|
|||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
}
|
}
|
||||||
|
packagingOptions {
|
||||||
|
dex {
|
||||||
|
useLegacyPackaging true
|
||||||
|
}
|
||||||
|
}
|
||||||
android.applicationVariants.all {
|
android.applicationVariants.all {
|
||||||
variant ->
|
variant ->
|
||||||
variant.outputs.all {
|
variant.outputs.all {
|
||||||
@@ -39,6 +44,6 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
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'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@ import android.content.Intent
|
|||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
import com.lt2333.simplicitytools.BuildConfig
|
||||||
import de.robv.android.xposed.*
|
import de.robv.android.xposed.*
|
||||||
@@ -261,33 +263,38 @@ class SystemUI : IXposedHookLoadPackage {
|
|||||||
//隐藏HD
|
//隐藏HD
|
||||||
try {
|
try {
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.android.systemui.statusbar.policy.MobileSignalController",
|
"com.android.systemui.statusbar.StatusBarMobileView",
|
||||||
lpparam.classLoader
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
"setVolte", Boolean::class.java,
|
"initViewState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun beforeHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
if (prefs.hasFileChanged()) {
|
if (prefs.hasFileChanged()) {
|
||||||
prefs.reload()
|
prefs.reload()
|
||||||
}
|
}
|
||||||
if (prefs.getBoolean("hide_hd_icon", false)) {
|
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(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
"updateVoiceIcon",
|
"updateState","com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun beforeHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
if (prefs.hasFileChanged()) {
|
if (prefs.hasFileChanged()) {
|
||||||
prefs.reload()
|
prefs.reload()
|
||||||
}
|
}
|
||||||
if (prefs.getBoolean("hide_hd_icon", false)) {
|
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