From 28faf816fc118066f237788feb115695a434d6a7 Mon Sep 17 00:00:00 2001
From: LittleTurtle2333 <841474544@qq.com>
Date: Thu, 17 Feb 2022 18:09:21 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=BD=91=E9=80=9F?=
=?UTF-8?q?=E7=A7=92=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/.gitignore | 1 +
app/build.gradle | 4 ++--
.../simplicitytools/hook/app/SystemUI.kt | 23 ++++++++++++++++---
app/src/main/res/values/strings.xml | 3 ++-
app/src/main/res/xml/root_preferences.xml | 8 +++++--
5 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/app/.gitignore b/app/.gitignore
index 67e07b8f..327034ee 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1,2 +1,3 @@
/build
/release
+/debug
diff --git a/app/build.gradle b/app/build.gradle
index ac84295d..8b0180c0 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -10,8 +10,8 @@ android {
applicationId "com.lt2333.simplicitytools"
minSdk 30
targetSdk 32
- versionCode 5
- versionName '1.0.4'
+ versionCode 6
+ versionName '1.0.5'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt
index f9e6cc24..e62b43ec 100644
--- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt
+++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/SystemUI.kt
@@ -229,8 +229,6 @@ class SystemUI : IXposedHookLoadPackage {
} catch (e: Exception) {
XposedBridge.log(e)
}
-
-
//隐藏HD
try {
XposedHelpers.findAndHookMethod(
@@ -265,7 +263,26 @@ class SystemUI : IXposedHookLoadPackage {
XposedBridge.log(e)
}
-
+ //隐藏 网速秒刷 图标
+ try {
+ XposedHelpers.findAndHookMethod(
+ "com.android.systemui.statusbar.policy.NetworkSpeedController",
+ lpparam.classLoader,
+ "postUpdateNetworkSpeedDelay",
+ Long::class.java,
+ object : XC_MethodHook() {
+ override fun beforeHookedMethod(param: MethodHookParam) {
+ if (prefs.hasFileChanged()) {
+ prefs.reload()
+ }
+ if (prefs.getBoolean("status_bar_network_speed_refresh_speed", false)) {
+ param.args[0] = 1000L
+ }
+ }
+ })
+ } catch (e: Exception) {
+ XposedBridge.log(e)
+ }
//时钟显秒
if (prefs.hasFileChanged()) {
prefs.reload()
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c24b78cb..b62d12f1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -43,6 +43,7 @@
基于 MIUI13(Android 12) 适配的自定义工具
隐藏 HD 图标
状态栏(重启系统界面生效)
- 时钟显秒
+ 时钟显秒
+ 网速秒刷新
\ No newline at end of file
diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml
index a7543c00..00c84805 100644
--- a/app/src/main/res/xml/root_preferences.xml
+++ b/app/src/main/res/xml/root_preferences.xml
@@ -15,8 +15,12 @@
app:title="@string/statusbar">
+ app:key="status_bar_time_seconds"
+ app:title="@string/status_bar_time_seconds" />
+