Refactor AppConfig const
This commit is contained in:
@@ -123,11 +123,11 @@ class AboutActivity : BaseActivity() {
|
||||
binding.checkPreRelease.isChecked = MmkvManager.decodeSettingsBool(AppConfig.PREF_CHECK_UPDATE_PRE_RELEASE, false)
|
||||
|
||||
binding.layoutSoureCcode.setOnClickListener {
|
||||
Utils.openUri(this, AppConfig.v2rayNGUrl)
|
||||
Utils.openUri(this, AppConfig.APP_URL)
|
||||
}
|
||||
|
||||
binding.layoutFeedback.setOnClickListener {
|
||||
Utils.openUri(this, AppConfig.v2rayNGIssues)
|
||||
Utils.openUri(this, AppConfig.APP_ISSUES_URL)
|
||||
}
|
||||
|
||||
binding.layoutOssLicenses.setOnClickListener {
|
||||
@@ -141,11 +141,11 @@ class AboutActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
binding.layoutTgChannel.setOnClickListener {
|
||||
Utils.openUri(this, AppConfig.TgChannelUrl)
|
||||
Utils.openUri(this, AppConfig.TG_CHANNEL_URL)
|
||||
}
|
||||
|
||||
binding.layoutPrivacyPolicy.setOnClickListener {
|
||||
Utils.openUri(this, AppConfig.v2rayNGPrivacyPolicy)
|
||||
Utils.openUri(this, AppConfig.APP_PRIVACY_POLICY)
|
||||
}
|
||||
|
||||
"v${BuildConfig.VERSION_NAME} (${SpeedtestManager.getLibVersion()})".also {
|
||||
|
||||
@@ -683,7 +683,7 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
|
||||
.putExtra("isRunning", mainViewModel.isRunning.value == true)
|
||||
)
|
||||
|
||||
R.id.promotion -> Utils.openUri(this, "${Utils.decode(AppConfig.PromotionUrl)}?t=${System.currentTimeMillis()}")
|
||||
R.id.promotion -> Utils.openUri(this, "${Utils.decode(AppConfig.APP_PROMOTION_URL)}?t=${System.currentTimeMillis()}")
|
||||
R.id.logcat -> startActivity(Intent(this, LogcatActivity::class.java))
|
||||
R.id.about -> startActivity(Intent(this, AboutActivity::class.java))
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class PerAppProxyActivity : BaseActivity() {
|
||||
toast(R.string.msg_downloading_content)
|
||||
binding.pbWaiting.show()
|
||||
|
||||
val url = AppConfig.androidpackagenamelistUrl
|
||||
val url = AppConfig.ANDROID_PACKAGE_NAME_LIST_URL
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
var content = HttpUtil.getUrlContent(url, 5000)
|
||||
if (content.isNullOrEmpty()) {
|
||||
|
||||
@@ -161,7 +161,7 @@ class SettingsActivity : BaseActivity() {
|
||||
}
|
||||
delayTestUrl?.setOnPreferenceChangeListener { _, any ->
|
||||
val nval = any as String
|
||||
delayTestUrl?.summary = if (nval == "") AppConfig.DelayTestUrl else nval
|
||||
delayTestUrl?.summary = if (nval == "") AppConfig.DELAY_TEST_URL else nval
|
||||
true
|
||||
}
|
||||
mode?.setOnPreferenceChangeListener { _, newValue ->
|
||||
@@ -202,7 +202,7 @@ class SettingsActivity : BaseActivity() {
|
||||
remoteDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_REMOTE_DNS, AppConfig.DNS_PROXY)
|
||||
domesticDns?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DOMESTIC_DNS, AppConfig.DNS_DIRECT)
|
||||
dnsHosts?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DNS_HOSTS)
|
||||
delayTestUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DELAY_TEST_URL, AppConfig.DelayTestUrl)
|
||||
delayTestUrl?.summary = MmkvManager.decodeSettingsString(AppConfig.PREF_DELAY_TEST_URL, AppConfig.DELAY_TEST_URL)
|
||||
|
||||
initSharedPreference()
|
||||
}
|
||||
@@ -364,6 +364,6 @@ class SettingsActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
fun onModeHelpClicked(view: View) {
|
||||
Utils.openUri(this, AppConfig.v2rayNGWikiMode)
|
||||
Utils.openUri(this, AppConfig.APP_WIKI_MODE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.v2ray.ang.R
|
||||
import com.v2ray.ang.databinding.ActivityUserAssetBinding
|
||||
import com.v2ray.ang.databinding.ItemRecyclerUserAssetBinding
|
||||
import com.v2ray.ang.dto.AssetUrlItem
|
||||
import com.v2ray.ang.extension.concatUrl
|
||||
import com.v2ray.ang.extension.toTrafficString
|
||||
import com.v2ray.ang.extension.toast
|
||||
import com.v2ray.ang.extension.toastError
|
||||
@@ -121,8 +122,11 @@ class UserAssetActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
private fun setGeoFilesSources() {
|
||||
AlertDialog.Builder(this).setItems(AppConfig.GEO_FILES_SOURCES
|
||||
.toTypedArray()) { _, i ->
|
||||
AlertDialog.Builder(this).setItems(
|
||||
AppConfig.GEO_FILES_SOURCES
|
||||
.map { it.replace(AppConfig.GITHUB_URL + "/", "").replace("/" + AppConfig.GITHUB_DOWNLOAD, "") }
|
||||
.toTypedArray()
|
||||
) { _, i ->
|
||||
try {
|
||||
val value = AppConfig.GEO_FILES_SOURCES[i]
|
||||
MmkvManager.encodeSettings(AppConfig.PREF_GEO_FILES_SOURCES, value)
|
||||
@@ -286,7 +290,8 @@ class UserAssetActivity : BaseActivity() {
|
||||
list.add(
|
||||
Utils.getUuid() to AssetUrlItem(
|
||||
it,
|
||||
getGeoFilesSources() + it
|
||||
getGeoFilesSources().concatUrl(it),
|
||||
locked = true
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -337,7 +342,7 @@ class UserAssetActivity : BaseActivity() {
|
||||
holder.itemUserAssetBinding.assetProperties.text = getString(R.string.msg_file_not_found)
|
||||
}
|
||||
|
||||
if (item.second.remarks in builtInGeoFiles && item.second.url == getGeoFilesSources() + item.second.remarks) {
|
||||
if (item.second.locked == true) {
|
||||
holder.itemUserAssetBinding.layoutEdit.visibility = GONE
|
||||
//holder.itemUserAssetBinding.layoutRemove.visibility = GONE
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user