mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
Add hide charging icon and WiFi standard icon
Update version to 1.3.3
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 32
|
targetSdk = 32
|
||||||
versionCode = 33
|
versionCode = 34
|
||||||
versionName = "1.3.2"
|
versionName = "1.3.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -15,8 +15,6 @@ class SystemUI : IXposedHookLoadPackage {
|
|||||||
HideAlarmIcon().handleLoadPackage(lpparam)
|
HideAlarmIcon().handleLoadPackage(lpparam)
|
||||||
//隐藏电池
|
//隐藏电池
|
||||||
HideBatteryIcon().handleLoadPackage(lpparam)
|
HideBatteryIcon().handleLoadPackage(lpparam)
|
||||||
//隐藏电池/百分号
|
|
||||||
HideBatteryPercentageIcon().handleLoadPackage(lpparam)
|
|
||||||
//隐藏蓝牙电量
|
//隐藏蓝牙电量
|
||||||
HideBluetoothHandsfreeBatteryIcon().handleLoadPackage(lpparam)
|
HideBluetoothHandsfreeBatteryIcon().handleLoadPackage(lpparam)
|
||||||
//隐藏蓝牙图标
|
//隐藏蓝牙图标
|
||||||
|
|||||||
@@ -2,13 +2,15 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
class HideBatteryIcon :IXposedHookLoadPackage {
|
class HideBatteryIcon : IXposedHookLoadPackage {
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView",
|
"com.android.systemui.statusbar.views.MiuiBatteryMeterView",
|
||||||
@@ -19,14 +21,65 @@ class HideBatteryIcon :IXposedHookLoadPackage {
|
|||||||
"updateResources",
|
"updateResources",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
|
|
||||||
|
//隐藏电池图标
|
||||||
if (XSPUtils.getBoolean("hide_battery_icon", false)) {
|
if (XSPUtils.getBoolean("hide_battery_icon", false)) {
|
||||||
val mBatteryIconView = XposedHelpers.getObjectField(
|
val mBatteryIconView = XposedHelpers.getObjectField(
|
||||||
param.thisObject,
|
param.thisObject,
|
||||||
"mBatteryDigitalView"
|
"mBatteryIconView"
|
||||||
) as FrameLayout
|
) as ImageView
|
||||||
mBatteryIconView.visibility = View.GONE
|
mBatteryIconView.visibility = View.GONE
|
||||||
|
|
||||||
|
if (XposedHelpers.getObjectField(param.thisObject, "mBatteryStyle") == 1) {
|
||||||
|
(XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryDigitalView"
|
||||||
|
) as FrameLayout).visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//隐藏电池内的百分比
|
||||||
|
if (XSPUtils.getBoolean("hide_battery_percentage_icon", false)) {
|
||||||
|
val mBatteryPercentMarkView = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryPercentMarkView"
|
||||||
|
) as TextView
|
||||||
|
mBatteryPercentMarkView.textSize = 0F
|
||||||
|
}
|
||||||
|
|
||||||
|
//隐藏电池百分号
|
||||||
|
if (XSPUtils.getBoolean("hide_battery_percentage_icon", false)) {
|
||||||
|
val mBatteryPercentMarkView = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryPercentMarkView"
|
||||||
|
) as TextView
|
||||||
|
mBatteryPercentMarkView.textSize = 0F
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
XposedHelpers.findAndHookMethod(classIfExists,"updateChargeAndText",object :XC_MethodHook(){
|
||||||
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
|
//隐藏电池充电图标
|
||||||
|
if (XSPUtils.getBoolean("hide_battery_charging_icon", false)) {
|
||||||
|
(XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryChargingInView"
|
||||||
|
) as ImageView).visibility = View.GONE
|
||||||
|
|
||||||
|
(XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryChargingView"
|
||||||
|
) as ImageView).visibility = View.GONE
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.systemui
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.FrameLayout
|
|
||||||
import android.widget.TextView
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
|
||||||
import de.robv.android.xposed.XposedHelpers
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
class HideBatteryPercentageIcon :IXposedHookLoadPackage {
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
|
||||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView",
|
|
||||||
lpparam.classLoader
|
|
||||||
)
|
|
||||||
XposedHelpers.findAndHookMethod(
|
|
||||||
classIfExists,
|
|
||||||
"updateResources",
|
|
||||||
object : XC_MethodHook() {
|
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
|
||||||
if (XSPUtils.getBoolean("hide_battery_percentage_icon", false)) {
|
|
||||||
val mBatteryPercentMarkView = XposedHelpers.getObjectField(
|
|
||||||
param.thisObject,
|
|
||||||
"mBatteryPercentMarkView"
|
|
||||||
) as TextView
|
|
||||||
mBatteryPercentMarkView.textSize = 0F
|
|
||||||
}
|
|
||||||
if (XSPUtils.getBoolean("hide_battery_icon", false)) {
|
|
||||||
val mBatteryIconView = XposedHelpers.getObjectField(
|
|
||||||
param.thisObject,
|
|
||||||
"mBatteryDigitalView"
|
|
||||||
) as FrameLayout
|
|
||||||
mBatteryIconView.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,7 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
@@ -20,12 +21,21 @@ class HideWifiActivityIcon : IXposedHookLoadPackage {
|
|||||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState",
|
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState",
|
||||||
object : XC_MethodHook() {
|
object : XC_MethodHook() {
|
||||||
override fun afterHookedMethod(param: MethodHookParam) {
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
|
//隐藏WIFI箭头
|
||||||
if (XSPUtils.getBoolean("hide_wifi_activity_icon", false)) {
|
if (XSPUtils.getBoolean("hide_wifi_activity_icon", false)) {
|
||||||
(XposedHelpers.getObjectField(
|
(XposedHelpers.getObjectField(
|
||||||
param.thisObject,
|
param.thisObject,
|
||||||
"mWifiActivityView"
|
"mWifiActivityView"
|
||||||
) as ImageView).visibility = View.INVISIBLE
|
) as ImageView).visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//隐藏WIFI标准图标
|
||||||
|
if (XSPUtils.getBoolean("hide_wifi_standard_icon", false)) {
|
||||||
|
(XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mWifiStandardView"
|
||||||
|
) as TextView).visibility = View.INVISIBLE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -130,4 +130,6 @@
|
|||||||
<string name="are_you_sure_reboot">确定重启系统?</string>
|
<string name="are_you_sure_reboot">确定重启系统?</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
<string name="are_you_sure_reboot_scope">确定重启全部作用域?</string>
|
<string name="are_you_sure_reboot_scope">确定重启全部作用域?</string>
|
||||||
|
<string name="hide_battery_charging_icon">隐藏 充电 图标</string>
|
||||||
|
<string name="hide_wifi_standard_icon">隐藏 WIFI标准 图标</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Simplicity Tools</string>
|
<string name="app_name">Simplicity Tools</string>
|
||||||
<string name="performance">性能</string>
|
<string name="performance">性能</string>
|
||||||
@@ -130,4 +130,6 @@
|
|||||||
<string name="are_you_sure_reboot">確定重啟系統?</string>
|
<string name="are_you_sure_reboot">確定重啟系統?</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
<string name="are_you_sure_reboot_scope">確定重啟全部作用域?</string>
|
<string name="are_you_sure_reboot_scope">確定重啟全部作用域?</string>
|
||||||
|
<string name="hide_battery_charging_icon">隱藏 充電 圖標</string>
|
||||||
|
<string name="hide_wifi_standard_icon">隱藏 WIFI標準 圖標</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Simplicity Tools</string>
|
<string name="app_name">Simplicity Tools</string>
|
||||||
<string name="performance">性能</string>
|
<string name="performance">性能</string>
|
||||||
@@ -130,4 +130,6 @@
|
|||||||
<string name="are_you_sure_reboot">確定重啟系統?</string>
|
<string name="are_you_sure_reboot">確定重啟系統?</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
<string name="are_you_sure_reboot_scope">確定重啟全部作用域?</string>
|
<string name="are_you_sure_reboot_scope">確定重啟全部作用域?</string>
|
||||||
|
<string name="hide_battery_charging_icon">隱藏 充電 圖示</string>
|
||||||
|
<string name="hide_wifi_standard_icon">隱藏 WIFI標準 圖示</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -130,4 +130,6 @@
|
|||||||
<string name="are_you_sure_reboot">Are you sure to reboot?</string>
|
<string name="are_you_sure_reboot">Are you sure to reboot?</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="are_you_sure_reboot_scope">Are you sure to reboot all scope?</string>
|
<string name="are_you_sure_reboot_scope">Are you sure to reboot all scope?</string>
|
||||||
|
<string name="hide_battery_charging_icon">Hide charging icon</string>
|
||||||
|
<string name="hide_wifi_standard_icon">Hide WIFI standard icon</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user