lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2026 -----
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 19802 discussions
[tor-browser/tor-browser-52.7.2esr-8.0-1] add distribution directory and options settings
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 0386bede269ce05d7155fc3b0d8b36e0539b6f78 Author: n8fr8 <nathan(a)freitas.net> Date: Mon Jul 17 21:59:42 2017 -0400 add distribution directory and options settings Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- .mozconfig-orfox | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mozconfig-orfox b/.mozconfig-orfox index 4b7a40f81123..1db4bd923cd1 100755 --- a/.mozconfig-orfox +++ b/.mozconfig-orfox @@ -9,13 +9,14 @@ ac_add_options --enable-application=mobile/android ac_add_options --target=arm-linux-androideabi ac_add_options --with-android-ndk="$NDK_BASE" #Enter the android ndk location(ndk r10e) ac_add_options --with-android-sdk="$SDK_BASE" #Enter the android sdk location +ac_add_options --with-branding=mobile/android/branding/orfox +ac_add_options --with-android-distribution-directory=mobile/android/orfox/distribution #enable ccache to set amount of cache assigned for build. ac_add_options --with-ccache ac_add_options --enable-optimize #ac_add_options --enable-official-branding -ac_add_options --with-branding=mobile/android/branding/orfox ##ac_add_options --enable-tor-browser-update ##ac_add_options --enable-update-packaging ac_add_options --enable-signmar
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] fix #17 from https://github.com/amoghbl1/tor-browser/issues don't restore tabs by default
by gk@torproject.org 20 Mar '18

20 Mar '18
commit e311353ec9e015992ae672834cfa9de796cb0ece Author: n8fr8 <nathan(a)freitas.net> Date: Mon Jul 17 13:33:42 2017 -0400 fix #17 from https://github.com/amoghbl1/tor-browser/issues don't restore tabs by default fix #11 from https://github.com/amoghbl1/tor-browser/issues turn off health report by default search history disabled by default fixes #12 sets private data to clear by default disable camera permissions as part of WebRTC disable #15 more work on #15 to remove permissions disable search history for v11+ as well work on #15 to disable location permissions ensure search history is off by default make sure voice and qr is disabled by default make sure autoplay is off by default Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- .../android/base/FennecManifest_permissions.xml.in | 12 ++++++++++- .../java/org/mozilla/gecko/home/BrowserSearch.java | 2 +- .../org/mozilla/gecko/home/SearchEngineRow.java | 2 +- .../mozilla/gecko/toolbar/ToolbarEditLayout.java | 4 ++-- mobile/android/base/resources/values/arrays.xml | 24 +++++++++++----------- .../base/resources/xml-v11/preferences_search.xml | 2 +- .../base/resources/xml/preferences_advanced.xml | 6 ++++-- .../base/resources/xml/preferences_privacy.xml | 2 +- .../base/resources/xml/preferences_search.xml | 2 +- .../android/geckoview/src/main/AndroidManifest.xml | 4 ++++ mobile/android/modules/RuntimePermissions.jsm | 2 +- .../SearchAndroidManifest_permissions.xml.in | 2 ++ modules/libpref/init/all.js | 2 +- 13 files changed, 42 insertions(+), 24 deletions(-) diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index cf3365582cb3..e711ce6a19de 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -17,9 +17,15 @@ (potentially) of the push feature. --> #include GcmAndroidManifest_permissions.xml.in +#ifdef MOZ_WIFI_STATE <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> +#endif + +#ifdef MOZ_LOCATION <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> +#endif + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> @@ -34,12 +40,16 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> + #ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> #endif +#ifdef MOZ_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif + <uses-feature android:name="android.hardware.touchscreen"/> <!-- Tab Queue --> @@ -56,10 +66,10 @@ <uses-feature android:name="android.hardware.audio.low_latency" android:required="false"/> <uses-feature android:name="android.hardware.camera.any" android:required="false"/> <uses-feature android:name="android.hardware.microphone" android:required="false"/> -#endif <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> +#endif <!-- App requires OpenGL ES 2.0 --> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> diff --git a/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java b/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java index 7732932fe3e5..4f029fcc331b 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/BrowserSearch.java @@ -275,7 +275,7 @@ public class BrowserSearch extends HomeFragment super.onResume(); final SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext()); - mSavedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, true); + mSavedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, false); // Fetch engines if we need to. if (mSearchEngines.isEmpty() || !Locale.getDefault().equals(mLastLocale)) { diff --git a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java index 5b97a8f5f7e9..39e9bc2865b7 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java @@ -391,7 +391,7 @@ class SearchEngineRow extends AnimatedHeightLayout { final int recycledSuggestionCount = mSuggestionView.getChildCount(); final SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext()); - final boolean savedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, true); + final boolean savedSearchesEnabled = prefs.getBoolean(GeckoPreferences.PREFS_HISTORY_SAVED_SEARCH, false); // Remove duplicates of search engine suggestions from saved searches. List<String> searchHistorySuggestions = (rawSearchHistorySuggestions != null) ? rawSearchHistorySuggestions : new ArrayList<String>(); diff --git a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java index c9731a4014d6..c0cee5eeaadd 100644 --- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java @@ -278,7 +278,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout { return false; } return GeckoSharedPrefs.forApp(context) - .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, true); + .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, false); } private void launchVoiceRecognizer() { @@ -315,7 +315,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout { return false; } return GeckoSharedPrefs.forApp(context) - .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, true); + .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, false); } private void launchQRCodeReader() { diff --git a/mobile/android/base/resources/values/arrays.xml b/mobile/android/base/resources/values/arrays.xml index d220ca9bb4e0..8369d817da8d 100644 --- a/mobile/android/base/resources/values/arrays.xml +++ b/mobile/android/base/resources/values/arrays.xml @@ -70,8 +70,8 @@ <item>@string/history_title</item> </string-array> <string-array name="pref_import_android_defaults"> - <item>true</item> - <item>true</item> + <item>false</item> + <item>false</item> </string-array> <string-array name="pref_import_android_values"> <item>android_import.data.bookmarks</item> @@ -126,16 +126,16 @@ <item>private.data.passwords</item> </string-array> <string-array name="pref_clear_on_exit_defaults"> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> </string-array> <string-array name="pref_restore_entries"> <item>@string/pref_restore_always</item> diff --git a/mobile/android/base/resources/xml-v11/preferences_search.xml b/mobile/android/base/resources/xml-v11/preferences_search.xml index 937b05b617c6..a58bb7cece44 100644 --- a/mobile/android/base/resources/xml-v11/preferences_search.xml +++ b/mobile/android/base/resources/xml-v11/preferences_search.xml @@ -27,7 +27,7 @@ <CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled" android:title="@string/pref_history_search_suggestions" - android:defaultValue="true" + android:defaultValue="false" android:persistent="true" /> </PreferenceScreen> diff --git a/mobile/android/base/resources/xml/preferences_advanced.xml b/mobile/android/base/resources/xml/preferences_advanced.xml index 32cdf0b915b5..ca8318b83767 100644 --- a/mobile/android/base/resources/xml/preferences_advanced.xml +++ b/mobile/android/base/resources/xml/preferences_advanced.xml @@ -27,7 +27,7 @@ <ListPreference android:key="android.not_a_preference.restoreSession3" android:title="@string/pref_restore" - android:defaultValue="always" + android:defaultValue="quit" android:entries="@array/pref_restore_entries" android:entryValues="@array/pref_restore_values" android:persistent="true" /> @@ -62,7 +62,9 @@ <SwitchPreference android:key="media.autoplay.enabled" android:title="@string/pref_media_autoplay_enabled" - android:summary="@string/pref_media_autoplay_enabled_summary" /> + android:summary="@string/pref_media_autoplay_enabled_summary" + android:defaultValue="false" + /> </PreferenceCategory> diff --git a/mobile/android/base/resources/xml/preferences_privacy.xml b/mobile/android/base/resources/xml/preferences_privacy.xml index 7b3215cb2665..1d4593ec2523 100644 --- a/mobile/android/base/resources/xml/preferences_privacy.xml +++ b/mobile/android/base/resources/xml/preferences_privacy.xml @@ -99,7 +99,7 @@ <CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled" android:title="@string/datareporting_fhr_title" android:summary="@string/datareporting_fhr_summary2" - android:defaultValue="true" /> + android:defaultValue="false" /> <org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.healthreport.link" android:title="@string/datareporting_abouthr_title" diff --git a/mobile/android/base/resources/xml/preferences_search.xml b/mobile/android/base/resources/xml/preferences_search.xml index 440167fe5e2a..fc8c258821e1 100644 --- a/mobile/android/base/resources/xml/preferences_search.xml +++ b/mobile/android/base/resources/xml/preferences_search.xml @@ -34,7 +34,7 @@ <CheckBoxPreference android:key="android.not_a_preference.search.search_history.enabled" android:title="@string/pref_history_search_suggestions" - android:defaultValue="true" + android:defaultValue="false" android:persistent="true" /> </PreferenceScreen> diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml index 4e2aaf447128..8584018cab39 100644 --- a/mobile/android/geckoview/src/main/AndroidManifest.xml +++ b/mobile/android/geckoview/src/main/AndroidManifest.xml @@ -3,7 +3,9 @@ <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> +#ifdef MOZ_LOCATION <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> +#endif <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> @@ -18,8 +20,10 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> +#ifdef MOZ_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif <uses-feature android:name="android.hardware.touchscreen"/> <!--#ifdef MOZ_WEBRTC--> diff --git a/mobile/android/modules/RuntimePermissions.jsm b/mobile/android/modules/RuntimePermissions.jsm index 42d8024b1a60..21c6102cafdb 100644 --- a/mobile/android/modules/RuntimePermissions.jsm +++ b/mobile/android/modules/RuntimePermissions.jsm @@ -38,4 +38,4 @@ var RuntimePermissions = { return Messaging.sendRequestForResult(msg); } -}; \ No newline at end of file +}; diff --git a/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in b/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in index a0abb99faebb..2575e5fe1bc4 100644 --- a/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in +++ b/mobile/android/search/manifests/SearchAndroidManifest_permissions.xml.in @@ -1,3 +1,5 @@ +#ifdef MOZ_LOCATION <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> +#endif <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 198028eeb96c..766e665c074a 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -591,7 +591,7 @@ pref("media.encoder.webm.enabled", true); #endif // Whether to autostart a media element with an |autoplay| attribute -pref("media.autoplay.enabled", true); +pref("media.autoplay.enabled", false); // The default number of decoded video frames that are enqueued in // MediaDecoderReader's mVideoQueue.
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] change defaults for Orfox
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 8030bcae3d0bb222cae6cee66fb5c1846cec8282 Author: n8fr8 <nathan(a)freitas.net> Date: Mon Jul 17 22:17:16 2017 -0400 change defaults for Orfox Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/moz.configure | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index 0ab0b113e274..c92919b5e767 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -19,23 +19,23 @@ project_flag('MOZ_ANDROID_GCM', project_flag('MOZ_ANDROID_DOWNLOADS_INTEGRATION', help='Enable system download manager on Android', - default=True) + default=False) project_flag('MOZ_ANDROID_BEAM', help='Enable NFC permission on Android', - default=True) + default=False) project_flag('MOZ_ANDROID_SEARCH_ACTIVITY', help='Include Search Activity on Android', - default=True) + default=False) project_flag('MOZ_ANDROID_MLS_STUMBLER', help='Include Mozilla Location Service Stumbler on Android', - default=True) + default=False) project_flag('MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE', help='Background service for downloading additional content at runtime', - default=True) + default=False) project_flag('MOZ_ANDROID_CUSTOM_TABS', help='Enable support for Android custom tabs', @@ -57,14 +57,14 @@ set_config('MOZ_ANDROID_ACTIVITY_STREAM', option(env='MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER', help='Build and package the install bouncer APK', - default=True) + default=False) set_config('MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER', - depends_if('MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER')(lambda _: True)) + depends_if('MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER')(lambda _: False)) imply_option('MOZ_SOCIAL', False) -imply_option('MOZ_SERVICES_HEALTHREPORT', True) -imply_option('MOZ_ANDROID_HISTORY', True) +imply_option('MOZ_SERVICES_HEALTHREPORT', False) +imply_option('MOZ_ANDROID_HISTORY', False) set_config('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0') add_old_configure_assignment('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0')
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] set default browser to DuckDuckGo modify DDG URL to the non-javascript site
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 750e3372e1a4887337ab6460ef3bb950c72b36f3 Author: n8fr8 <nathan(a)freitas.net> Date: Mon Jul 17 00:08:50 2017 -0400 set default browser to DuckDuckGo modify DDG URL to the non-javascript site Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/locales/en-US/chrome/region.properties | 10 +++++----- mobile/locales/en-US/searchplugins/duckduckgo.xml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mobile/locales/en-US/chrome/region.properties b/mobile/locales/en-US/chrome/region.properties index 201152118819..d194cdac4131 100644 --- a/mobile/locales/en-US/chrome/region.properties +++ b/mobile/locales/en-US/chrome/region.properties @@ -3,17 +3,17 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Default search engine -browser.search.defaultenginename=Google +browser.search.defaultenginename=DuckDuckGo # Search engine order (order displayed in the search bar dropdown). -browser.search.order.1=Google -browser.search.order.2=Yahoo +browser.search.order.1=DuckDuckGo +browser.search.order.2=Google browser.search.order.3=Bing # These override the equivalents above when the client detects that it is in # US market only. -browser.search.defaultenginename.US=Yahoo -browser.search.order.US.1=Yahoo +browser.search.defaultenginename.US=DuckDuckGo +browser.search.order.US.1=DuckDuckGo browser.search.order.US.2=Google browser.search.order.US.3=Bing diff --git a/mobile/locales/en-US/searchplugins/duckduckgo.xml b/mobile/locales/en-US/searchplugins/duckduckgo.xml index 9e96ae21a005..824b42a05c9d 100644 --- a/mobile/locales/en-US/searchplugins/duckduckgo.xml +++ b/mobile/locales/en-US/searchplugins/duckduckgo.xml @@ -11,13 +11,13 @@ <Param name="type" value="list"/> </Url> <!-- this is effectively x-moz-phonesearch, but search service expects a text/html entry --> -<Url type="text/html" method="GET" template="https://duckduckgo.com/"> +<Url type="text/html" method="GET" template="https://duckduckgo.com/html/"> <Param name="q" value="{searchTerms}" /> <Param name="t" value="fpas" /> </Url> -<Url type="application/x-moz-tabletsearch" method="GET" template="https://duckduckgo.com/"> +<Url type="application/x-moz-tabletsearch" method="GET" template="https://duckduckgo.com/html/"> <Param name="q" value="{searchTerms}" /> <Param name="t" value="ftas" /> </Url> -<SearchForm>https://duckduckgo.com</SearchForm> +<SearchForm>https://duckduckgo.com/html/</SearchForm> </SearchPlugin>
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: disable screenshots and prevent page from being in "recent apps"
by gk@torproject.org 20 Mar '18

20 Mar '18
commit d14a1e47739a99ef6265ab09aa4d2c26be086c20 Author: Hans-Christoph Steiner <hans(a)eds.org> Date: Sat Nov 21 00:10:06 2015 +0100 Orfox: disable screenshots and prevent page from being in "recent apps" Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/base/java/org/mozilla/gecko/GeckoApp.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java index 05fa2bbf812e..2f989576c1a9 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java @@ -95,6 +95,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.Window; +import android.view.WindowManager; import android.widget.AbsoluteLayout; import android.widget.AdapterView; import android.widget.Button; @@ -1257,6 +1258,9 @@ public abstract class GeckoApp GeckoScreenOrientation.getInstance().update(getResources().getConfiguration().orientation); + // disable screenshots and pic in "recent apps" + getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); + setContentView(getLayout()); // Set up Gecko layout.
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: hook up default panic trigger to "quit and clear"
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 4f8bad4120d0d20148840adae41ad712812c4ddc Author: Hans-Christoph Steiner <hans(a)eds.org> Date: Sat Nov 21 00:24:09 2015 +0100 Orfox: hook up default panic trigger to "quit and clear" Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/base/AndroidManifest.xml.in | 7 ++ .../base/java/org/mozilla/gecko/GeckoApp.java | 76 ++++++++++++---------- 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index 2ec98c35ab54..1aa50a08463d 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -155,6 +155,13 @@ <data android:pathPattern=".*\\.xpi" /> </intent-filter> + <!-- receive triggers from panickit apps --> + <intent-filter> + <action android:name="info.guardianproject.panic.action.TRIGGER" /> + + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + #ifdef MOZ_ANDROID_BEAM <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java index 2f989576c1a9..1bf4f1d77de5 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java @@ -152,6 +152,8 @@ public abstract class GeckoApp public static final String INTENT_REGISTER_STUMBLER_LISTENER = "org.mozilla.gecko.STUMBLER_REGISTER_LOCAL_LISTENER"; + public static final String ACTION_PANIC_TRIGGER = "info.guardianproject.panic.action.TRIGGER"; + public static final String EXTRA_STATE_BUNDLE = "stateBundle"; public static final String LAST_SELECTED_TAB = "lastSelectedTab"; @@ -520,48 +522,52 @@ public abstract class GeckoApp @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.quit) { - // Make sure the Guest Browsing notification goes away when we quit. - GuestSession.hideNotification(this); + quitAndClear(); + return true; + } - final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this); - final Set<String> clearSet = - PrefUtils.getStringSet(prefs, ClearOnShutdownPref.PREF, new HashSet<String>()); + return super.onOptionsItemSelected(item); + } - final JSONObject clearObj = new JSONObject(); - for (String clear : clearSet) { - try { - clearObj.put(clear, true); - } catch (JSONException ex) { - Log.e(LOGTAG, "Error adding clear object " + clear, ex); - } - } + private void quitAndClear() { + // Make sure the Guest Browsing notification goes away when we quit. + GuestSession.hideNotification(this); - final JSONObject res = new JSONObject(); - try { - res.put("sanitize", clearObj); - } catch (JSONException ex) { - Log.e(LOGTAG, "Error adding sanitize object", ex); - } + final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this); + final Set<String> clearSet = + PrefUtils.getStringSet(prefs, ClearOnShutdownPref.PREF, new HashSet<String>()); - // If the user has opted out of session restore, and does want to clear history - // we also want to prevent the current session info from being saved. - if (clearObj.has("private.data.history")) { - final String sessionRestore = getSessionRestorePreference(getSharedPreferences()); - try { - res.put("dontSaveSession", "quit".equals(sessionRestore)); - } catch (JSONException ex) { - Log.e(LOGTAG, "Error adding session restore data", ex); - } + final JSONObject clearObj = new JSONObject(); + for (String clear : clearSet) { + try { + clearObj.put(clear, true); + } catch(JSONException ex) { + Log.e(LOGTAG, "Error adding clear object " + clear, ex); } + } - GeckoAppShell.notifyObservers("Browser:Quit", res.toString()); - // We don't call doShutdown() here because this creates a race condition which can - // cause the clearing of private data to fail. Instead, we shut down the UI only after - // we're done sanitizing. - return true; + final JSONObject res = new JSONObject(); + try { + res.put("sanitize", clearObj); + } catch(JSONException ex) { + Log.e(LOGTAG, "Error adding sanitize object", ex); } - return super.onOptionsItemSelected(item); + // If the user has opted out of session restore, and does want to clear history + // we also want to prevent the current session info from being saved. + if (clearObj.has("private.data.history")) { + final String sessionRestore = getSessionRestorePreference(getSharedPreferences()); + try { + res.put("dontSaveSession", "quit".equals(sessionRestore)); + } catch(JSONException ex) { + Log.e(LOGTAG, "Error adding session restore data", ex); + } + } + + GeckoAppShell.notifyObservers("Browser:Quit", res.toString()); + // We don't call doShutdown() here because this creates a race condition which can + // cause the clearing of private data to fail. Instead, we shut down the UI only after + // we're done sanitizing. } @Override @@ -1625,6 +1631,8 @@ public abstract class GeckoApp // Copy extras. settingsIntent.putExtras(intent.getUnsafe()); startActivity(settingsIntent); + } else if (ACTION_PANIC_TRIGGER.equals(action)) { + quitAndClear(); } //app state callbacks
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: Strings fix, probably a WONTAPPLY ESR59.
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 6f851d8b0d02fba238dab78d12044f290a8dc8dd Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Thu Jun 29 15:37:08 2017 -0700 Orfox: Strings fix, probably a WONTAPPLY ESR59. Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/base/strings.xml.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index ec39107f8f60..adc431789713 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -30,10 +30,6 @@ #include ../services/strings.xml.in #include ../orfox/strings.xml.in - <string name="no_space_to_start_error">&no_space_to_start_error;</string> - <string name="error_loading_file">&error_loading_file;</string> - - <string name="firstrun_panel_title_welcome">&firstrun_panel_title_welcome;</string> <string name="firstrun_urlbar_message">&firstrun_urlbar_message;</string>
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: remove Tab:Load event queuing and only use Intent queuing
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 274ae1ec2dcacb68e860f7aa1d10a10504877507 Author: Hans-Christoph Steiner <hans(a)eds.org> Date: Fri Sep 18 11:03:18 2015 +0200 Orfox: remove Tab:Load event queuing and only use Intent queuing Tab:Load queuing is too flaky, since the Fennec UI will block waiting for Gecko to confirm that it received the event. For more on this: refs #5530 https://dev.guardianproject.info/issues/5530 https://lists.mayfirst.org/pipermail/guardian-dev/2015-September/004499.html Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/base/java/org/mozilla/gecko/BrowserApp.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 34f93ee56cdb..8cb69ce011ab 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -1080,12 +1080,7 @@ public class BrowserApp extends GeckoApp @Override public void onReceive(Context context, Intent intent) { if (TextUtils.equals(intent.getAction(), OrbotHelper.ACTION_STATUS)) { - String status = intent.getStringExtra(OrbotHelper.EXTRA_STATUS); - Tabs.getInstance().setTorStatus(status); - - if (status.equals(OrbotHelper.STATUS_ON)) { - GeckoAppShell.sendPendingUrlIntents(BrowserApp.this); - } + GeckoAppShell.setTorStatus(intent); } } };
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: Update orfox branding and icon
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 379d5b66211fc2d28ceceed512aaa7a5c58081cf Author: n8fr8 <nathan(a)freitas.net> Date: Wed Jun 29 13:49:35 2016 -0400 Orfox: Update orfox branding and icon Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/branding/orfox/LICENSE.txt | 2 + mobile/android/branding/orfox/content/favicon.png | Bin 0 -> 820 bytes .../android/branding/orfox/content/favicon32.png | Bin 2418 -> 1797 bytes .../android/branding/orfox/content/favicon64.png | Bin 7165 -> 3993 bytes mobile/android/branding/orfox/ic_launcher.zip | Bin 96525 -> 0 bytes mobile/android/branding/orfox/icon.png | Bin 36456 -> 0 bytes mobile/android/branding/orfox/orfox.png | Bin 36456 -> 55962 bytes mobile/android/branding/orfox/orfox.xcf | Bin 267775 -> 0 bytes mobile/android/branding/orfox/orfox_icon_v2.svg | 100 +++++++++++++++++++++ .../branding/orfox/res/drawable-hdpi/icon.png | Bin 8545 -> 3549 bytes .../orfox/res/drawable-hdpi/large_icon.png | Bin 27 -> 9558 bytes .../branding/orfox/res/drawable-mdpi/icon.png | Bin 4332 -> 2577 bytes .../orfox/res/drawable-mdpi/large_icon.png | Bin 26 -> 5878 bytes .../branding/orfox/res/drawable-xhdpi/icon.png | Bin 13454 -> 5878 bytes .../orfox/res/drawable-xhdpi/large_icon.png | Bin 28 -> 13553 bytes .../branding/orfox/res/drawable-xxhdpi/icon.png | Bin 26491 -> 9558 bytes .../orfox/res/drawable-xxhdpi/large_icon.png | Bin 28 -> 13553 bytes .../branding/orfox/res/drawable-xxxhdpi/icon.png | Bin 42959 -> 13553 bytes 18 files changed, 102 insertions(+) diff --git a/mobile/android/branding/orfox/LICENSE.txt b/mobile/android/branding/orfox/LICENSE.txt new file mode 100644 index 000000000000..5edd0bec67a3 --- /dev/null +++ b/mobile/android/branding/orfox/LICENSE.txt @@ -0,0 +1,2 @@ +Fox by Sebastian Blei from the Noun Project +https://thenounproject.com/search/?q=fox&i=4144 diff --git a/mobile/android/branding/orfox/content/favicon.png b/mobile/android/branding/orfox/content/favicon.png new file mode 100644 index 000000000000..6c711b2544e1 Binary files /dev/null and b/mobile/android/branding/orfox/content/favicon.png differ diff --git a/mobile/android/branding/orfox/content/favicon32.png b/mobile/android/branding/orfox/content/favicon32.png index 90d37f997854..0c414d6ca46b 100644 Binary files a/mobile/android/branding/orfox/content/favicon32.png and b/mobile/android/branding/orfox/content/favicon32.png differ diff --git a/mobile/android/branding/orfox/content/favicon64.png b/mobile/android/branding/orfox/content/favicon64.png index a3db8126f5a1..bfc9e05538c6 100644 Binary files a/mobile/android/branding/orfox/content/favicon64.png and b/mobile/android/branding/orfox/content/favicon64.png differ diff --git a/mobile/android/branding/orfox/ic_launcher.zip b/mobile/android/branding/orfox/ic_launcher.zip deleted file mode 100644 index 69601344519e..000000000000 Binary files a/mobile/android/branding/orfox/ic_launcher.zip and /dev/null differ diff --git a/mobile/android/branding/orfox/icon.png b/mobile/android/branding/orfox/icon.png deleted file mode 100644 index 6e0051b95a32..000000000000 Binary files a/mobile/android/branding/orfox/icon.png and /dev/null differ diff --git a/mobile/android/branding/orfox/orfox.png b/mobile/android/branding/orfox/orfox.png index 350edb58d994..6c6d906aa044 100644 Binary files a/mobile/android/branding/orfox/orfox.png and b/mobile/android/branding/orfox/orfox.png differ diff --git a/mobile/android/branding/orfox/orfox.xcf b/mobile/android/branding/orfox/orfox.xcf deleted file mode 100644 index 2a8f829c3c34..000000000000 Binary files a/mobile/android/branding/orfox/orfox.xcf and /dev/null differ diff --git a/mobile/android/branding/orfox/orfox_icon_v2.svg b/mobile/android/branding/orfox/orfox_icon_v2.svg new file mode 100644 index 000000000000..b9f575b6d077 --- /dev/null +++ b/mobile/android/branding/orfox/orfox_icon_v2.svg @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Generator: flash2svg, http://dissentgraphics.com/tools/flash2svg --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="Tor" + image-rendering="optimizeSpeed" + version="1.1" + style="background-color:#ffffff" + x="0px" + y="0px" + width="1024px" + height="1024px" + viewBox="0 0 1024 1024" + enable-background="new 0 0 1024 1024" + inkscape:version="0.48.4 r9939" + sodipodi:docname="orfox_icon_v2.svg"> + <metadata + id="metadata3977"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1147" + inkscape:window-height="818" + id="namedview3975" + showgrid="false" + inkscape:zoom="0.23046875" + inkscape:cx="175.88107" + inkscape:cy="513.58454" + inkscape:window-x="363" + inkscape:window-y="132" + inkscape:window-maximized="0" + inkscape:current-layer="Tor" /> + <defs + transform="matrix(1 0 0 1 0 0) " + id="defs3953" /> + <g + id="shadow"> + <g + id="shape"> + <path + id="path" + fill="#000000" + fill-opacity="0.09803921568627451" + d="M969.65,351.3 Q961.05,330.45 950.25,310.45 C946.2,302.9 941.9,295.4 937.35,288.05 917.8,256.35 893.95,226.4 865.8,198.25 773.65,106.1 662.35,60 532,60 401.65,60 290.4,106.1 198.25,198.25 106.1,290.4 60,401.65 60,532 60,662.35 106.1,773.65 198.25,865.8 290.4,957.95 401.65,1004 532,1004 662.35,1004 773.65,957.95 865.8,865.8 916.55,815 953.35,758.4 976.15,696.05 994.7,645.2 1004,590.55 1004,532 1004,487.1 998.55,444.45 987.6,404.05 986.35,399.5 985.05,394.95 983.7,390.45 979.6,377.15 974.9,364.1 969.65,351.3z" /> + </g> + </g> + <g + id="bg"> + <g + id="shape2"> + <path + id="path1" + d="M969.75,394 C968.65,389.65 967.4,385 966.1,380.4 963.6,371.65 960.75,362.8 957.65,354.05 951.2,335.8 943.5,318 934.5,300.4 930.7,293 926.55,285.45 922.2,278 901.9,243.5 876.4,210.8 845.85,180.25 806.9,141.3 764.5,110.55 718.35,87.9 679.05,68.6 636.9,55.35 592.2,48.2 575.95,45.6 559.4,43.8 542.15,42.85 532.45,42.3 522.3,42 512.05,42 502.7,42 493.45,42.25 484.15,42.75 477.45,43.1 470.8,43.55 464.1,44.2 407.25,49.4 354.3,64 305.15,88.2 259.55,110.6 217.25,141.3 178.3,180.25 89.05,269.5 43,376.75 40.2,501.75 Q40.05,507.85 40.05,514 C40.05,644.35 86.15,755.65 178.3,847.8 263.55,933.05 365.15,978.85 483,985.2 483.35,985.25 483.75,985.25 484.15,985.3 484.3,985.3 484.4,985.3 484.55,985.3 493.05,985.75 501.15,986 509.05,986 510.25,986 511.15,986 512.05,986 522.35,986 532.55,985.7 542.15,985.2 544.65,985.05 546.9,984.9 549.1,984.75 569.3,983.3 589,980.7 607.8,977.05 615.75,975.5 623.6,973.75 631.2,971.9 712,951.6 783.35,910.3 845.85,847.8 851.95,841.7 857.85,835.55 863.35,829.5 90 3.2,785.65 933.1,737.9 953.2,686 962.3,662.55 969.35,638.25 974.5,612.95 979.7,587.15 982.8,560.3 983.75,532.5 983.95,526.45 984.05,520.25 984.05,514 984.05,513.35 984.05,512.65 984.05,512 984.05,511.65 984.05,511.35 984.05,511 984.05,507.9 984,504.8 983.95,501.65 983.1,464.45 978.4,428.65 969.75,394z" + fill-opacity="1" + fill="#4F3663" /> + </g> + </g> + <path + inkscape:connector-curvature="0" + d="m 686.21069,582.70555 c -1.93177,-1.97288 -4.58283,-3.08262 -7.34348,-3.08262 -78.07933,0 -82.75807,0 -110.78935,53.47317 -1.58926,3.02781 -1.56871,6.65845 0.0685,9.66572 1.62352,3.00727 4.65133,5.00754 8.06276,5.32951 0.17811,0.0206 4.58283,0.42471 11.24814,0.42471 16.98866,0 48.19846,-2.70585 66.26261,-20.8111 7.14483,-7.16538 11.54955,-15.88577 13.13196,-25.99676 0.66448,-0.0548 1.2947,-0.11645 1.87697,-0.15755 12.16608,-1.03439 20.2083,-1.71942 20.4138,-11.4331 0.0685,-2.76065 -1.00014,-5.43226 -2.93191,-7.41198 z" + id="path4-8" + style="fill:#4f3663;fill-opacity:1" /> + <path + inkscape:connector-curvature="0" + d="m 464.25524,633.0961 c -28.03128,-53.47317 -32.70316,-53.47317 -110.78933,-53.47317 -2.76066,0 -5.41171,1.10974 -7.34349,3.08262 -1.93177,1.97972 -2.99356,4.65133 -2.93191,7.41198 0.20551,9.70683 8.24772,10.39871 20.41379,11.4331 0.57542,0.048 1.21935,0.1096 1.87697,0.15755 1.58926,10.12469 5.99398,18.83138 13.13196,25.99676 18.06415,18.1121 49.26711,20.8111 66.26261,20.8111 0,0 0,0 0,0 6.65846,0 11.05633,-0.41101 11.24129,-0.42471 3.41143,-0.32197 6.42555,-2.32224 8.06276,-5.32951 1.63721,-3.00727 1.66462,-6.63791 0.0754,-9.66572 z" + id="path6-8" + style="fill:#4f3663;fill-opacity:1" /> + <path + inkscape:connector-curvature="0" + d="m 797.15129,217.4905 c -13.59093,-13.58407 -39.06021,-13.17991 -73.6746,1.1577 -62.37168,25.8392 -146.02711,96.09552 -164.02961,170.83877 -14.88562,-1.34265 -30.57958,-2.13728 -47.28053,-2.13728 -16.70779,0 -32.40175,0.79463 -47.28738,2.13728 -18.00249,-74.7501 -101.65793,-145.00642 -164.03644,-170.84562 -34.60754,-14.33076 -60.07683,-14.74177 -73.65405,-1.15085 -23.70192,23.70192 -27.39421,88.48488 -23.35941,136.76556 4.89794,58.54236 20.78371,109.24118 43.34163,139.93721 -2.6305,30.36723 -10.88507,146.02025 12.20717,183.3953 24.93497,40.34806 122.90061,82.19633 149.8838,93.1362 -0.26031,19.11909 0.63023,62.87173 13.22101,80.33991 17.49558,24.27049 67.85188,34.77194 89.68367,34.77194 21.83865,0 72.2018,-10.50145 89.68367,-34.77194 12.60449,-17.47503 13.42652,-61.54963 13.13881,-80.79888 27.0654,-10.86452 125.03105,-52.33602 149.97286,-92.67038 23.09909,-37.37505 14.83767,-153.06232 12.20717,-183.40215 51.76061,-70.63993 59.69321,-236.99177 19.98223,-276.70277 z m -45.0405,2 89.08805 c 1.57556,1.57556 3.56899,2.34964 5.60352,2.69216 3.32923,47.56824 5.55557,131.94295 -10.248,157.50814 -18.14635,29.36709 -92.19772,64.598 -132.54578,81.3332 v -45.42411 c 0,-5.67202 -4.60338,-10.2754 -10.2754,-10.2754 -5.67202,0 -10.2754,4.60338 -10.2754,10.2754 v 58.71362 6.85026 5.61722 c 0,0.30141 0.0685,0.58912 0.0891,0.88369 0.007,24.18828 -2.55515,54.95967 -9.27526,64.28973 -8.48748,11.78246 -34.51164,21.01662 -55.95297,24.60615 10.82342,-10.00138 21.914,-25.61999 21.914,-38.9369 0,-21.53038 -17.44763,-28.80537 -38.97116,-28.80537 -21.52353,0 -38.97801,7.27499 -38.97801,28.80537 0,13.31006 11.12483,28.94237 21.94825,38.9369 -21.44133,-3.57583 -47.48603,-12.81684 -55.98036,-24.60615 -6.68586,-9.27526 -9.29581,-39.62878 -9.35061,-63.59101 0.0685,-0.51377 0.1507,-1.04124 0.1507,-1.58241 v -9.30951 c 0,-0.1233 0,-0.25346 0,-0.37676 0,-0.0274 0,-0.0548 0,-0.0822 V 702.6811 c 0,-5.67202 -4.59653,-10.2754 -10.2754,-10.2754 -5.67887,0 -10.27539,4.60338 -10.27539,10.2754 v 45 .88992 C 369.09881,731.69197 295.02004,696.15965 276.85314,666.77886 261.06328,641.22737 263.28961,556.83896 266.61199,509.26387 c 2.04138,-0.34252 4.03481,-1.1166 5.61037,-2.69216 4.01426,-4.0074 4.01426,-10.52201 0,-14.52941 -24.76371,-24.77056 -42.67715,-76.92163 -47.91075,-139.50565 -4.61023,-55.13094 2.7127,-105.81605 17.40652,-120.51672 5.0966,-5.0966 21.56463,-6.69271 51.26053,5.61036 64.94052,26.901 154.90505,104.52821 154.90505,180.33324 0,5.67887 4.59652,10.2754 10.27539,10.2754 5.67887,0 10.2754,-4.59653 10.2754,-10.2754 0,-2.7127 -0.10275,-5.41856 -0.30141,-8.12441 13.87179,-1.23305 28.5108,-1.93862 44.02665,-1.93862 15.51585,0 30.14802,0.71242 44.02665,1.93862 -0.1918,2.70585 -0.30141,5.41856 -0.30141,8.12441 0,5.67887 4.60338,10.2754 10.2754,10.2754 5.67202,0 10.2754,-4.59653 10.2754,-10.2754 0,-75.79133 89.95768,-153.42539 154.8982,-180.32639 29.67535,-12.29622 46.17764,-10.70696 51.27423,-5.61036 30.9221,30.9221 24.70891,204.80238 -30.50423,260.02237 -4.0074,4.01426 -4.0074,10.51516 0.007,14.52941 z" + id="path8-0" + style="fill:#78af52;fill-opacity:1" /> + <path + style="fill:#eaeace;fill-opacity:1" + d="m 462.6355,852.50032 c -25.77069,-12.9955 -28.86564,-22.7931 -28.93825,-91.6151 0,-31.9291 -1.44541,-60.2368 -3.13674,-62.9059 -1.69202,-2.6691 -6.97357,-4.3018 -11.73656,-3.6283 -8.03262,1.1357 -8.73888,3.0145 -9.73765,25.9062 -1.02891,23.5723 -1.4365,24.5702 -9.07112,22.2012 -27.12363,-8.4164 -99.5049,-51.247 -113.61918,-67.2326 -12.99496,-14.71792 -16.50298,-31.9536 -18.58135,-91.29648 -1.7475,-49.90494 -1.17756,-59.05477 4.46158,-71.56006 l 6.46597,-14.33871 -9.80753,-12.85876 c -24.61506,-32.27133 -38.06076,-80.73449 -40.8858,-147.36496 -2.1503,-50.72751 1.47691,-79.77202 12.07564,-96.67821 17.61272,-28.09519 109.25145,19.60307 166.48816,86.65757 19.39173,22.71836 33.8499,52.43495 38.58275,79.30285 2.3099,13.11449 5.88574,22.11094 9.31019,23.4251 6.36047,2.44068 15.52476,-3.90335 15.52476,-10.7469 0,-7.17572 8.91356,-9.01468 43.69373,-9.01468 24.50819,0 33.33407,1.3321 36.89347,5.56838 12.93604,15.39672 14.24033,16.19402 20.77274,12.69785 4.29238,-2.29703 7.33321,-9.622 56 8.90124,-21.43927 7.43801,-56.07209 69.85078,-126.27005 143.75623,-161.68824 34.77263,-16.66451 55.40769,-17.63067 62.97243,-2.9485 14.5486,28.23645 16.3646,99.39338 4.05125,158.73893 -6.42144,30.94998 -25.57135,76.57336 -35.59535,84.80272 -6.44267,5.28964 -8.24635,20.45647 -2.82984,23.80365 5.43226,3.35745 8.25799,70.79207 4.4513,106.23665 -4.69586,43.72537 -10.81725,55.80167 -38.1135,75.18717 -19.27459,13.6884 -91.89973,52.8459 -98.01291,52.8459 -1.1988,0 -2.20442,-9.3883 -2.23524,-20.8628 -0.0685,-24.7592 -3.22305,-30.9905 -14.86782,-29.344 l -8.66079,1.2246 -1.99548,63.4955 c -1.40567,44.7465 -3.54844,66.619 -7.25648,74.0734 -5.01508,10.0828 -20.47819,20.209 -39.37944,25.7878 l -8.7197,2.5737 7.81273,-12.6413 c 10.08907,-16.3245 9.89246,-28.9182 -0.64393,-41.1665 -11.79615,-13.7141 -42.15105,-16.2806 -60.01585,-5.0744 -11.72012,7.3519 -12.1606,8.4262 -10.50694,25.6369 0.97068,10.0998 4.58625,21.1241 8.26005,25.1834 9.04988,10.0004 0.80901,9.6139 -20.12745,-0.9438 l 0,0 z m -0 .54117,-212.0739 c 1.73038,-12.16224 -22.68122,-47.8041 -36.61124,-53.45392 -13.7889,-5.59235 -75.42484,-10.02722 -82.0922,-5.90671 -8.09633,5.00398 -3.22305,20.04175 6.90438,21.30412 6.46939,0.80641 10.94604,5.1627 15.60901,15.18984 9.89658,21.28049 36.02555,33.23756 69.65624,31.87593 23.0299,-0.93239 25.50422,-1.77264 26.53381,-9.00926 z m 160.69078,5.61187 c 18.85467,-6.39534 32.59082,-17.42337 38.08747,-30.5789 3.66627,-8.77341 7.62229,-12.21744 15.0103,-13.06681 7.09277,-0.81545 10.3624,-3.47302 11.15909,-9.07153 1.84409,-12.95378 -8.67998,-15.58668 -49.62469,-12.41501 -33.35737,2.58385 -38.01144,3.8395 -47.33328,12.77061 -13.73684,13.16073 -29.96306,43.45931 -27.17089,50.73573 2.72983,7.11359 40.65632,8.14353 59.872,1.62591 l 0,0 z" + id="path3787" + inkscape:connector-curvature="0" /> +</svg> diff --git a/mobile/android/branding/orfox/res/drawable-hdpi/icon.png b/mobile/android/branding/orfox/res/drawable-hdpi/icon.png index 30731f03daf6..2a1dc9aea83d 100644 Binary files a/mobile/android/branding/orfox/res/drawable-hdpi/icon.png and b/mobile/android/branding/orfox/res/drawable-hdpi/icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png deleted file mode 120000 index fd11ee776429..000000000000 --- a/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-xxhdpi/icon.png \ No newline at end of file diff --git a/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png new file mode 100644 index 000000000000..946e03e42d0b Binary files /dev/null and b/mobile/android/branding/orfox/res/drawable-hdpi/large_icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-mdpi/icon.png b/mobile/android/branding/orfox/res/drawable-mdpi/icon.png index a7d98aa9c771..78ace1c9b6d3 100644 Binary files a/mobile/android/branding/orfox/res/drawable-mdpi/icon.png and b/mobile/android/branding/orfox/res/drawable-mdpi/icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png deleted file mode 120000 index 79362e743cd1..000000000000 --- a/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-xhdpi/icon.png \ No newline at end of file diff --git a/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png new file mode 100644 index 000000000000..8e45a100870b Binary files /dev/null and b/mobile/android/branding/orfox/res/drawable-mdpi/large_icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-xhdpi/icon.png b/mobile/android/branding/orfox/res/drawable-xhdpi/icon.png index 155611f2da7d..8e45a100870b 100644 Binary files a/mobile/android/branding/orfox/res/drawable-xhdpi/icon.png and b/mobile/android/branding/orfox/res/drawable-xhdpi/icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png deleted file mode 120000 index 17528430e69f..000000000000 --- a/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-xxxhdpi/icon.png \ No newline at end of file diff --git a/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png new file mode 100644 index 000000000000..d3a4929e7503 Binary files /dev/null and b/mobile/android/branding/orfox/res/drawable-xhdpi/large_icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-xxhdpi/icon.png b/mobile/android/branding/orfox/res/drawable-xxhdpi/icon.png index 8e6e60311f8f..946e03e42d0b 100644 Binary files a/mobile/android/branding/orfox/res/drawable-xxhdpi/icon.png and b/mobile/android/branding/orfox/res/drawable-xxhdpi/icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png deleted file mode 120000 index 17528430e69f..000000000000 --- a/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-xxxhdpi/icon.png \ No newline at end of file diff --git a/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png b/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png new file mode 100644 index 000000000000..d3a4929e7503 Binary files /dev/null and b/mobile/android/branding/orfox/res/drawable-xxhdpi/large_icon.png differ diff --git a/mobile/android/branding/orfox/res/drawable-xxxhdpi/icon.png b/mobile/android/branding/orfox/res/drawable-xxxhdpi/icon.png index 9c4820ce6729..d3a4929e7503 100644 Binary files a/mobile/android/branding/orfox/res/drawable-xxxhdpi/icon.png and b/mobile/android/branding/orfox/res/drawable-xxxhdpi/icon.png differ
1 0
0 0
[tor-browser/tor-browser-52.7.2esr-8.0-1] Orfox: NetCipher enabled, checks if orbot is installed
by gk@torproject.org 20 Mar '18

20 Mar '18
commit 67aca67cc7b0802f19024ad39f3d70733a47ce49 Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Mon Jul 20 21:46:25 2015 -0400 Orfox: NetCipher enabled, checks if orbot is installed Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- .../base/java/org/mozilla/gecko/BrowserApp.java | 32 ++- mobile/android/base/moz.build | 6 + mobile/android/base/strings.xml.in | 5 + .../netcipher/proxy/OrbotHelper.java | 186 ++++++++++++++++ .../netcipher/proxy/TorServiceUtils.java | 233 +++++++++++++++++++++ mobile/android/orfox/strings.xml.in | 5 + 6 files changed, 462 insertions(+), 5 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 9023618669ef..a532b454a263 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -174,6 +174,8 @@ import android.animation.ObjectAnimator; import org.json.JSONException; import org.json.JSONObject; +import info.guardianproject.netcipher.proxy.OrbotHelper; + import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; @@ -1068,6 +1070,30 @@ public class BrowserApp extends GeckoApp } } + public void checkStartOrbot() { + if (!OrbotHelper.isOrbotInstalled(this)) { + final Intent intent = OrbotHelper.getOrbotInstallIntent(this); + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.install_orbot); + builder.setMessage(R.string.you_must_have_orbot); + builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + startActivity(intent); + } + }); + builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + } + }); + builder.show(); + } else { + OrbotHelper.requestStartTor(this); + } + } + @Override public void onResume() { super.onResume(); @@ -1076,11 +1102,7 @@ public class BrowserApp extends GeckoApp return; } - if (!mHasResumed) { - EventDispatcher.getInstance().unregisterGeckoThreadListener((GeckoEventListener) this, - "Prompt:ShowTop"); - mHasResumed = true; - } + checkStartOrbot(); processTabQueue(); diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 6c88464ab521..4dbb1c25fdab 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -12,6 +12,7 @@ include('android-services.mozbuild') geckoview_source_dir = TOPSRCDIR + '/mobile/android/geckoview/src/main/' geckoview_thirdparty_source_dir = TOPSRCDIR + '/mobile/android/geckoview/src/thirdparty/' +geckoview_netcipher_source_dir = TOPSRCDIR + '/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/' thirdparty_source_dir = TOPSRCDIR + '/mobile/android/thirdparty/' constants_jar = add_java_jar('constants') @@ -289,6 +290,11 @@ gvjar.sources += [geckoview_thirdparty_source_dir + f for f in [ 'java/com/googlecode/eyesfree/braille/selfbraille/WriteData.java', ]] +gvjar.sources += [geckoview_netcipher_source_dir + f for f in [ + 'OrbotHelper.java', + 'TorServiceUtils.java', +]] + gvjar.extra_jars += [ CONFIG['ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB'], CONFIG['ANDROID_SUPPORT_V4_AAR_LIB'], diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 3511a4eca644..ec39107f8f60 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -28,6 +28,11 @@ #include ../search/strings/search_strings.xml.in #include ../services/strings.xml.in +#include ../orfox/strings.xml.in + + <string name="no_space_to_start_error">&no_space_to_start_error;</string> + <string name="error_loading_file">&error_loading_file;</string> + <string name="firstrun_panel_title_welcome">&firstrun_panel_title_welcome;</string> diff --git a/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java new file mode 100644 index 000000000000..d6a632fda37d --- /dev/null +++ b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java @@ -0,0 +1,186 @@ + +package info.guardianproject.netcipher.proxy; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.text.TextUtils; +import android.util.Log; + + +import java.util.List; + +public class OrbotHelper { + + private final static int REQUEST_CODE_STATUS = 100; + + public final static String ORBOT_PACKAGE_NAME = "org.torproject.android"; + public final static String ORBOT_MARKET_URI = "market://details?id=" + ORBOT_PACKAGE_NAME; + public final static String ORBOT_FDROID_URI = "https://f-droid.org/repository/browse/?fdid=" + + ORBOT_PACKAGE_NAME; + public final static String ORBOT_PLAY_URI = "https://play.google.com/store/apps/details?id=" + + ORBOT_PACKAGE_NAME; + + /** + * A request to Orbot to transparently start Tor services + */ + public final static String ACTION_START = "org.torproject.android.intent.action.START"; + /** + * {@link Intent} send by Orbot with {@code ON/OFF/STARTING/STOPPING} status + */ + public final static String ACTION_STATUS = "org.torproject.android.intent.action.STATUS"; + /** + * {@code String} that contains a status constant: {@link #STATUS_ON}, + * {@link #STATUS_OFF}, {@link #STATUS_STARTING}, or + * {@link #STATUS_STOPPING} + */ + public final static String EXTRA_STATUS = "org.torproject.android.intent.extra.STATUS"; + /** + * A {@link String} {@code packageName} for Orbot to direct its status reply + * to, used in {@link #ACTION_START} {@link Intent}s sent to Orbot + */ + public final static String EXTRA_PACKAGE_NAME = "org.torproject.android.intent.extra.PACKAGE_NAME"; + + /** + * All tor-related services and daemons are stopped + */ + public final static String STATUS_OFF = "OFF"; + /** + * All tor-related services and daemons have completed starting + */ + public final static String STATUS_ON = "ON"; + public final static String STATUS_STARTING = "STARTING"; + public final static String STATUS_STOPPING = "STOPPING"; + /** + * The user has disabled the ability for background starts triggered by + * apps. Fallback to the old Intent that brings up Orbot. + */ + public final static String STATUS_STARTS_DISABLED = "STARTS_DISABLED"; + + public final static String ACTION_START_TOR = "org.torproject.android.START_TOR"; + public final static String ACTION_REQUEST_HS = "org.torproject.android.REQUEST_HS_PORT"; + public final static int START_TOR_RESULT = 0x048079234; + public final static int HS_REQUEST_CODE = 9999; + + private final static String FDROID_PACKAGE_NAME = "org.fdroid.fdroid"; + private final static String PLAY_PACKAGE_NAME = "com.android.vending"; + + private OrbotHelper() { + // only static utility methods, do not instantiate + } + + public static boolean isOrbotRunning(Context context) { + int procId = TorServiceUtils.findProcessId(context); + + return (procId != -1); + } + + public static boolean isOrbotInstalled(Context context) { + return isAppInstalled(context, ORBOT_PACKAGE_NAME); + } + + private static boolean isAppInstalled(Context context, String uri) { + try { + PackageManager pm = context.getPackageManager(); + pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + + public static void requestHiddenServiceOnPort(Activity activity, int port) { + Intent intent = new Intent(ACTION_REQUEST_HS); + intent.setPackage(ORBOT_PACKAGE_NAME); + intent.putExtra("hs_port", port); + + activity.startActivityForResult(intent, HS_REQUEST_CODE); + } + + /** + * First, checks whether Orbot is installed. If Orbot is installed, then a + * broadcast {@link Intent} is sent to request Orbot to start transparently + * in the background. When Orbot receives this {@code Intent}, it will + * immediately reply to this all with its status via an + * {@link #ACTION_STATUS} {@code Intent} that is broadcast to the + * {@code packageName} of the provided {@link Context} (i.e. + * {@link Context#getPackageName()}. + * + * @param context the app {@link Context} will receive the reply + * @return whether the start request was sent to Orbot + */ + public static boolean requestStartTor(Context context) { + if (OrbotHelper.isOrbotInstalled(context)) { + Log.i("OrbotHelper", "requestStartTor " + context.getPackageName()); + Intent intent = getOrbotStartIntent(); + intent.putExtra(EXTRA_PACKAGE_NAME, context.getPackageName()); + context.sendBroadcast(intent); + return true; + } + return false; + } + + public static Intent getOrbotStartIntent() { + Intent intent = new Intent(ACTION_START); + intent.setPackage(ORBOT_PACKAGE_NAME); + return intent; + } + + /** + * First, checks whether Orbot is installed, then checks whether Orbot is + * running. If Orbot is installed and not running, then an {@link Intent} is + * sent to request Orbot to start, which will show the main Orbot screen. + * The result will be returned in + * {@link Activity#onActivityResult(int requestCode, int resultCode, Intent data)} + * with a {@code requestCode} of {@link START_TOR_RESULT} + * + * @param activity the {@link Activity} that gets the + * {@code START_TOR_RESULT} result + * @return whether the start request was sent to Orbot + */ + public static boolean requestShowOrbotStart(Activity activity) { + if (OrbotHelper.isOrbotInstalled(activity)) { + if (!OrbotHelper.isOrbotRunning(activity)) { + Intent intent = getShowOrbotStartIntent(); + activity.startActivityForResult(intent, START_TOR_RESULT); + return true; + } + } + return false; + } + + public static Intent getShowOrbotStartIntent() { + Intent intent = new Intent(ACTION_START_TOR); + intent.setPackage(ORBOT_PACKAGE_NAME); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + return intent; + } + + public static Intent getOrbotInstallIntent(Context context) { + final Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(ORBOT_MARKET_URI)); + + PackageManager pm = context.getPackageManager(); + List<ResolveInfo> resInfos = pm.queryIntentActivities(intent, 0); + + String foundPackageName = null; + for (ResolveInfo r : resInfos) { + Log.i("OrbotHelper", "market: " + r.activityInfo.packageName); + if (TextUtils.equals(r.activityInfo.packageName, FDROID_PACKAGE_NAME) + || TextUtils.equals(r.activityInfo.packageName, PLAY_PACKAGE_NAME)) { + foundPackageName = r.activityInfo.packageName; + break; + } + } + + if (foundPackageName == null) { + intent.setData(Uri.parse(ORBOT_FDROID_URI)); + } else { + intent.setPackage(foundPackageName); + } + return intent; + } +} diff --git a/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java new file mode 100644 index 000000000000..e553ecac3543 --- /dev/null +++ b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java @@ -0,0 +1,233 @@ +/* Copyright (c) 2009, Nathan Freitas, Orbot / The Guardian Project - http://openideals.com/guardian */ +/* See LICENSE for licensing information */ + +package info.guardianproject.netcipher.proxy; + +import android.content.Context; +import android.util.Log; + + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.URLEncoder; +import java.util.StringTokenizer; + +public class TorServiceUtils { + + private final static String TAG = "TorUtils"; + // various console cmds + public final static String SHELL_CMD_CHMOD = "chmod"; + public final static String SHELL_CMD_KILL = "kill -9"; + public final static String SHELL_CMD_RM = "rm"; + public final static String SHELL_CMD_PS = "ps"; + public final static String SHELL_CMD_PIDOF = "pidof"; + + public final static String CHMOD_EXE_VALUE = "700"; + + public static boolean isRootPossible() + { + + StringBuilder log = new StringBuilder(); + + try { + + // Check if Superuser.apk exists + File fileSU = new File("/system/app/Superuser.apk"); + if (fileSU.exists()) + return true; + + fileSU = new File("/system/app/superuser.apk"); + if (fileSU.exists()) + return true; + + fileSU = new File("/system/bin/su"); + if (fileSU.exists()) + { + String[] cmd = { + "su" + }; + int exitCode = TorServiceUtils.doShellCommand(cmd, log, false, true); + if (exitCode != 0) + return false; + else + return true; + } + + // Check for 'su' binary + String[] cmd = { + "which su" + }; + int exitCode = TorServiceUtils.doShellCommand(cmd, log, false, true); + + if (exitCode == 0) { + Log.d(TAG, "root exists, but not sure about permissions"); + return true; + + } + + } catch (IOException e) { + // this means that there is no root to be had (normally) so we won't + // log anything + Log.e(TAG, "Error checking for root access", e); + + } catch (Exception e) { + Log.e(TAG, "Error checking for root access", e); + // this means that there is no root to be had (normally) + } + + Log.e(TAG, "Could not acquire root permissions"); + + return false; + } + + public static int findProcessId(Context context) { + String dataPath = context.getFilesDir().getParentFile().getParentFile().getAbsolutePath(); + String command = dataPath + "/" + OrbotHelper.ORBOT_PACKAGE_NAME + "/app_bin/tor"; + int procId = -1; + + try { + procId = findProcessIdWithPidOf(command); + + if (procId == -1) + procId = findProcessIdWithPS(command); + } catch (Exception e) { + try { + procId = findProcessIdWithPS(command); + } catch (Exception e2) { + Log.e(TAG, "Unable to get proc id for command: " + URLEncoder.encode(command), e2); + } + } + + return procId; + } + + // use 'pidof' command + public static int findProcessIdWithPidOf(String command) throws Exception + { + + int procId = -1; + + Runtime r = Runtime.getRuntime(); + + Process procPs = null; + + String baseName = new File(command).getName(); + // fix contributed my mikos on 2010.12.10 + procPs = r.exec(new String[] { + SHELL_CMD_PIDOF, baseName + }); + // procPs = r.exec(SHELL_CMD_PIDOF); + + BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream())); + String line = null; + + while ((line = reader.readLine()) != null) + { + + try + { + // this line should just be the process id + procId = Integer.parseInt(line.trim()); + break; + } catch (NumberFormatException e) + { + Log.e("TorServiceUtils", "unable to parse process pid: " + line, e); + } + } + + return procId; + + } + + // use 'ps' command + public static int findProcessIdWithPS(String command) throws Exception + { + + int procId = -1; + + Runtime r = Runtime.getRuntime(); + + Process procPs = null; + + procPs = r.exec(SHELL_CMD_PS); + + BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream())); + String line = null; + + while ((line = reader.readLine()) != null) + { + if (line.indexOf(' ' + command) != -1) + { + + StringTokenizer st = new StringTokenizer(line, " "); + st.nextToken(); // proc owner + + procId = Integer.parseInt(st.nextToken().trim()); + + break; + } + } + + return procId; + + } + + public static int doShellCommand(String[] cmds, StringBuilder log, boolean runAsRoot, + boolean waitFor) throws Exception + { + + Process proc = null; + int exitCode = -1; + + if (runAsRoot) + proc = Runtime.getRuntime().exec("su"); + else + proc = Runtime.getRuntime().exec("sh"); + + OutputStreamWriter out = new OutputStreamWriter(proc.getOutputStream()); + + for (int i = 0; i < cmds.length; i++) + { + // TorService.logMessage("executing shell cmd: " + cmds[i] + + // "; runAsRoot=" + runAsRoot + ";waitFor=" + waitFor); + + out.write(cmds[i]); + out.write("\n"); + } + + out.flush(); + out.write("exit\n"); + out.flush(); + + if (waitFor) + { + + final char buf[] = new char[10]; + + // Consume the "stdout" + InputStreamReader reader = new InputStreamReader(proc.getInputStream()); + int read = 0; + while ((read = reader.read(buf)) != -1) { + if (log != null) + log.append(buf, 0, read); + } + + // Consume the "stderr" + reader = new InputStreamReader(proc.getErrorStream()); + read = 0; + while ((read = reader.read(buf)) != -1) { + if (log != null) + log.append(buf, 0, read); + } + + exitCode = proc.waitFor(); + + } + + return exitCode; + + } +} diff --git a/mobile/android/orfox/strings.xml.in b/mobile/android/orfox/strings.xml.in new file mode 100644 index 000000000000..e3a22974ed78 --- /dev/null +++ b/mobile/android/orfox/strings.xml.in @@ -0,0 +1,5 @@ +<!-- NetCipher Integration Strings, used for dialog --> + <string name="install_orbot">Install Orbot?</string> + <string name="you_must_have_orbot">You must have Orbot installed and activated to proxy traffic through it. Would you like to download it?</string> + <string name="yes">Yes</string> + <string name="no">No</string>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1624
  • 1625
  • 1626
  • 1627
  • 1628
  • 1629
  • 1630
  • ...
  • 1981
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.