Skip to content

Commit

Permalink
fix: Statusbar clock for Android 15
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Oct 6, 2024
1 parent 4b613fd commit 184d7c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ object StatusBarClockNew : BaseHook() {
override fun init() {
statusBarClass.constructorFinder()
.filterByParamCount(3)
.first().createAfterHook {
.filterByParamTypes {
it[0] == Context::class.java
}.first().createAfterHook {
try {
val miuiClock = it.thisObject as TextView
val miuiClockName = miuiClock.resources.getResourceEntryName(miuiClock.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ object TimeCustomization : BaseHook() {
var c: Context? = null
mClockClass.constructorFinder()
.filterByParamCount(3)
.first().createHook {
.filterByParamTypes {
it[0] == Context::class.java
}.first().createHook {
after {
try {
c = it.args[0] as Context
Expand Down Expand Up @@ -137,7 +139,9 @@ object TimeCustomization : BaseHook() {

mClockClass.constructorFinder()
.filterByParamCount(3)
.first().createHook {
.filterByParamTypes {
it[0] == Context::class.java
}.first().createHook {
after {
try {
c = it.args[0] as Context
Expand Down Expand Up @@ -190,7 +194,7 @@ object TimeCustomization : BaseHook() {
val mMiuiStatusBarClockController =
textV.getObjectField("mMiuiStatusBarClockController")
val mCalendar =
if (isAndroidVersion(34)) {
if (isMoreAndroidVersion(34)) {
mMiuiStatusBarClockController?.getObjectField("mCalendar")
} else {
mMiuiStatusBarClockController?.callMethod("getCalendar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object NewNetworkSpeedStyle : BaseHook() {
} else {
lp.width = viewWidth
}
meter.setLayoutParams(lp)
meter.layoutParams = lp
}
meter.postDelayed({
val number = meter.getObjectField("mNetworkSpeedNumberText") as TextView
Expand Down

0 comments on commit 184d7c9

Please sign in to comment.