[tor-commits] [tor-browser/tor-browser-60.5.1esr-8.5-1] Bug 28329 - Part 1. Add new Tor resources

gk at torproject.org gk at torproject.org
Fri Mar 15 21:48:09 UTC 2019


commit 0db4c9243320d2c516329949ee17e8b0a5b13624
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date:   Tue Feb 19 22:45:46 2019 +0000

    Bug 28329 - Part 1. Add new Tor resources
---
 .../main/res/color/tor_bridges_enabled_colors.xml  |  10 ++++++
 .../main/res/color/tor_bridges_select_builtin.xml  |   8 +++++
 .../res/drawable-nodpi/tor_bootstrap_onion.gif     | Bin 0 -> 137518 bytes
 .../app/src/main/res/drawable/ic_settings_24px.xml |  36 +++++++++++++++++++++
 .../res/drawable/list_section_divider_material.xml |  19 +++++++++++
 .../drawable/list_section_divider_mtrl_alpha.9.png | Bin 0 -> 164 bytes
 .../app/src/main/res/drawable/rounded_corners.xml  |  11 +++++++
 .../src/main/res/drawable/tor_spinning_onion.xml   |  12 +++++++
 mobile/android/app/src/main/res/xml/separator.xml  |  13 ++++++++
 .../android/app/src/photon/res/values/colors.xml   |   2 ++
 .../base/locales/en-US/torbrowser_strings.dtd      |  32 ++++++++++++++++++
 mobile/android/base/strings.xml.in                 |  29 +++++++++++++++++
 12 files changed, 172 insertions(+)

diff --git a/mobile/android/app/src/main/res/color/tor_bridges_enabled_colors.xml b/mobile/android/app/src/main/res/color/tor_bridges_enabled_colors.xml
new file mode 100644
index 000000000000..a51ffd547c04
--- /dev/null
+++ b/mobile/android/app/src/main/res/color/tor_bridges_enabled_colors.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+<!-- Used by the Bridges Enabled switch for correct coloring -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+   <item android:state_checked="true"
+           android:color="@color/tor_bootstrap_background" />
+   <item android:color="#808080" />
+</selector>
diff --git a/mobile/android/app/src/main/res/color/tor_bridges_select_builtin.xml b/mobile/android/app/src/main/res/color/tor_bridges_select_builtin.xml
new file mode 100644
index 000000000000..948ed552d539
--- /dev/null
+++ b/mobile/android/app/src/main/res/color/tor_bridges_select_builtin.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+<!-- Used for changing the color of the radio button -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+   <item android:color="#808080" />
+</selector>
diff --git a/mobile/android/app/src/main/res/drawable-nodpi/tor_bootstrap_onion.gif b/mobile/android/app/src/main/res/drawable-nodpi/tor_bootstrap_onion.gif
new file mode 100755
index 000000000000..b9478997b5d6
Binary files /dev/null and b/mobile/android/app/src/main/res/drawable-nodpi/tor_bootstrap_onion.gif differ
diff --git a/mobile/android/app/src/main/res/drawable/ic_settings_24px.xml b/mobile/android/app/src/main/res/drawable/ic_settings_24px.xml
new file mode 100644
index 000000000000..c582193aa12d
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/ic_settings_24px.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright 2018 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<!--
+    Downloaded from:
+    https://raw.githubusercontent.com/material-components/material-components-android/aae325e6b4a83afd6fcfa3e40e4e822a520e04fe/catalog/java/io/material/catalog/assets/res/drawable/ic_settings_24px.xml
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="20"
+    android:viewportHeight="20"
+    tools:ignore="NewApi">
+
+  <path
+      android:pathData="M0,0 L20,0 L20,20 L0,20 L0,0 Z" />
+  <path
+      android:fillColor="?attr/colorControlNormal"
+      android:pathData="M15.95,10.78 C15.98,10.53,16,10.27,16,10 S15.98,9.47,15.94,9.22 L17.63,7.9 C17.78,7.78,17.82,7.56,17.73,7.39 L16.13,4.62 C16.03,4.44,15.82,4.38,15.64,4.44 L13.65,5.24 C13.23,4.92,12.79,4.66,12.3,4.46 L12,2.34 C11.97,2.14,11.8,2,11.6,2 L8.4,2 C8.2,2,8.04,2.14,8.01,2.34 L7.71,4.46 C7.22,4.66,6.77,4.93,6.36,5.24 L4.37,4.44 C4.19,4.37,3.98,4.44,3.88,4.62 L2.28,7.39 C2.18,7.57,2.22,7.78,2.38,7.9 L4.07,9.22 C4.03,9.47,4,9.74,4,10 S4.02,10.53,4.06,10.78 L2.37,12.1 C2.22,12.22,2.18,12.44,2.27,12.61 L3.87,15.38 C3.97,15.56,4.18,15.62,4.36,15.56 L6.35,14.76 C6.77,15.08,7.21,15.34,7.7,15.54 L8,17.66 C8.04,17.86,8.2,18,8.4,18 L11.6,18 C11.8,18,11.97,17.86,11.99,17.66 L12.29,15.54 C12.78,15.34,13.23,15.07,13.64,14.76 L15.63,15.56 C15.81,15.63,16.02,15.56,16.12,15.38 L17.72,12.61 C17.82,12.43,17.78,12.22,17.62,12.1 L15.95,10.78 Z M10,13 C8.35,13,7,11.65,7,10 S8.35,7,10,7 S13,8.35,13,10 S11.65,13,10,13 Z" />
+</vector>
diff --git a/mobile/android/app/src/main/res/drawable/list_section_divider_material.xml b/mobile/android/app/src/main/res/drawable/list_section_divider_material.xml
new file mode 100644
index 000000000000..dd66b88381fa
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/list_section_divider_material.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+          http://www.apache.org/licenses/LICENSE-2.0
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<!-- Based on:
+    https://android.googlesource.com/platform/frameworks/base/+/refs/heads/pie-release/core/res/res/drawable/list_section_divider_material.xml
+-->
+<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
+    android:src="@drawable/list_section_divider_mtrl_alpha"
+    android:tint="#ff000000"
+    android:alpha="0.12" />
diff --git a/mobile/android/app/src/main/res/drawable/list_section_divider_mtrl_alpha.9.png b/mobile/android/app/src/main/res/drawable/list_section_divider_mtrl_alpha.9.png
new file mode 100644
index 000000000000..12d8b2f4aa00
Binary files /dev/null and b/mobile/android/app/src/main/res/drawable/list_section_divider_mtrl_alpha.9.png differ
diff --git a/mobile/android/app/src/main/res/drawable/rounded_corners.xml b/mobile/android/app/src/main/res/drawable/rounded_corners.xml
new file mode 100644
index 000000000000..670da2fed66e
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/rounded_corners.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+
+<!-- Used for rounding the corners of a button -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+    <solid android:color="#FFFFFF" />
+    <corners android:radius="5dp" />
+</shape>
diff --git a/mobile/android/app/src/main/res/drawable/tor_spinning_onion.xml b/mobile/android/app/src/main/res/drawable/tor_spinning_onion.xml
new file mode 100644
index 000000000000..6bcc52f87f93
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/tor_spinning_onion.xml
@@ -0,0 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+
+<vector android:height="24dp" android:viewportHeight="289"
+    android:viewportWidth="247" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#FF000000" android:pathData="M100.02,44.97C96.2,31.15 83.92,21.59 69.91,21.51V0c16.52,0 32.07,7.97 41.98,21.51V0h20.99v21.51C142.78,7.97 158.33,0 174.85,0v21.51c-14.01,0.08 -26.29,9.63 -30.12,23.45C203.49,54.97 41.26,54.97 100.02,44.97z"/>
+    <path android:fillColor="#FF000000" android:pathData="M123.92,52.47c-62.22,0 -112.65,50.44 -112.65,112.65c0,62.22 50.44,112.65 112.65,112.65V52.47z"/>
+    <path android:fillColor="#FF000000" android:pathData="M123.92,266.51c56,0 101.39,-45.39 101.39,-101.39c0,-56 -45.39,-101.39 -101.39,-101.39S22.53,109.13 22.53,165.12C22.53,221.12 67.92,266.51 123.92,266.51zM123.92,289.04C55.48,289.04 0,233.56 0,165.12S55.48,41.2 123.92,41.2s123.92,55.48 123.92,123.92S192.36,289.04 123.92,289.04z"/>
+    <path android:fillColor="#FF000000" android:pathData="M124.92,78.78v22.53c34.79,0.54 62.84,28.89 62.84,63.81c0,34.92 -28.04,63.28 -62.84,63.81v22.53c47.24,-0.54 85.37,-38.98 85.37,-86.34C210.29,117.76 172.16,79.32 124.92,78.78z"/>
+    <path android:fillColor="#FF000000" android:pathData="M123.92,116.31v22.53c14.52,0 26.29,11.77 26.29,26.29s-11.77,26.29 -26.29,26.29v22.53c26.96,0 48.82,-21.86 48.82,-48.82C172.74,138.16 150.88,116.31 123.92,116.31z"/>
+</vector>
diff --git a/mobile/android/app/src/main/res/xml/separator.xml b/mobile/android/app/src/main/res/xml/separator.xml
new file mode 100644
index 000000000000..edd95cd90a3a
--- /dev/null
+++ b/mobile/android/app/src/main/res/xml/separator.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+
+<!-- List item separator -->
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:textSize="8sp"
+    android:textStyle="bold"
+    android:background="@drawable/list_section_divider_material"/>
diff --git a/mobile/android/app/src/photon/res/values/colors.xml b/mobile/android/app/src/photon/res/values/colors.xml
index b322a46fe008..2762e364dd79 100644
--- a/mobile/android/app/src/photon/res/values/colors.xml
+++ b/mobile/android/app/src/photon/res/values/colors.xml
@@ -154,6 +154,8 @@
     <color name="tor_tab_inactive_text">#484848</color>
     <color name="tor_tab_active_text">#7D4698</color>
     <color name="tor_description_background_text">#FAFAFA</color>
+
+    <color name="tor_bootstrap_background">#420C5D</color>
     <!-- Restricted profiles palette -->
 
     <color name="restricted_profile_background_gold">#ffffcb51</color>
diff --git a/mobile/android/base/locales/en-US/torbrowser_strings.dtd b/mobile/android/base/locales/en-US/torbrowser_strings.dtd
index 5419f4942b3e..44b4a44ff93c 100644
--- a/mobile/android/base/locales/en-US/torbrowser_strings.dtd
+++ b/mobile/android/base/locales/en-US/torbrowser_strings.dtd
@@ -23,3 +23,35 @@
 <!ENTITY firstrun_onionservices_title "Onion Services.">
 <!ENTITY firstrun_onionservices_message "Onion services are sites that end with a .onion that provide extra protections to publishers and visitors, including added safeguards against censorship. Onion services allow anyone to provide content and services anonymously.">
 <!ENTITY firstrun_onionservices_next "Go to explore">
+
+<!ENTITY tor_bootstrap_swipe_for_logs "Swipe to the left to see Tor logs">
+<!ENTITY tor_bootstrap_connect "Connect">
+<!ENTITY tor_bootstrap_starting_status "We are connecting to the Tor network...">
+
+<!ENTITY pref_tor_network_title "Network">
+<!ENTITY pref_tor_select_a_bridge_title "Select a Bridge">
+<!ENTITY pref_tor_provide_a_bridge_title "Provide a Bridge">
+
+<!ENTITY pref_category_tor_network_summary "Tor Browser connects you to the Tor Network run by thousands of volunteers around the world! Can these options help you?">
+<!ENTITY pref_category_tor_bridge_summary "Bridges are unlisted Tor relays that make it more difficult to block connections into the Tor network. Because of how some countries try to block Tor, certain bridges work in some countries but not others.">
+
+<!ENTITY pref_choice_tor_bridges_enabled_title "Internet is censored here">
+<!ENTITY pref_choice_tor_bridges_enabled_summary "Tap to configure a bridge to connect to Tor">
+
+<!ENTITY pref_tor_bridges_provide_manual_button_title "Provide a Bridge I know">
+<!ENTITY pref_tor_bridges_provide_select_text_title "Select a Bridge">
+<!ENTITY pref_tor_bridges_provide_manual_text_title "Enter Bridge">
+<!ENTITY pref_tor_bridges_provide_manual_summary "Enter the bridge information you received from a trusted source">
+<!ENTITY pref_tor_bridges_provide_manual_address_port_placeholder "address:port">
+<!ENTITY pref_tor_hint_type_one_per_line "Type one per line">
+
+<!-- When another PT is recommended, change TorNetworkBridgeSelectPreference::saveCurrentCheckedRadioButton(), too -->
+<!ENTITY pref_bridges_type_obfs4 "obfs4 (recommended)">
+<!ENTITY pref_bridges_type_meek_azure "meek-azure">
+<!ENTITY pref_bridges_type_obfs3 "obfs3">
+<!ENTITY pref_tor_network_bridges_enabled_change_builtin "You\'re using a built-in bridge to connect to Tor. Change">
+<!ENTITY pref_tor_network_bridges_enabled_change_custom "You\'re using a custom bridge to connect to Tor. Change">
+<!ENTITY pref_tor_network_using_multiple_provided_bridges "You\'re using multiple custom bridges.">
+<!ENTITY pref_tor_network_using_a_provided_bridge "You\'re using &formatS; bridge.">
+
+<!ENTITY tor_notify_user_about_error "An error occurred, please swipe for more information.">
diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in
index 2beb152ad5bb..eaa902b95060 100644
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -82,6 +82,35 @@
   <string name="firstrun_onionservices_message">&firstrun_onionservices_message;</string>
   <string name="firstrun_onionservices_next">&firstrun_onionservices_next;</string>
 
+  <string name="pref_tor_network_title">&pref_tor_network_title;</string>
+  <string name="pref_tor_select_a_bridge_title">&pref_tor_select_a_bridge_title;</string>
+  <string name="pref_tor_provide_a_bridge_title">&pref_tor_provide_a_bridge_title;</string>
+  <string name="pref_category_tor_network_summary">&pref_category_tor_network_summary;</string>
+  <string name="pref_category_tor_bridge_summary">&pref_category_tor_bridge_summary;</string>
+  <string name="tor_notify_user_about_error">&tor_notify_user_about_error;</string>
+
+  <string name="tor_bootstrap_swipe_for_logs">&tor_bootstrap_swipe_for_logs;</string>
+  <string name="tor_bootstrap_connect">&tor_bootstrap_connect;</string>
+  <string name="tor_bootstrap_starting_status">&tor_bootstrap_starting_status;</string>
+
+  <string name="pref_choice_tor_bridges_enabled_title">&pref_choice_tor_bridges_enabled_title;</string>
+  <string name="pref_choice_tor_bridges_enabled_summary">&pref_choice_tor_bridges_enabled_summary;</string>
+  <string name="pref_bridges_type_obfs4">&pref_bridges_type_obfs4;</string>
+  <string name="pref_bridges_type_meek_azure">&pref_bridges_type_meek_azure;</string>
+  <string name="pref_bridges_type_obfs3">&pref_bridges_type_obfs3;</string>
+
+  <string name="pref_tor_bridges_provide_manual_button_title">&pref_tor_bridges_provide_manual_button_title;</string>
+  <string name="pref_tor_bridges_provide_select_text_title">&pref_tor_bridges_provide_select_text_title;</string>
+  <string name="pref_tor_bridges_provide_manual_text_title">&pref_tor_bridges_provide_manual_text_title;</string>
+  <string name="pref_tor_bridges_provide_manual_summary">&pref_tor_bridges_provide_manual_summary;</string>
+
+  <string name="pref_tor_bridges_provide_manual_address_port_placeholder">&pref_tor_bridges_provide_manual_address_port_placeholder;</string>
+  <string name="pref_tor_hint_type_one_per_line">&pref_tor_hint_type_one_per_line;</string>
+  <string name="pref_tor_network_bridges_enabled_change_custom">&pref_tor_network_bridges_enabled_change_custom;</string>
+  <string name="pref_tor_network_bridges_enabled_change_builtin">&pref_tor_network_bridges_enabled_change_builtin;</string>
+  <string name="pref_tor_network_using_multiple_provided_bridges">&pref_tor_network_using_multiple_provided_bridges;</string>
+  <string name="pref_tor_network_using_a_provided_bridge">&pref_tor_network_using_a_provided_bridge;</string>
+
   <string name="bookmarks_title">&bookmarks_title;</string>
   <string name="history_title">&history_title;</string>
 





More information about the tor-commits mailing list