Rename ProfileItem to ProfileLiteItem
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.v2ray.ang.dto
|
||||
|
||||
data class ProfileItem(
|
||||
data class ProfileLiteItem(
|
||||
val configType: EConfigType,
|
||||
var subscriptionId: String = "",
|
||||
var remarks: String = "",
|
||||
@@ -2,5 +2,5 @@ package com.v2ray.ang.dto
|
||||
|
||||
data class ServersCache(
|
||||
val guid: String,
|
||||
val profile: ProfileItem
|
||||
val profile: ProfileLiteItem
|
||||
)
|
||||
@@ -5,7 +5,7 @@ import com.tencent.mmkv.MMKV
|
||||
import com.v2ray.ang.AppConfig.PREF_IS_BOOTED
|
||||
import com.v2ray.ang.AppConfig.PREF_ROUTING_RULESET
|
||||
import com.v2ray.ang.dto.AssetUrlItem
|
||||
import com.v2ray.ang.dto.ProfileItem
|
||||
import com.v2ray.ang.dto.ProfileLiteItem
|
||||
import com.v2ray.ang.dto.RulesetItem
|
||||
import com.v2ray.ang.dto.ServerAffiliationInfo
|
||||
import com.v2ray.ang.dto.ServerConfig
|
||||
@@ -72,7 +72,7 @@ object MmkvManager {
|
||||
return JsonUtil.fromJson(json, ServerConfig::class.java)
|
||||
}
|
||||
|
||||
fun decodeProfileConfig(guid: String): ProfileItem? {
|
||||
fun decodeProfileConfig(guid: String): ProfileLiteItem? {
|
||||
if (guid.isBlank()) {
|
||||
return null
|
||||
}
|
||||
@@ -80,7 +80,7 @@ object MmkvManager {
|
||||
if (json.isNullOrBlank()) {
|
||||
return null
|
||||
}
|
||||
return JsonUtil.fromJson(json, ProfileItem::class.java)
|
||||
return JsonUtil.fromJson(json, ProfileLiteItem::class.java)
|
||||
}
|
||||
|
||||
fun encodeServerConfig(guid: String, config: ServerConfig): String {
|
||||
@@ -94,7 +94,7 @@ object MmkvManager {
|
||||
mainStorage.encode(KEY_SELECTED_SERVER, key)
|
||||
}
|
||||
}
|
||||
val profile = ProfileItem(
|
||||
val profile = ProfileLiteItem(
|
||||
configType = config.configType,
|
||||
subscriptionId = config.subscriptionId,
|
||||
remarks = config.remarks,
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.v2ray.ang.AppConfig
|
||||
import com.v2ray.ang.AppConfig.ANG_PACKAGE
|
||||
import com.v2ray.ang.R
|
||||
import com.v2ray.ang.dto.EConfigType
|
||||
import com.v2ray.ang.dto.ProfileItem
|
||||
import com.v2ray.ang.dto.ProfileLiteItem
|
||||
import com.v2ray.ang.dto.ServerConfig
|
||||
import com.v2ray.ang.dto.ServersCache
|
||||
import com.v2ray.ang.dto.V2rayConfig
|
||||
@@ -102,7 +102,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
|
||||
val key = MmkvManager.encodeServerConfig("", config)
|
||||
MmkvManager.encodeServerRaw(key, server)
|
||||
serverList.add(0, key)
|
||||
val profile = ProfileItem(
|
||||
val profile = ProfileLiteItem(
|
||||
configType = config.configType,
|
||||
subscriptionId = config.subscriptionId,
|
||||
remarks = config.remarks,
|
||||
@@ -131,7 +131,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
|
||||
var profile = MmkvManager.decodeProfileConfig(guid)
|
||||
if (profile == null) {
|
||||
val config = MmkvManager.decodeServerConfig(guid) ?: continue
|
||||
profile = ProfileItem(
|
||||
profile = ProfileLiteItem(
|
||||
configType = config.configType,
|
||||
subscriptionId = config.subscriptionId,
|
||||
remarks = config.remarks,
|
||||
|
||||
Reference in New Issue
Block a user