Skip to content

Commit

Permalink
7.1.0 (#519)
Browse files Browse the repository at this point in the history
* fix: 可能的空指针问题 (#518)

* 7.1.0

---------

Co-authored-by: 焕晨HChen <[email protected]>
  • Loading branch information
YuKongA and HChenX authored Jan 3, 2025
1 parent c16aa34 commit 48c3324
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId = "statusbar.lyric"
minSdk = 26
targetSdk = 35
versionCode = 702
versionName = "7.0.2"
versionCode = 710
versionName = "7.1.0"
aaptOptions.cruncherEnabled = false
dependenciesInfo.includeInApk = false
buildConfigField("long", "BUILD_TIME", "$buildTime")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class SystemUILyric : BaseHook() {
if (mCentralSurfacesImpl.existField("mIsFullscreen")) {
isInFullScreenMode = mCentralSurfacesImpl?.getObjectField("mIsFullscreen") as Boolean
statusbarShowing = mCentralSurfacesImpl?.getObjectField("mTransientShown") as Boolean
} else {
} else if (defaultDisplay.existField("isInFullscreenMode")) {
val isInFullscreenMode = defaultDisplay?.getObjectField("isInFullscreenMode")
isInFullScreenMode = isInFullscreenMode?.getObjectField("\$\$delegate_0")?.callMethod("getValue") as Boolean

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/statusbar/lyric/tools/Tools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import statusbar.lyric.R
import statusbar.lyric.config.XposedOwnSP
import statusbar.lyric.tools.ActivityTools.isHook
import statusbar.lyric.tools.LogTools.log
import statusbar.lyric.tools.Tools.existField
import java.io.DataOutputStream
import java.util.Objects
import java.util.regex.Pattern
Expand Down Expand Up @@ -247,7 +246,8 @@ object Tools {
}

fun Any?.existField(fieldName: String): Boolean {
return this?.javaClass?.declaredFields?.any { it.name == fieldName } ?: false
if (this == null) return false
return XposedHelpers.findFieldIfExists(this.javaClass, fieldName) != null
}

fun Any?.existMethod(methodName: String): Boolean {
Expand Down

0 comments on commit 48c3324

Please sign in to comment.