mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2026-05-09 18:11:26 +08:00
Fixed the issue with decimal point in Subscription-Userinfo field (#547)
https://github.com/MetaCubeX/ClashMetaForAndroid/discussions/292
This commit is contained in:
@@ -160,13 +160,13 @@ class ProfileManager(private val context: Context) : IProfileManager,
|
||||
val info = flag.split("=")
|
||||
when {
|
||||
info[0].contains("upload") && info[1].isNotEmpty() -> upload =
|
||||
BigDecimal(info[1]).longValueExact()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("download") && info[1].isNotEmpty() -> download =
|
||||
BigDecimal(info[1]).longValueExact()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("total") && info[1].isNotEmpty() -> total =
|
||||
BigDecimal(info[1]).longValueExact()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("expire") && info[1].isNotEmpty() -> {
|
||||
if (info[1].isNotEmpty()) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import java.math.BigDecimal
|
||||
import java.net.URL
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
@@ -88,13 +89,13 @@ object ProfileProcessor {
|
||||
val info = flag.split("=")
|
||||
when {
|
||||
info[0].contains("upload") && info[1].isNotEmpty() -> upload =
|
||||
info[1].toLong()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("download") && info[1].isNotEmpty() -> download =
|
||||
info[1].toLong()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("total") && info[1].isNotEmpty() -> total =
|
||||
info[1].toLong()
|
||||
BigDecimal(info[1].split('.').first()).longValueExact()
|
||||
|
||||
info[0].contains("expire") && info[1].isNotEmpty() -> expire =
|
||||
(info[1].toDouble() * 1000).toLong()
|
||||
|
||||
Reference in New Issue
Block a user