mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-15 04:41:18 +08:00
Compare commits
4 Commits
b6d89d28a2
...
95aea35865
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95aea35865 | ||
|
|
81407c0287 | ||
|
|
e04c699572 | ||
|
|
bebda7c08f |
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
versionCode = 53
|
||||
versionName = "1.5.2"
|
||||
versionCode = 52
|
||||
versionName = "1.5.1"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -498,14 +498,6 @@ class SettingsActivity : MIUIActivity() {
|
||||
menuButton.visibility = View.VISIBLE
|
||||
return ArrayList<BaseView>().apply {
|
||||
add(TitleTextV(resId = R.string.statusbar))
|
||||
add(
|
||||
TextSummaryWithSwitchV(
|
||||
TextSummaryV(
|
||||
textId = R.string.big_mobile_type_icon
|
||||
),
|
||||
SwitchV("big_mobile_type_icon")
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextSummaryWithSwitchV(
|
||||
TextSummaryV(
|
||||
|
||||
@@ -58,8 +58,6 @@ class SystemUI : IXposedHookLoadPackage {
|
||||
OldQSCustom().handleLoadPackage(lpparam)
|
||||
//双排网速
|
||||
DoubleLineNetworkSpeed().handleLoadPackage(lpparam)
|
||||
|
||||
StatusBarBigMobileTypeIcon().handleLoadPackage(lpparam)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,54 +3,29 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideMobileTypeIcon : IXposedHookLoadPackage {
|
||||
val isBigType=XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState =
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
lpparam.classLoader,
|
||||
"initViewState",
|
||||
iconState
|
||||
) {
|
||||
hideMobileTypeIcon(it)
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
lpparam.classLoader,
|
||||
"updateState",
|
||||
iconState
|
||||
) {
|
||||
hideMobileTypeIcon(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||
hasEnable("hide_mobile_type_icon") {
|
||||
if (isBigType) {
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility =
|
||||
View.GONE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility =
|
||||
View.GONE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility =
|
||||
View.GONE
|
||||
} else {
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility =
|
||||
View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility =
|
||||
View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility =
|
||||
View.INVISIBLE
|
||||
}
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||
hasEnable("hide_mobile_type_icon") {
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import cn.fkj233.ui.activity.dp2px
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
|
||||
class StatusBarBigMobileTypeIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("big_mobile_type_icon") {
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
lpparam.classLoader,
|
||||
"init"
|
||||
) {
|
||||
val StatusBarMobileView = it.thisObject as ViewGroup
|
||||
val context: Context = StatusBarMobileView.context
|
||||
val res: Resources = context.resources
|
||||
val mobile_container_left_ID: Int =
|
||||
res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
|
||||
val mobile_left_mobile_inout_ID: Int = res.getIdentifier(
|
||||
"mobile_left_mobile_inout",
|
||||
"id",
|
||||
"com.android.systemui"
|
||||
)
|
||||
val mobile_container_right_ID: Int = res.getIdentifier(
|
||||
"mobile_container_right",
|
||||
"id",
|
||||
"com.android.systemui"
|
||||
)
|
||||
val mobile_type_ID: Int =
|
||||
res.getIdentifier("mobile_type", "id", "com.android.systemui")
|
||||
val TextAppearance_StatusBar_Carrier_ID: Int = res.getIdentifier(
|
||||
"TextAppearance.StatusBar.Carrier",
|
||||
"style",
|
||||
"com.android.systemui"
|
||||
)
|
||||
|
||||
//获取mobile_container_left并在父布局中删除
|
||||
val mobile_container_left =
|
||||
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_left_ID)
|
||||
val mobile_container_left_fl =
|
||||
mobile_container_left.layoutParams as LinearLayout.LayoutParams
|
||||
(mobile_container_left.parent as ViewGroup).removeView(mobile_container_left)
|
||||
//获取mobile_container_right的父布局,并在mobile_container_right前添加mobile_container_left
|
||||
val mobile_container_right =
|
||||
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_right_ID)
|
||||
val RightParentLayout = mobile_container_right.parent as ViewGroup
|
||||
val mobile_container_right_Index =
|
||||
RightParentLayout.indexOfChild(mobile_container_left)
|
||||
RightParentLayout.addView(
|
||||
mobile_container_left,
|
||||
mobile_container_right_Index - 1
|
||||
)
|
||||
mobile_container_left_fl.topMargin = dp2px(context, 1.5f)
|
||||
mobile_container_left.layoutParams = mobile_container_left_fl
|
||||
val mobile_type = StatusBarMobileView.findViewById<TextView>(mobile_type_ID)
|
||||
mobile_type.setTextAppearance(TextAppearance_StatusBar_Carrier_ID)
|
||||
val mobile_type_fl = mobile_type.layoutParams as FrameLayout.LayoutParams
|
||||
mobile_type_fl.width = dp2px(context, 25f)
|
||||
mobile_type_fl.gravity = Gravity.CENTER or Gravity.START
|
||||
mobile_type.layoutParams = mobile_type_fl
|
||||
val mobile_left_mobile_inout =
|
||||
StatusBarMobileView.findViewById<ImageView>(mobile_left_mobile_inout_ID)
|
||||
val mobile_left_mobile_inout_fl =
|
||||
mobile_left_mobile_inout.layoutParams as FrameLayout.LayoutParams
|
||||
mobile_left_mobile_inout_fl.width = dp2px(context, 8f)
|
||||
mobile_left_mobile_inout_fl.marginStart = dp2px(context, 16f)
|
||||
mobile_left_mobile_inout_fl.bottomMargin = dp2px(context, 3f)
|
||||
mobile_left_mobile_inout.layoutParams = mobile_left_mobile_inout_fl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,11 @@ package com.lt2333.simplicitytools.tile
|
||||
import android.service.quicksettings.Tile
|
||||
import android.service.quicksettings.TileService
|
||||
|
||||
class AllowScreenshots : TileService() {
|
||||
class AllowScreenshots : TileService(){
|
||||
val key = "disable_flag_secure"
|
||||
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
try {
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
val prefEditor = pref.edit()
|
||||
if (pref.getBoolean(key, false)) {
|
||||
@@ -20,13 +19,10 @@ class AllowScreenshots : TileService() {
|
||||
}
|
||||
prefEditor.commit()
|
||||
qsTile.updateTile()
|
||||
} catch (e: SecurityException) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartListening() {
|
||||
super.onStartListening()
|
||||
try {
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
if (pref.getBoolean(key, false)) {
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
@@ -34,7 +30,5 @@ class AllowScreenshots : TileService() {
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
}
|
||||
qsTile.updateTile()
|
||||
} catch (e: SecurityException) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ class LockMaxFpsTile : TileService() {
|
||||
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
try {
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
val prefEditor = pref.edit()
|
||||
if (pref.getBoolean(key, false)) {
|
||||
@@ -21,13 +20,10 @@ class LockMaxFpsTile : TileService() {
|
||||
}
|
||||
prefEditor.commit()
|
||||
qsTile.updateTile()
|
||||
} catch (e: SecurityException) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartListening() {
|
||||
super.onStartListening()
|
||||
try {
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
if (pref.getBoolean(key, false)) {
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
@@ -35,7 +31,6 @@ class LockMaxFpsTile : TileService() {
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
}
|
||||
qsTile.updateTile()
|
||||
} catch (e: SecurityException) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,8 +173,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_size">Tamaño de fila dual (0: no cambiar)</string>
|
||||
<string name="status_bar_network_speed_dual_row_icon">Icono de fila dual</string>
|
||||
<string name="none">Ninguno</string>
|
||||
<string name="status_bar_network_speed_dual_row_gravity">Alineación de icono en fila dual</string>
|
||||
<string name="left">Izquierda</string>
|
||||
<string name="right">Derecha</string>
|
||||
<string name="big_mobile_type_icon">Icono grande de red móvil</string>
|
||||
</resources>
|
||||
|
||||
@@ -176,5 +176,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_gravity">Aliniere rândul dublu</string>
|
||||
<string name="left">Stânga</string>
|
||||
<string name="right">Dreapta</string>
|
||||
<string name="big_mobile_type_icon">Pictogramă mare pentru tipul datelor mobile</string>
|
||||
</resources>
|
||||
|
||||
@@ -180,5 +180,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_gravity">Выравнивание скорости сети в 2 ряда</string>
|
||||
<string name="left">Влево</string>
|
||||
<string name="right">Вправо</string>
|
||||
<string name="big_mobile_type_icon">Большая иконка типа сети</string>
|
||||
</resources>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<string name="disable_flag_secure_summary">Güvenlik için Kontrol merkezinde açılır hızlı ayar eklemeye izin vermeyen yazılımda ekran görüntüsüne izin ver</string>
|
||||
<string name="home">Ev</string>
|
||||
<string name="home_time">Her zaman Ana ekran saatini göster</string>
|
||||
<string name="reboot_host">Cihazı yeniden başlat</string>
|
||||
<string name="reboot_host">Tüm kapsamı yeniden başlat</string>
|
||||
<string name="reboot">Sistemi Yeniden Başlat </string>
|
||||
<!--Status bar icons-->
|
||||
<string name="status_bar_icon">Durum çubuğu simgeleri</string>
|
||||
@@ -174,8 +174,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_size">Çift sıra boyutu (0: değişmez)</string>
|
||||
<string name="status_bar_network_speed_dual_row_icon">Çift satır simgesi</string>
|
||||
<string name="none">Hiçbiri</string>
|
||||
<string name="status_bar_network_speed_dual_row_gravity">Çift sıra hizalama</string>
|
||||
<string name="left">Sol</string>
|
||||
<string name="right">Sağ </string>
|
||||
<string name="big_mobile_type_icon">Büyük mobil ikon tipi</string>
|
||||
</resources>
|
||||
|
||||
@@ -176,5 +176,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_gravity">双排对齐</string>
|
||||
<string name="left">左边</string>
|
||||
<string name="right">右边</string>
|
||||
<string name="big_mobile_type_icon">大移动类型图标</string>
|
||||
</resources>
|
||||
|
||||
@@ -173,8 +173,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_size">雙排大小(0:不更改)</string>
|
||||
<string name="status_bar_network_speed_dual_row_icon">雙行圖示</string>
|
||||
<string name="none">無</string>
|
||||
<string name="status_bar_network_speed_dual_row_gravity">雙行網速對齊</string>
|
||||
<string name="left">置左</string>
|
||||
<string name="right">置右</string>
|
||||
<string name="big_mobile_type_icon">大行動網路圖示</string>
|
||||
</resources>
|
||||
|
||||
@@ -180,5 +180,4 @@
|
||||
<string name="status_bar_network_speed_dual_row_gravity">Dual row align</string>
|
||||
<string name="left">Left</string>
|
||||
<string name="right">Right</string>
|
||||
<string name="big_mobile_type_icon">Big Mobile Type Icon</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user