Some settings + proxy fixes

This commit is contained in:
gdlbo
2022-07-03 14:11:33 +03:00
parent 0db27e1690
commit 5054dbdc7d
4 changed files with 25 additions and 11 deletions
@@ -8,6 +8,7 @@ import static ru.vtosters.lite.ui.vkui.VBottomSheetBuilder.VBSContent;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.About.getCommitLink;
import static ru.vtosters.lite.utils.CacheUtils.humanReadableByteCountBin;
import static ru.vtosters.lite.utils.Globals.*;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getDrawableFromUrl;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
@@ -19,6 +20,7 @@ import static ru.vtosters.lite.utils.Globals.restartApplication;
import static ru.vtosters.lite.utils.Preferences.ads;
import static ru.vtosters.lite.utils.Preferences.devmenu;
import static ru.vtosters.lite.utils.Preferences.disableSettingsSumms;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.hasSpecialVerif;
import static ru.vtosters.lite.utils.Preferences.hasVerification;
import static ru.vtosters.lite.utils.Preferences.isValidSignature;
@@ -27,6 +29,7 @@ import static ru.vtosters.lite.utils.Preferences.navbar;
import static ru.vtosters.lite.utils.Preferences.offline;
import static ru.vtosters.lite.utils.Preferences.shortinfo;
import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Proxy.*;
import static ru.vtosters.lite.utils.Themes.getDarkTheme;
import static ru.vtosters.lite.utils.Themes.getLightTheme;
import static ru.vtosters.lite.utils.Themes.setTheme;
@@ -69,7 +72,7 @@ import ru.vtosters.lite.utils.VKUIwrapper;
public class VTSettings extends MaterialPreferenceToolbarFragment{
public static String getValAsString(String stringid, Boolean value){
if(disableSettingsSumms()) return "";
if(disableSettingsSumms()) return null;
if(value){
return Globals.getString(stringid) + ": " + Globals.getString("vtlsettenabled");
@@ -79,7 +82,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
}
public static String getSSFSsumm(){
if(disableSettingsSumms()) return "";
if(disableSettingsSumms()) return null;
if(hasSpecialVerif())
return Globals.getString("vtlssfssumm") + ": " + Globals.getString("vtlsettverifyes");
@@ -88,17 +91,27 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
}
public static String getDocksumm(){
if(disableSettingsSumms()) return "";
if(disableSettingsSumms()) return null;
return Globals.getString("vtldocksumm") + ": " + DockBarManager.getInstance().getTabCount();
}
public static String getTGSsumm(){
if(disableSettingsSumms()) return "";
if(disableSettingsSumms()) return null;
return Globals.getString("vtltgssumm") + ": " + TelegramStickersService.getInstance(Globals.getContext()).getPacksListReference().size();
}
public static String getProxysumm(){
var type = getPrefsValue("proxy");
if(disableSettingsSumms()) return null;
if(type.equals("noproxy")) type = Globals.getString("vtlsettdisabled");
return Globals.getString("vtlproxysumm") + ": " + type;
}
public static SharedPreferences getCurrentAccount(){
return Globals.getContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE);
}
@@ -115,7 +128,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
String themessumm = getValAsString("vtlthemessumm", navbar());
String tgssumm = getTGSsumm();
String interfacesumm = getValAsString("vtlinterfacesumm", shortinfo());
String proxysumm = getValAsString("vtlproxysumm", getPrefsValue("proxy").equals("noproxy"));
String proxysumm = getProxysumm();
String othersumm = getValAsString("vtlothersumm", vtverif());
String ssfs = getSSFSsumm();
String about = "Commit: " + getBuildNumber();
@@ -2,6 +2,7 @@ package ru.vtosters.lite.utils;
import static java.lang.System.clearProperty;
import static java.lang.System.getProperties;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
@@ -15,7 +16,7 @@ public class Proxy{
String oauth = "oauth.vk.com";
String vkstatic = "static.vk.com";
String proxproxyapi = getPrefsValue("proxyapi");
String proxyapi = getPrefsValue("proxyapi");
String proxyoauth = getPrefsValue("proxyoauth");
String proxystatic = getPrefsValue("proxystatic");
@@ -23,13 +24,13 @@ public class Proxy{
return link;
}
if(proxproxyapi.isEmpty() || proxyoauth.isEmpty() || proxystatic.isEmpty()){
Log.d("VTLite", "Proxy is not set" + " " + proxproxyapi + " " + proxyoauth + " " + proxystatic);
if(proxyapi.isEmpty() || proxyoauth.isEmpty() || proxystatic.isEmpty()){
Log.d("VTLite", "Proxy is not set" + " " + proxyapi + " " + proxyoauth + " " + proxystatic);
return link;
}
if(link.contains(vkapi)){
return link.replace(proxproxyapi, vkapi);
return link.replace(proxyapi, vkapi);
}
if(link.contains(oauth)){
+1 -1
View File
@@ -5764,7 +5764,7 @@
<string name="vtlthemessumm">Покраска навбара</string>
<string name="vtltgssumm">Установлено паков</string>
<string name="vtlinterfacesumm">Округление чисел</string>
<string name="vtlproxysumm">Проксирование</string>
<string name="vtlproxysumm">Тип проксирования</string>
<string name="vtlothersumm">Отображение верификаций</string>
<string name="vtlmultiaccsumm">Доступно аккаунтов</string>
<string name="vtlhidesumm">Скрыть подписи в настройках</string>
+1 -1
View File
@@ -5922,7 +5922,7 @@ May look like a fake leaving the online"</string>
<string name="vtlthemessumm">Navbar coloring</string>
<string name="vtltgssumm">Installed packs</string>
<string name="vtlinterfacesumm">Round numbers</string>
<string name="vtlproxysumm">Proxy</string>
<string name="vtlproxysumm">Proxy type</string>
<string name="vtlothersumm">Show verifications</string>
<string name="vtlmultiaccsumm">Available accounts</string>
<string name="vtlhidesumm">Hide settings summaries</string>