diff --git a/app/build.gradle b/app/build.gradle index 79ce7ed59..b768a1fcd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,8 +24,8 @@ android { applicationId "net.xzos.upgradeall" minSdkVersion 21 targetSdkVersion 29 - versionCode 37 - versionName "0.1.1" + versionCode 38 + versionName "0.1.1-rc.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/net/xzos/upgradeall/ui/viewmodels/fragment/CloudConfigPlaceholderFragment.kt b/app/src/main/java/net/xzos/upgradeall/ui/viewmodels/fragment/CloudConfigPlaceholderFragment.kt index 5ab20f02a..f89749761 100644 --- a/app/src/main/java/net/xzos/upgradeall/ui/viewmodels/fragment/CloudConfigPlaceholderFragment.kt +++ b/app/src/main/java/net/xzos/upgradeall/ui/viewmodels/fragment/CloudConfigPlaceholderFragment.kt @@ -87,6 +87,7 @@ internal class CloudConfigPlaceholderFragment : Fragment() { } } ?: run { + MiscellaneousUtils.resetCloudHubUrl() if (this@CloudConfigPlaceholderFragment.isVisible) MiscellaneousUtils.showToast(context, R.string.network_error) } diff --git a/app/src/main/java/net/xzos/upgradeall/utils/MiscellaneousUtils.kt b/app/src/main/java/net/xzos/upgradeall/utils/MiscellaneousUtils.kt index bba2ceb10..7a28dc0f2 100644 --- a/app/src/main/java/net/xzos/upgradeall/utils/MiscellaneousUtils.kt +++ b/app/src/main/java/net/xzos/upgradeall/utils/MiscellaneousUtils.kt @@ -24,6 +24,7 @@ import org.json.JSONException import java.io.StringReader import java.util.* + object MiscellaneousUtils { init { @@ -55,6 +56,17 @@ object MiscellaneousUtils { return cloudConfigGetter } + fun resetCloudHubUrl() { + val prefKey = "cloud_rules_hub_url" + val defaultCloudRulesHubUrl = context.resources.getString(R.string.default_cloud_rules_hub_url) + val prefs = PreferenceManager.getDefaultSharedPreferences(context) + val editor = prefs.edit() + editor.putString(prefKey, defaultCloudRulesHubUrl) + editor.apply() + renewCloudConfigGetter() + showToast(context, R.string.reset_git_url_configuration, duration = Toast.LENGTH_LONG) + } + fun accessByBrowser(url: String?, context: Context?) { if (url != null && context != null) try { diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml index 5e25e75b7..565e93643 100644 --- a/app/src/main/res/values/config.xml +++ b/app/src/main/res/values/config.xml @@ -6,5 +6,5 @@ 10 18 - https://github.com/DUpdateSystem/UpgradeAll-rules/ + https://github.com/DUpdateSystem/UpgradeAll-rules/tree/master diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 806cd7e2a..3150fe0ba 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -126,6 +126,7 @@ 长按云端版本号可标记为“已处理”,即跳过此次更新 \n标记后再次长按已标记的版本号即可取消标记 标注已处理的版本号已落后于最新版本 已自动修复错误配置 + 已尝试复原 Git 地址配置 处理中 添加新分组