[app] Enabled DoH by default if country is CN

This commit is contained in:
tehcneko 2021-02-27 21:09:58 +08:00
parent 3bb40a5990
commit 9ab0ee9d32
1 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import androidx.preference.PreferenceManager;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Locale;
import io.github.lsposed.manager.repo.RepoLoader;
import io.github.lsposed.manager.ui.activity.CrashReportActivity;
@ -93,6 +94,11 @@ public class App extends Application {
instance = this;
pref = PreferenceManager.getDefaultSharedPreferences(this);
if ("CN".equals(Locale.getDefault().getCountry())) {
if (!pref.contains("doh")) {
pref.edit().putBoolean("doh", true).apply();
}
}
DayNightDelegate.setApplicationContext(this);
DayNightDelegate.setDefaultNightMode(ThemeUtil.getDarkTheme());
RepoLoader.getInstance().loadRemoteData();