修复模块吐垃圾

This commit is contained in:
乌堆小透明
2022-03-01 23:40:33 +08:00
parent 840b4654e3
commit 963b76cda1
2 changed files with 55 additions and 43 deletions

View File

@@ -56,8 +56,6 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
// + " or newer for package " + apkPath // + " or newer for package " + apkPath
findAndHookMethod("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class, findAndHookMethod("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class,
new ReturnConstant(prefs, "corepatch", 0)); new ReturnConstant(prefs, "corepatch", 0));
findAndHookMethod("com.android.apksig.ApkVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class,
new ReturnConstant(prefs, "corepatch", 0));
// Package " + packageName + " signatures do not match previously installed version; ignoring!" // Package " + packageName + " signatures do not match previously installed version; ignoring!"
// public boolean checkCapability(String sha256String, @CertCapabilities int flags) { // public boolean checkCapability(String sha256String, @CertCapabilities int flags) {

View File

@@ -34,41 +34,51 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
Integer.TYPE, Integer.TYPE,
object : XC_MethodHook() { object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) { override fun afterHookedMethod(param: MethodHookParam) {
c = param.args[0] as Context try {
val textV = param.thisObject as TextView c = param.args[0] as Context
textV.isSingleLine = false val textV = param.thisObject as TextView
textV.isSingleLine = false
if (XSPUtils.getBoolean("status_bar_time_double_line", false)) { if (XSPUtils.getBoolean("status_bar_time_double_line", false)) {
str = "\n" str = "\n"
var clock_double_line_size = 7F var clock_double_line_size = 7F
if (XSPUtils.getInt("status_bar_clock_double_line_size",0) != 0 ){ if (XSPUtils.getInt("status_bar_clock_double_line_size", 0) != 0) {
clock_double_line_size = XSPUtils.getInt("status_bar_clock_double_line_size",0).toFloat() clock_double_line_size =
XSPUtils.getInt("status_bar_clock_double_line_size", 0)
.toFloat()
}
textV.setTextSize(
TypedValue.COMPLEX_UNIT_DIP,
clock_double_line_size
)
} else {
if (XSPUtils.getInt("status_bar_clock_size", 0) != 0) {
val clock_size =
XSPUtils.getInt("status_bar_clock_size", 0).toFloat()
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_size)
}
} }
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP,clock_double_line_size)
} else {
if (XSPUtils.getInt("status_bar_clock_size",0) != 0 ){
val clock_size = XSPUtils.getInt("status_bar_clock_size",0).toFloat()
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP,clock_size)
}
}
val d: Method = textV.javaClass.getDeclaredMethod("updateTime") val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
val r = Runnable { val r = Runnable {
d.isAccessible = true d.isAccessible = true
d.invoke(textV) d.invoke(textV)
}
class T : TimerTask() {
override fun run() {
Handler(textV.context.mainLooper).post(r)
} }
class T : TimerTask() {
override fun run() {
Handler(textV.context.mainLooper).post(r)
}
}
if (textV.resources.getResourceEntryName(textV.id) == "clock")
Timer().scheduleAtFixedRate(
T(),
1000 - System.currentTimeMillis() % 1000,
1000
)
} catch (e: java.lang.Exception) {
} }
if (textV.resources.getResourceEntryName(textV.id) == "clock")
Timer().scheduleAtFixedRate(
T(),
1000 - System.currentTimeMillis() % 1000,
1000
)
} }
} }
) )
@@ -76,18 +86,22 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
object : XC_MethodHook() { object : XC_MethodHook() {
@SuppressLint("SetTextI18n", "SimpleDateFormat") @SuppressLint("SetTextI18n", "SimpleDateFormat")
override fun afterHookedMethod(param: MethodHookParam) { override fun afterHookedMethod(param: MethodHookParam) {
val textV = param.thisObject as TextView try {
if (textV.resources.getResourceEntryName(textV.id) == "clock") { val textV = param.thisObject as TextView
val t = Settings.System.getString( if (textV.resources.getResourceEntryName(textV.id) == "clock") {
c!!.contentResolver, val t = Settings.System.getString(
Settings.System.TIME_12_24 c!!.contentResolver,
) Settings.System.TIME_12_24
now_time = Calendar.getInstance().time )
now_time = Calendar.getInstance().time
textV.text = textV.text =
getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + str + getDoubleHour() + getTime( getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + str + getDoubleHour() + getTime(
t t
) + getSecond() ) + getSecond()
}
} catch (e: Exception) {
} }
} }
}) })