Skip to content

Commit

Permalink
[修复] 可能导致的空指针崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
YenalyLiew committed Oct 21, 2024
1 parent 8a5d342 commit d59421b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ android {
jvmTarget = JavaVersion.VERSION_21.toString()
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all-compatibility")
}
lint {
disable += setOf("EnsureInitializerMetadata")
}
namespace = "com.yenaly.han1meviewer"
}

Expand Down
5 changes: 4 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
-keepnames class * extends android.app.Activity
-keepnames class * extends androidx.fragment.app.Fragment

-keep class * extends cn.jzvd.** { *; }
-keep class * extends cn.jzvd.** { *; }

-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ class HJzvdStd @JvmOverloads constructor(
private var videoSpeed: Float = userDefSpeed
set(value) {
field = value
// #issue-crashlytics-c8636c4bb0b8516675cbeb9e8776bf0b:
// 有些机器到这里可能会报空指针异常,所以加了个判断,但是不知道为什么会报空指针异常
mediaInterface?.let { mi ->
val isPlaying = mi.isPlaying
mi.setSpeed(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,10 @@ class SystemMediaKernel(jzvd: Jzvd) : JZMediaSystem(jzvd), HMediaKernel {
mediaPlayer?.pause()
}
}

// #issue-crashlytics-c8636c4bb0b8516675cbeb9e8776bf0b:
// 有些机器到这里可能会报空指针异常,所以加了个判断,但是不知道为什么会报空指针异常
override fun isPlaying(): Boolean {
return mediaPlayer?.isPlaying == true
}
}
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_home_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingBottom="8dp"
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Plugins
androidGradle = "8.5.2"
androidGradle = "8.7.1"
kotlin = "2.0.20"
serializationPlugin = "2.0.20"
ksp = "2.0.20-1.0.24"
Expand All @@ -11,7 +11,7 @@ coreKtx = "1.13.1"
appCompat = "1.7.0"
material = "1.12.0"
coroutinesAndroid = "1.9.0"
activity = "1.9.2"
activity = "1.9.3"
fragment = "1.8.4"
constraintLayout = "2.1.4"
recyclerView = "1.3.2"
Expand All @@ -28,8 +28,8 @@ lifecycleLiveDataKtx = "2.8.6"
roomRuntime = "2.6.1"
roomKtx = "2.6.1"
roomCompiler = "2.6.1"
navigationFragmentKtx = "2.8.2"
navigationUiKtx = "2.8.2"
navigationFragmentKtx = "2.8.3"
navigationUiKtx = "2.8.3"
preferenceKtx = "1.2.1"
workRuntime = "2.9.1"
workRuntimeKtx = "2.9.1"
Expand Down

0 comments on commit d59421b

Please sign in to comment.