]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Speed up cold start time. https://redmine.stoutner.com/issues/249
authorSoren Stoutner <soren@stoutner.com>
Wed, 21 Feb 2018 06:34:12 +0000 (23:34 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 21 Feb 2018 06:34:12 +0000 (23:34 -0700)
app/src/main/assets/de/about_licenses_dark.html
app/src/main/assets/de/about_licenses_light.html
app/src/main/assets/en/about_licenses_dark.html
app/src/main/assets/en/about_licenses_light.html
app/src/main/assets/es/about_licenses_dark.html
app/src/main/assets/es/about_licenses_light.html
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java
app/src/main/res/values-es/strings.xml
app/src/main/res/values-ru/strings.xml

index c5a3d74463a38822b820b9e96b36346090a0cb42..474f5ed940bb87222ecd2d1406e8dfc85ebedcf4 100644 (file)
@@ -37,8 +37,8 @@
             The source code is available from <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
         <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            are <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
             and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
             Privacy Browser incorporates them using the GPLv3+ option.</p>
 
index 5d028e5bc030f223b507b94084d24bac71ed5d5c..778ae18451e47698ff084477131839f1e19a672d 100644 (file)
@@ -37,8 +37,8 @@
             The source code is available from <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
         <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            are <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
             and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
             Privacy Browser incorporates them using the GPLv3+ option.</p>
 
index 3fbabfb26055b7c9a9e6f49ecfbf62d90b893365..2ab9393bfd30acaf499efb9d652deb77b676c686 100644 (file)
@@ -32,8 +32,8 @@
             The source code is available from <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
         <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            are <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
             and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
             Privacy Browser incorporates them using the GPLv3+ option.</p>
 
index f30fed24a27e915741303a23595cbaf5ddc5c642..f95b2ab6196d1429161f14fd046a4762e50d7512 100644 (file)
@@ -32,8 +32,8 @@
             The source code is available from <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
         <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            are <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
             and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
             Privacy Browser incorporates them using the GPLv3+ option.</p>
 
index e7724932c28d9587cdd4abc8b0110dd07163d7fa..6ded3f243767add1500876369e16c5b986c2f0a5 100644 (file)
             El texto completo de la licencia se encuentra en la parte inferior de este documento (se deja en el idioma original).
             El código fuente está disponible en <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
-        <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
-            and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
-            Privacy Browser incorporates them using the GPLv3+ option.</p>
-
-        <p><a href="https://easylist.to/easylist/fanboy-annoyance.txt">Fanboy’s Annoyance List</a> and <a href="https://easylist.to/easylist/fanboy-social.txt">Fanboy’s Social Blocking List</a>
-            are released under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported license</a>,
-            which is <a href="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible with the GPLv3+</a>.
-            The lists are included unchanged in Privacy Browser.</p>
-
-        <p>More information about the block lists can be found on the <a href="https://easylist.to/">EasyList website</a>.</p>
+        <h3>Listas de bloqueo</h3>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> y <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            tienen <a href="https://easylist.to/pages/licence.html">licencia dual</a> bajo las licencias <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+            y <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a>.
+            Navegador Privado las incorpora usando la opción GPLv3+.</p>
+
+        <p><a href="https://easylist.to/easylist/fanboy-annoyance.txt">La lista molesta de Fanboy</a> y <a href="https://easylist.to/easylist/fanboy-social.txt">la lista de bloqueo social de Fanboy</a>
+            se liberan bajo la licencia <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported</a>,
+            la cual es <a href="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible con la GPLv3+</a>.
+            Las listas se incluyen sin cambios en Navegador Privado.</p>
+
+        <p>Más información sobre las listas de bloqueo puede encontrarse en la <a href="https://easylist.to/">página web de EasyList</a>.</p>
 
         <h3>Librerías</h3>
         <p>Navegador privado está construido con la <a href="https://developer.android.com/topic/libraries/support-library/index.html">librería de soporte de android</a>,
index 1594a04140951a588378966e4ea0565b2b6f7bc2..5a9fe3f6648d0d307fe2e1a8712ea02c23eb5247 100644 (file)
             El texto completo de la licencia se encuentra en la parte inferior de este documento (se deja en el idioma original).
             El código fuente está disponible en <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">git.stoutner.com</a>.</p>
 
-        <h3>Block Lists</h3>
-        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> and <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a> are
-            <a href="https://easylist.to/pages/licence.html">dual licensed</a> under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
-            and the <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a> licenses.
-            Privacy Browser incorporates them using the GPLv3+ option.</p>
-
-        <p><a href="https://easylist.to/easylist/fanboy-annoyance.txt">Fanboy’s Annoyance List</a> and <a href="https://easylist.to/easylist/fanboy-social.txt">Fanboy’s Social Blocking List</a>
-            are released under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported license</a>,
-            which is <a href="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible with the GPLv3+</a>.
-            The lists are included unchanged in Privacy Browser.</p>
-
-        <p>More information about the block lists can be found on the <a href="https://easylist.to/">EasyList website</a>.</p>
+        <h3>Listas de bloqueo</h3>
+        <p><a href="https://easylist.to/easylist/easylist.txt">EasyList</a> y <a href="https://easylist.to/easylist/easyprivacy.txt">EasyPrivacy</a>
+            tienen <a href="https://easylist.to/pages/licence.html">licencia dual</a> bajo las licencias <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>
+            y <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0+ Unported</a>.
+            Navegador Privado las incorpora usando la opción GPLv3+.</p>
+
+        <p><a href="https://easylist.to/easylist/fanboy-annoyance.txt">La lista molesta de Fanboy</a> y <a href="https://easylist.to/easylist/fanboy-social.txt">la lista de bloqueo social de Fanboy</a>
+            se liberan bajo la licencia <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported</a>,
+            la cual es <a href="https://www.gnu.org/licenses/license-list.en.html#ccby">compatible con la GPLv3+</a>.
+            Las listas se incluyen sin cambios en Navegador Privado.</p>
+
+        <p>Más información sobre las listas de bloqueo puede encontrarse en la <a href="https://easylist.to/">página web de EasyList</a>.</p>
 
         <h3>Librerías</h3>
         <p>Navegador privado está construido con la <a href="https://developer.android.com/topic/libraries/support-library/index.html">librería de soporte de android</a>,
index 01d1f8b4a3acc1cc94149251c84f14437c90e884..8cffc2a56ee8e583978d83f619214486c5a87b4b 100644 (file)
@@ -409,21 +409,6 @@ public class MainWebViewActivity extends AppCompatActivity implements AddDomainD
         // Run the default commands.
         super.onCreate(savedInstanceState);
 
-        // Instantiate the block list helper.
-        BlockListHelper blockListHelper = new BlockListHelper();
-
-        // Parse the block lists.
-        ArrayList<List<String[]>> easyList = blockListHelper.parseBlockList(getAssets(), "blocklists/easylist.txt");
-        ArrayList<List<String[]>> easyPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/easyprivacy.txt");
-        ArrayList<List<String[]>> fanboyAnnoyance = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-annoyance.txt");
-        ArrayList<List<String[]>> fanboySocial = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-social.txt");
-
-        // Get the list versions.
-        easyListVersion = easyList.get(0).get(0)[0];
-        easyPrivacyVersion = easyPrivacy.get(0).get(0)[0];
-        fanboyAnnoyanceVersion = fanboyAnnoyance.get(0).get(0)[0];
-        fanboySocialVersion = fanboySocial.get(0).get(0)[0];
-
         // Set the content view.
         setContentView(R.layout.main_drawerlayout);
 
@@ -822,6 +807,21 @@ public class MainWebViewActivity extends AppCompatActivity implements AddDomainD
         // drawerToggle creates the hamburger icon at the start of the AppBar.
         drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, supportAppBar, R.string.open_navigation_drawer, R.string.close_navigation_drawer);
 
+        // Instantiate the block list helper.
+        BlockListHelper blockListHelper = new BlockListHelper();
+
+        // Parse the block lists.
+        final ArrayList<List<String[]>> easyList = blockListHelper.parseBlockList(getAssets(), "blocklists/easylist.txt");
+        final ArrayList<List<String[]>> easyPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/easyprivacy.txt");
+        final ArrayList<List<String[]>> fanboyAnnoyance = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-annoyance.txt");
+        final ArrayList<List<String[]>> fanboySocial = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-social.txt");
+
+        // Store the list versions.
+        easyListVersion = easyList.get(0).get(0)[0];
+        easyPrivacyVersion = easyPrivacy.get(0).get(0)[0];
+        fanboyAnnoyanceVersion = fanboyAnnoyance.get(0).get(0)[0];
+        fanboySocialVersion = fanboySocial.get(0).get(0)[0];
+
         mainWebView.setWebViewClient(new WebViewClient() {
             // `shouldOverrideUrlLoading` makes this `WebView` the default handler for URLs inside the app, so that links are not kicked out to other apps.
             // We have to use the deprecated `shouldOverrideUrlLoading` until API >= 24.
index 62ca537af240763cbcefcccab9ff1d1bd1e9b510..ec449a505d7a7148175a031d4808c59a21371154 100644 (file)
@@ -34,33 +34,33 @@ import java.util.regex.Pattern;
 public class BlockListHelper {
     public ArrayList<List<String[]>> parseBlockList(AssetManager assets, String blockListName) {
         // Initialize the header list.
-        List<String[]> headers = new LinkedList<>();
+        List<String[]> headers = new ArrayList<>();
 
         // Initialize the white lists.
-        List<String[]> mainWhiteList = new LinkedList<>();
-        List<String[]> finalWhiteList = new LinkedList<>();
-        List<String[]> domainWhiteList = new LinkedList<>();
-        List<String[]> domainInitialWhiteList = new LinkedList<>();
-        List<String[]> domainFinalWhiteList = new LinkedList<>();
-        List<String[]> thirdPartyWhiteList = new LinkedList<>();
-        List<String[]> thirdPartyDomainWhiteList = new LinkedList<>();
-        List<String[]> thirdPartyDomainInitialWhiteList = new LinkedList<>();
+        List<String[]> mainWhiteList = new ArrayList<>();
+        List<String[]> finalWhiteList = new ArrayList<>();
+        List<String[]> domainWhiteList = new ArrayList<>();
+        List<String[]> domainInitialWhiteList = new ArrayList<>();
+        List<String[]> domainFinalWhiteList = new ArrayList<>();
+        List<String[]> thirdPartyWhiteList = new ArrayList<>();
+        List<String[]> thirdPartyDomainWhiteList = new ArrayList<>();
+        List<String[]> thirdPartyDomainInitialWhiteList = new ArrayList<>();
 
         // Initialize the black lists
-        List<String[]> mainBlackList = new LinkedList<>();
-        List<String[]> initialBlackList = new LinkedList<>();
-        List<String[]> finalBlackList = new LinkedList<>();
-        List<String[]> domainBlackList = new LinkedList<>();
-        List<String[]> domainInitialBlackList = new LinkedList<>();
-        List<String[]> domainFinalBlackList = new LinkedList<>();
-        List<String[]> thirdPartyBlackList = new LinkedList<>();
-        List<String[]> thirdPartyInitialBlackList = new LinkedList<>();
-        List<String[]> thirdPartyDomainBlackList = new LinkedList<>();
-        List<String[]> thirdPartyDomainInitialBlackList = new LinkedList<>();
-        List<String[]> regularExpressionBlackList = new LinkedList<>();
-        List<String[]> domainRegularExpressionBlackList = new LinkedList<>();
-        List<String[]> thirdPartyRegularExpressionBlackList = new LinkedList<>();
-        List<String[]> thirdPartyDomainRegularExpressionBlackList = new LinkedList<>();
+        List<String[]> mainBlackList = new ArrayList<>();
+        List<String[]> initialBlackList = new ArrayList<>();
+        List<String[]> finalBlackList = new ArrayList<>();
+        List<String[]> domainBlackList = new ArrayList<>();
+        List<String[]> domainInitialBlackList = new ArrayList<>();
+        List<String[]> domainFinalBlackList = new ArrayList<>();
+        List<String[]> thirdPartyBlackList = new ArrayList<>();
+        List<String[]> thirdPartyInitialBlackList = new ArrayList<>();
+        List<String[]> thirdPartyDomainBlackList = new ArrayList<>();
+        List<String[]> thirdPartyDomainInitialBlackList = new ArrayList<>();
+        List<String[]> regularExpressionBlackList = new ArrayList<>();
+        List<String[]> domainRegularExpressionBlackList = new ArrayList<>();
+        List<String[]> thirdPartyRegularExpressionBlackList = new ArrayList<>();
+        List<String[]> thirdPartyDomainRegularExpressionBlackList = new ArrayList<>();
 
 
         // Populate the block lists.  The `try` is required by `InputStreamReader`.
index 2b5964ec3bc669aa711b798d1de555a037829f33..774f272729e96973d0ae390aefb781aac93425e7 100644 (file)
         <string name="incognito_mode_summary">Borrar el historial y el caché después de que cada página web termine de cargar.</string>
         <string name="do_not_track">No rastrear</string>
         <string name="do_not_track_summary">Enviar la cabecera de no rastrear (DNT) que educadamente sugiere que los servidores web no rastreen este navegador.</string>
+    <string name="block_lists">Bloquear listas</string>
+        <string name="easylist">EasyList</string>
+        <string name="easylist_summary">Lista principal de bloqueo de anuncios.</string>
+        <string name="easyprivacy">EasyPrivacy</string>
+        <string name="easyprivacy_summary">Lista principal de bloqueo de rastreadores.</string>
+        <string name="fanboy_annoyance_list">Lista molesta de Fanboy</string>
+        <string name="fanboy_annoyance_list_summary">Bloquear popups y enlaces molestos.  Incluye la lista de bloqueo social de Fanboy.</string>
+        <string name="fanboy_social_blocking_list">Lista de bloqueo social de Fanboy</string>
+        <string name="fanboy_social_blocking_list_summary">Bloquear contenidos de medios sociales de terceros.</string>
     <string name="tor">Tor</string>
         <string name="proxy_through_orbot">Enviar a través de Orbot</string>
         <string name="proxy_through_orbot_summary">Enviar todo el tráfico web a través de Orbot en localhost:8118.</string>
         </string-array>
         <string name="search_custom_url">URL personalizado de búsqueda</string>
         <string name="custom_url">URL personalizado</string>
-    <string name="full_screen">Pantalla Completa</string>
+    <string name="full_screen">Pantalla completa</string>
         <string name="full_screen_browsing_mode">Navegación de pantalla completa</string>
         <string name="full_screen_browsing_mode_summary">Doble toque para alternar a modo de navegación de pantalla completa.</string>
         <string name="hide_system_bars">Esconder barras del systema</string>
             <string name="security_patch">Parche de seguridad:</string>
             <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
-            <string name="easylist">EasyList:</string>
             <string name="orbot">Orbot:</string>
+            <string name="easylist_label">EasyList:</string>
+            <string name="easyprivacy_label">EasyPrivacy:</string>
+            <string name="fanboy_annoyance_label">Lista molesta de Fanboy:</string>
+            <string name="fanboy_social_label">Lista de bloqueo social de Fanboy:</string>
         <string name="package_signature">Firma del paquete</string>
             <string name="issuer_dn">DN del emisor:</string>
             <string name="subject_dn">DN del sujeto:</string>
index 04ce5ee79dfc062366a1364eecc1189377e2b9f4..5ded5daf4639ca5c8c4a0918f76869428219ae29 100644 (file)
         <string name="incognito_mode_summary">Очистка журнала и кэша после завершения загрузки каждой веб-страницы.</string>
         <string name="do_not_track">Не отслеживать</string>
         <string name="do_not_track_summary">Отправлять заголовок \'не отслеживать\', являющийся пожеланием веб-серверу не отслеживать этот браузер.</string>
+    <string name="block_lists">Списки блокировки</string>
+        <string name="easylist">EasyList</string>
+        <string name="easylist_summary">Основной список блокировки рекламы.</string>
+        <string name="easyprivacy">EasyPrivacy</string>
+        <string name="easyprivacy_summary">Основной список блокировки отслеживания.</string>
+        <string name="fanboy_annoyance_list">Fanboy’s annoyance list</string>
+        <string name="fanboy_annoyance_list_summary">Блокирует раздражающие всплывающие окна и ссылки.  Включает в себя Fanboy’s social blocking lists.</string>
+        <string name="fanboy_social_blocking_list">Fanboy’s social blocking list</string>
+        <string name="fanboy_social_blocking_list_summary">Блокирует содержимое социальных сетей.</string>
     <string name="tor">Tor</string>
         <string name="proxy_through_orbot">Прокси через Orbot</string>
         <string name="proxy_through_orbot_summary">Проксировать весь веб-трафик через Orbot на localhost:8118.</string>
             <string name="security_patch">Патч безопасности:</string>
             <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
-            <string name="easylist">EasyList:</string>
             <string name="orbot">Orbot:</string>
+            <string name="easylist_label">EasyList:</string>
+            <string name="easyprivacy_label">EasyPrivacy:</string>
+            <string name="fanboy_annoyance_label">Fanboy’s Annoyance List:</string>
+            <string name="fanboy_social_label">Fanboy’s Social Blocking List:</string>
         <string name="package_signature">Подпись пакета</string>
             <string name="issuer_dn">DN эмитента:</string>
             <string name="subject_dn">DN субъекта:</string>