mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 20:01:17 +08:00
Compare commits
3 Commits
7acd0aaff8
...
919694fce7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
919694fce7 | ||
|
|
f5ff3e78c4 | ||
|
|
3619fbf4d3 |
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 32
|
targetSdk = 32
|
||||||
versionCode = 58
|
versionCode = 59
|
||||||
versionName = "1.5.7"
|
versionName = "1.5.8"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
"killall com.android.updater",
|
"killall com.android.updater",
|
||||||
"killall com.miui.mediaeditor",
|
"killall com.miui.mediaeditor",
|
||||||
"killall com.miui.screenshot",
|
"killall com.miui.screenshot",
|
||||||
"killall com.milink.service"
|
"killall com.milink.service",
|
||||||
|
"killall com.xiaomi.misubscreenui",
|
||||||
)
|
)
|
||||||
ShellUtils.execCommand(command, true)
|
ShellUtils.execCommand(command, true)
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -1605,6 +1606,16 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(LineV())
|
add(LineV())
|
||||||
|
add(TitleTextV(resId = R.string.rear_display))
|
||||||
|
add(
|
||||||
|
TextSummaryWithSwitchV(
|
||||||
|
TextSummaryV(
|
||||||
|
textId = R.string.show_weather_main_switch,
|
||||||
|
),
|
||||||
|
SwitchV("rear_show_weather")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.remove_ad))
|
add(TitleTextV(resId = R.string.remove_ad))
|
||||||
add(
|
add(
|
||||||
TextSummaryWithSwitchV(
|
TextSummaryWithSwitchV(
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class XposedEntry : EasyXposedInit() {
|
|||||||
ThemeManager, // 主题壁纸
|
ThemeManager, // 主题壁纸
|
||||||
ScreenShot, // 截屏
|
ScreenShot, // 截屏
|
||||||
Cast, //投屏
|
Cast, //投屏
|
||||||
|
RearDisplay, //背屏
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.cast.RearDisplayWeather
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object RearDisplay: AppRegister() {
|
||||||
|
override val packageName: String = "com.xiaomi.misubscreenui"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "Simplicitytools"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
RearDisplayWeather, //背屏显示天气
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.cast
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.util.TypedValue
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.RelativeLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import cn.fkj233.ui.activity.dp2px
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
|
||||||
|
object RearDisplayWeather : HookRegister() {
|
||||||
|
@SuppressLint("ResourceType")
|
||||||
|
override fun init() {
|
||||||
|
hasEnable("rear_show_weather") {
|
||||||
|
findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") {
|
||||||
|
name == "onFinishInflate"
|
||||||
|
}.hookMethod {
|
||||||
|
before {
|
||||||
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
|
val context = viewGroup.context
|
||||||
|
|
||||||
|
//获取原组件
|
||||||
|
val gradientLayoutID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"gradient_layout",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val gradientLayout: ViewGroup = viewGroup.findViewById(gradientLayoutID)
|
||||||
|
|
||||||
|
val dateID =
|
||||||
|
context.resources.getIdentifier("date", "id", context.packageName)
|
||||||
|
val date: TextView = viewGroup.findViewById(dateID)
|
||||||
|
|
||||||
|
|
||||||
|
//创建天气组件
|
||||||
|
val mWeatherView = WeatherView(context, false).apply {
|
||||||
|
gravity = Gravity.END
|
||||||
|
setTextAppearance(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"Sub_Screen_Aod_date_s",
|
||||||
|
"style",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
typeface = Typeface.create("mipro-medium", Typeface.NORMAL)
|
||||||
|
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14f)
|
||||||
|
|
||||||
|
}
|
||||||
|
gradientLayout.addView(mWeatherView, (gradientLayout.indexOfChild(date) + 1))
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findMethod("com.xiaomi.misubscreenui.light.aod.view.HorizontalClockView") {
|
||||||
|
name == "onFinishInflate"
|
||||||
|
}.hookMethod {
|
||||||
|
before {
|
||||||
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
|
val context = viewGroup.context
|
||||||
|
|
||||||
|
//获取原组件
|
||||||
|
val gradientLayoutID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"gradient_layout",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val gradientLayout: RelativeLayout = viewGroup.findViewById(gradientLayoutID)
|
||||||
|
|
||||||
|
val dateID =
|
||||||
|
context.resources.getIdentifier("date", "id", context.packageName)
|
||||||
|
val date: TextView = viewGroup.findViewById(dateID)
|
||||||
|
|
||||||
|
val dateParentLayout: ViewGroup = date.parent as ViewGroup
|
||||||
|
|
||||||
|
|
||||||
|
//创建天气组件
|
||||||
|
val mWeatherView = WeatherView(context, false).apply {
|
||||||
|
id = View.generateViewId()
|
||||||
|
gravity = Gravity.CENTER
|
||||||
|
maxLines = 1
|
||||||
|
setTextAppearance(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"Sub_Screen_Aod_date_s_horizontal",
|
||||||
|
"style",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
typeface = Typeface.create("mipro-medium", 0)
|
||||||
|
|
||||||
|
layoutParams = RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT, dp2px(context, 30f)
|
||||||
|
).also {
|
||||||
|
it.addRule(RelativeLayout.END_OF, dateID)
|
||||||
|
it.marginStart = dp2px(context, 2f)
|
||||||
|
it.marginEnd = dp2px(context, 2f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dateParentLayout.addView(
|
||||||
|
mWeatherView,
|
||||||
|
(dateParentLayout.indexOfChild(date) + 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
//电池位置
|
||||||
|
val batteryID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"battery_container",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val battery: ViewGroup = viewGroup.findViewById(batteryID)
|
||||||
|
|
||||||
|
battery.layoutParams = RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT, dp2px(context, 30f)
|
||||||
|
).also {
|
||||||
|
it.addRule(RelativeLayout.END_OF, mWeatherView.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -205,4 +205,7 @@
|
|||||||
<string name="digestCreak">Deshabilitar comparación de firmas</string>
|
<string name="digestCreak">Deshabilitar comparación de firmas</string>
|
||||||
<string name="digestCreak_summary">Permitir reinstalar apps con firmas diferentes.</string>
|
<string name="digestCreak_summary">Permitir reinstalar apps con firmas diferentes.</string>
|
||||||
<string name="UsePreSig">Usar firmas instaladas</string>
|
<string name="UsePreSig">Usar firmas instaladas</string>
|
||||||
|
<string name="UsePreSig_summary">Usar siempre las firmas de las aplicaciones instaladas cuando se instale una.\nEsto es extremadamente<b<peligroso</b>.\n¡Habilitar únicamente cuando sea necesario!</string>
|
||||||
|
<string name="enhancedMode">Modo mejorado</string>
|
||||||
|
<string name="enhancedMode_summary">Pasar algunas validaciones en la aplicación</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -197,4 +197,16 @@
|
|||||||
<string name="clock_center_and_icon_left">Saat Merkezi ve Sol Simge</string>
|
<string name="clock_center_and_icon_left">Saat Merkezi ve Sol Simge</string>
|
||||||
<string name="maximum_number_of_notification_icons">Maksimum bildirim simgesi sayısı</string>
|
<string name="maximum_number_of_notification_icons">Maksimum bildirim simgesi sayısı</string>
|
||||||
<string name="maximum_number_of_notification_dots">Maksimum bildirim noktası sayısı</string>
|
<string name="maximum_number_of_notification_dots">Maksimum bildirim noktası sayısı</string>
|
||||||
|
<string name="custom_mobile_type_text">Özel mobil tip metin</string>
|
||||||
|
<string name="custom_mobile_type_text_switch">Özel mobil tip metin anahtarı</string>
|
||||||
|
<string name="downgr">Sürüm düşürmeye izin ver</string>
|
||||||
|
<string name="downgr_summary">Sürüm düşürme uygulamalarına izin ver.</string>
|
||||||
|
<string name="authcreak">Özet doğrulamayı devre dışı bırak</string>
|
||||||
|
<string name="authcreak_summary">Apk\'te dosya değiştirildikten sonra uygulamaların yüklenmesine izin verir (geçersiz özet hatasını yoksay).</string>
|
||||||
|
<string name="digestCreak">Karşılaştırma imzalarını devre dışı bırak</string>
|
||||||
|
<string name="digestCreak_summary">Uygulamayı farklı imzalarla yeniden yüklemeye izin ver</string>
|
||||||
|
<string name="UsePreSig">Yüklü imzaları kullan</string>
|
||||||
|
<string name="UsePreSig_summary">Yüklerken her zaman önceden yüklenmiş uygulamaların imzalarını kullanın.\nBu son derece <b>tehlikelidir</b>.\nYalnızca gerçekten gerektiğinde etkinleştirin!</string>
|
||||||
|
<string name="enhancedMode">Gelişmiş Mod</string>
|
||||||
|
<string name="enhancedMode_summary">Uygulamada bazı doğrulamaları geç</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -208,4 +208,5 @@
|
|||||||
<string name="UsePreSig_summary">安装时总是使用已安装应用的签名。\n不是一般的<b>危险</b>\n仅在绝对需要时启用</string>
|
<string name="UsePreSig_summary">安装时总是使用已安装应用的签名。\n不是一般的<b>危险</b>\n仅在绝对需要时启用</string>
|
||||||
<string name="enhancedMode">增强模式</string>
|
<string name="enhancedMode">增强模式</string>
|
||||||
<string name="enhancedMode_summary">可以解决一些APP内部的完整性校验,一般不需要开启</string>
|
<string name="enhancedMode_summary">可以解决一些APP内部的完整性校验,一般不需要开启</string>
|
||||||
|
<string name="rear_display">背屏 (11Ultra)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -198,4 +198,14 @@
|
|||||||
<string name="maximum_number_of_notification_dots">通知點點數量</string>
|
<string name="maximum_number_of_notification_dots">通知點點數量</string>
|
||||||
<string name="custom_mobile_type_text">自訂行動網路類型文字</string>
|
<string name="custom_mobile_type_text">自訂行動網路類型文字</string>
|
||||||
<string name="custom_mobile_type_text_switch">自訂行動網路類型文字開關</string>
|
<string name="custom_mobile_type_text_switch">自訂行動網路類型文字開關</string>
|
||||||
|
<string name="downgr">允許降級安裝應用</string>
|
||||||
|
<string name="downgr_summary">允許在已安裝新版的情況下覆蓋安裝舊版本</string>
|
||||||
|
<string name="authcreak">禁用應用安裝管理器簽名驗證</string>
|
||||||
|
<string name="authcreak_summary">關閉安裝應用時的簽名驗證,可以安裝被修改的APK</string>
|
||||||
|
<string name="digestCreak">禁用APK簽名驗證</string>
|
||||||
|
<string name="digestCreak_summary">允許覆蓋安裝同包名不同簽名的應用</string>
|
||||||
|
<string name="UsePreSig">安裝時始終使用已安裝應用的簽名</string>
|
||||||
|
<string name="UsePreSig_summary">安裝時始終使用已安裝應用的簽名\n這非常<b>危險</b>\n僅在真正需要時啟用!</string>
|
||||||
|
<string name="enhancedMode">增強模式</string>
|
||||||
|
<string name="enhancedMode_summary">可以解決一些應用內部的完整性較驗,一般不需要開啟</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -12,5 +12,6 @@
|
|||||||
<item>com.android.thememanager</item>
|
<item>com.android.thememanager</item>
|
||||||
<item>com.miui.screenshot</item>
|
<item>com.miui.screenshot</item>
|
||||||
<item>com.milink.service</item>
|
<item>com.milink.service</item>
|
||||||
|
<item>com.xiaomi.misubscreenui</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -212,4 +212,5 @@
|
|||||||
<string name="UsePreSig_summary">Always use signatures from already installed apps when installing.\nThis is extremely <b>dangerous</b>.\nOnly enable when really needed!</string>
|
<string name="UsePreSig_summary">Always use signatures from already installed apps when installing.\nThis is extremely <b>dangerous</b>.\nOnly enable when really needed!</string>
|
||||||
<string name="enhancedMode">Enhanced Mode</string>
|
<string name="enhancedMode">Enhanced Mode</string>
|
||||||
<string name="enhancedMode_summary">Pass some validation in the application</string>
|
<string name="enhancedMode_summary">Pass some validation in the application</string>
|
||||||
|
<string name="rear_display">Rear Display (11Ultra)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user