From 830397a59032cb425448baef01e85a7bb62e86d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=8C=E5=A0=86=E5=B0=8F=E9=80=8F=E6=98=8E?= Date: Tue, 15 Mar 2022 21:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E6=8B=89=E5=A4=A9?= =?UTF-8?q?=E6=B0=94=E7=89=88=E6=9C=AC=E8=AF=86=E5=88=AB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hook/app/systemui/ControlCenterWeather.kt | 32 ++++++++++++++++--- .../hook/app/systemui/NotificationWeather.kt | 32 ++++++++++++++++--- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt index b102bb80..1626281e 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/ControlCenterWeather.kt @@ -100,8 +100,20 @@ class ControlCenterWeather : IXposedHookLoadPackage { val viewGroup = it.thisObject as ViewGroup val context = viewGroup.context - // MIUI编译时间大于 2022-03-12 00:00:00 - if (SystemProperties.get(context, "ro.build.date.utc")!!.toInt() >= 1647014400) { + // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 + if (SystemProperties.get(context, "ro.build.date.utc")!! + .toInt() >= 1647014400 && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("DEV") && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("XM") + ) { //获取原组件 val big_time_ID = context.resources.getIdentifier("big_time", "id", context.packageName) @@ -251,8 +263,20 @@ class ControlCenterWeather : IXposedHookLoadPackage { val viewGroup = it.thisObject as ViewGroup val context = viewGroup.context val mOrientation = viewGroup.getObjectField("mOrientation") as Int - // MIUI编译时间大于 2022-03-12 00:00:00 - if (SystemProperties.get(context, "ro.build.date.utc")!!.toInt() >= 1647014400) { + // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 + if (SystemProperties.get(context, "ro.build.date.utc")!! + .toInt() >= 1647014400 && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("DEV") && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("XM") + ) { if (mOrientation == 1) { mConstraintLayout!!.visibility = View.VISIBLE } else { diff --git a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt index db9b5eb3..29dffb52 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/hook/app/systemui/NotificationWeather.kt @@ -30,8 +30,20 @@ class NotificationWeather : IXposedHookLoadPackage { val viewGroup = it.thisObject as ViewGroup val context = viewGroup.context - // MIUI编译时间大于 2022-03-12 00:00:00 - if (SystemProperties.get(context, "ro.build.date.utc")!!.toInt() >= 1647014400) { + // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 + if (SystemProperties.get(context, "ro.build.date.utc")!! + .toInt() >= 1647014400 && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("DEV") && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("XM") + ) { //获取原组件 val big_time_ID = context.resources.getIdentifier("big_time", "id", context.packageName) @@ -181,8 +193,20 @@ class NotificationWeather : IXposedHookLoadPackage { val viewGroup = it.thisObject as ViewGroup val context = viewGroup.context val mOrientation = viewGroup.getObjectField("mOrientation") as Int - // MIUI编译时间大于 2022-03-12 00:00:00 - if (SystemProperties.get(context, "ro.build.date.utc")!!.toInt() >= 1647014400) { + // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 + if (SystemProperties.get(context, "ro.build.date.utc")!! + .toInt() >= 1647014400 && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("DEV") && + + !SystemProperties.get( + context, + "ro.build.version.incremental" + )!!.endsWith("XM") + ) { if (mOrientation == 1) { mConstraintLayout!!.visibility = View.VISIBLE } else {