mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-15 21:01:18 +08:00
Compare commits
12 Commits
8f874ae26d
...
1b6d6dd64d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b6d6dd64d | ||
|
|
4197a3f9cf | ||
|
|
409b6f23f1 | ||
|
|
7955eb5d61 | ||
|
|
fde524365e | ||
|
|
54a52695e2 | ||
|
|
77f9f2ef7e | ||
|
|
c08589b99b | ||
|
|
c8896104d8 | ||
|
|
9c6a02d616 | ||
|
|
7fdd191b25 | ||
|
|
5d9453f828 |
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
versionCode = 59
|
||||
versionName = "1.5.8"
|
||||
versionCode = 58
|
||||
versionName = "1.5.7"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -195,8 +195,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
"killall com.android.updater",
|
||||
"killall com.miui.mediaeditor",
|
||||
"killall com.miui.screenshot",
|
||||
"killall com.milink.service",
|
||||
"killall com.xiaomi.misubscreenui",
|
||||
"killall com.milink.service"
|
||||
)
|
||||
ShellUtils.execCommand(command, true)
|
||||
dismiss()
|
||||
@@ -1606,16 +1605,6 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
)
|
||||
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(
|
||||
TextSummaryWithSwitchV(
|
||||
|
||||
@@ -24,7 +24,6 @@ class XposedEntry : EasyXposedInit() {
|
||||
ThemeManager, // 主题壁纸
|
||||
ScreenShot, // 截屏
|
||||
Cast, //投屏
|
||||
RearDisplay, //背屏
|
||||
)
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
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, //背屏显示天气
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,5 +209,4 @@
|
||||
<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>
|
||||
<string name="rear_display">Arka Ekran (11Ultra</string>
|
||||
</resources>
|
||||
|
||||
@@ -208,5 +208,4 @@
|
||||
<string name="UsePreSig_summary">安装时总是使用已安装应用的签名。\n不是一般的<b>危险</b>\n仅在绝对需要时启用</string>
|
||||
<string name="enhancedMode">增强模式</string>
|
||||
<string name="enhancedMode_summary">可以解决一些APP内部的完整性校验,一般不需要开启</string>
|
||||
<string name="rear_display">背屏 (11Ultra)</string>
|
||||
</resources>
|
||||
|
||||
@@ -208,5 +208,4 @@
|
||||
<string name="UsePreSig_summary">安裝時始終使用已安裝應用的簽名\n這非常<b>危險</b>\n僅在真正需要時啟用!</string>
|
||||
<string name="enhancedMode">增強模式</string>
|
||||
<string name="enhancedMode_summary">可以解決一些應用內部的完整性較驗,一般不需要開啟</string>
|
||||
<string name="rear_display">後螢幕(11Ultra)</string>
|
||||
</resources>
|
||||
|
||||
@@ -12,6 +12,5 @@
|
||||
<item>com.android.thememanager</item>
|
||||
<item>com.miui.screenshot</item>
|
||||
<item>com.milink.service</item>
|
||||
<item>com.xiaomi.misubscreenui</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -212,5 +212,4 @@
|
||||
<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_summary">Pass some validation in the application</string>
|
||||
<string name="rear_display">Rear Display (11Ultra)</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user