mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
修复模块吐垃圾
This commit is contained in:
@@ -56,8 +56,6 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
// + " or newer for package " + apkPath
|
||||
findAndHookMethod("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class,
|
||||
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!"
|
||||
// public boolean checkCapability(String sha256String, @CertCapabilities int flags) {
|
||||
|
||||
@@ -34,41 +34,51 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
Integer.TYPE,
|
||||
object : XC_MethodHook() {
|
||||
override fun afterHookedMethod(param: MethodHookParam) {
|
||||
c = param.args[0] as Context
|
||||
val textV = param.thisObject as TextView
|
||||
textV.isSingleLine = false
|
||||
try {
|
||||
c = param.args[0] as Context
|
||||
val textV = param.thisObject as TextView
|
||||
textV.isSingleLine = false
|
||||
|
||||
if (XSPUtils.getBoolean("status_bar_time_double_line", false)) {
|
||||
str = "\n"
|
||||
var clock_double_line_size = 7F
|
||||
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()
|
||||
if (XSPUtils.getBoolean("status_bar_time_double_line", false)) {
|
||||
str = "\n"
|
||||
var clock_double_line_size = 7F
|
||||
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()
|
||||
}
|
||||
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 r = Runnable {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
|
||||
class T : TimerTask() {
|
||||
override fun run() {
|
||||
Handler(textV.context.mainLooper).post(r)
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
val r = Runnable {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
|
||||
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() {
|
||||
@SuppressLint("SetTextI18n", "SimpleDateFormat")
|
||||
override fun afterHookedMethod(param: MethodHookParam) {
|
||||
val textV = param.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||
val t = Settings.System.getString(
|
||||
c!!.contentResolver,
|
||||
Settings.System.TIME_12_24
|
||||
)
|
||||
now_time = Calendar.getInstance().time
|
||||
try {
|
||||
val textV = param.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||
val t = Settings.System.getString(
|
||||
c!!.contentResolver,
|
||||
Settings.System.TIME_12_24
|
||||
)
|
||||
now_time = Calendar.getInstance().time
|
||||
|
||||
textV.text =
|
||||
getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + str + getDoubleHour() + getTime(
|
||||
t
|
||||
) + getSecond()
|
||||
textV.text =
|
||||
getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + str + getDoubleHour() + getTime(
|
||||
t
|
||||
) + getSecond()
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user