fix: the error caused by too large value of subscription information

This commit is contained in:
metacubex
2023-02-27 18:36:12 +08:00
parent 1d86190f8f
commit 86e94da6a6
2 changed files with 11 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ import kotlinx.coroutines.withContext
import okhttp3.OkHttpClient
import okhttp3.Request
import java.io.FileNotFoundException
import java.math.BigDecimal
import java.util.*
class ProfileManager(private val context: Context) : IProfileManager,
@@ -159,13 +160,13 @@ class ProfileManager(private val context: Context) : IProfileManager,
val info = flag.split("=")
when {
info[0].contains("upload") -> upload =
info[1].toLong()
BigDecimal(info[1]).longValueExact()
info[0].contains("download") -> download =
info[1].toLong()
BigDecimal(info[1]).longValueExact()
info[0].contains("total") -> total =
info[1].toLong()
info[0].contains("total") -> total =
BigDecimal(info[1]).longValueExact()
info[0].contains("expire") -> {
if (info[1].isNotEmpty()) {