Remove china app check for updated apps

This commit is contained in:
世界 2023-10-27 13:08:38 +08:00
parent 77ab22ee71
commit 953a0bee72
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -23,6 +23,10 @@ class AppChangeReceiver : BroadcastReceiver() {
Log.d(TAG, "per app proxy disabled") Log.d(TAG, "per app proxy disabled")
return return
} }
if (intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
Log.d(TAG, "skip app update")
return
}
val perAppProxyUpdateOnChange = Settings.perAppProxyUpdateOnChange val perAppProxyUpdateOnChange = Settings.perAppProxyUpdateOnChange
if (perAppProxyUpdateOnChange == Settings.PER_APP_PROXY_DISABLED) { if (perAppProxyUpdateOnChange == Settings.PER_APP_PROXY_DISABLED) {
Log.d(TAG, "update on change disabled") Log.d(TAG, "update on change disabled")
@ -36,10 +40,10 @@ class AppChangeReceiver : BroadcastReceiver() {
val isChinaApp = PerAppProxyActivity.scanChinaApps(listOf(packageName)).isNotEmpty() val isChinaApp = PerAppProxyActivity.scanChinaApps(listOf(packageName)).isNotEmpty()
Log.d(TAG, "scan china app result for $packageName: $isChinaApp") Log.d(TAG, "scan china app result for $packageName: $isChinaApp")
if ((perAppProxyUpdateOnChange == Settings.PER_APP_PROXY_INCLUDE) xor !isChinaApp) { if ((perAppProxyUpdateOnChange == Settings.PER_APP_PROXY_INCLUDE) xor !isChinaApp) {
Settings.perAppProxyList = Settings.perAppProxyList + packageName Settings.perAppProxyList += packageName
Log.d(TAG, "added to list") Log.d(TAG, "added to list")
} else { } else {
Settings.perAppProxyList = Settings.perAppProxyList - packageName Settings.perAppProxyList -= packageName
Log.d(TAG, "removed from list") Log.d(TAG, "removed from list")
} }
} }