removed random proxy
This commit is contained in:
@@ -108,22 +108,22 @@ public class ProxyHook {
|
||||
|
||||
RadioButton rgDefault = new RadioButton(new ContextThemeWrapper(ctx, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
|
||||
RadioButton rgZaborona = new RadioButton(new ContextThemeWrapper(ctx, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
|
||||
RadioButton rgRandomProxy = new RadioButton(new ContextThemeWrapper(ctx, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
|
||||
// RadioButton rgRandomProxy = new RadioButton(new ContextThemeWrapper(ctx, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
|
||||
RadioButton rgVika = new RadioButton(new ContextThemeWrapper(ctx, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
|
||||
|
||||
SwitchHook.setCompoundButton(rgDefault);
|
||||
SwitchHook.setCompoundButton(rgZaborona);
|
||||
SwitchHook.setCompoundButton(rgRandomProxy);
|
||||
// SwitchHook.setCompoundButton(rgRandomProxy);
|
||||
SwitchHook.setCompoundButton(rgVika);
|
||||
|
||||
rg.addView(rgDefault);
|
||||
rg.addView(rgVika);
|
||||
rg.addView(rgZaborona);
|
||||
rg.addView(rgRandomProxy);
|
||||
// rg.addView(rgRandomProxy);
|
||||
|
||||
rgDefault.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
|
||||
rgZaborona.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
|
||||
rgRandomProxy.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
|
||||
// rgRandomProxy.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
|
||||
rgVika.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
|
||||
|
||||
rg.setPadding(dp2px(18f), dp2px(12f), dp2px(18f), 0);
|
||||
@@ -134,15 +134,15 @@ public class ProxyHook {
|
||||
rgZaborona.setText(ctx.getString(R.string.proxy_enable) + " (Zaborona)");
|
||||
rgZaborona.setTextColor(getTextAttr());
|
||||
|
||||
rgRandomProxy.setText(ctx.getString(R.string.proxy_enable) + " (Random Socks Proxy)");
|
||||
rgRandomProxy.setTextColor(getTextAttr());
|
||||
// rgRandomProxy.setText(ctx.getString(R.string.proxy_enable) + " (Random Socks Proxy)");
|
||||
// rgRandomProxy.setTextColor(getTextAttr());
|
||||
|
||||
rgVika.setText(ctx.getString(R.string.proxy_enable) + " (Vika Mobile)");
|
||||
rgVika.setTextColor(getTextAttr());
|
||||
|
||||
rgZaborona.setChecked(isZaboronaEnabled());
|
||||
rgDefault.setChecked(!isZaboronaEnabled() && !isRandomProxyEnabled() && !isVikaProxyEnabled());
|
||||
rgRandomProxy.setChecked(isRandomProxyEnabled());
|
||||
// rgRandomProxy.setChecked(isRandomProxyEnabled());
|
||||
rgVika.setChecked(isVikaProxyEnabled());
|
||||
|
||||
new VkAlertDialog.Builder(ctx)
|
||||
@@ -153,9 +153,9 @@ public class ProxyHook {
|
||||
if (rgZaborona.isChecked()) {
|
||||
Preferences.getPreferences().edit().putString("proxy", "zaborona").commit();
|
||||
restartApplication();
|
||||
} else if (rgRandomProxy.isChecked()) {
|
||||
Preferences.getPreferences().edit().putString("proxy", "randomproxy").commit();
|
||||
restartApplication();
|
||||
// } else if (rgRandomProxy.isChecked()) {
|
||||
// Preferences.getPreferences().edit().putString("proxy", "randomproxy").commit();
|
||||
// restartApplication();
|
||||
} else if (rgVika.isChecked()) {
|
||||
Preferences.getPreferences().edit().putString("proxy", "vika").commit();
|
||||
restartApplication();
|
||||
|
||||
@@ -71,7 +71,8 @@ public class ProxyUtils {
|
||||
}
|
||||
|
||||
public static Boolean isRandomProxyEnabled() {
|
||||
return Preferences.getString("proxy").equals("randomproxy");
|
||||
// return Preferences.getString("proxy").equals("randomproxy");
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Boolean isApiProxyEnabled() {
|
||||
@@ -129,11 +130,11 @@ public class ProxyUtils {
|
||||
return list.contains(":"); // proxy format: ip:port
|
||||
}
|
||||
|
||||
public static void setProxy() throws IOException {
|
||||
public static void setProxy() {
|
||||
if (!isAnyProxyEnabled()) return;
|
||||
switch (Preferences.getString("proxy")) {
|
||||
case "zaborona" -> Zaborona.loadProxy();
|
||||
case "randomproxy" -> RandomProxy.loadProxy();
|
||||
// case "randomproxy" -> RandomProxy.loadProxy();
|
||||
case "socks" -> CustomSocks.loadProxy();
|
||||
case "http" -> CustomHttp.loadProxy();
|
||||
case "https" -> CustomHttps.loadProxy();
|
||||
|
||||
@@ -13,14 +13,14 @@ public class ProxySettingsFragment extends TrackedMaterialPreferenceToolbarFragm
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_proxy);
|
||||
findPreference("random_proxy").setOnPreferenceClickListener(preference -> {
|
||||
try {
|
||||
setupNewProxy();
|
||||
} catch (IOException e) {
|
||||
sendToast(requireContext().getString(R.string.get_proxy_error));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
// findPreference("random_proxy").setOnPreferenceClickListener(preference -> {
|
||||
// try {
|
||||
// setupNewProxy();
|
||||
// } catch (IOException e) {
|
||||
// sendToast(requireContext().getString(R.string.get_proxy_error));
|
||||
// }
|
||||
// return true;
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -604,7 +604,7 @@
|
||||
<item>Без проксі</item>
|
||||
<item>zaborona.help</item>
|
||||
<item>VikaMobile</item>
|
||||
<item>Рандомны проксі</item>
|
||||
<!-- <item>Рандомны проксі</item>-->
|
||||
<item>Іншы проксі для API</item>
|
||||
<item>Іншы HTTP</item>
|
||||
<item>Іншы HTTPS</item>
|
||||
|
||||
@@ -592,7 +592,7 @@
|
||||
<item>Без прокси</item>
|
||||
<item>zaborona.help</item>
|
||||
<item>VikaMobile</item>
|
||||
<item>Рандомный прокси</item>
|
||||
<!-- <item>Рандомный прокси</item>-->
|
||||
<item>Сторонний прокси для API</item>
|
||||
<item>Сторонний HTTP</item>
|
||||
<item>Сторонний HTTPS</item>
|
||||
|
||||
@@ -592,7 +592,7 @@
|
||||
<item>Без проксі</item>
|
||||
<item>zaborona.help</item>
|
||||
<item>VikaMobile</item>
|
||||
<item>Випадковий проксі</item>
|
||||
<!-- <item>Випадковий проксі</item>-->
|
||||
<item>Сторонній проксі для API</item>
|
||||
<item>Сторонній HTTP</item>
|
||||
<item>Сторонній HTTPS</item>
|
||||
|
||||
@@ -736,7 +736,7 @@
|
||||
<item>No proxy</item>
|
||||
<item>zaborona.help</item>
|
||||
<item>VikaMobile</item>
|
||||
<item>Random proxy</item>
|
||||
<!-- <item>Random proxy</item>-->
|
||||
<item>Custom API proxy</item>
|
||||
<item>Custom HTTP</item>
|
||||
<item>Custom HTTPS</item>
|
||||
@@ -746,7 +746,7 @@
|
||||
<item>noproxy</item>
|
||||
<item>zaborona</item>
|
||||
<item>vika</item>
|
||||
<item>randomproxy</item>
|
||||
<!-- <item>randomproxy</item>-->
|
||||
<item>apiproxy</item>
|
||||
<item>http</item>
|
||||
<item>https</item>
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
android:entryValues="@array/proxy_value"
|
||||
android:key="proxy"
|
||||
android:title="@string/useproxy"/>
|
||||
<Preference
|
||||
android:key="random_proxy"
|
||||
android:summary="@string/proxy_setup_summ"
|
||||
android:title="@string/proxy_setup_title"/>
|
||||
<!-- <Preference-->
|
||||
<!-- android:key="random_proxy"-->
|
||||
<!-- android:summary="@string/proxy_setup_summ"-->
|
||||
<!-- android:title="@string/proxy_setup_title"/>-->
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/proxyadvsettings">
|
||||
<EditTextPreference
|
||||
|
||||
Reference in New Issue
Block a user