Sfoglia il codice sorgente

fix: type error for subscription

metacubex 3 anni fa
parent
commit
2ab1571e3a

+ 1 - 1
design/src/main/java/com/github/kr328/clash/design/util/I18n.kt

@@ -72,5 +72,5 @@ fun Double.toProgress(): Int {
 }
 }
 fun Long.toDateStr(): String {
 fun Long.toDateStr(): String {
     val simpleDateFormat =SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
     val simpleDateFormat =SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
-    return simpleDateFormat.format(Date(this*1000))
+    return simpleDateFormat.format(Date(this))
 }
 }

+ 1 - 1
service/src/main/java/com/github/kr328/clash/service/ProfileManager.kt

@@ -169,7 +169,7 @@ class ProfileManager(private val context: Context) : IProfileManager,
 
 
                             info[0].contains("expire") -> {
                             info[0].contains("expire") -> {
                                 if (info[1].isNotEmpty()) {
                                 if (info[1].isNotEmpty()) {
-                                    expire = info[1].toLong()
+                                    expire = (info[1].toDouble()*1000).toLong()
                                 }
                                 }
                             }
                             }
                         }
                         }

+ 1 - 1
service/src/main/java/com/github/kr328/clash/service/ProfileProcessor.kt

@@ -96,7 +96,7 @@ object ProfileProcessor {
 
 
                                             info[0].contains("expire") -> {
                                             info[0].contains("expire") -> {
                                                 if (info[1].isNotEmpty()) {
                                                 if (info[1].isNotEmpty()) {
-                                                    expire = info[1].toLong()
+                                                    expire = (info[1].toDouble() * 1000).toLong()
                                                 }
                                                 }
                                             }
                                             }
                                         }
                                         }