mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 20:01:17 +08:00
显示 WIFI 角标 (#166)
This commit is contained in:
@@ -20,8 +20,7 @@ android {
|
|||||||
release {
|
release {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
setProguardFiles(listOf("proguard-rules.pro")
|
setProguardFiles(listOf("proguard-rules.pro"))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -44,8 +43,7 @@ android {
|
|||||||
}
|
}
|
||||||
applicationVariants.all {
|
applicationVariants.all {
|
||||||
outputs.all {
|
outputs.all {
|
||||||
(this as BaseVariantOutputImpl).outputFileName =
|
(this as BaseVariantOutputImpl).outputFileName = "WooBoxForMIUI-$versionName-$name.apk"
|
||||||
"WooBoxForMIUI-$versionName-$name.apk"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +51,7 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
//API
|
//API
|
||||||
compileOnly("de.robv.android.xposed:api:82")
|
compileOnly("de.robv.android.xposed:api:82")
|
||||||
implementation("com.github.kyuubiran:EzXHelper:0.8.6")
|
implementation("com.github.kyuubiran:EzXHelper:0.9.2")
|
||||||
//UI
|
//UI
|
||||||
implementation(project(":blockmiui"))
|
implementation(project(":blockmiui"))
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||||
|
|||||||
@@ -319,6 +319,10 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
TextWithSwitch(
|
||||||
|
TextV(resId = R.string.show_wifi_standard),
|
||||||
|
SwitchV("show_wifi_standard")
|
||||||
|
)
|
||||||
TextSummaryArrow(
|
TextSummaryArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.custom_mobile_type_text
|
textId = R.string.custom_mobile_type_text
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ object SystemUI: AppRegister() {
|
|||||||
CustomMobileTypeText, //自定义移动类型文本
|
CustomMobileTypeText, //自定义移动类型文本
|
||||||
CanNotificationSlide, //允许下滑通知打开小窗
|
CanNotificationSlide, //允许下滑通知打开小窗
|
||||||
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
|
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
|
||||||
|
ShowWifiStandard, // 显示 WIFI 角标
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
|
|
||||||
|
object ShowWifiStandard : HookRegister() {
|
||||||
|
override fun init() {
|
||||||
|
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||||
|
name == "initViewState" && parameterCount == 1
|
||||||
|
}.hookBefore {
|
||||||
|
hasEnable("show_wifi_standard") {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
|
||||||
|
name == "copyTo" && parameterCount == 1
|
||||||
|
}.hookBefore {
|
||||||
|
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
|
||||||
|
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||||
|
name == "updateState" && parameterCount == 1
|
||||||
|
}.hookBefore {
|
||||||
|
hasEnable("show_wifi_standard") {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
|
||||||
|
name == "copyTo" && parameterCount == 1
|
||||||
|
}.hookBefore {
|
||||||
|
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
|
||||||
|
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -182,6 +182,7 @@
|
|||||||
<string name="left">Left</string>
|
<string name="left">Left</string>
|
||||||
<string name="right">Right</string>
|
<string name="right">Right</string>
|
||||||
<string name="big_mobile_type_icon">Big Mobile Type Icon</string>
|
<string name="big_mobile_type_icon">Big Mobile Type Icon</string>
|
||||||
|
<string name="show_wifi_standard">Show Wifi Standard</string>
|
||||||
<string name="can_notification_slide">Make most notifications can be slide to small window</string>
|
<string name="can_notification_slide">Make most notifications can be slide to small window</string>
|
||||||
<string name="battery_percentage_font_size">Battery percentage font size</string>
|
<string name="battery_percentage_font_size">Battery percentage font size</string>
|
||||||
<string name="zero_do_no_change">0: do not change</string>
|
<string name="zero_do_no_change">0: do not change</string>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:7.1.3")
|
classpath("com.android.tools.build:gradle:7.2.0")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|||||||
Reference in New Issue
Block a user