From: Soren Stoutner Date: Wed, 21 Feb 2018 06:34:12 +0000 (-0700) Subject: Speed up cold start time. https://redmine.stoutner.com/issues/249 X-Git-Tag: v2.8~1 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=6fdb3adb172e7221723097b656a1f6bb59a1d4dd;p=PrivacyBrowserAndroid.git Speed up cold start time. https://redmine.stoutner.com/issues/249 --- diff --git a/app/src/main/assets/de/about_licenses_dark.html b/app/src/main/assets/de/about_licenses_dark.html index c5a3d744..474f5ed9 100644 --- a/app/src/main/assets/de/about_licenses_dark.html +++ b/app/src/main/assets/de/about_licenses_dark.html @@ -37,8 +37,8 @@ The source code is available from git.stoutner.com.

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ +

EasyList and EasyPrivacy + are dual licensed under the GPLv3+ and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. Privacy Browser incorporates them using the GPLv3+ option.

diff --git a/app/src/main/assets/de/about_licenses_light.html b/app/src/main/assets/de/about_licenses_light.html index 5d028e5b..778ae184 100644 --- a/app/src/main/assets/de/about_licenses_light.html +++ b/app/src/main/assets/de/about_licenses_light.html @@ -37,8 +37,8 @@ The source code is available from git.stoutner.com.

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ +

EasyList and EasyPrivacy + are dual licensed under the GPLv3+ and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. Privacy Browser incorporates them using the GPLv3+ option.

diff --git a/app/src/main/assets/en/about_licenses_dark.html b/app/src/main/assets/en/about_licenses_dark.html index 3fbabfb2..2ab9393b 100644 --- a/app/src/main/assets/en/about_licenses_dark.html +++ b/app/src/main/assets/en/about_licenses_dark.html @@ -32,8 +32,8 @@ The source code is available from git.stoutner.com.

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ +

EasyList and EasyPrivacy + are dual licensed under the GPLv3+ and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. Privacy Browser incorporates them using the GPLv3+ option.

diff --git a/app/src/main/assets/en/about_licenses_light.html b/app/src/main/assets/en/about_licenses_light.html index f30fed24..f95b2ab6 100644 --- a/app/src/main/assets/en/about_licenses_light.html +++ b/app/src/main/assets/en/about_licenses_light.html @@ -32,8 +32,8 @@ The source code is available from git.stoutner.com.

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ +

EasyList and EasyPrivacy + are dual licensed under the GPLv3+ and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. Privacy Browser incorporates them using the GPLv3+ option.

diff --git a/app/src/main/assets/es/about_licenses_dark.html b/app/src/main/assets/es/about_licenses_dark.html index e7724932..6ded3f24 100644 --- a/app/src/main/assets/es/about_licenses_dark.html +++ b/app/src/main/assets/es/about_licenses_dark.html @@ -34,18 +34,18 @@ 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 git.stoutner.com.

-

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ - and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. - Privacy Browser incorporates them using the GPLv3+ option.

- -

Fanboy’s Annoyance List and Fanboy’s Social Blocking List - are released under the Creative Commons Attribution 3.0 Unported license, - which is compatible with the GPLv3+. - The lists are included unchanged in Privacy Browser.

- -

More information about the block lists can be found on the EasyList website.

+

Listas de bloqueo

+

EasyList y EasyPrivacy + tienen licencia dual bajo las licencias GPLv3+ + y Creative Commons Attribution-ShareAlike 3.0+ Unported. + Navegador Privado las incorpora usando la opción GPLv3+.

+ +

La lista molesta de Fanboy y la lista de bloqueo social de Fanboy + se liberan bajo la licencia Creative Commons Attribution 3.0 Unported, + la cual es compatible con la GPLv3+. + Las listas se incluyen sin cambios en Navegador Privado.

+ +

Más información sobre las listas de bloqueo puede encontrarse en la página web de EasyList.

Librerías

Navegador privado está construido con la librería de soporte de android, diff --git a/app/src/main/assets/es/about_licenses_light.html b/app/src/main/assets/es/about_licenses_light.html index 1594a041..5a9fe3f6 100644 --- a/app/src/main/assets/es/about_licenses_light.html +++ b/app/src/main/assets/es/about_licenses_light.html @@ -34,18 +34,18 @@ 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 git.stoutner.com.

-

Block Lists

-

EasyList and EasyPrivacy are - dual licensed under the GPLv3+ - and the Creative Commons Attribution-ShareAlike 3.0+ Unported licenses. - Privacy Browser incorporates them using the GPLv3+ option.

- -

Fanboy’s Annoyance List and Fanboy’s Social Blocking List - are released under the Creative Commons Attribution 3.0 Unported license, - which is compatible with the GPLv3+. - The lists are included unchanged in Privacy Browser.

- -

More information about the block lists can be found on the EasyList website.

+

Listas de bloqueo

+

EasyList y EasyPrivacy + tienen licencia dual bajo las licencias GPLv3+ + y Creative Commons Attribution-ShareAlike 3.0+ Unported. + Navegador Privado las incorpora usando la opción GPLv3+.

+ +

La lista molesta de Fanboy y la lista de bloqueo social de Fanboy + se liberan bajo la licencia Creative Commons Attribution 3.0 Unported, + la cual es compatible con la GPLv3+. + Las listas se incluyen sin cambios en Navegador Privado.

+ +

Más información sobre las listas de bloqueo puede encontrarse en la página web de EasyList.

Librerías

Navegador privado está construido con la librería de soporte de android, diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 01d1f8b4..8cffc2a5 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -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> easyList = blockListHelper.parseBlockList(getAssets(), "blocklists/easylist.txt"); - ArrayList> easyPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/easyprivacy.txt"); - ArrayList> fanboyAnnoyance = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-annoyance.txt"); - ArrayList> 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> easyList = blockListHelper.parseBlockList(getAssets(), "blocklists/easylist.txt"); + final ArrayList> easyPrivacy = blockListHelper.parseBlockList(getAssets(), "blocklists/easyprivacy.txt"); + final ArrayList> fanboyAnnoyance = blockListHelper.parseBlockList(getAssets(), "blocklists/fanboy-annoyance.txt"); + final ArrayList> 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. diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java index 62ca537a..ec449a50 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java @@ -34,33 +34,33 @@ import java.util.regex.Pattern; public class BlockListHelper { public ArrayList> parseBlockList(AssetManager assets, String blockListName) { // Initialize the header list. - List headers = new LinkedList<>(); + List headers = new ArrayList<>(); // Initialize the white lists. - List mainWhiteList = new LinkedList<>(); - List finalWhiteList = new LinkedList<>(); - List domainWhiteList = new LinkedList<>(); - List domainInitialWhiteList = new LinkedList<>(); - List domainFinalWhiteList = new LinkedList<>(); - List thirdPartyWhiteList = new LinkedList<>(); - List thirdPartyDomainWhiteList = new LinkedList<>(); - List thirdPartyDomainInitialWhiteList = new LinkedList<>(); + List mainWhiteList = new ArrayList<>(); + List finalWhiteList = new ArrayList<>(); + List domainWhiteList = new ArrayList<>(); + List domainInitialWhiteList = new ArrayList<>(); + List domainFinalWhiteList = new ArrayList<>(); + List thirdPartyWhiteList = new ArrayList<>(); + List thirdPartyDomainWhiteList = new ArrayList<>(); + List thirdPartyDomainInitialWhiteList = new ArrayList<>(); // Initialize the black lists - List mainBlackList = new LinkedList<>(); - List initialBlackList = new LinkedList<>(); - List finalBlackList = new LinkedList<>(); - List domainBlackList = new LinkedList<>(); - List domainInitialBlackList = new LinkedList<>(); - List domainFinalBlackList = new LinkedList<>(); - List thirdPartyBlackList = new LinkedList<>(); - List thirdPartyInitialBlackList = new LinkedList<>(); - List thirdPartyDomainBlackList = new LinkedList<>(); - List thirdPartyDomainInitialBlackList = new LinkedList<>(); - List regularExpressionBlackList = new LinkedList<>(); - List domainRegularExpressionBlackList = new LinkedList<>(); - List thirdPartyRegularExpressionBlackList = new LinkedList<>(); - List thirdPartyDomainRegularExpressionBlackList = new LinkedList<>(); + List mainBlackList = new ArrayList<>(); + List initialBlackList = new ArrayList<>(); + List finalBlackList = new ArrayList<>(); + List domainBlackList = new ArrayList<>(); + List domainInitialBlackList = new ArrayList<>(); + List domainFinalBlackList = new ArrayList<>(); + List thirdPartyBlackList = new ArrayList<>(); + List thirdPartyInitialBlackList = new ArrayList<>(); + List thirdPartyDomainBlackList = new ArrayList<>(); + List thirdPartyDomainInitialBlackList = new ArrayList<>(); + List regularExpressionBlackList = new ArrayList<>(); + List domainRegularExpressionBlackList = new ArrayList<>(); + List thirdPartyRegularExpressionBlackList = new ArrayList<>(); + List thirdPartyDomainRegularExpressionBlackList = new ArrayList<>(); // Populate the block lists. The `try` is required by `InputStreamReader`. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 2b5964ec..774f2727 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -294,6 +294,15 @@ Borrar el historial y el caché después de que cada página web termine de cargar. No rastrear Enviar la cabecera de no rastrear (DNT) que educadamente sugiere que los servidores web no rastreen este navegador. + Bloquear listas + EasyList + Lista principal de bloqueo de anuncios. + EasyPrivacy + Lista principal de bloqueo de rastreadores. + Lista molesta de Fanboy + Bloquear popups y enlaces molestos. Incluye la lista de bloqueo social de Fanboy. + Lista de bloqueo social de Fanboy + Bloquear contenidos de medios sociales de terceros. Tor Enviar a través de Orbot Enviar todo el tráfico web a través de Orbot en localhost:8118. @@ -321,7 +330,7 @@ URL personalizado de búsqueda URL personalizado - Pantalla Completa + Pantalla completa Navegación de pantalla completa Doble toque para alternar a modo de navegación de pantalla completa. Esconder barras del systema @@ -395,8 +404,11 @@ Parche de seguridad: WebKit: Chrome: - EasyList: Orbot: + EasyList: + EasyPrivacy: + Lista molesta de Fanboy: + Lista de bloqueo social de Fanboy: Firma del paquete DN del emisor: DN del sujeto: diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 04ce5ee7..5ded5daf 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -299,6 +299,15 @@ Очистка журнала и кэша после завершения загрузки каждой веб-страницы. Не отслеживать Отправлять заголовок \'не отслеживать\', являющийся пожеланием веб-серверу не отслеживать этот браузер. + Списки блокировки + EasyList + Основной список блокировки рекламы. + EasyPrivacy + Основной список блокировки отслеживания. + Fanboy’s annoyance list + Блокирует раздражающие всплывающие окна и ссылки. Включает в себя Fanboy’s social blocking lists. + Fanboy’s social blocking list + Блокирует содержимое социальных сетей. Tor Прокси через Orbot Проксировать весь веб-трафик через Orbot на localhost:8118. @@ -400,8 +409,11 @@ Патч безопасности: WebKit: Chrome: - EasyList: Orbot: + EasyList: + EasyPrivacy: + Fanboy’s Annoyance List: + Fanboy’s Social Blocking List: Подпись пакета DN эмитента: DN субъекта: