Browse Source

remove orbot proxy selection, update about menu

master
R4SAS 6 years ago
parent
commit
7534374848
  1. 7
      app/src/main/java/org/purplei2p/lightning/constant/Constants.java
  2. 2
      app/src/main/java/org/purplei2p/lightning/preference/PreferenceManager.java
  3. 3
      app/src/main/java/org/purplei2p/lightning/settings/fragment/GeneralSettingsFragment.java
  4. 12
      app/src/main/java/org/purplei2p/lightning/utils/ProxyUtils.java
  5. 8
      app/src/main/res/values-ru/strings.xml
  6. 8
      app/src/main/res/values/strings.xml
  7. 6
      app/src/main/res/xml/preference_about.xml
  8. 11
      app/src/main/res/xml/preferences_headers.xml

7
app/src/main/java/org/purplei2p/lightning/constant/Constants.java

@ -57,14 +57,13 @@ public final class Constants {
public static final String FOLDER = "folder://"; public static final String FOLDER = "folder://";
// These should match the order of @array/proxy_choices_array // These should match the order of @array/proxy_choices_array
@IntDef({NO_PROXY, PROXY_ORBOT, PROXY_I2P, PROXY_MANUAL}) @IntDef({NO_PROXY, PROXY_I2P, PROXY_MANUAL})
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface Proxy {} public @interface Proxy {}
public static final int NO_PROXY = 0; public static final int NO_PROXY = 0;
public static final int PROXY_ORBOT = 1; public static final int PROXY_I2P = 1;
public static final int PROXY_I2P = 2; public static final int PROXY_MANUAL = 2;
public static final int PROXY_MANUAL = 3;
// Default text encoding we will use // Default text encoding we will use
public static final String DEFAULT_ENCODING = "UTF-8"; public static final String DEFAULT_ENCODING = "UTF-8";

2
app/src/main/java/org/purplei2p/lightning/preference/PreferenceManager.java

@ -232,7 +232,6 @@ public class PreferenceManager {
@Constants.Proxy int proxy = mPrefs.getInt(Name.PROXY_CHOICE, Constants.PROXY_I2P); @Constants.Proxy int proxy = mPrefs.getInt(Name.PROXY_CHOICE, Constants.PROXY_I2P);
switch (proxy) { switch (proxy) {
case Constants.NO_PROXY: case Constants.NO_PROXY:
case Constants.PROXY_ORBOT:
case Constants.PROXY_I2P: case Constants.PROXY_I2P:
case Constants.PROXY_MANUAL: case Constants.PROXY_MANUAL:
return proxy; return proxy;
@ -431,7 +430,6 @@ public class PreferenceManager {
* Valid choices: * Valid choices:
* <ul> * <ul>
* <li>{@link Constants#NO_PROXY}</li> * <li>{@link Constants#NO_PROXY}</li>
* <li>{@link Constants#PROXY_ORBOT}</li>
* <li>{@link Constants#PROXY_I2P}</li> * <li>{@link Constants#PROXY_I2P}</li>
* </ul> * </ul>
* *

3
app/src/main/java/org/purplei2p/lightning/settings/fragment/GeneralSettingsFragment.java

@ -194,9 +194,6 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
private void setProxyChoice(@Constants.Proxy int choice) { private void setProxyChoice(@Constants.Proxy int choice) {
switch (choice) { switch (choice) {
case Constants.PROXY_ORBOT:
choice = ProxyUtils.setProxyChoice(choice, mActivity);
break;
case Constants.PROXY_I2P: case Constants.PROXY_I2P:
choice = ProxyUtils.setProxyChoice(choice, mActivity); choice = ProxyUtils.setProxyChoice(choice, mActivity);
break; break;

12
app/src/main/java/org/purplei2p/lightning/utils/ProxyUtils.java

@ -40,10 +40,6 @@ public class ProxyUtils {
case Constants.NO_PROXY: case Constants.NO_PROXY:
// We shouldn't be here // We shouldn't be here
return; return;
case Constants.PROXY_ORBOT:
host = "localhost";
port = 8118;
break;
case Constants.PROXY_I2P: case Constants.PROXY_I2P:
host = "localhost"; host = "localhost";
port = 4444; port = 4444;
@ -82,14 +78,6 @@ public class ProxyUtils {
@Constants.Proxy @Constants.Proxy
public static int setProxyChoice(int choice, @NonNull Activity activity) { public static int setProxyChoice(int choice, @NonNull Activity activity) {
switch (choice) {
case Constants.PROXY_ORBOT:
break;
case Constants.PROXY_I2P:
break;
case Constants.PROXY_MANUAL:
break;
}
return choice; return choice;
} }
} }

8
app/src/main/res/values-ru/strings.xml

@ -93,8 +93,8 @@
<string name="download_sdcard_busy_dlg_title">Карта памяти недоступна</string> <string name="download_sdcard_busy_dlg_title">Карта памяти недоступна</string>
<string name="download_sdcard_busy_dlg_msg">Карта памяти подключена к ПК. Для начала загрузки отключите её от ПК, нажав на уведомление.</string> <string name="download_sdcard_busy_dlg_msg">Карта памяти подключена к ПК. Для начала загрузки отключите её от ПК, нажав на уведомление.</string>
<string name="incognito_cookies">Включить куки в режиме инкогнито</string> <string name="incognito_cookies">Включить куки в режиме инкогнито</string>
<string name="action_follow_me">Связаться с разработчиками</string> <string name="bugtracker">Багтрекер</string>
<string name="url_twitter">twitter.com/RestainoAnthony</string> <string name="bugtracker_title">Сообщить о проблеме можно здесь</string>
<string name="clear_cache">Очистить кэш</string> <string name="clear_cache">Очистить кэш</string>
<string name="message_cache_cleared">Кэш очищен</string> <string name="message_cache_cleared">Кэш очищен</string>
<string name="message_import">Закладки импортированы</string> <string name="message_import">Закладки импортированы</string>
@ -126,7 +126,6 @@
<string name="http_proxy">HTTP прокси</string> <string name="http_proxy">HTTP прокси</string>
<string-array name="proxy_choices_array"> <string-array name="proxy_choices_array">
<item>Нет</item> <item>Нет</item>
<item>Orbot</item>
<item>I2P</item> <item>I2P</item>
<item>Вручную</item> <item>Вручную</item>
</string-array> </string-array>
@ -208,9 +207,6 @@
<string name="action_delete_all_bookmarks">Удалить все закладки</string> <string name="action_delete_all_bookmarks">Удалить все закладки</string>
<string name="message_open_download_fail">Не удалось открыть файл</string> <string name="message_open_download_fail">Не удалось открыть файл</string>
<string name="faq">FAQ</string>
<string name="faq_description">Часто задаваемые вопросы</string>
<!-- debug strings --> <!-- debug strings -->
<string name="debug_title">Настройки отладки</string> <string name="debug_title">Настройки отладки</string>
<string name="debug_leak_canary">LeakCanary</string> <string name="debug_leak_canary">LeakCanary</string>

8
app/src/main/res/values/strings.xml

@ -93,8 +93,8 @@
<string name="download_sdcard_busy_dlg_title">USB storage unavailable</string> <string name="download_sdcard_busy_dlg_title">USB storage unavailable</string>
<string name="download_sdcard_busy_dlg_msg">The storage is busy. To allow downloads, touch \'Turn Off USB Storage\' in the notification.</string> <string name="download_sdcard_busy_dlg_msg">The storage is busy. To allow downloads, touch \'Turn Off USB Storage\' in the notification.</string>
<string name="incognito_cookies">Enable cookies in incognito mode</string> <string name="incognito_cookies">Enable cookies in incognito mode</string>
<string name="action_follow_me">Contact me</string> <string name="bugtracker">Bugtracker</string>
<string name="url_twitter">twitter.com/RestainoAnthony</string> <string name="bugtracker_title">You can report issues here</string>
<string name="clear_cache">Clear cache</string> <string name="clear_cache">Clear cache</string>
<string name="message_cache_cleared">Cache cleared</string> <string name="message_cache_cleared">Cache cleared</string>
<string name="message_import">Bookmarks were imported</string> <string name="message_import">Bookmarks were imported</string>
@ -126,7 +126,6 @@
<string name="http_proxy">HTTP proxy</string> <string name="http_proxy">HTTP proxy</string>
<string-array name="proxy_choices_array"> <string-array name="proxy_choices_array">
<item>None</item> <item>None</item>
<item>Orbot</item>
<item>I2P</item> <item>I2P</item>
<item>Manual</item> <item>Manual</item>
</string-array> </string-array>
@ -208,9 +207,6 @@
<string name="action_delete_all_bookmarks">Delete all bookmarks</string> <string name="action_delete_all_bookmarks">Delete all bookmarks</string>
<string name="message_open_download_fail">This file doesn\'t exist anymore</string> <string name="message_open_download_fail">This file doesn\'t exist anymore</string>
<string name="faq">FAQ</string>
<string name="faq_description">Frequently asked questions</string>
<!-- debug strings --> <!-- debug strings -->
<string name="debug_title">Debug Settings</string> <string name="debug_title">Debug Settings</string>
<string name="debug_leak_canary">LeakCanary</string> <string name="debug_leak_canary">LeakCanary</string>

6
app/src/main/res/xml/preference_about.xml

@ -4,11 +4,11 @@
<PreferenceCategory android:title="@string/settings_about"> <PreferenceCategory android:title="@string/settings_about">
<Preference <Preference
android:summary="@string/url_twitter" android:summary="@string/bugtracker"
android:title="@string/action_follow_me"> android:title="@string/bugtracker_title">
<intent <intent
android:action="android.intent.action.VIEW" android:action="android.intent.action.VIEW"
android:data="http://twitter.com/RestainoAnthony"> android:data="https://gitlab.i2pd.xyz/r4sas/lightning-i2p/issues">
<extra <extra
android:name="SOURCE" android:name="SOURCE"
android:value="SELF" /> android:value="SELF" />

11
app/src/main/res/xml/preferences_headers.xml

@ -19,17 +19,6 @@
android:fragment="org.purplei2p.lightning.settings.fragment.AboutSettingsFragment" android:fragment="org.purplei2p.lightning.settings.fragment.AboutSettingsFragment"
android:summary="@string/settings_about_explain" android:summary="@string/settings_about_explain"
android:title="@string/settings_about"/> android:title="@string/settings_about"/>
<header
android:summary="@string/faq_description"
android:title="@string/faq">
<intent
android:action="android.intent.action.VIEW"
android:data="http://acrdevelopment.org/lightning/faq">
<extra
android:name="SOURCE"
android:value="SELF"/>
</intent>
</header>
<header <header
android:fragment="org.purplei2p.lightning.settings.fragment.DebugSettingsFragment" android:fragment="org.purplei2p.lightning.settings.fragment.DebugSettingsFragment"
android:title="@string/debug_title"/> android:title="@string/debug_title"/>

Loading…
Cancel
Save