Horis 1 anno fa
parent
commit
2fe26909af

+ 1 - 1
app/src/main/java/io/legado/app/help/update/AppReleaseInfo.kt

@@ -13,7 +13,7 @@ data class AppReleaseInfo(
     val downloadUrl: String,
     val downloadUrl: String,
     val assetUrl: String
     val assetUrl: String
 ) {
 ) {
-    val versionName: String = name.split("_").getOrNull(2)?.removeSuffix(".apk") ?: ""
+    val versionName: String = name.split("_").getOrNull(2)?.dropLast(2) ?: ""
 }
 }
 
 
 enum class AppVariant {
 enum class AppVariant {

+ 7 - 6
app/src/main/java/io/legado/app/service/WebTileService.kt

@@ -40,12 +40,13 @@ class WebTileService : TileService() {
 
 
     override fun onStartListening() {
     override fun onStartListening() {
         super.onStartListening()
         super.onStartListening()
-        if (WebService.isRun) {
-            qsTile.state = Tile.STATE_ACTIVE
-            qsTile.updateTile()
-        } else {
-            qsTile.state = Tile.STATE_INACTIVE
-            qsTile.updateTile()
+        qsTile?.run {
+            state = if (WebService.isRun) {
+                Tile.STATE_ACTIVE
+            } else {
+                Tile.STATE_INACTIVE
+            }
+            updateTile()
         }
         }
     }
     }