freeImplementation 'com.google.firebase:firebase-ads:15.0.1'
// Only compile the consent library for the free flavor. It is used to comply with the GDPR in Europe.
- freeImplementation 'com.google.android.ads.consent:consent-library:1.0.4'
+ freeImplementation 'com.google.android.ads.consent:consent-library:1.0.6'
}
\ No newline at end of file
`android:persistableMode="persistNever"` removes Privacy Browser from the recent apps list on a device reboot.
`tools:ignore="unusedAttribute"` removes the lint warning that `persistableMode` does not apply to API < 21. -->
<activity
- android:name=".activities.SettingsActivity"
- android:label="@string/privacy_browser_settings"
+ android:name=".activities.RequestsActivity"
+ android:label="@string/requests"
android:parentActivityName=".activities.MainWebViewActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="fullUser"
android:persistableMode="persistNever"
tools:ignore="UnusedAttribute" />
+ <!-- `android:configChanges="orientation|screenSize"` makes the activity not reload when the orientation changes.
+ `android:persistableMode="persistNever"` removes Privacy Browser from the recent apps list on a device reboot.
+ `tools:ignore="unusedAttribute"` removes the lint warning that `persistableMode` does not apply to API < 21. -->
+ <activity
+ android:name=".activities.SettingsActivity"
+ android:label="@string/privacy_browser_settings"
+ android:parentActivityName=".activities.MainWebViewActivity"
+ android:configChanges="orientation|screenSize"
+ android:screenOrientation="fullUser"
+ android:persistableMode="persistNever"
+ tools:ignore="UnusedAttribute" />
+
<!-- `android:configChanges="orientation|screenSize"` makes the activity not reload when the orientation changes.
`android:persistableMode="persistNever"` removes Privacy Browser from the recent apps list on a device reboot.
`tools:ignore="unusedAttribute"` removes the lint warning that `persistableMode` does not apply to API < 21. -->
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">News</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Bug-Tracker und Feature-Anfragen</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_dark.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_dark.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_light.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">News</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_light.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Bug-Tracker und Feature-Anfragen</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_light.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_light.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_dark.png"> Lesezeichen</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_dark.png"> Lesezeichen</h3>
<p>Bookmarks can be accessed in a drawer layout by swiping from the right of the screen.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_light.png"> Lesezeichen</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_light.png"> Lesezeichen</h3>
<p>Bookmarks can be accessed in a drawer layout by swiping from the right of the screen.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_dark.png"> Secure Web Browsing</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_dark.png"> Secure Web Browsing</h3>
<p>Privacy Browser’s default is to browse with JavaScript, cookies, and DOM storage disabled.
However, some websites legitimately need these features enabled to function correctly.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_light.png"> Secure Web Browsing</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_light.png"> Secure Web Browsing</h3>
<p>Privacy Browser’s default is to browse with JavaScript, cookies, and DOM storage disabled.
However, some websites legitimately need these features enabled to function correctly.
Deshalb aktiviert das Aktivieren von Erstanbieter-Cookies zugleich auch Drittanbieter-Cookies.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_dark.png"> DOM-Speicher</h3>
+ <h3><img class="title" src="../shared_images/web_blue_dark.png"> DOM-Speicher</h3>
<p>Der Document Object Model-Speicher, auch bekannt als Web-Speicher, ist wie Cookies auf Steroiden. Während die maximale Gesamtspeichergrße für alle Cookies von
einer einzigen URL 4kb beträgt, kann der DOM-Speicher zwischen <a href="https://en.wikipedia.org/wiki/Web_storage#Storage_size">5-25 Megabytes pro Seite</a> betragen.
Da der DOM-Speicher Javascript zum Lesen und Schreiben von Daten nutzt, ändert das Aktivieren also nichts, solange nicht auch Javascript aktiviert ist.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_dark.png"> Formulardaten</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_dark.png"> Formulardaten</h3>
<p>Formulardaten beinhalten die Informationen, die in Web-Formularen eingegeben werden, wie Benutzernamen, Adressen, Telefonnummern etc. und listet sie als Auswahlmenü auf künftig besuchten Websites auf.
Ungleich der anderen Arten der lokalen Datenspeicherung werden Formulardaten nicht ohne die explizite Handlung des Nutzers an den Webserver gesendet.</p>
Deshalb aktiviert das Aktivieren von Erstanbieter-Cookies zugleich auch Drittanbieter-Cookies.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_light.png"> DOM-Speicher</h3>
+ <h3><img class="title" src="../shared_images/web_blue_light.png"> DOM-Speicher</h3>
<p>Der Document Object Model-Speicher, auch bekannt als Web-Speicher, ist wie Cookies auf Steroiden. Während die maximale Gesamtspeichergrße für alle Cookies von
einer einzigen URL 4kb beträgt, kann der DOM-Speicher zwischen <a href="https://en.wikipedia.org/wiki/Web_storage#Storage_size">5-25 Megabytes pro Seite</a> betragen.
Da der DOM-Speicher Javascript zum Lesen und Schreiben von Daten nutzt, ändert das Aktivieren also nichts, solange nicht auch Javascript aktiviert ist.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_light.png"> Formulardaten</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_light.png"> Formulardaten</h3>
<p>Formulardaten beinhalten die Informationen, die in Web-Formularen eingegeben werden, wie Benutzernamen, Adressen, Telefonnummern etc. und listet sie als Auswahlmenü auf künftig besuchten Websites auf.
Ungleich der anderen Arten der lokalen Datenspeicherung werden Formulardaten nicht ohne die explizite Handlung des Nutzers an den Webserver gesendet.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_dark.png"> Connect with Confidence</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_dark.png"> Connect with Confidence</h3>
<p>When visiting an encrypted URL (one that begins with HTTPS), the webserver uses an SSL certificate to both encrypt the information sent to the browser and to identify the server.
The purpose of the server identification is to prevent a machine located between the browser and the webserver from pretending to be the server and decrypting the information in transit.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_light.png"> Connect with Confidence</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_light.png"> Connect with Confidence</h3>
<p>When visiting an encrypted URL (one that begins with HTTPS), the webserver uses an SSL certificate to both encrypt the information sent to the browser and to identify the server.
The purpose of the server identification is to prevent a machine located between the browser and the webserver from pretending to be the server and decrypting the information in transit.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_dark.png"> Do Not Track</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_dark.png"> Do Not Track</h3>
<p>A few years ago the W3C (World Wide Web Consortium) created a mechanism for browsers to inform web servers that they would not like to be tracked.
This is accomplished by including a <a href="https://en.wikipedia.org/wiki/Do_Not_Track">DNT (Do Not Track) header</a> with web requests.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_light.png"> Do Not Track</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_light.png"> Do Not Track</h3>
<p>A few years ago the W3C (World Wide Web Consortium) created a mechanism for browsers to inform web servers that they would not like to be tracked.
This is accomplished by including a <a href="https://en.wikipedia.org/wiki/Do_Not_Track">DNT (Do Not Track) header</a> with web requests.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_dark.png"> Browser-Identifikation</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_dark.png"> Browser-Identifikation</h3>
<p>Wenn Internetbrowser sich mit Websites verbinden senden sie einen sog. User Agent, welcher den Browser und die
Rendering-Möglichkeiten an die Website kommuniziert. Die Website kann diese Informationen nutzen, um zu entscheiden, welche Version der Website
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_light.png"> Browser-Identifikation</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_light.png"> Browser-Identifikation</h3>
<p>Wenn Internetbrowser sich mit Websites verbinden senden sie einen sog. User Agent, welcher den Browser und die
Rendering-Möglichkeiten an die Website kommuniziert. Die Website kann diese Informationen nutzen, um zu entscheiden, welche Version der Website
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">News</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Bug Tracker and Feature Requests</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_dark.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_dark.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_light.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">News</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_light.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Bug Tracker and Feature Requests</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_light.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_light.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_dark.png"> Bookmarks</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_dark.png"> Bookmarks</h3>
<p>Bookmarks can be accessed in a drawer layout by swiping from the right of the screen.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_light.png"> Bookmarks</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_light.png"> Bookmarks</h3>
<p>Bookmarks can be accessed in a drawer layout by swiping from the right of the screen.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_dark.png"> Secure Web Browsing</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_dark.png"> Secure Web Browsing</h3>
<p>Privacy Browser’s default is to browse with JavaScript, cookies, and DOM storage disabled.
However, some websites legitimately need these features enabled to function correctly.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_light.png"> Secure Web Browsing</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_light.png"> Secure Web Browsing</h3>
<p>Privacy Browser’s default is to browse with JavaScript, cookies, and DOM storage disabled.
However, some websites legitimately need these features enabled to function correctly.
between first-party and third-party cookies</a>. Thus, enabling first-party cookies will also enable third-party cookies.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_dark.png"> DOM Storage</h3>
+ <h3><img class="title" src="../shared_images/web_blue_dark.png"> DOM Storage</h3>
<p>Document Object Model storage, also known as web storage, is like cookies on steroids. Whereas the maximum combined storage size for all cookies from
a single URL is 4 kilobytes, DOM storage can hold <a href="https://en.wikipedia.org/wiki/Web_storage#Storage_size">megabytes per site</a>.
Because DOM storage uses JavaScript to read and write data, enabling it will do nothing unless JavaScript is also enabled.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_dark.png"> Form Data</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_dark.png"> Form Data</h3>
<p>Form data contains information typed into web forms, like user names, addresses, phone numbers, etc., and lists them in a drop-down box on future visits.
Unlike the other forms of local storage, form data is not sent to the web server without specific user interaction.</p>
between first-party and third-party cookies</a>. Thus, enabling first-party cookies will also enable third-party cookies.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_light.png"> DOM Storage</h3>
+ <h3><img class="title" src="../shared_images/web_blue_light.png"> DOM Storage</h3>
<p>Document Object Model storage, also known as web storage, is like cookies on steroids. Whereas the maximum combined storage size for all cookies from
a single URL is 4 kilobytes, DOM storage can hold <a href="https://en.wikipedia.org/wiki/Web_storage#Storage_size">megabytes per site</a>.
Because DOM storage uses JavaScript to read and write data, enabling it will do nothing unless JavaScript is also enabled.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_light.png"> Form Data</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_light.png"> Form Data</h3>
<p>Form data contains information typed into web forms, like user names, addresses, phone numbers, etc., and lists them in a drop-down box on future visits.
Unlike the other forms of local storage, form data is not sent to the web server without specific user interaction.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_dark.png"> Connect with Confidence</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_dark.png"> Connect with Confidence</h3>
<p>When visiting an encrypted URL (one that begins with HTTPS), the webserver uses an SSL certificate to both encrypt the information sent to the browser and to identify the server.
The purpose of the server identification is to prevent a machine located between the browser and the webserver from pretending to be the server and decrypting the information in transit.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_light.png"> Connect with Confidence</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_light.png"> Connect with Confidence</h3>
<p>When visiting an encrypted URL (one that begins with HTTPS), the webserver uses an SSL certificate to both encrypt the information sent to the browser and to identify the server.
The purpose of the server identification is to prevent a machine located between the browser and the webserver from pretending to be the server and decrypting the information in transit.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_dark.png"> Do Not Track</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_dark.png"> Do Not Track</h3>
<p>A few years ago the W3C (World Wide Web Consortium) created a mechanism for browsers to inform web servers that they would not like to be tracked.
This is accomplished by including a <a href="https://en.wikipedia.org/wiki/Do_Not_Track">DNT (Do Not Track) header</a> with web requests.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_light.png"> Do Not Track</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_light.png"> Do Not Track</h3>
<p>A few years ago the W3C (World Wide Web Consortium) created a mechanism for browsers to inform web servers that they would not like to be tracked.
This is accomplished by including a <a href="https://en.wikipedia.org/wiki/Do_Not_Track">DNT (Do Not Track) header</a> with web requests.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_dark.png"> Browser Identification</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_dark.png"> Browser Identification</h3>
<p>When web browsers connect to websites, they send a user agent, which identifies the browser and the rendering capabilities it possesses.
The web server can use this information to decide which version of the website to send to the browser.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_light.png"> Browser Identification</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_light.png"> Browser Identification</h3>
<p>When web browsers connect to websites, they send a user agent, which identifies the browser and the rendering capabilities it possesses.
The web server can use this information to decide which version of the website to send to the browser.
<body>
<h3>Páginas web</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_dark.png"></a> <a href="https://www.stoutner.com/category/privacy-browser/">Noticias</a></p>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_dark.png"></a>
+ <a href="https://www.stoutner.com/category/privacy-browser/">Noticias</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_dark.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Hoja de ruta</a></p>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_dark.png"></a>
+ <a href="https://www.stoutner.com/category/roadmap/">Hoja de ruta</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_dark.png"></a> <a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Seguimiento de errores y petición de funciones</a></p>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_dark.png"></a>
+ <a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Seguimiento de errores y petición de funciones</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_dark.png"></a> <a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Foro</a></p>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_dark.png"></a>
+ <a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Foro</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_dark.png"></a> <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_dark.png"></a>
+ <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Páginas web</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_light.png"></a> <a href="https://www.stoutner.com/category/privacy-browser/">Noticias</a></p>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_light.png"></a>
+ <a href="https://www.stoutner.com/category/privacy-browser/">Noticias</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_light.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Hoja de ruta</a></p>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_light.png"></a>
+ <a href="https://www.stoutner.com/category/roadmap/">Hoja de ruta</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_light.png"></a> <a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Seguimiento de errores y petición de funciones</a></p>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_light.png"></a>
+ <a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Seguimiento de errores y petición de funciones</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_light.png"></a> <a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Foro</a></p>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_light.png"></a>
+ <a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Foro</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_light.png"></a> <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_light.png"></a>
+ <a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_dark.png"> Favoritos</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_dark.png"> Favoritos</h3>
<p>Se puede acceder a los favoritos en un diseño de cajón deslizando desde la derecha de la pantalla.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_light.png"> Favoritos</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_light.png"> Favoritos</h3>
<p>Se puede acceder a los favoritos en un diseño de cajón deslizando desde la derecha de la pantalla.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_dark.png"> Navegación web segura</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_dark.png"> Navegación web segura</h3>
<p>Por defecto Navegador Privado navega con Javascript, cookies y almacenamiento DOM desactivados.
Sin embargo, algunas páginas web necesitan legítimamente estas características para funcionar correctamente.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_light.png"> Navegación web segura</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_light.png"> Navegación web segura</h3>
<p>Por defecto Navegador Privado navega con Javascript, cookies y almacenamiento DOM desactivados.
Sin embargo, algunas páginas web necesitan legítimamente estas características para funcionar correctamente.
y de terceras partes</a>. Así que habilitando las cookies de primera parte se habilitarán también las de terceras partes.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_dark.png"> Almacenamiento DOM</h3>
+ <h3><img class="title" src="../shared_images/web_blue_dark.png"> Almacenamiento DOM</h3>
<p>El almacenamiento Modelo de Objeto de Documento (Document Object Model), también conocido como almacenamiento web, es como cookies pero más poderoso.
Mientras el tamaño de almacenamiento combinado máximo para todas las cookies de una única URL es de 4 kilobytes,
Debido a que el almacenamiento DOM usa Javascript para leer y escribir los datos, habilitarlo no hará nada a menos que Javascript sea habilitado también.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_dark.png"> Datos de formulario</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_dark.png"> Datos de formulario</h3>
<p>Los datos de formulario contienen información escrita en formularios web, como nombres de usuario, direcciones, números de teléfono, etcétera,
y los enumera en un cuadro desplegable en futuras visitas.
y de terceras partes</a>. Así que habilitando las cookies de primera parte se habilitarán también las de terceras partes.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_light.png"> Almacenamiento DOM</h3>
+ <h3><img class="title" src="../shared_images/web_blue_light.png"> Almacenamiento DOM</h3>
<p>El almacenamiento Modelo de Objeto de Documento (Document Object Model), también conocido como almacenamiento web, es como cookies pero más poderoso.
Mientras el tamaño de almacenamiento combinado máximo para todas las cookies de una única URL es de 4 kilobytes,
Debido a que el almacenamiento DOM usa Javascript para leer y escribir los datos, habilitarlo no hará nada a menos que Javascript sea habilitado también.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_light.png"> Datos de formulario</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_light.png"> Datos de formulario</h3>
<p>Los datos de formulario contienen información escrita en formularios web, como nombres de usuario, direcciones, números de teléfono, etcétera,
y los enumera en un cuadro desplegable en futuras visitas.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_dark.png"> Conectar con confianza</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_dark.png"> Conectar con confianza</h3>
<p>Al visitar una URL cifrada (que empieza con HTTPS), el servidor web usa un certificado SSL para cifrar tanto la información enviada al navegador como asimismo para identificar al servidor.
El propósito de la identificación del servidor es para prevenir que una máquina ubicada entre el navegador y el servidor web pretenda ser el servidor y descifrar la información en tránsito.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_light.png"> Conectar con confianza</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_light.png"> Conectar con confianza</h3>
<p>Al visitar una URL cifrada (que empieza con HTTPS), el servidor web usa un certificado SSL para cifrar tanto la información enviada al navegador como asimismo para identificar al servidor.
El propósito de la identificación del servidor es para prevenir que una máquina ubicada entre el navegador y el servidor web pretenda ser el servidor y descifrar la información en tránsito.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_dark.png"> No Rastrear</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_dark.png"> No Rastrear</h3>
<p>Hace algunos años la W3C (Consorcio Mundial de la Red) creó un mecanismo para que los navegadores informaran a los servidores web que no les gustaría ser rastreados.
Esto se logra incluyendo un <a href="https://en.wikipedia.org/wiki/Do_Not_Track">encabezado DNT (Do Not Track o No Rastrear)</a> con las solicitudes web.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_light.png"> No Rastrear</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_light.png"> No Rastrear</h3>
<p>Hace algunos años la W3C (Consorcio Mundial de la Red) creó un mecanismo para que los navegadores informaran a los servidores web que no les gustaría ser rastreados.
Esto se logra incluyendo un <a href="https://en.wikipedia.org/wiki/Do_Not_Track">encabezado DNT (Do Not Track o No Rastrear)</a> con las solicitudes web.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_dark.png"> Identificación del navegador</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_dark.png"> Identificación del navegador</h3>
<p>Cuando los navegadores web se conectan a las páginas web, envían un agente de usuario, que identifica al navegador y a las capacidades de rendering que posee.
El servidor web puede usar esta información para decidir qué versión de página web enviar al navegador.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_light.png"> Identificación del navegador</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_light.png"> Identificación del navegador</h3>
<p>Cuando los navegadores web se conectan a las páginas web, envían un agente de usuario, que identifica al navegador y a las capacidades de rendering que posee.
El servidor web puede usar esta información para decidir qué versión de página web enviar al navegador.
<body>
<h3>Collegamenti</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">Novità</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_dark.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_dark.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Segnalazioni di Bug e richieste di nuove funzionalità</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_dark.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_dark.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Collegamenti</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_light.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">Novità</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_light.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_light.png"></a> <a href="https://www.stoutner.com/category/roadmap/">Roadmap</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Segnalazioni di Bug e richieste di nuove funzionalità</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Forum</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_light.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_light.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_dark.png"> Segnalibri</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_dark.png"> Segnalibri</h3>
<p>E' possibile visualizzare i segnalibri attraverso un cassetto che si apre scorrendo dal lato destro dello schermo.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_light.png"> Segnalibri</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_light.png"> Segnalibri</h3>
<p>E' possibile visualizzare i segnalibri attraverso un cassetto che si apre scorrendo dal lato destro dello schermo.</p>
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">Новости</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_dark.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_dark.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Дорожная карта</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Система отслеживания ошибок и пожеланий</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_dark.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_dark.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Форум</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_dark.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_dark.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
<body>
<h3>Websites</h3>
- <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/ic_chrome_reader_mode_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/privacy-browser/"><img class="icon" src="../shared_images/chrome_reader_mode_blue_light.png"></a>
<a href="https://www.stoutner.com/category/privacy-browser/">Новости</a></p>
- <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/ic_map_blue_light.png"></a>
+ <p><a href="https://www.stoutner.com/category/roadmap/"><img class="icon" src="../shared_images/map_blue_light.png"></a>
<a href="https://www.stoutner.com/category/roadmap/">Дорожная карта</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/ic_bug_report_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/issues"><img class="icon" src="../shared_images/bug_report_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/issues">Система отслеживания ошибок и пожеланий</a></p>
- <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/ic_question_answer_blue_light.png"></a>
+ <p><a href="https://redmine.stoutner.com/projects/privacy-browser/boards"><img class="icon" src="../shared_images/question_answer_blue_light.png"></a>
<a href="https://redmine.stoutner.com/projects/privacy-browser/boards">Форум</a></p>
- <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/ic_more_blue_light.png"></a>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary"><img class="icon" src="../shared_images/more_blue_light.png"></a>
<a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=summary">GitWeb</a></p>
</body>
</html>
\ No newline at end of file
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_dark.png"> Закладки</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_dark.png"> Закладки</h3>
<p>К закладкам можно получить доступ из боковой панели, выполнив свайп от правой части экрана.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_bookmark_border_blue_light.png"> Закладки</h3>
+ <h3><img class="title" src="../shared_images/bookmark_border_blue_light.png"> Закладки</h3>
<p>К закладкам можно получить доступ из боковой панели, выполнив свайп от правой части экрана.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_dark.png"> Безопасный просмотр веб-страниц</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_dark.png"> Безопасный просмотр веб-страниц</h3>
<p>По умолчанию в Privacy Browser отключены JavaScript, файлы cookie и хранилище DOM. Однако, для правильной работы, некоторым веб-сайтам эти опции необходимы.
Настройки домена могут автоматически включать нужный набор опций при посещении определенного домена.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_dns_blue_dark.png"> Безопасный просмотр веб-страниц</h3>
+ <h3><img class="title" src="../shared_images/dns_blue_dark.png"> Безопасный просмотр веб-страниц</h3>
<p>По умолчанию в Privacy Browser отключены JavaScript, файлы cookie и хранилище DOM. Однако, для правильной работы, некоторым веб-сайтам эти опции необходимы.
Настройки домена могут автоматически включать нужный набор опций при посещении определенного домена.</p>
Таким образом, включение первичных файлов cookie также разрешит и сторонние.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_dark.png"> Хранилище DOM</h3>
+ <h3><img class="title" src="../shared_images/web_blue_dark.png"> Хранилище DOM</h3>
<p>Хранилище объектной модели документа (Document Object Model), также известное как веб-хранилище, называют cookie (печенье) на стероидах.
В то время как максимальный объем хранения для всех файлов cookie с одного URL-адреса составляет 4 килобайта,
Поскольку хранилище DOM использует JavaScript для чтения и записи данных, включение его ни на что не влияет при отключенном JavaScript.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_dark.png"> Данные формы</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_dark.png"> Данные формы</h3>
<p>Данные формы содержат информацию, вводимую в веб-формы, такие как имена пользователей, адреса, телефонные номера и т. д., и перечисляются в раскрывающемся списке при будущих посещениях.
В отличие от других форм локального хранилища данные формы не отправляются на веб-сервер без специального взаимодействия с пользователем.</p>
Таким образом, включение первичных файлов cookie также разрешит и сторонние.</p>
- <h3><img class="title" src="../shared_images/ic_web_blue_dark.png"> Хранилище DOM</h3>
+ <h3><img class="title" src="../shared_images/web_blue_dark.png"> Хранилище DOM</h3>
<p>Хранилище объектной модели документа (Document Object Model), также известное как веб-хранилище, называют cookie (печенье) на стероидах.
В то время как максимальный объем хранения для всех файлов cookie с одного URL-адреса составляет 4 килобайта,
Поскольку хранилище DOM использует JavaScript для чтения и записи данных, включение его ни на что не влияет при отключенном JavaScript.</p>
- <h3><img class="title" src="../shared_images/ic_subtitles_blue_dark.png"> Данные формы</h3>
+ <h3><img class="title" src="../shared_images/subtitles_blue_dark.png"> Данные формы</h3>
<p>Данные формы содержат информацию, вводимую в веб-формы, такие как имена пользователей, адреса, телефонные номера и т. д., и перечисляются в раскрывающемся списке при будущих посещениях.
В отличие от других форм локального хранилища данные формы не отправляются на веб-сервер без специального взаимодействия с пользователем.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_dark.png"> Подключение с уверенностью</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_dark.png"> Подключение с уверенностью</h3>
<p>При посещении зашифрованного URL (тот, который начинается с HTTPS) веб-сервер использует сертификат SSL для шифрования информации, отправленной в браузер, и для идентификации сервера.
Цель идентификации сервера состоит в том, чтобы запретить машине, расположенной между браузером и веб-сервером, притворяться сервером и дешифровать информацию во время ее транзита.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_vpn_lock_blue_dark.png"> Подключение с уверенностью</h3>
+ <h3><img class="title" src="../shared_images/vpn_lock_blue_dark.png"> Подключение с уверенностью</h3>
<p>При посещении зашифрованного URL (тот, который начинается с HTTPS) веб-сервер использует сертификат SSL для шифрования информации, отправленной в браузер, и для идентификации сервера.
Цель идентификации сервера состоит в том, чтобы запретить машине, расположенной между браузером и веб-сервером, притворяться сервером и дешифровать информацию во время ее транзита.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_dark.png"> Не отслеживать</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_dark.png"> Не отслеживать</h3>
<p>Несколько лет назад W3C (консорциум World Wide Web) создал механизм для браузеров для информирования веб-серверов о том, что они не хотели бы отслеживаться.
Это достигается путем включения <a href="https://en.wikipedia.org/wiki/Do_Not_Track"> заголовка DNT (Не отслеживать) </a> в веб-запросы.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_location_off_blue_light.png"> Не отслеживать</h3>
+ <h3><img class="title" src="../shared_images/location_off_blue_light.png"> Не отслеживать</h3>
<p>Несколько лет назад W3C (консорциум World Wide Web) создал механизм для браузеров для информирования веб-серверов о том, что они не хотели бы отслеживаться.
Это достигается путем включения <a href="https://en.wikipedia.org/wiki/Do_Not_Track"> заголовка DNT (Не отслеживать) </a> в веб-запросы.</p>
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_dark.png"> Идентификация браузера</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_dark.png"> Идентификация браузера</h3>
<p>При подключении браузера к веб-сайтам происходит отправка пользовательского агента, который идентифицирует браузер и возможности визуализации, которыми он обладает.
Веб-сервер может использовать эту информацию, чтобы решить, какую версию сайта отправить в браузер.
</head>
<body>
- <h3><img class="title" src="../shared_images/ic_devices_other_blue_light.png"> Идентификация браузера</h3>
+ <h3><img class="title" src="../shared_images/devices_other_blue_light.png"> Идентификация браузера</h3>
<p>При подключении браузера к веб-сайтам происходит отправка пользовательского агента, который идентифицирует браузер и возможности визуализации, которыми он обладает.
Веб-сервер может использовать эту информацию, чтобы решить, какую версию сайта отправить в браузер.
final Toolbar bookmarksAppBar = findViewById(R.id.bookmarks_toolbar);
setSupportActionBar(bookmarksAppBar);
- // Get a handle for the activity, the app bar, and the `ListView`.
+ // Get a handle for the activity, the app bar, and the ListView.
final Activity bookmarksActivity = this;
appBar = getSupportActionBar();
bookmarksListView = findViewById(R.id.bookmarks_listview);
- // This assert removes the incorrect warning in Android Studio on the following line that `appBar` might be null.
+ // Remove the incorrect lint warning that `appBar` might be null.
assert appBar != null;
- // Display the home arrow on `SupportActionBar`.
+ // Display the home arrow on the app bar.
appBar.setDisplayHomeAsUpEnabled(true);
// Initialize the database helper. `this` specifies the context. The two `nulls` do not specify the database name or a `CursorFactory`.
// Remove the incorrect warning in Android Studio that `appBar` might be null.
assert appBar != null;
- // Display the `Spinner` and the back arrow in the `AppBar`.
+ // Display the spinner and the back arrow in the app bar.
appBar.setCustomView(R.layout.bookmarks_databaseview_spinner);
appBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_HOME_AS_UP);
// Initialize the database handler. `this` specifies the context. The two `null`s do not specify the database name or a `CursorFactory`. The `0` is to specify a database version, but that is set instead using a constant in `BookmarksDatabaseHelper`.
bookmarksDatabaseHelper = new BookmarksDatabaseHelper(this, null, null, 0);
- // Setup a `MatrixCursor` for "All Folders" and "Home Folder".
+ // Setup a matrix cursor for "All Folders" and "Home Folder".
String[] matrixCursorColumnNames = {BookmarksDatabaseHelper._ID, BookmarksDatabaseHelper.BOOKMARK_NAME};
MatrixCursor matrixCursor = new MatrixCursor(matrixCursorColumnNames);
matrixCursor.addRow(new Object[]{ALL_FOLDERS_DATABASE_ID, getString(R.string.all_folders)});
// Combine `matrixCursor` and `foldersCursor`.
MergeCursor foldersMergeCursor = new MergeCursor(new Cursor[]{matrixCursor, foldersCursor});
- // Create a `ResourceCursorAdapter` for the `Spinner` with `this` context. `0` specifies no flags.;
+ // Create a resource cursor adapter for the spinner.
ResourceCursorAdapter foldersCursorAdapter = new ResourceCursorAdapter(this, R.layout.bookmarks_databaseview_spinner_item, foldersMergeCursor, 0) {
@Override
public void bindView(View view, Context context, Cursor cursor) {
- // Get a handle for the `Spinner` item `TextView`.
+ // Get a handle for the spinner item text view.
TextView spinnerItemTextView = view.findViewById(R.id.spinner_item_textview);
- // Set the `TextView` to display the folder name.
+ // Set the text view to display the folder name.
spinnerItemTextView.setText(cursor.getString(cursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_NAME)));
}
};
- // Set the `ResourceCursorAdapter` drop drown view resource.
+ // Set the resource cursor adapter drop drown view resource.
foldersCursorAdapter.setDropDownViewResource(R.layout.bookmarks_databaseview_spinner_dropdown_item);
- // Get a handle for the folder `Spinner`.
+ // Get a handle for the folder spinner and set the adapter.
Spinner folderSpinner = findViewById(R.id.bookmarks_databaseview_spinner);
-
- // Set the adapter for the folder `Spinner`.
folderSpinner.setAdapter(foldersCursorAdapter);
- // Handle clicks on the `Spinner` dropdown.
+ // Handle clicks on the spinner dropdown.
folderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// Store the current folder database ID.
currentFolderDatabaseId = databaseId;
- // Populate the bookmarks `ListView` based on the `Spinner` selection.
+ // Populate the bookmarks list view based on the spinner selection.
switch (databaseId) {
// Get a cursor with all the folders.
case ALL_FOLDERS_DATABASE_ID:
currentFolderName = folderName;
}
- // Update the `ListView`.
+ // Update the list view.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
}
HttpAuthenticationDialog.HttpAuthenticationListener, NavigationView.OnNavigationItemSelectedListener, PinnedSslCertificateMismatchDialog.PinnedSslCertificateMismatchListener,
SslCertificateErrorDialog.SslCertificateErrorListener, UrlHistoryDialog.UrlHistoryListener {
- // `darkTheme` is public static so it can be accessed from `AboutActivity`, `GuideActivity`, `AddDomainDialog`, `SettingsActivity`, `DomainsActivity`, `DomainsListFragment`, `BookmarksActivity`,
- // `BookmarksDatabaseViewActivity`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `DownloadFileDialog`, `DownloadImageDialog`, `EditBookmarkDialog`, `EditBookmarkFolderDialog`,
- // `EditBookmarkDatabaseViewDialog`, `HttpAuthenticationDialog`, `MoveToFolderDialog`, `SslCertificateErrorDialog`, `UrlHistoryDialog`, `ViewSslCertificateDialog`, `CreateHomeScreenShortcutDialog`,
- // and `OrbotProxyHelper`. It is also used in `onCreate()`, `applyAppSettings()`, `applyDomainSettings()`, and `updatePrivacyIcons()`.
+ // `darkTheme` is public static so it can be accessed from everywhere.
public static boolean darkTheme;
// `allowScreenshots` is public static so it can be accessed from everywhere. It is also used in `onCreate()`.
public static String fanboyAnnoyanceVersion;
public static String fanboySocialVersion;
+ // The request items are public static so they can be accessed by `BlockListHelper`, `RequestsArrayAdapter`, and `ViewRequestsDialog`. They are also used in `onCreate()`.
+ public static List<String[]> resourceRequests;
+ public static String[] whiteListResultStringArray;
+ public final static int REQUEST_DISPOSITION = 0;
+ public final static int REQUEST_URL = 1;
+ public final static int REQUEST_BLOCKLIST = 2;
+ public final static int REQUEST_SUBLIST = 3;
+ public final static int REQUEST_BLOCKLIST_ENTRIES = 4;
+ public final static int REQUEST_BLOCKLIST_ORIGINAL_ENTRY = 5;
+
+ public final static int REQUEST_DEFAULT = 0;
+ public final static int REQUEST_ALLOWED = 1;
+ public final static int REQUEST_BLOCKED = 2;
+
+ public final static int MAIN_WHITELIST = 1;
+ public final static int FINAL_WHITELIST = 2;
+ public final static int DOMAIN_WHITELIST = 3;
+ public final static int DOMAIN_INITIAL_WHITELIST = 4;
+ public final static int DOMAIN_FINAL_WHITELIST = 5;
+ public final static int THIRD_PARTY_WHITELIST = 6;
+ public final static int THIRD_PARTY_DOMAIN_WHITELIST = 7;
+ public final static int THIRD_PARTY_DOMAIN_INITIAL_WHITELIST = 8;
+
+ public final static int MAIN_BLACKLIST = 9;
+ public final static int INITIAL_BLACKLIST = 10;
+ public final static int FINAL_BLACKLIST = 11;
+ public final static int DOMAIN_BLACKLIST = 12;
+ public final static int DOMAIN_INITIAL_BLACKLIST = 13;
+ public final static int DOMAIN_FINAL_BLACKLIST = 14;
+ public final static int DOMAIN_REGULAR_EXPRESSION_BLACKLIST = 15;
+ public final static int THIRD_PARTY_BLACKLIST = 16;
+ public final static int THIRD_PARTY_INITIAL_BLACKLIST = 17;
+ public final static int THIRD_PARTY_DOMAIN_BLACKLIST = 18;
+ public final static int THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST = 19;
+ public final static int THIRD_PARTY_REGULAR_EXPRESSION_BLACKLIST = 20;
+ public final static int THIRD_PARTY_DOMAIN_REGULAR_EXPRESSION_BLACKLIST = 21;
+ public final static int REGULAR_EXPRESSION_BLACKLIST = 22;
+
// `currentBookmarksFolder` is public static so it can be accessed from `BookmarksActivity`. It is also used in `onCreate()`, `onBackPressed()`, `onCreateBookmark()`, `onCreateBookmarkFolder()`,
// `onSaveEditBookmark()`, `onSaveEditBookmarkFolder()`, and `loadBookmarksFolder()`.
public static String currentBookmarksFolder;
final MenuItem navigationBackMenuItem = navigationMenu.getItem(1);
final MenuItem navigationForwardMenuItem = navigationMenu.getItem(2);
final MenuItem navigationHistoryMenuItem = navigationMenu.getItem(3);
+ final MenuItem navigationRequestsMenuItem = navigationMenu.getItem(4);
// Initialize the bookmarks database helper. `this` specifies the context. The two `nulls` do not specify the database name or a `CursorFactory`.
// The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
return true;
});
- // The `DrawerListener` allows us to update the Navigation Menu.
+ // The `DrawerListener` is used to update the Navigation Menu.
drawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
@Override
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
@Override
public void onDrawerStateChanged(int newState) {
if ((newState == DrawerLayout.STATE_SETTLING) || (newState == DrawerLayout.STATE_DRAGGING)) { // The drawer is opening or closing.
- // Update the `Back`, `Forward`, and `History` menu items.
+ // Initialize a the blocked requests counter.
+ int blockedRequests = 0;
+
+ // Count the number of blocked requests.
+ for (int i = 0; i < resourceRequests.size(); i++) {
+ if (Integer.valueOf(resourceRequests.get(i)[REQUEST_DISPOSITION]) == REQUEST_BLOCKED) {
+ blockedRequests++;
+ }
+ }
+
+ // Update the back, forward, history, and requests menu items.
navigationBackMenuItem.setEnabled(mainWebView.canGoBack());
navigationForwardMenuItem.setEnabled(mainWebView.canGoForward());
navigationHistoryMenuItem.setEnabled((mainWebView.canGoBack() || mainWebView.canGoForward()));
+ navigationRequestsMenuItem.setTitle(getResources().getString(R.string.requests) + " - " + blockedRequests);
// Hide the keyboard (if displayed) so we can see the navigation menu. `0` indicates no additional flags.
inputMethodManager.hideSoftInputFromWindow(mainWebView.getWindowToken(), 0);
// Instantiate the block list helper.
BlockListHelper blockListHelper = new BlockListHelper();
+ // Initialize the list of resource requests.
+ resourceRequests = new ArrayList<>();
+
// 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");
}
}
- // Check requests against the block lists. The deprecated `shouldInterceptRequest` must be used until minimum API >= 21.
+ // Check requests against the block lists. The deprecated `shouldInterceptRequest()` must be used until minimum API >= 21.
@SuppressWarnings("deprecation")
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url){
// Create an empty web resource response to be used if the resource request is blocked.
WebResourceResponse emptyWebResourceResponse = new WebResourceResponse("text/plain", "utf8", new ByteArrayInputStream("".getBytes()));
+ // Reset `whiteListResultStringArray`.
+ whiteListResultStringArray = null;
+
// Check EasyList if it is enabled.
if (easyListEnabled) {
if (blockListHelper.isBlocked(formattedUrlString, url, easyList)) {
}
}
+ // Add the request to the log.
+ if (whiteListResultStringArray != null ) { // The request was processed by a whitelist.
+ resourceRequests.add(whiteListResultStringArray);
+ } else { // The request didn't match any blocklist entry. Log it as a defult request.
+ resourceRequests.add(new String[]{String.valueOf(REQUEST_DEFAULT), url});
+ }
+
// The resource request has not been blocked. `return null` loads the requested resource.
return null;
}
// Update the URL in urlTextBox when the page starts to load.
@Override
- public void onPageStarted(WebView view, String url, Bitmap favicon) {// If night mode is enabled, hide `mainWebView` until after the night mode CSS is applied.
+ public void onPageStarted(WebView view, String url, Bitmap favicon) {
+ // Reset the list of resource requests.
+ resourceRequests.clear();
+
+ // If night mode is enabled, hide `mainWebView` until after the night mode CSS is applied.
if (nightMode) {
mainWebView.setVisibility(View.INVISIBLE);
}
urlHistoryDialogFragment.show(getSupportFragmentManager(), getString(R.string.history));
break;
+ case R.id.requests:
+ // Launch the requests activity.
+ Intent requestsIntent = new Intent(this, RequestsActivity.class);
+ startActivity(requestsIntent);
+ break;
+
case R.id.downloads:
// Launch the system Download Manager.
Intent downloadManagerIntent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
reapplyDomainSettingsOnRestart = true;
currentDomainName = "";
- // Launch `DomainsActivity`.
+ // Launch the domains activity.
Intent domainsIntent = new Intent(this, DomainsActivity.class);
startActivity(domainsIntent);
break;
reapplyDomainSettingsOnRestart = true;
currentDomainName = "";
- // Launch `SettingsActivity`.
+ // Launch the settings activity.
Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsIntent);
break;
// Apply any custom domain settings.
applyDomainSettings(url, true, false);
- // Load the URL.
- mainWebView.loadUrl(url, customHeaders);
-
// Set `urlIsLoading` to prevent changes in the user agent on websites with redirects from reloading the current website.
urlIsLoading = true;
+
+ // Load the URL.
+ mainWebView.loadUrl(url, customHeaders);
}
public void findPreviousOnPage(View view) {
--- /dev/null
+/*
+ * Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+ *
+ * Privacy Browser is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.stoutner.privacybrowser.activities;
+
+import android.content.Context;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.os.Bundle;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.AppCompatDialogFragment;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.ResourceCursorAdapter;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.adapters.RequestsArrayAdapter;
+import com.stoutner.privacybrowser.dialogs.ViewRequestDialog;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RequestsActivity extends AppCompatActivity implements ViewRequestDialog.ViewRequestListener {
+ // The list view is used in `onCreate()` and `launchViewRequestDialog()`.
+ private ListView resourceRequestsListView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Set the activity theme.
+ if (MainWebViewActivity.darkTheme) {
+ setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
+ } else {
+ setTheme(R.style.PrivacyBrowserLight_SecondaryActivity);
+ }
+
+ // Run the default commands.
+ super.onCreate(savedInstanceState);
+
+ // Set the content view.
+ setContentView(R.layout.requests_coordinatorlayout);
+
+ // Use the `SupportActionBar` from `android.support.v7.app.ActionBar` until the minimum API is >= 21.
+ Toolbar blockListsAppBar = findViewById(R.id.blocklists_toolbar);
+ setSupportActionBar(blockListsAppBar);
+
+ // Get a handle for the app bar and the list view.
+ ActionBar appBar = getSupportActionBar();
+ resourceRequestsListView = findViewById(R.id.resource_requests_listview);
+
+ // Remove the incorrect lint warning that `appBar` might be null.
+ assert appBar != null;
+
+ // Display the spinner and the back arrow in the app bar.
+ appBar.setCustomView(R.layout.requests_spinner);
+ appBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_HOME_AS_UP);
+
+ // Initialize the resource array lists.
+ List<String[]> defaultResourceRequests = new ArrayList<>();
+ List<String[]> allowedResourceRequests = new ArrayList<>();
+ List<String[]> blockedResourceRequests = new ArrayList<>();
+
+ // Populate the resource array lists.
+ for (String[] request : MainWebViewActivity.resourceRequests) {
+ switch (Integer.valueOf(request[MainWebViewActivity.REQUEST_DISPOSITION])) {
+ case MainWebViewActivity.REQUEST_DEFAULT:
+ defaultResourceRequests.add(request);
+ break;
+
+ case MainWebViewActivity.REQUEST_ALLOWED:
+ allowedResourceRequests.add(request);
+ break;
+
+ case MainWebViewActivity.REQUEST_BLOCKED:
+ blockedResourceRequests.add(request);
+ break;
+ }
+ }
+
+ // Setup a matrix cursor for the resource lists.
+ MatrixCursor spinnerCursor = new MatrixCursor(new String[]{"_id", "Requests"});
+ spinnerCursor.addRow(new Object[]{0, getString(R.string.all) + " - " + MainWebViewActivity.resourceRequests.size()});
+ spinnerCursor.addRow(new Object[]{1, getString(R.string.default_label) + " - " + defaultResourceRequests.size()});
+ spinnerCursor.addRow(new Object[]{2, getString(R.string.allowed) + " - " + allowedResourceRequests.size()});
+ spinnerCursor.addRow(new Object[]{3, getString(R.string.blocked) + " - " + blockedResourceRequests.size()});
+
+ // Create a resource cursor adapter for the spinner.
+ ResourceCursorAdapter spinnerCursorAdapter = new ResourceCursorAdapter(this, R.layout.requests_spinner_item, spinnerCursor, 0) {
+ @Override
+ public void bindView(View view, Context context, Cursor cursor) {
+ // Get a handle for the spinner item text view.
+ TextView spinnerItemTextView = view.findViewById(R.id.spinner_item_textview);
+
+ // Set the text view to display the resource list.
+ spinnerItemTextView.setText(cursor.getString(1));
+ }
+ };
+
+ // Set the resource cursor adapter drop down view resource.
+ spinnerCursorAdapter.setDropDownViewResource(R.layout.requests_spinner_dropdown_item);
+
+ // Get a handle for the app bar spinner and set the adapter.
+ Spinner appBarSpinner = findViewById(R.id.requests_spinner);
+ appBarSpinner.setAdapter(spinnerCursorAdapter);
+
+ // Handle clicks on the spinner dropdown.
+ appBarSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ switch (position) {
+ case 0: // All requests.
+ // Get an adapter for all the request.
+ ArrayAdapter<String[]> allResourceRequestsArrayAdapter = new RequestsArrayAdapter(getApplicationContext(), MainWebViewActivity.resourceRequests);
+
+ // Display the adapter in the list view.
+ resourceRequestsListView.setAdapter(allResourceRequestsArrayAdapter);
+ break;
+
+ case 1: // Default requests.
+ // Get an adapter for the default requests.
+ ArrayAdapter<String[]> defaultResourceRequestsArrayAdapter = new RequestsArrayAdapter(getApplicationContext(), defaultResourceRequests);
+
+ // Display the adapter in the list view.
+ resourceRequestsListView.setAdapter(defaultResourceRequestsArrayAdapter);
+ break;
+
+ case 2: // Allowed requests.
+ // Get an adapter for the allowed requests.
+ ArrayAdapter<String[]> allowedResourceRequestsArrayAdapter = new RequestsArrayAdapter(getApplicationContext(), allowedResourceRequests);
+
+ // Display the adapter in the list view.
+ resourceRequestsListView.setAdapter(allowedResourceRequestsArrayAdapter);
+ break;
+
+ case 3: // Blocked requests.
+ // Get an adapter fo the blocked requests.
+ ArrayAdapter<String[]> blockedResourceRequestsArrayAdapter = new RequestsArrayAdapter(getApplicationContext(), blockedResourceRequests);
+
+ // Display the adapter in the list view.
+ resourceRequestsListView.setAdapter(blockedResourceRequestsArrayAdapter);
+ break;
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> parent) {
+ // Do nothing.
+ }
+ });
+
+ // Create an array adapter with the list of the resource requests.
+ ArrayAdapter<String[]> resourceRequestsArrayAdapter = new RequestsArrayAdapter(getApplicationContext(), MainWebViewActivity.resourceRequests);
+
+ // Populate the list view with the resource requests adapter.
+ resourceRequestsListView.setAdapter(resourceRequestsArrayAdapter);
+
+ // Listen for taps on entries in the list view.
+ resourceRequestsListView.setOnItemClickListener((AdapterView<?> parent, View view, int position, long id) -> {
+ // Display the view request dialog. The list view is 0 based, so the position must be incremented by 1.
+ launchViewRequestDialog(position + 1);
+ });
+ }
+
+ @Override
+ public void onPrevious(int id) {
+ // Show the previous dialog.
+ launchViewRequestDialog(id -1);
+ }
+
+ @Override
+ public void onNext(int id) {
+ // Show the next dialog.
+ launchViewRequestDialog(id + 1);
+ }
+
+ private void launchViewRequestDialog(int id) {
+ // Determine if this is the last request in the list.
+ boolean isLastRequest = (id == resourceRequestsListView.getCount());
+
+ // Get the string array for the selected resource request. The resource requests list view is zero based.
+ String[] selectedRequestStringArray = (String[]) resourceRequestsListView.getItemAtPosition(id - 1);
+
+ // Remove the warning that `selectedRequest` might be null.
+ assert selectedRequestStringArray != null;
+
+ // Show the request detail dialog.
+ AppCompatDialogFragment viewRequestDialogFragment = ViewRequestDialog.request(id, isLastRequest, selectedRequestStringArray);
+ viewRequestDialogFragment.show(getSupportFragmentManager(), getString(R.string.request_details));
+ }
+}
\ No newline at end of file
/*
- * Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
*
private final int currentPage;
public HistoryArrayAdapter(Context context, ArrayList<History> historyArrayList, int currentPageId) {
- // We need to call `super` from the base `ArrayAdapter`. `0` is the `textViewResourceId`.
+ // `super` must be called from the base `ArrayAdapter`. `0` is the `textViewResourceId`, which is unused.
super(context, 0, historyArrayList);
// Store `currentPageId` in the class variable.
@Override
@NonNull
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
- // Inflate the view if it is `null`.
+ // Inflate the view if it is null.
if (convertView == null) {
// `false` does not attach `url_history_item_linearlayout` to `parent`.
convertView = LayoutInflater.from(getContext()).inflate(R.layout.url_history_item_linearlayout, parent, false);
}
// Get handles for `favoriteIconImageView` and `urlTextView`.
- ImageView favoriteIconImageView = (ImageView) convertView.findViewById(R.id.history_favorite_icon_imageview);
- TextView urlTextView = (TextView) convertView.findViewById(R.id.history_url_textview);
+ ImageView favoriteIconImageView = convertView.findViewById(R.id.history_favorite_icon_imageview);
+ TextView urlTextView = convertView.findViewById(R.id.history_url_textview);
// Get the URL history for this position.
History history = getItem(position);
--- /dev/null
+/*
+ * Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+ *
+ * Privacy Browser is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.stoutner.privacybrowser.adapters;
+
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
+
+import java.util.List;
+
+public class RequestsArrayAdapter extends ArrayAdapter<String[]> {
+ public RequestsArrayAdapter(Context context, List<String[]> resourceRequestsList) {
+ // `super` must be called form the base ArrayAdapter. `0` is the `textViewResourceId`, which is unused.
+ super(context, 0, resourceRequestsList);
+ }
+
+ @Override
+ @NonNull
+ public View getView(int position, View view, @NonNull ViewGroup parent) {
+ // Get a handle for the context.
+ Context context = getContext();
+
+ // Inflate the view if it is null.
+ if (view == null) {
+ view = LayoutInflater.from(context).inflate(R.layout.requests_item_linearlayout, parent, false);
+ }
+
+ // Get handles for the views.
+ LinearLayout linearLayout = view.findViewById(R.id.request_item_linearlayout);
+ TextView actionTextView = view.findViewById(R.id.request_item_action);
+ TextView urlTextView = view.findViewById(R.id.request_item_url);
+
+ // Get the string array for this entry.
+ String[] entryStringArray = getItem(position);
+
+ // Remove the lint warning below that `entryStringArray` might be null.
+ assert entryStringArray != null;
+
+ // The ID is one greater than the position because it is 0 based.
+ int id = position + 1;
+
+ // Set the action text and the background color.
+ switch (Integer.valueOf(entryStringArray[0])) {
+ case MainWebViewActivity.REQUEST_DEFAULT:
+ // Create the disposition string.
+ String requestDefault = id + ". " + context.getResources().getString(R.string.allowed);
+
+ // Set the disposition text.
+ actionTextView.setText(requestDefault);
+
+ // Set the background color.
+ linearLayout.setBackgroundColor(context.getResources().getColor(R.color.transparent));
+ break;
+
+ case MainWebViewActivity.REQUEST_ALLOWED:
+ // Create the disposition string.
+ String requestAllowed = id + ". " + context.getResources().getString(R.string.allowed);
+
+ // Set the disposition text.
+ actionTextView.setText(requestAllowed);
+
+ // Set the background color.
+ if (MainWebViewActivity.darkTheme) {
+ linearLayout.setBackgroundColor(context.getResources().getColor(R.color.blue_700_50));
+ } else {
+ linearLayout.setBackgroundColor(context.getResources().getColor(R.color.blue_100));
+ }
+ break;
+
+
+ case MainWebViewActivity.REQUEST_BLOCKED:
+ // Create the disposition string.
+ String requestBlocked = id + ". " + context.getResources().getString(R.string.blocked);
+
+ // Set the disposition text.
+ actionTextView.setText(requestBlocked);
+
+ // Set the background color.
+ if (MainWebViewActivity.darkTheme) {
+ linearLayout.setBackgroundColor(context.getResources().getColor(R.color.red_700_50));
+ } else {
+ linearLayout.setBackgroundColor(context.getResources().getColor(R.color.red_100));
+ }
+ break;
+ }
+
+ // Set the URL text.
+ urlTextView.setText(entryStringArray[1]);
+
+ // Set the text color. For some unexplained reason, `android:textColor="?android:textColorPrimary"` doesn't work in the layout file. Probably some bug relating to array adapters.
+ if (MainWebViewActivity.darkTheme) {
+ actionTextView.setTextColor(context.getResources().getColor(R.color.gray_200));
+ urlTextView.setTextColor(context.getResources().getColor(R.color.gray_200));
+ } else {
+ actionTextView.setTextColor(context.getResources().getColor(R.color.black));
+ urlTextView.setTextColor(context.getResources().getColor(R.color.black));
+ }
+
+ // Return the modified view.
+ return view;
+ }
+}
public void onAttach(Context context) {
+ // Run the default commands.
super.onAttach(context);
- // Get a handle for `AddDomainListener` from `context`.
- try {
- addDomainListener = (AddDomainListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement `AddDomainListener`.");
- }
+ // Get a handle for the listener from the launching context.
+ addDomainListener = (AddDomainListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
public void onAttach(Context context) {
super.onAttach(context);
- // Get a handle for `CreateBookmarkListener` from `context`.
- try {
- createBookmarkListener = (CreateBookmarkListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement `CreateBookmarkListener`.");
- }
+ // Get a handle for `CreateBookmarkListener` from the launching context.
+ createBookmarkListener = (CreateBookmarkListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
public void onAttach(Context context) {
super.onAttach(context);
- // Get a handle for `createBookmarkFolderListener` from `context`.
- try {
- createBookmarkFolderListener = (CreateBookmarkFolderListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement CreateBookmarkFolderListener.");
- }
+ // Get a handle for `createBookmarkFolderListener` from the launching context.
+ createBookmarkFolderListener = (CreateBookmarkFolderListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
// Check to make sure that the parent activity implements the listener.
public void onAttach(Context context) {
+ // Run the default commands.
super.onAttach(context);
- try {
- createHomeScreenShortcutListener = (CreateHomeScreenShortcutListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement CreateHomeScreenShortcutListener.");
- }
+
+ // Get a handle for `CreateHomeScreenShortcutListener` from the launching context.
+ createHomeScreenShortcutListener = (CreateHomeScreenShortcutListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
import java.util.Locale;
public class DownloadFileDialog extends AppCompatDialogFragment {
+ // `downloadFileListener` is used in `onAttach()` and `onCreateDialog()`.
+ private DownloadFileListener downloadFileListener;
+
+ // The public interface is used to send information back to the parent activity.
+ public interface DownloadFileListener {
+ void onDownloadFile(AppCompatDialogFragment dialogFragment, String downloadUrl);
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ // Run the default commands.
+ super.onAttach(context);
- private String downloadUrl;
- private String downloadFileName;
- private String fileSize;
+ // Get a handle for `DownloadFileListener` from the launching context.
+ downloadFileListener = (DownloadFileListener) context;
+ }
public static DownloadFileDialog fromUrl(String urlString, String contentDisposition, long contentLength) {
// Create an arguments bundle.
}
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
+ @NonNull
+ // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
+ @SuppressLint("InflateParams")
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Remove the warning below that `getArguments()` might be null.
assert getArguments() != null;
- // Store the strings in the local class variables.
- downloadUrl = getArguments().getString("URL");
- downloadFileName = getArguments().getString("File_Name");
-
- // Get the `File_Size`.
+ // Store the variables from the bundle.
+ String downloadUrl = getArguments().getString("URL");
+ String downloadFileName = getArguments().getString("File_Name");
long fileSizeLong = getArguments().getLong("File_Size");
+ // Initialize the file size string.
+ String fileSize;
+
// Convert `fileSizeLong` to a String.
if (fileSizeLong == -1) { // We don't know the file size.
fileSize = getString(R.string.unknown_size);
} else { // Convert `fileSize` to MB and store it in `fileSizeString`. `%.3g` displays the three most significant digits.
fileSize = String.format(Locale.getDefault(), "%.3g", (float) fileSizeLong / 1048576) + " MB";
}
- }
-
- // The public interface is used to send information back to the parent activity.
- public interface DownloadFileListener {
- void onDownloadFile(AppCompatDialogFragment dialogFragment, String downloadUrl);
- }
-
- // `downloadFileListener` is used in `onAttach()` and `onCreateDialog()`.
- private DownloadFileListener downloadFileListener;
-
- @Override
- public void onAttach(Context context) {
- super.onAttach(context);
-
- // Check to make sure the parent activity implements the listener.
- try {
- downloadFileListener = (DownloadFileListener) context;
- } catch (ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement DownloadFileListener.");
- }
- }
- @Override
- @NonNull
- // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
- @SuppressLint("InflateParams")
- public Dialog onCreateDialog(Bundle savedInstanceState) {
// Remove the warning below that `getActivity()` might be null;
assert getActivity() != null;
// `android.support.v7.app.AlertDialog` uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
// We have to use `AppCompatDialogFragment` instead of `DialogFragment` or an error is produced on API <=22.
public class DownloadImageDialog extends AppCompatDialogFragment {
+ // `downloadImageListener` is used in `onAttach()` and `onCreateDialog()`.
+ private DownloadImageListener downloadImageListener;
+
+ // The public interface is used to send information back to the parent activity.
+ public interface DownloadImageListener {
+ void onDownloadImage(AppCompatDialogFragment dialogFragment, String downloadUrl);
+ }
+
+ // Check to make sure tha the parent activity implements the listener.
+ @Override
+ public void onAttach(Context context) {
+ // Run the default commands.
+ super.onAttach(context);
- private String imageUrl;
- private String imageFileName;
+ // Get a handle for `DownloadImageListener` from the launching context.
+ downloadImageListener = (DownloadImageListener) context;
+ }
public static DownloadImageDialog imageUrl(String imageUrlString) {
// Create an arguments bundle.
return thisDownloadFileDialog;
}
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Remove the warning below that `getArguments()` might be null.
- assert getArguments() != null;
-
- // Store the strings in the local class variables.
- imageUrl = getArguments().getString("URL");
- imageFileName = getArguments().getString("Image_Name");
- }
-
- // The public interface is used to send information back to the parent activity.
- public interface DownloadImageListener {
- void onDownloadImage(AppCompatDialogFragment dialogFragment, String downloadUrl);
- }
-
- // `downloadImageListener` is used in `onAttach()` and `onCreateDialog()`.
- private DownloadImageListener downloadImageListener;
-
- // Check to make sure tha the parent activity implements the listener.
- @Override
- public void onAttach(Context context) {
- super.onAttach(context);
- try {
- downloadImageListener = (DownloadImageListener) context;
- } catch (ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement DownloadImageListener.");
- }
- }
-
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@SuppressLint("InflateParams")
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the warning below that `getArguments()` might be null.
+ assert getArguments() != null;
+
+ // Get the strings from the bundle.
+ String imageUrl = getArguments().getString("URL");
+ String imageFileName = getArguments().getString("Image_Name");
+
// Remove the warning below that `.getActivity()` might be null.
assert getActivity() != null;
public static final int DOWNLOAD_FILE = 1;
public static final int DOWNLOAD_IMAGE = 2;
- private int downloadType;
+ // `downloadLocationPermissionDialogListener` is used in `onAttach()` and `onCreateDialog()`.
+ private DownloadLocationPermissionDialogListener downloadLocationPermissionDialogListener;
+
+ // The public interface is used to send information back to the parent activity.
+ public interface DownloadLocationPermissionDialogListener {
+ void onCloseDownloadLocationPermissionDialog(int downloadType);
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ // Run the default commands.
+ super.onAttach(context);
+
+ // Get a handle for `DownloadLocationPermissionDialogListener` from the launching context.
+ downloadLocationPermissionDialogListener = (DownloadLocationPermissionDialogListener) context;
+ }
public static DownloadLocationPermissionDialog downloadType(int type) {
// Create an arguments bundle.
}
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Store the download type in the local class variable.
- downloadType = getArguments().getInt("Download_Type");
- }
+ int downloadType = getArguments().getInt("Download_Type");
- // The public interface is used to send information back to the parent activity.
- public interface DownloadLocationPermissionDialogListener {
- void onCloseDownloadLocationPermissionDialog(int downloadType);
- }
-
- // `downloadLocationPermissionDialogListener` is used in `onAttach()` and `onCreateDialog()`.
- private DownloadLocationPermissionDialogListener downloadLocationPermissionDialogListener;
-
- @Override
- public void onAttach(Context context) {
- super.onAttach(context);
-
- // Check to make sure the parent activity implements the listener.
- try {
- downloadLocationPermissionDialogListener = (DownloadLocationPermissionDialogListener) context;
- } catch (ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement DownloadLocationPermissionDialogListener.");
- }
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use a builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Instantiate the class variables.
private EditBookmarkDatabaseViewListener editBookmarkDatabaseViewListener;
- private int bookmarkDatabaseId;
private String currentBookmarkName;
private String currentUrl;
private int currentFolderDatabaseId;
// Run the default commands.
super.onAttach(context);
- // Get a handle for `EditBookmarkDatabaseViewListener` from `context`.
- try {
- editBookmarkDatabaseViewListener = (EditBookmarkDatabaseViewListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkDatabaseViewListener.");
- }
+ // Get a handle for `EditBookmarkDatabaseViewListener` from the launching context.
+
+ editBookmarkDatabaseViewListener = (EditBookmarkDatabaseViewListener) context;
}
// Store the database ID in the arguments bundle.
return editBookmarkDatabaseViewDialog;
}
+ // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
+ @SuppressLint("InflateParams")
@Override
- public void onCreate(Bundle savedInstanceState) {
- // Run the default commands.
- super.onCreate(savedInstanceState);
-
+ @NonNull
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Remove the incorrect lint warning below that `getInt()` might be null.
assert getArguments() != null;
- // Store the bookmark database ID in the class variable.
- bookmarkDatabaseId = getArguments().getInt("Database ID");
- }
+ // Get the bookmark database ID from the bundle.
+ int bookmarkDatabaseId = getArguments().getInt("Database ID");
- // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
- @SuppressLint("InflateParams")
- @Override
- @NonNull
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
+ // Initialize the database helper. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
BookmarksDatabaseHelper bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
// Get a cursor with the selected bookmark and move it to the first position.
public class EditBookmarkDialog extends AppCompatDialogFragment {
// Instantiate the class variables.
private EditBookmarkListener editBookmarkListener;
- private int selectedBookmarkDatabaseId;
private EditText nameEditText;
private EditText urlEditText;
private RadioButton newIconRadioButton;
// Run the default commands.
super.onAttach(context);
- // Get a handle for `EditBookmarkListener` from `context`.
- try {
- editBookmarkListener = (EditBookmarkListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkListener.");
- }
+ // Get a handle for `EditBookmarkListener` from the launching context.
+ editBookmarkListener = (EditBookmarkListener) context;
}
// Store the database ID in the arguments bundle.
return editBookmarkDialog;
}
+ // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
+ @SuppressLint("InflateParams")
@Override
- public void onCreate(Bundle savedInstanceState) {
- // Run the default commands.
- super.onCreate(savedInstanceState);
-
+ @NonNull
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Remove the incorrect lint warning that `getInt()` might be null.
assert getArguments() != null;
// Store the bookmark database ID in the class variable.
- selectedBookmarkDatabaseId = getArguments().getInt("Database ID");
- }
+ int selectedBookmarkDatabaseId = getArguments().getInt("Database ID");
- // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
- @SuppressLint("InflateParams")
- @Override
- @NonNull
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
+ // Initialize the database helper. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
BookmarksDatabaseHelper bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
// Get a `Cursor` with the selected bookmark and move it to the first position.
// Remove the incorrect lint warning that `getActivity()` might be null.
assert getActivity() != null;
- // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
+ // Set the view. The parent view is null because it will be assigned by the alert dialog.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_dialog, null));
// Set the listener for the negative button.
// Instantiate the class variables.
private EditBookmarkFolderDatabaseViewListener editBookmarkFolderDatabaseViewListener;
private BookmarksDatabaseHelper bookmarksDatabaseHelper;
- private int folderDatabaseId;
private StringBuilder exceptFolders;
private String currentFolderName;
private int currentParentFolderDatabaseId;
// Run the default commands.
super.onAttach(context);
- // Get a handle for `EditBookmarkDatabaseViewListener` from `context`.
- try {
- editBookmarkFolderDatabaseViewListener = (EditBookmarkFolderDatabaseViewListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkFolderDatabaseViewListener.");
- }
+ // Get a handle for `EditBookmarkDatabaseViewListener` from the launching context.
+ editBookmarkFolderDatabaseViewListener = (EditBookmarkFolderDatabaseViewListener) context;
}
// Store the database ID in the arguments bundle.
return editBookmarkFolderDatabaseViewDialog;
}
- @Override
- public void onCreate(Bundle savedInstanceState) {
- // Run the default commands.
- super.onCreate(savedInstanceState);
-
- // Remove the incorrect lint warning that `getInt()` might be null.
- assert getArguments() != null;
-
- // Store the bookmark database ID in the class variable.
- folderDatabaseId = getArguments().getInt("Database ID");
- }
-
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@SuppressLint("InflateParams")
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getInt()` might be null.
+ assert getArguments() != null;
+
+ // Get the bookmark database ID from the bundle.
+ int folderDatabaseId = getArguments().getInt("Database ID");
+
// Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
// Select the current folder in the `Spinner` if the bookmark isn't in the "Home Folder".
if (!parentFolder.equals("")) {
// Get the database ID of the parent folder.
- int folderDatabaseId = bookmarksDatabaseHelper.getFolderDatabaseId(folderCursor.getString(folderCursor.getColumnIndex(BookmarksDatabaseHelper.PARENT_FOLDER)));
+ int parentFolderDatabaseId = bookmarksDatabaseHelper.getFolderDatabaseId(folderCursor.getString(folderCursor.getColumnIndex(BookmarksDatabaseHelper.PARENT_FOLDER)));
// Initialize `parentFolderPosition` and the iteration variable.
int parentFolderPosition = 0;
// Find the parent folder position in folders `ResourceCursorAdapter`.
do {
- if (foldersCursorAdapter.getItemId(i) == folderDatabaseId) {
+ if (foldersCursorAdapter.getItemId(i) == parentFolderDatabaseId) {
// Store the current position for the parent folder.
parentFolderPosition = i;
} else {
import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper;
public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
+ // Instantiate the class variable.
+ private EditBookmarkFolderListener editBookmarkFolderListener;
+
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkFolderListener {
void onSaveBookmarkFolder(AppCompatDialogFragment dialogFragment, int selectedFolderDatabaseId);
}
- // Instantiate the class variables.
- private EditBookmarkFolderListener editBookmarkFolderListener;
- private int selectedFolderDatabaseId;
-
public void onAttach(Context context) {
// Run the default commands.
super.onAttach(context);
- // Get a handle for `EditFolderListener` from `parentActivity`.
- try {
- editBookmarkFolderListener = (EditBookmarkFolderListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkFolderListener.");
- }
+ // Get a handle for `EditFolderListener` from the launching context.
+ editBookmarkFolderListener = (EditBookmarkFolderListener) context;
}
// Store the database ID in the arguments bundle.
return editBookmarkFolderDialog;
}
+ // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
+ @SuppressLint("InflateParams")
@Override
- public void onCreate(Bundle savedInstanceState) {
- // Run the default commands.
- super.onCreate(savedInstanceState);
-
+ @NonNull
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
// Remove the incorrect lint warning that `getInt()` might be null.
assert getArguments() != null;
// Store the folder database ID in the class variable.
- selectedFolderDatabaseId = getArguments().getInt("Database ID");
- }
+ int selectedFolderDatabaseId = getArguments().getInt("Database ID");
- // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
- @SuppressLint("InflateParams")
- @Override
- @NonNull
- public Dialog onCreateDialog(Bundle savedInstanceState) {
// Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
final BookmarksDatabaseHelper bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
public class HttpAuthenticationDialog extends AppCompatDialogFragment{
-
- // The private variables are used in `onCreate()` and `onCreateDialog()`.
- private String httpAuthHost;
- private String httpAuthRealm;
-
- public static HttpAuthenticationDialog displayDialog(String host, String realm) {
- // Store the strings in a `Bundle`.
- Bundle argumentsBundle = new Bundle();
- argumentsBundle.putString("Host", host);
- argumentsBundle.putString("Realm", realm);
-
- // Add `argumentsBundle` to this instance of `HttpAuthenticationDialog`.
- HttpAuthenticationDialog thisHttpAuthenticationDialog = new HttpAuthenticationDialog();
- thisHttpAuthenticationDialog.setArguments(argumentsBundle);
- return thisHttpAuthenticationDialog;
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Remove the incorrect lint warnings that `getString()` might be null.
- assert getArguments() != null;
-
- // Save the host and realm in class variables.
- httpAuthHost = getArguments().getString("Host");
- httpAuthRealm = getArguments().getString("Realm");
- }
+ // `httpAuthenticationListener` is used in `onAttach()` and `onCreateDialog()`
+ private HttpAuthenticationListener httpAuthenticationListener;
// The public interface is used to send information back to the parent activity.
public interface HttpAuthenticationListener {
void onHttpAuthenticationProceed(AppCompatDialogFragment dialogFragment);
}
- // `httpAuthenticationListener` is used in `onAttach()` and `onCreateDialog()`
- private HttpAuthenticationListener httpAuthenticationListener;
-
public void onAttach(Context context) {
super.onAttach(context);
// Get a handle for `httpAuthenticationListener` from `context`.
- try {
- httpAuthenticationListener = (HttpAuthenticationListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement `HttpAuthenticationListener`.");
- }
+ httpAuthenticationListener = (HttpAuthenticationListener) context;
+ }
+
+ public static HttpAuthenticationDialog displayDialog(String host, String realm) {
+ // Store the strings in a `Bundle`.
+ Bundle argumentsBundle = new Bundle();
+ argumentsBundle.putString("Host", host);
+ argumentsBundle.putString("Realm", realm);
+
+ // Add `argumentsBundle` to this instance of `HttpAuthenticationDialog`.
+ HttpAuthenticationDialog thisHttpAuthenticationDialog = new HttpAuthenticationDialog();
+ thisHttpAuthenticationDialog.setArguments(argumentsBundle);
+ return thisHttpAuthenticationDialog;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warnings that `getString()` might be null.
+ assert getArguments() != null;
+
+ // Get the host and realm variables from the bundle.
+ String httpAuthHost = getArguments().getString("Host");
+ String httpAuthRealm = getArguments().getString("Realm");
+
// Remove the incorrect lint warning that `getActivity()` might be null.
assert getActivity() != null;
import java.io.ByteArrayOutputStream;
public class MoveToFolderDialog extends AppCompatDialogFragment {
- // Instantiate class variables.
+ // Instantiate the class variables.
+ private MoveToFolderListener moveToFolderListener;
private BookmarksDatabaseHelper bookmarksDatabaseHelper;
private StringBuilder exceptFolders;
void onMoveToFolder(AppCompatDialogFragment dialogFragment);
}
- // `moveToFolderListener` is used in `onAttach()` and `onCreateDialog`.
- private MoveToFolderListener moveToFolderListener;
-
public void onAttach(Context context) {
+ // Run the default commands.
super.onAttach(context);
- // Get a handle for `MoveToFolderListener` from `parentActivity`.
- try {
- moveToFolderListener = (MoveToFolderListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkFolderListener.");
- }
+ // Get a handle for `MoveToFolderListener` from the launching context.
+ moveToFolderListener = (MoveToFolderListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
import java.util.Date;
public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment {
- // `layoutInflater` is used in `onCreateDialog()` and `pagerAdapter`.
+ // Instantiate the class variables.
+ private PinnedSslCertificateMismatchListener pinnedSslCertificateMismatchListener;
private LayoutInflater layoutInflater;
-
- // The current website SSL certificate variables are used in `onCreateDialog()` and `pagerAdapter()`.
private String currentSslIssuedToCNameString;
private String currentSslIssuedToONameString;
private String currentSslIssuedToUNameString;
void onSslMismatchProceed();
}
- // `sslCertificateErrorListener` is used in `onAttach` and `onCreateDialog`.
- private PinnedSslCertificateMismatchDialog.PinnedSslCertificateMismatchListener pinnedSslCertificateMismatchListener;
-
// Check to make sure that the parent activity implements the listener.
public void onAttach(Context context) {
+ // Run the default commands.
super.onAttach(context);
- try {
- pinnedSslCertificateMismatchListener = (PinnedSslCertificateMismatchDialog.PinnedSslCertificateMismatchListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement PinnedSslCertificateMismatchListener");
- }
+ // Get a handle for `PinnedSslCertificateMismatchListener` from the launching context.
+ pinnedSslCertificateMismatchListener = (PinnedSslCertificateMismatchListener) context;
}
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
import java.util.Date;
public class SslCertificateErrorDialog extends AppCompatDialogFragment {
+ // `sslCertificateErrorListener` is used in `onAttach` and `onCreateDialog`.
+ private SslCertificateErrorListener sslCertificateErrorListener;
+
+ // The public interface is used to send information back to the parent activity.
+ public interface SslCertificateErrorListener {
+ void onSslErrorCancel();
+
+ void onSslErrorProceed();
+ }
+
+ public void onAttach(Context context) {
+ // Run the default commands.
+ super.onAttach(context);
- // The private variables are used in `onCreate()` and `onCreateDialog()`.
- private int primaryErrorInt;
- private String urlWithError;
- private String issuedToCName;
- private String issuedToOName;
- private String issuedToUName;
- private String issuedByCName;
- private String issuedByOName;
- private String issuedByUName;
- private String startDate;
- private String endDate;
+ // Get a handle for `SslCertificateErrorListener` from the launching context.
+ sslCertificateErrorListener = (SslCertificateErrorListener) context;
+ }
public static SslCertificateErrorDialog displayDialog(SslError error) {
// Get the various components of the SSL error message.
return thisSslCertificateErrorDialog;
}
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Remove the incorrect lint warning that `getArguments()` might be null.
- assert getArguments() != null;
-
- // Save the components of the SSL error message in class variables.
- primaryErrorInt = getArguments().getInt("PrimaryErrorInt");
- urlWithError = getArguments().getString("UrlWithError");
- issuedToCName = getArguments().getString("IssuedToCName");
- issuedToOName = getArguments().getString("IssuedToOName");
- issuedToUName = getArguments().getString("IssuedToUName");
- issuedByCName = getArguments().getString("IssuedByCName");
- issuedByOName = getArguments().getString("IssuedByOName");
- issuedByUName = getArguments().getString("IssuedByUName");
- startDate = getArguments().getString("StartDate");
- endDate = getArguments().getString("EndDate");
- }
-
- // The public interface is used to send information back to the parent activity.
- public interface SslCertificateErrorListener {
- void onSslErrorCancel();
-
- void onSslErrorProceed();
- }
-
- // `sslCertificateErrorListener` is used in `onAttach` and `onCreateDialog`.
- private SslCertificateErrorListener sslCertificateErrorListener;
-
- // Check to make sure that the parent activity implements the listener.
- public void onAttach(Context context) {
- super.onAttach(context);
-
- try {
- sslCertificateErrorListener = (SslCertificateErrorListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement SslCertificateErrorListener");
- }
- }
-
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@SuppressLint("InflateParams")
@SuppressWarnings("deprecation")
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getArguments()` might be null.
+ assert getArguments() != null;
+
+ // Get the components of the SSL error message from the bundle.
+ int primaryErrorInt = getArguments().getInt("PrimaryErrorInt");
+ String urlWithError = getArguments().getString("UrlWithError");
+ String issuedToCName = getArguments().getString("IssuedToCName");
+ String issuedToOName = getArguments().getString("IssuedToOName");
+ String issuedToUName = getArguments().getString("IssuedToUName");
+ String issuedByCName = getArguments().getString("IssuedByCName");
+ String issuedByOName = getArguments().getString("IssuedByOName");
+ String issuedByUName = getArguments().getString("IssuedByUName");
+ String startDate = getArguments().getString("StartDate");
+ String endDate = getArguments().getString("EndDate");
+
// Remove the incorrect lint warning that `getActivity()` might be null.
assert getActivity() != null;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
-// We have to use `AppCompatDialogFragment` instead of `DialogFragment` or an error is produced on API <= 22. `android.support.v7.app.AlertDialog` also uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
+// `AppCompatDialogFragment` must be used instead of `DialogFragment` or an error is produced on API <= 22.
+// `android.support.v7.app.AlertDialog` also uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
import android.support.v7.app.AppCompatDialogFragment;
import android.util.Base64;
import android.view.LayoutInflater;
alertDialog.show();
// Instantiate a `HistoryArrayAdapter`.
- final HistoryArrayAdapter historyArrayAdapter = new HistoryArrayAdapter(getContext(), historyArrayList, currentPageId);
+ HistoryArrayAdapter historyArrayAdapter = new HistoryArrayAdapter(getContext(), historyArrayList, currentPageId);
// Get a handle for the list view.
ListView listView = alertDialog.findViewById(R.id.history_listview);
// Listen for clicks on entries in the list view.
listView.setOnItemClickListener((AdapterView<?> parent, View view, int position, long id) -> {
- // Convert the `long` `id` to an `int`.
+ // Convert the long ID to an int.
int itemId = (int) id;
// Only consume the click if it is not on the `currentPageId`.
--- /dev/null
+/*
+ * Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+ *
+ * Privacy Browser is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.stoutner.privacybrowser.dialogs;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatDialogFragment;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.TextView;
+
+import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
+
+public class ViewRequestDialog extends AppCompatDialogFragment {
+ // The public interface is used to send information back to the parent activity.
+ public interface ViewRequestListener {
+ void onPrevious(int id);
+
+ void onNext(int id);
+ }
+
+ // `viewRequestListener` is used in `onAttach()` and `onCreateDialog()`.
+ private ViewRequestListener viewRequestListener;
+
+ public void onAttach(Context context) {
+ // Run the default commands.
+ super.onAttach(context);
+
+ // Get a handle for the listener from the launching context.
+ viewRequestListener = (ViewRequestListener) context;
+ }
+
+ public static ViewRequestDialog request(int id, boolean isLastRequest, String[] requestDetails) {
+ // Create a bundle.
+ Bundle bundle = new Bundle();
+
+ // Store the request details.
+ bundle.putInt("ID", id);
+ bundle.putBoolean("Is Last Request", isLastRequest);
+ bundle.putStringArray("Request Details", requestDetails);
+
+ // Add the bundle to the dialog.
+ ViewRequestDialog viewRequestDialog = new ViewRequestDialog();
+ viewRequestDialog.setArguments(bundle);
+
+ // Return the new dialog.
+ return viewRequestDialog;
+ }
+
+ @Override
+ @NonNull
+ // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
+ @SuppressLint("InflateParams")
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getInt()` might be null.
+ assert getArguments() != null;
+
+ // Get the info from the bundle.
+ int id = getArguments().getInt("ID");
+ boolean isLastRequest = getArguments().getBoolean("Is Last Request");
+ String[] requestDetails = getArguments().getStringArray("Request Details");
+
+ // Use an alert dialog builder to create the alert dialog.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style and icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ dialogBuilder.setIcon(R.drawable.block_ads_enabled_dark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ dialogBuilder.setIcon(R.drawable.block_ads_enabled_light);
+ }
+
+ // Create the dialog title.
+ String title = getResources().getString(R.string.request_details) + " - " + id;
+
+ // Set the title.
+ dialogBuilder.setTitle(title);
+
+ // Remove the incorrect lint warnings about items being null.
+ assert requestDetails != null;
+ assert getActivity() != null;
+
+ // Set the view. The parent view is null because it will be assigned by the alert dialog.
+ dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.view_request_dialog, null));
+
+ // Set the close button.
+ dialogBuilder.setNeutralButton(R.string.close, (DialogInterface dialog, int which) -> {
+ // Do nothing. The dialog will close automatically.
+ });
+
+ // Set the previous button.
+ dialogBuilder.setNegativeButton(R.string.previous, (DialogInterface dialog, int which) -> {
+ // Load the previous request.
+ viewRequestListener.onPrevious(id);
+ });
+
+ // Set the next button.
+ dialogBuilder.setPositiveButton(R.string.next, (DialogInterface dialog, int which) -> {
+ // Load the next request.
+ viewRequestListener.onNext(id);
+ });
+
+ // Create an alert dialog from the alert dialog builder.
+ final AlertDialog alertDialog = dialogBuilder.create();
+
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ //The alert dialog must be shown before the contents can be modified.
+ alertDialog.show();
+
+ // Get handles for the dialog views.
+ TextView requestAction = alertDialog.findViewById(R.id.request_action);
+ TextView requestUrl = alertDialog.findViewById(R.id.request_url);
+ TextView requestBlockListLabel = alertDialog.findViewById(R.id.request_blocklist_label);
+ TextView requestBlockList = alertDialog.findViewById(R.id.request_blocklist);
+ TextView requestSubListLabel = alertDialog.findViewById(R.id.request_sublist_label);
+ TextView requestSubList = alertDialog.findViewById(R.id.request_sublist);
+ TextView requestBlockListEntriesLabel = alertDialog.findViewById(R.id.request_blocklist_entries_label);
+ TextView requestBlockListEntries = alertDialog.findViewById(R.id.request_blocklist_entries);
+ TextView requestBlockListOriginalEntryLabel = alertDialog.findViewById(R.id.request_blocklist_original_entry_label);
+ TextView requestBlockListOriginalEntry = alertDialog.findViewById(R.id.request_blocklist_original_entry);
+ Button previousButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE);
+ Button nextButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
+
+ // Disable the previous button if the first resource request is displayed.
+ previousButton.setEnabled(!(id == 1));
+
+ // Disable the next button if the last resource request is displayed.
+ nextButton.setEnabled(!isLastRequest);
+
+ // Set the request action text.
+ switch (Integer.valueOf(requestDetails[MainWebViewActivity.REQUEST_DISPOSITION])) {
+ case MainWebViewActivity.REQUEST_DEFAULT:
+ // Set the text.
+ requestAction.setText(R.string.default_allowed);
+
+ // Set the background color.
+ requestAction.setBackgroundColor(getResources().getColor(R.color.transparent));
+ break;
+
+ case MainWebViewActivity.REQUEST_ALLOWED:
+ // Set the text.
+ requestAction.setText(R.string.allowed);
+
+ // Set the background color.
+ if (MainWebViewActivity.darkTheme) {
+ requestAction.setBackgroundColor(getResources().getColor(R.color.blue_700_50));
+ } else {
+ requestAction.setBackgroundColor(getResources().getColor(R.color.blue_100));
+ }
+ break;
+
+ case MainWebViewActivity.REQUEST_BLOCKED:
+ // Set the text.
+ requestAction.setText(R.string.blocked);
+
+ // Set the background color.
+ if (MainWebViewActivity.darkTheme) {
+ requestAction.setBackgroundColor(getResources().getColor(R.color.red_700_50));
+ } else {
+ requestAction.setBackgroundColor(getResources().getColor(R.color.red_100));
+ }
+ break;
+ }
+
+ // Display the request URL.
+ requestUrl.setText(requestDetails[MainWebViewActivity.REQUEST_URL]);
+
+ // Modify the dialog based on the request action.
+ if (requestDetails.length == 2) { // A default request.
+ // Hide the unused views.
+ requestBlockListLabel.setVisibility(View.GONE);
+ requestBlockList.setVisibility(View.GONE);
+ requestSubListLabel.setVisibility(View.GONE);
+ requestSubList.setVisibility(View.GONE);
+ requestBlockListEntriesLabel.setVisibility(View.GONE);
+ requestBlockListEntries.setVisibility(View.GONE);
+ requestBlockListOriginalEntryLabel.setVisibility(View.GONE);
+ requestBlockListOriginalEntry.setVisibility(View.GONE);
+ } else { // A blocked or allowed request.
+ // Set the text on the text views.
+ requestBlockList.setText(requestDetails[MainWebViewActivity.REQUEST_BLOCKLIST]);
+ requestBlockListEntries.setText(requestDetails[MainWebViewActivity.REQUEST_BLOCKLIST_ENTRIES]);
+ requestBlockListOriginalEntry.setText(requestDetails[MainWebViewActivity.REQUEST_BLOCKLIST_ORIGINAL_ENTRY]);
+
+ // Set the sublist text.
+ switch (Integer.valueOf(requestDetails[MainWebViewActivity.REQUEST_SUBLIST])) {
+ case MainWebViewActivity.MAIN_WHITELIST:
+ requestSubList.setText(R.string.main_whitelist);
+ break;
+
+ case MainWebViewActivity.FINAL_WHITELIST:
+ requestSubList.setText(R.string.final_whitelist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_WHITELIST:
+ requestSubList.setText(R.string.domain_whitelist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_INITIAL_WHITELIST:
+ requestSubList.setText(R.string.domain_initial_whitelist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_FINAL_WHITELIST:
+ requestSubList.setText(R.string.domain_final_whitelist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_WHITELIST:
+ requestSubList.setText(R.string.third_party_whiteist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_DOMAIN_WHITELIST:
+ requestSubList.setText(R.string.third_party_domain_whitelist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_WHITELIST:
+ requestSubList.setText(R.string.third_party_domain_initial_whitelist);
+ break;
+
+ case MainWebViewActivity.MAIN_BLACKLIST:
+ requestSubList.setText(R.string.main_blacklist);
+ break;
+
+ case MainWebViewActivity.INITIAL_BLACKLIST:
+ requestSubList.setText(R.string.initial_blacklist);
+ break;
+
+ case MainWebViewActivity.FINAL_BLACKLIST:
+ requestSubList.setText(R.string.final_blacklist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_BLACKLIST:
+ requestSubList.setText(R.string.domain_blacklist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_INITIAL_BLACKLIST:
+ requestSubList.setText(R.string.domain_initial_blacklist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_FINAL_BLACKLIST:
+ requestSubList.setText(R.string.domain_final_blacklist);
+ break;
+
+ case MainWebViewActivity.DOMAIN_REGULAR_EXPRESSION_BLACKLIST:
+ requestSubList.setText(R.string.domain_regular_expression_blacklist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_BLACKLIST:
+ requestSubList.setText(R.string.third_party_blacklist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_DOMAIN_BLACKLIST:
+ requestSubList.setText(R.string.third_party_domain_blacklist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST:
+ requestSubList.setText(R.string.third_party_domain_initial_blacklist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_REGULAR_EXPRESSION_BLACKLIST:
+ requestSubList.setText(R.string.third_party_regular_expression_blacklist);
+ break;
+
+ case MainWebViewActivity.THIRD_PARTY_DOMAIN_REGULAR_EXPRESSION_BLACKLIST:
+ requestSubList.setText(R.string.third_party_domain_regular_expression_blacklist);
+ break;
+
+ case MainWebViewActivity.REGULAR_EXPRESSION_BLACKLIST:
+ requestSubList.setText(R.string.regular_expression_blacklist);
+ break;
+ }
+ }
+
+ // `onCreateDialog` requires the return of an alert dialog.
+ return alertDialog;
+ }
+}
import android.content.res.AssetManager;
import android.net.Uri;
-import android.util.Log;
+
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
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 ArrayList<>();
+ List<String[]> headers = new ArrayList<>(); // 0.
// Initialize the white lists.
- 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<>();
+ List<String[]> mainWhiteList = new ArrayList<>(); // 1.
+ List<String[]> finalWhiteList = new ArrayList<>(); // 2.
+ List<String[]> domainWhiteList = new ArrayList<>(); // 3.
+ List<String[]> domainInitialWhiteList = new ArrayList<>(); // 4.
+ List<String[]> domainFinalWhiteList = new ArrayList<>(); // 5.
+ List<String[]> thirdPartyWhiteList = new ArrayList<>(); // 6.
+ List<String[]> thirdPartyDomainWhiteList = new ArrayList<>(); // 7.
+ List<String[]> thirdPartyDomainInitialWhiteList = new ArrayList<>(); // 8.
// Initialize the black lists
- 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<>();
+ List<String[]> mainBlackList = new ArrayList<>(); // 9.
+ List<String[]> initialBlackList = new ArrayList<>(); // 10.
+ List<String[]> finalBlackList = new ArrayList<>(); // 11.
+ List<String[]> domainBlackList = new ArrayList<>(); // 12.
+ List<String[]> domainInitialBlackList = new ArrayList<>(); // 13.
+ List<String[]> domainFinalBlackList = new ArrayList<>(); // 14.
+ List<String[]> domainRegularExpressionBlackList = new ArrayList<>(); // 15.
+ List<String[]> thirdPartyBlackList = new ArrayList<>(); // 16.
+ List<String[]> thirdPartyInitialBlackList = new ArrayList<>(); // 17.
+ List<String[]> thirdPartyDomainBlackList = new ArrayList<>(); // 18.
+ List<String[]> thirdPartyDomainInitialBlackList = new ArrayList<>(); // 19.
+ List<String[]> regularExpressionBlackList = new ArrayList<>(); // 20.
+ List<String[]> thirdPartyRegularExpressionBlackList = new ArrayList<>(); // 21.
+ List<String[]> thirdPartyDomainRegularExpressionBlackList = new ArrayList<>(); // 22.
// Populate the block lists. The `try` is required by `InputStreamReader`.
// Parse the block list.
while ((blockListEntry = bufferedReader.readLine()) != null) {
+ // Store the original block list entry.
String originalBlockListEntry = blockListEntry;
// Remove any `^` from the block list entry. Privacy Browser does not process them in the interest of efficiency.
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyDomainInitialWhiteList.add(domainDoubleEntry);
// " - " + originalBlockListEntry);
} else { // Process a third-party domain initial white list single entry.
// Create a domain entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the third party domain initial white list.
thirdPartyDomainInitialWhiteList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyDomainWhiteList.add(domainDoubleEntry);
// originalBlockListEntry);
} else { // Process a third-party domain single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyDomainWhiteList.add(domainEntry);
String fifthEntry = fourthEntry.substring(fourthWildcardIndex + 1);
// Create an entry string array.
- String[] quintupleEntry = {firstEntry, realSecondEntry, realThirdEntry, realFourthEntry, fifthEntry};
+ String[] quintupleEntry = {firstEntry, realSecondEntry, realThirdEntry, realFourthEntry, fifthEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyWhiteList.add(quintupleEntry);
// realFourthEntry + " , " + fifthEntry + " - " + originalBlockListEntry);
} else { // Process a third-party white list quadruple entry.
// Create an entry string array.
- String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry};
+ String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyWhiteList.add(quadrupleEntry);
}
} else { // Process a third-party white list triple entry.
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyWhiteList.add(tripleEntry);
}
} else { // Process a third-party white list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyWhiteList.add(doubleEntry);
}
} else { // Process a third-party white list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyWhiteList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry};
+ String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the white list.
domainInitialWhiteList.add(domainTripleEntry);
// thirdEntry + " - " + originalBlockListEntry);
} else { // Process a domain initial double entry.
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
domainInitialWhiteList.add(domainDoubleEntry);
}
} else { // Process a domain initial single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
domainInitialWhiteList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
domainFinalWhiteList.add(domainDoubleEntry);
// originalBlockListEntry);
} else { // Process a domain final white list single entry.
// create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
domainFinalWhiteList.add(domainEntry);
String fourthEntry = thirdEntry.substring(thirdWildcardIndex + 1);
// Create an entry string array.
- String[] domainQuadrupleEntry = {domain, firstEntry, realSecondEntry, realThirdEntry, fourthEntry};
+ String[] domainQuadrupleEntry = {domain, firstEntry, realSecondEntry, realThirdEntry, fourthEntry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainQuadrupleEntry);
// realThirdEntry + " , " + fourthEntry + " - " + originalBlockListEntry);
} else { // Process a domain white list triple entry.
// Create an entry string array.
- String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry};
+ String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainTripleEntry);
}
} else { // Process a domain white list double entry.
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainDoubleEntry);
}
} else { // Process a domain white list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
finalWhiteList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " final white list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process a final white list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the white list.
finalWhiteList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the white list.
mainWhiteList.add(tripleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " main white list added: " + firstEntry + " , " + realSecondEntry + " , " + thirdEntry + " - " + originalBlockListEntry);
} else { // Process a main white list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
mainWhiteList.add(doubleEntry);
}
} else { // Process a main white list single entry.
// Create an entry string array.
- String[] singleEntry = {blockListEntry};
+ String[] singleEntry = {blockListEntry, originalBlockListEntry};
// Add the entry to the white list.
mainWhiteList.add(singleEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " final black list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process a final black list single entry.
// create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] tripleDomainEntry = {domain, firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleDomainEntry = {domain, firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyDomainInitialBlackList.add(tripleDomainEntry);
// " , " + thirdEntry + " - " + originalBlockListEntry);
} else { // Process a third-party domain initial black list double entry.
// Create an entry string array.
- String[] doubleDomainEntry = {domain, firstEntry, secondEntry};
+ String[] doubleDomainEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyDomainInitialBlackList.add(doubleDomainEntry);
}
} else { // Process a third-party domain initial black list single entry.
// Create an entry string array.
- String[] singleEntry = {domain, entry};
+ String[] singleEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyDomainInitialBlackList.add(singleEntry);
}
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyDomainRegularExpressionBlackList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyDomainWhiteList.add(domainDoubleEntry);
// originalBlockListEntry);
} else { // Process a third-party domain white list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
thirdPartyDomainWhiteList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list
thirdPartyDomainBlackList.add(domainDoubleEntry);
// originalBlockListEntry);
} else { // Process a third-party domain black list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyDomainBlackList.add(domainEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " third-party black list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process a third-party black list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add an entry to the black list.
thirdPartyBlackList.add(singleEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] thirdPartyDoubleEntry = {firstEntry, secondEntry};
+ String[] thirdPartyDoubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyInitialBlackList.add(thirdPartyDoubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " third-party initial black list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process a third-party initial black list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyInitialBlackList.add(singleEntry);
}
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyRegularExpressionBlackList.add(singleEntry);
entry = entry.substring(0, entry.length() - 1);
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(singleEntry);
String fourthEntry = thirdEntry.substring(thirdWildcardIndex + 1);
// Create an entry string array.
- String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry};
+ String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(quadrupleEntry);
// fourthEntry + " - " + originalBlockListEntry);
} else { // Process a third-party black list triple entry.
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(tripleEntry);
}
} else { // Process a third-party black list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(doubleEntry);
String entry = blockListEntry.substring(0, blockListEntry.indexOf("$"));
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
thirdPartyBlackList.add(singleEntry);
String thirdEntry = secondEntry.substring((secondWildcardIndex + 1));
// Create an entry string array.
- String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry};
+ String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainTripleEntry);
// " - " + originalBlockListEntry);
} else { // Process a domain white list double entry.
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainDoubleEntry);
}
} else { // Process a domain white list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the white list.
domainWhiteList.add(domainEntry);
//Log.i("BlockLists", headers.get(1)[0] + " not added: " + originalBlockListEntry);
} else { // Process a domain initial black list entry
// Create an entry string array.
- String[] domainEntry = {domain, entryBase};
+ String[] domainEntry = {domain, entryBase, originalBlockListEntry};
// Add the entry to the black list.
domainInitialBlackList.add(domainEntry);
String secondEntry = entryBase.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
domainFinalBlackList.add(domainDoubleEntry);
// originalBlockListEntry);
} else { // Process a domain final black list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entryBase};
+ String[] domainEntry = {domain, entryBase, originalBlockListEntry};
// Add the entry to the black list.
domainFinalBlackList.add(domainEntry);
}
} else if (entry.contains("\\")) { // Process a domain regular expression black list entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the black list.
domainRegularExpressionBlackList.add(domainEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry};
+ String[] domainTripleEntry = {domain, firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
domainBlackList.add(domainTripleEntry);
// " - " + originalBlockListEntry);
} else { // Process a domain black list double entry.
// Create an entry string array.
- String[] domainDoubleEntry = {domain, firstEntry, secondEntry};
+ String[] domainDoubleEntry = {domain, firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
domainBlackList.add(domainDoubleEntry);
}
} else { // Process a domain black list single entry.
// Create an entry string array.
- String[] domainEntry = {domain, entry};
+ String[] domainEntry = {domain, entry, originalBlockListEntry};
// Add the entry to the black list.
domainBlackList.add(domainEntry);
String secondEntry = blockListEntry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the white list.
mainWhiteList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " main white list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process a white list single entry.
// Create an entry string array.
- String[] singleEntry = {blockListEntry};
+ String[] singleEntry = {blockListEntry, originalBlockListEntry};
// Add the entry to the white list.
mainWhiteList.add(singleEntry);
blockListEntry = blockListEntry.substring(0, blockListEntry.indexOf("$"));
// Create an entry string array.
- String[] singleEntry = {blockListEntry};
+ String[] singleEntry = {blockListEntry, originalBlockListEntry};
// Add the entry to the black list.
regularExpressionBlackList.add(singleEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
initialBlackList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " initial black list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process an initial black list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
initialBlackList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(tripleEntry);
// originalBlockListEntry);
} else { // Process a final black list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(doubleEntry);
}
} else { // Process a final black list single entry.
// Create an entry sting array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(tripleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " main black list added: " + firstEntry + " , " + realSecondEntry + " , " + thirdEntry + " - " + originalBlockListEntry);
} else { // Process a main black list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(doubleEntry);
}
} else { // Process a main black list single entry.
// Create an entry string array.
- String[] singleEntry = {blockListEntry};
+ String[] singleEntry = {blockListEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(singleEntry);
String secondEntry = entry.substring(wildcardIndex + 1);
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
initialBlackList.add(doubleEntry);
//Log.i("BlockLists", headers.get(1)[0] + " initial black list added: " + firstEntry + " , " + secondEntry + " - " + originalBlockListEntry);
} else { // Process an initial black list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
initialBlackList.add(singleEntry);
String thirdEntry = secondEntry.substring(secondWildcardIndex + 1);
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(tripleEntry);
// originalBlockListEntry);
} else { // Process a final black list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(doubleEntry);
}
} else { // Process a final black list single entry.
// Create an entry string array.
- String[] singleEntry = {entry};
+ String[] singleEntry = {entry, originalBlockListEntry};
// Add the entry to the black list.
finalBlackList.add(singleEntry);
String fifthEntry = fourthEntry.substring(fourthWildcardIndex + 1);
// Create an entry string array.
- String[] quintupleEntry = {firstEntry, realSecondEntry, realThirdEntry, realFourthEntry, fifthEntry};
+ String[] quintupleEntry = {firstEntry, realSecondEntry, realThirdEntry, realFourthEntry, fifthEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(quintupleEntry);
// realFourthEntry + " , " + fifthEntry + " - " + originalBlockListEntry);
} else { // Process a main black list quadruple entry.
// Create an entry string array.
- String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry};
+ String[] quadrupleEntry = {firstEntry, realSecondEntry, realThirdEntry, fourthEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(quadrupleEntry);
}
} else { // Process a main black list triple entry.
// Create an entry string array.
- String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry};
+ String[] tripleEntry = {firstEntry, realSecondEntry, thirdEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(tripleEntry);
}
} else { // Process a main black list double entry.
// Create an entry string array.
- String[] doubleEntry = {firstEntry, secondEntry};
+ String[] doubleEntry = {firstEntry, secondEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(doubleEntry);
}
} else { // Process a main black list single entry.
// Create an entry string array.
- String[] singleEntry = {blockListEntry};
+ String[] singleEntry = {blockListEntry, originalBlockListEntry};
// Add the entry to the black list.
mainBlackList.add(singleEntry);
}
public boolean isBlocked(String currentUrl, String resourceUrl, ArrayList<List<String[]>> blockList) {
- // Get the list title.
- String blockListTitle = blockList.get(0).get(1)[0];
+ // Get the block list name.
+ String BLOCK_LIST_NAME_STRING = blockList.get(0).get(1)[0];
+ // Get the current domain.
Uri currentUri = Uri.parse(currentUrl);
String currentDomain = currentUri.getHost();
+ // Get the resource domain.
Uri resourceUri = Uri.parse(resourceUrl);
String resourceDomain = resourceUri.getHost();
+ // Initialize the third-party request tracker.
boolean thirdPartyRequest = false;
// If one of the domains is `about:blank` it will throw a null object reference on the string comparison.
// Process the white lists.
// Main white list.
- for (String[] whiteListEntry : blockList.get(1)) {
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.MAIN_WHITELIST)) {
switch (whiteListEntry.length) {
- case 1: // There is one entry.
+ case 2: // There is one entry.
if (resourceUrl.contains(whiteListEntry[0])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " main white list: " + whiteListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_WHITELIST), whiteListEntry[0], whiteListEntry[1]};
// Not blocked.
return false;
}
break;
- case 2:
+ case 3: // There are two entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " main white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1],
+ whiteListEntry[2]};
// Not blocked.
return false;
}
break;
- case 3:
+ case 4: // There are three entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " main white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] + " - " +
- resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
}
// Final white list.
- for (String[] whiteListEntry : blockList.get(2)) {
- if (whiteListEntry.length == 1) { // There is one entry.
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.FINAL_WHITELIST)) {
+ if (whiteListEntry.length == 2) { // There is one entry.
if (resourceUrl.contains(whiteListEntry[0])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " final white list: " + whiteListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.FINAL_WHITELIST), whiteListEntry[0], whiteListEntry[1]};
// Not blocked.
return false;
}
} else { // There are two entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " final white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.FINAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
// Only check the domain lists if the current domain is not null (like `about:blank`).
if (currentDomain != null) {
// Domain white list.
- for (String[] whiteListEntry : blockList.get(3)) {
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.DOMAIN_WHITELIST)) {
switch (whiteListEntry.length) {
- case 2: // There is one entry.
+ case 3: // There is one entry.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " --" + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
break;
- case 3: // There are two entries.
+ case 4: // There are two entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
}
break;
- case 4: // There are three entries.
+ case 5: // There are three entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2]) && resourceUrl.contains(whiteListEntry[3])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " , " + whiteListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2] + "\n" + whiteListEntry[3],
+ whiteListEntry[4]};
// Not blocked.
return false;
}
break;
- case 5: // There are four entries.
+ case 6: // There are four entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2]) && resourceUrl.contains(whiteListEntry[3]) &&
resourceUrl.contains(whiteListEntry[4])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " , " + whiteListEntry[3] + " , " + whiteListEntry[4] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2] + "\n" + whiteListEntry[3] + "\n" +
+ whiteListEntry[4], whiteListEntry[5]};
// Not blocked.
return false;
}
// Domain initial white list.
- for (String[] whiteListEntry : blockList.get(4)) {
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.DOMAIN_INITIAL_WHITELIST)) {
switch (whiteListEntry.length) {
- case 2: // There is one entry.
+ case 3: // There is one entry.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.startsWith(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain initial white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_INITIAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
break;
- case 3: // There are two entries.
+ case 4: // There are two entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.startsWith(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain initial white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " +
- whiteListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_INITIAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
}
break;
- case 4: // There are three entries.
+ case 5: // There are three entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.startsWith(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2]) && resourceUrl.startsWith(whiteListEntry[3])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain initial white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " +
- whiteListEntry[2] + " , " + whiteListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_INITIAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2] + "\n" + whiteListEntry[3],
+ whiteListEntry[4]};
// Not blocked.
return false;
}
// Domain final white list.
- for (String[] whiteListEntry : blockList.get(5)) {
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.DOMAIN_FINAL_WHITELIST)) {
switch (whiteListEntry.length) {
- case 2: // There is one entry;
+ case 3: // There is one entry;
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.endsWith(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain final white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_FINAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
break;
- case 3: // There are two entries;
+ case 4: // There are two entries;
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.endsWith(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " domain final white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " +
- whiteListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_FINAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
+
// Not blocked.
return false;
// Only check the third-party white lists if this is a third-party request.
if (thirdPartyRequest) {
// Third-party white list.
- for (String[] whiteListEntry : blockList.get(6)) {
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_WHITELIST)) {
switch (whiteListEntry.length) {
- case 1: // There is one entry
+ case 2: // There is one entry
if (resourceUrl.contains(whiteListEntry[0])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party white list: " + whiteListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_WHITELIST), whiteListEntry[0], whiteListEntry[1]};
// Not blocked.
return false;
}
break;
- case 2: // There are two entries.
+ case 3: // There are two entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
break;
- case 3: // There are three entries.
+ case 4: // There are three entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
}
break;
- case 4: // There are four entries.
+ case 5: // There are four entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2]) && resourceUrl.contains(whiteListEntry[3])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " , " + whiteListEntry[3] + " - " + resourceUrl);
-
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2] + "\n" + whiteListEntry[3],
+ whiteListEntry[4]};
// Not blocked.
return false;
}
break;
- case 5: // There are five entries.
+ case 6: // There are five entries.
if (resourceUrl.contains(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2]) && resourceUrl.contains(whiteListEntry[3]) &&
resourceUrl.contains(whiteListEntry[4])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " + whiteListEntry[2] +
- " , " + whiteListEntry[3] + " , " + whiteListEntry[4] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2] + "\n" + whiteListEntry[3] + "\n" +
+ whiteListEntry[4], whiteListEntry[5]};
// Not blocked.
return false;
}
// Third-party domain white list.
- for (String[] whiteListEntry : blockList.get(7)) {
- if (whiteListEntry.length == 2) { // There is one entry.
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_DOMAIN_WHITELIST)) {
+ if (whiteListEntry.length == 3) { // There is one entry.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
} else { // There are two entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.contains(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party domain white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " +
- whiteListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
}
// Third-party domain initial white list.
- for (String[] whiteListEntry : blockList.get(8)) {
- if (whiteListEntry.length == 2) { // There is one entry.
+ for (String[] whiteListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_WHITELIST)) {
+ if (whiteListEntry.length == 3) { // There is one entry.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.startsWith(whiteListEntry[1])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party domain initial white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " - " +
- resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1], whiteListEntry[2]};
// Not blocked.
return false;
}
} else { // There are two entries.
if (currentDomain.endsWith(whiteListEntry[0]) && resourceUrl.startsWith(whiteListEntry[1]) && resourceUrl.contains(whiteListEntry[2])) {
- Log.i("BlockLists", "Request allowed by " + blockListTitle + " third-party domain initial white list: " + whiteListEntry[0] + " , " + whiteListEntry[1] + " , " +
- whiteListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.whiteListResultStringArray = new String[] {String.valueOf(MainWebViewActivity.REQUEST_ALLOWED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_WHITELIST), whiteListEntry[0] + "\n" + whiteListEntry[1] + "\n" + whiteListEntry[2], whiteListEntry[3]};
// Not blocked.
return false;
// Process the black lists.
// Main black list.
- for (String[] blackListEntry : blockList.get(9)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.MAIN_BLACKLIST)) {
switch (blackListEntry.length) {
- case 1: // There is one entry.
+ case 2: // There is one entry.
if (resourceUrl.contains(blackListEntry[0])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " main black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
break;
- case 2: // There are two entries.
+ case 3: // There are two entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " main black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are three entries.
+ case 4: // There are three entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " main black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] + " - " +
- resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
break;
- case 4: // There are four entries.
+ case 5: // There are four entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2]) && resourceUrl.contains(blackListEntry[3])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " main black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] + " , " +
- blackListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2] + "\n" + blackListEntry[3], blackListEntry[4]});
// Blocked.
return true;
}
break;
- case 5: // There are five entries.
+ case 6: // There are five entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2]) && resourceUrl.contains(blackListEntry[3]) &&
resourceUrl.contains(blackListEntry[4])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " main black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] + " , " +
- blackListEntry[3] + ", " + blackListEntry[4] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.MAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2] + "\n" + blackListEntry[3] + "\n" +
+ blackListEntry[4], blackListEntry[5]});
// Blocked.
return true;
}
// Initial black list.
- for (String[] blackListEntry : blockList.get(10)) {
- if (blackListEntry.length == 1) { // There is one entry.
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.INITIAL_BLACKLIST)) {
+ if (blackListEntry.length == 2) { // There is one entry.
if (resourceUrl.startsWith(blackListEntry[0])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " initial black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.INITIAL_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
} else { // There are two entries
if (resourceUrl.startsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
// Final black list.
- for (String[] blackListEntry : blockList.get(11)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.FINAL_BLACKLIST)) {
switch (blackListEntry.length) {
- case 1: // There is one entry.
+ case 2: // There is one entry.
if (resourceUrl.endsWith(blackListEntry[0])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " final black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.FINAL_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
break;
- case 2: // There are two entries.
+ case 3: // There are two entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.endsWith(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " final black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.FINAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are three entries.
+ case 4: // There are three entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.endsWith(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " final black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] + " - " +
- resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.FINAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
// Only check the domain lists if the current domain is not null (like `about:blank`).
if (currentDomain != null) {
// Domain black list.
- for (String[] blackListEntry : blockList.get(12)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.DOMAIN_BLACKLIST)) {
switch (blackListEntry.length) {
- case 2: // There is one entry.
+ case 3: // There is one entry.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are two entries.
+ case 4: // There are two entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] +
- " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
break;
- case 4: // There are three entries.
+ case 5: // There are three entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2]) && resourceUrl.contains(blackListEntry[3])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] +
- " , " + blackListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2] + "\n" + blackListEntry[3],
+ blackListEntry[4]});
// Blocked.
return true;
}
// Domain initial black list.
- for (String[] blackListEntry : blockList.get(13)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.DOMAIN_INITIAL_BLACKLIST)) {
+ // Store the entry in the resource request log.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.startsWith(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1],
+ blackListEntry[2]});
// Blocked.
return true;
}
// Domain final black list.
- for (String[] blackListEntry : blockList.get(14)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.DOMAIN_FINAL_BLACKLIST)) {
switch (blackListEntry.length) {
- case 2: // There is one entry.
+ case 3: // There is one entry.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.endsWith(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain final black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_FINAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are two entries.
+ case 4: // There are two entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.endsWith(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain final black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] +
- " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_FINAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
// Domain regular expression black list.
- for (String[] blackListEntry : blockList.get(15)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.DOMAIN_REGULAR_EXPRESSION_BLACKLIST)) {
if (currentDomain.endsWith(blackListEntry[0]) && Pattern.matches(blackListEntry[1], resourceUrl)) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " domain regular expression black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.DOMAIN_REGULAR_EXPRESSION_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
// Only check the third-party black lists if this is a third-party request.
if (thirdPartyRequest) {
// Third-party black list.
- for (String[] blackListEntry : blockList.get(16)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_BLACKLIST)) {
switch (blackListEntry.length) {
- case 1: // There is one entry.
+ case 2: // There is one entry.
if (resourceUrl.contains(blackListEntry[0])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
break;
- case 2: // There are two entries.
+ case 3: // There are two entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are three entries.
+ case 4: // There are three entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] +
- " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
break;
- case 4: // There are four entries.
+ case 5: // There are four entries.
if (resourceUrl.contains(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2]) && resourceUrl.contains(blackListEntry[3])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " + blackListEntry[2] +
- " , " + blackListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2] + "\n" + blackListEntry[3],
+ blackListEntry[4]});
// Blocked.
return true;
}
// Third-party initial black list.
- for (String[] blackListEntry : blockList.get(17)) {
- if (blackListEntry.length == 1) { // There is one entry.
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_INITIAL_BLACKLIST)) {
+ if (blackListEntry.length == 2) { // There is one entry.
if (resourceUrl.startsWith(blackListEntry[0])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party initial black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_INITIAL_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
} else { // There are two entries.
if (resourceUrl.startsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
// Third-party domain black list.
- for (String[] blackListEntry : blockList.get(18)) {
- if (blackListEntry.length == 2) { // There is one entry.
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_DOMAIN_BLACKLIST)) {
+ if (blackListEntry.length == 3) { // There is one entry.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
} else { // There are two entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.contains(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " +
- blackListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
// Third-party domain initial black list.
- for (String[] blackListEntry : blockList.get(19)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST)) {
switch (blackListEntry.length) {
- case 2: // There is one entry.
+ case 3: // There is one entry.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.startsWith(blackListEntry[1])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " +
- resourceUrl);
-
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
break;
- case 3: // There are two entries.
+ case 4: // There are two entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.startsWith(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " +
- blackListEntry[2] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2], blackListEntry[3]});
// Blocked.
return true;
}
break;
- case 4: // There are three entries.
+ case 5: // There are three entries.
if (currentDomain.endsWith(blackListEntry[0]) && resourceUrl.startsWith(blackListEntry[1]) && resourceUrl.contains(blackListEntry[2]) && resourceUrl.contains(blackListEntry[3])) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain initial black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " , " +
- blackListEntry[2] + blackListEntry[3] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_INITIAL_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1] + "\n" + blackListEntry[2] + "\n" + blackListEntry[3],
+ blackListEntry[4]});
// Blocked.
return true;
}
// Third-party regular expression black list.
- for (String[] blackListEntry : blockList.get(20)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_REGULAR_EXPRESSION_BLACKLIST)) {
if (Pattern.matches(blackListEntry[0], resourceUrl)) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party regular expression black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_REGULAR_EXPRESSION_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// Blocked.
return true;
}
// Third-party domain regular expression black list.
- for (String[] blackListEntry : blockList.get(21)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.THIRD_PARTY_DOMAIN_REGULAR_EXPRESSION_BLACKLIST)) {
if (currentDomain.endsWith(blackListEntry[0]) && Pattern.matches(blackListEntry[1], resourceUrl)) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " third-party domain regular expression black list: " + blackListEntry[0] + " , " + blackListEntry[1] + " - " +
- resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.THIRD_PARTY_DOMAIN_REGULAR_EXPRESSION_BLACKLIST), blackListEntry[0] + "\n" + blackListEntry[1], blackListEntry[2]});
// Blocked.
return true;
}
// Regular expression black list.
- for (String[] blackListEntry : blockList.get(22)) {
+ for (String[] blackListEntry : blockList.get(MainWebViewActivity.REGULAR_EXPRESSION_BLACKLIST)) {
if (Pattern.matches(blackListEntry[0], resourceUrl)) {
- Log.i("BlockLists", "Request blocked by " + blockListTitle + " regular expression black list: " + blackListEntry[0] + " - " + resourceUrl);
+ // Store the entry in the resource request log.
+ MainWebViewActivity.resourceRequests.add(new String[] {String.valueOf(MainWebViewActivity.REQUEST_BLOCKED), resourceUrl, BLOCK_LIST_NAME_STRING,
+ String.valueOf(MainWebViewActivity.REGULAR_EXPRESSION_BLACKLIST), blackListEntry[0], blackListEntry[1]});
// blocked.
return true;
mLoadedApkField.setAccessible(true);
Object mLoadedApkObject = mLoadedApkField.get(privacyBrowserContext);
- // Suppress the lint warning that reflection may not alwasy work in the future and on all devices.
+ // Suppress the lint warning that reflection may not always work in the future and on all devices.
@SuppressLint("PrivateApi") Class loadedApkClass = Class.forName("android.app.LoadedApk");
Field mReceiversField = loadedApkClass.getDeclaredField("mReceivers");
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Highlight the selected item when the spinner is open. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:state_checked="true" android:color="@color/gray_300" />
+ <item android:color="@color/blue_300" />
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Highlight the selected item when the spinner is open. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:state_checked="true" android:color="@color/white" />
+ <item android:color="@color/blue_100" />
+</selector>
\ No newline at end of file
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:text="@string/block_lists"
+ android:text="@string/blocklists"
android:textStyle="bold"
android:textSize="18sp"
android:textColor="?attr/aboutTitle"
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar. When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
+<!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar.
+ When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
<android.support.design.widget.CoordinatorLayout
android:id="@+id/bookmarks_coordinatorlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent" >
- <!-- android:theme="@style/PrivacyBrowser.DarkAppBar" makes the text and icons in the AppBar white. -->
<android.support.v7.widget.Toolbar
android:id="@+id/bookmarks_toolbar"
android:layout_height="wrap_content"
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
android:layout_width="match_parent"
android:fitsSystemWindows="true" >
- <!-- The `LinearLayout` with `orientation="vertical"` moves the `ListView` below the `AppBarLayout`. -->
+ <!-- The `LinearLayout` with `orientation="vertical"` moves the list view below the app bar layout. -->
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2017-2018 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<!-- A `CheckedTextView` allows the color of the text to be changed when it is selected (checked). -->
+<!-- A checked text view allows the color of the text to be changed when it is selected (checked). -->
<CheckedTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner_item_textview"
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar.
+ When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay. -->
+<android.support.design.widget.CoordinatorLayout
+ android:id="@+id/blocklists_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:fitsSystemWindows="true">
+
+ <!-- the `LinearLayout` with `orientation="vertical"` moves the content below the `AppBarLayout`. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical" >
+
+ <android.support.design.widget.AppBarLayout
+ android:id="@+id/blocklists_appbarlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <android.support.v7.widget.Toolbar
+ android:id="@+id/blocklists_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?attr/colorPrimaryDark"
+ android:theme="?attr/appBarTextTheme"
+ app:popupTheme="?attr/popupsTheme" />
+ </android.support.design.widget.AppBarLayout>
+
+ <!-- `android:dividerHeight` must be at least `1dp` or the `ListView` is inconsistent in calculating how many bookmarks are displayed. -->
+ <ListView
+ android:id="@+id/resource_requests_listview"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:divider="@color/transparent"
+ android:dividerHeight="1dp" />
+ </LinearLayout>
+</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<LinearLayout
+ android:id="@+id/request_item_linearlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/request_item_action"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_margin="10dp"
+ android:textSize="16sp" />
+
+ <TextView
+ android:id="@+id/request_item_url"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_margin="10dp"
+ android:textSize="16sp"
+ android:maxLines="1"
+ android:ellipsize="end" />
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<Spinner
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/requests_spinner"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- A checked text view allows the color of the text to be changed when it is selected (checked). -->
+<CheckedTextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/spinner_item_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:maxLines="1"
+ android:paddingStart="20dp"
+ android:paddingEnd="20dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:textSize="18sp"
+ android:textColor="?attr/requestsSpinnerTextColorSelector"
+ android:background="?attr/requestsSpinnerBackground" />
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/spinner_item_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:maxLines="1"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:textSize="18sp"
+ android:textColor="?attr/requestsSpinnerHeaderTextColor" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+ Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
<LinearLayout
- android:id="@+id/history_item_linearlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2018 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp" >
+
+ <!-- Disposition. -->
+ <TextView
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/disposition"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="5dp" />
+
+ <TextView
+ android:id="@+id/request_action"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+
+ <!-- URL -->
+ <TextView
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/url"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="10dp" />
+
+ <TextView
+ android:id="@+id/request_url"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+
+ <!-- Blocklist -->
+ <TextView
+ android:id="@+id/request_blocklist_label"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/blocklist"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="10dp" />
+
+ <TextView
+ android:id="@+id/request_blocklist"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+
+ <!-- Sublist -->
+ <TextView
+ android:id="@+id/request_sublist_label"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/sublist"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="10dp" />
+
+ <TextView
+ android:id="@+id/request_sublist"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+
+ <!-- Blocklist Entries. -->
+ <TextView
+ android:id="@+id/request_blocklist_entries_label"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/blocklist_entries"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="10dp" />
+
+ <TextView
+ android:id="@+id/request_blocklist_entries"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+
+ <!-- Blocklist Entries. -->
+ <TextView
+ android:id="@+id/request_blocklist_original_entry_label"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/blocklist_original_entry"
+ android:textSize="12sp"
+ android:textColor="@color/blue_700"
+ android:layout_marginTop="10dp" />
+
+ <TextView
+ android:id="@+id/request_blocklist_original_entry"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textSize="16sp"
+ android:textColor="?android:textColorPrimary"
+ android:textIsSelectable="true" />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
<group
android:id="@+id/navigationGroup1" >
+ <item
+ android:id="@+id/requests"
+ android:title="@string/requests"
+ android:icon="@drawable/block_ads_enabled_light"
+ android:orderInCategory="50" />
+
<item
android:id="@+id/downloads"
android:title="@string/downloads"
android:icon="@drawable/downloads_light"
- android:orderInCategory="50" />
+ android:orderInCategory="60" />
<item
android:id="@+id/domains"
android:title="@string/domains"
android:icon="@drawable/domains"
- android:orderInCategory="60" />
+ android:orderInCategory="70" />
<item
android:id="@+id/settings"
android:title="@string/settings"
android:icon="@drawable/settings"
- android:orderInCategory="70" />
+ android:orderInCategory="80" />
</group>
<!-- If a group has an id, a line is drawn above it in the navigation view. -->
android:id="@+id/guide"
android:title="@string/guide"
android:icon="@drawable/guide"
- android:orderInCategory="80" />
+ android:orderInCategory="90" />
<item
android:id="@+id/about"
android:title="@string/about"
android:icon="@drawable/about_light"
- android:orderInCategory="90" />
+ android:orderInCategory="100" />
</group>
<!-- If a group has an id, a line is drawn above it in the navigation view. -->
android:id="@+id/clearAndExit"
android:title="@string/clear_and_exit"
android:icon="@drawable/clear_and_exit"
- android:orderInCategory="100" />
+ android:orderInCategory="110" />
</group>
</menu>
\ No newline at end of file
<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="allow_screenshots">Permitir capturas de pantalla</string>
<string name="allow_screenshots_summary">Permitir capturas de pantalla, grabación de vídeo y visualización en pantallas inseguras. Cambiar esta configuración reiniciará Navegador Privado.</string>
- <string name="block_lists">Listas de bloqueo</string>
+ <string name="blocklists">Listas de bloqueo</string>
<string name="easylist">EasyList</string>
<string name="easylist_summary">Lista principal de bloqueo de anuncios.</string>
<string name="easyprivacy">EasyPrivacy</string>
<string name="allow_screenshots">Permetti gli screenshot</string>
<string name="allow_screenshots_summary">Permette gli screenshot, la registrazione di video, e la possibilità di visualizzare su schermi non sicuri.
La modifica di questa impostazione provoca il riavvio di Privacy Browser.</string>
- <string name="block_lists">Block List</string>
+ <string name="blocklists">Blocklist</string>
<string name="easylist">EasyList</string>
<string name="easylist_summary">Blocking list principale.</string>
<string name="easyprivacy">EasyPrivacy</string>
<string name="do_not_track_summary">Отправлять заголовок \'Не отслеживать\', предлагающий веб-серверу не отслеживать этот браузер.</string>
<string name="allow_screenshots">Разрешить скриншоты</string>
<string name="allow_screenshots_summary">Разрешить скриншоты, запись видео и просмотр на незащищенных дисплеях. При изменении этого параметра Privacy Browser будет перезапущен.</string>
- <string name="block_lists">Списки блокировки</string>
+ <string name="blocklists">Списки блокировки</string>
<string name="easylist">EasyList</string>
<string name="easylist_summary">Основной список блокировки рекламы.</string>
<string name="easyprivacy">EasyPrivacy</string>
<attr name="bookmarksSpinnerHeaderTextColor" format="reference" />
<attr name="bookmarksSpinnerTextColorSelector" format="reference" />
<attr name="bookmarksSpinnerBackground" format="reference" />
+ <attr name="requestsSpinnerHeaderTextColor" format="reference" />
+ <attr name="requestsSpinnerTextColorSelector" format="reference" />
+ <attr name="requestsSpinnerBackground" format="reference" />
<attr name="editBookmarkSpinnerTextColorSelector" format="reference" />
<attr name="redText" format="reference" />
<color name="light_green_100">#FFDCEDC8</color>
<color name="light_green_a700">#FF64DD17</color>
+ <color name="red_100">#FFFFCDD2</color>
+ <color name="red_200">#FFEF9A9A</color>
+ <color name="red_600">#FFE53935</color>
+ <color name="red_700">#FFD32F2F</color>
+ <color name="red_700_50">#55D32F2F</color>
+ <color name="red_800">#FFC62828</color>
<color name="red_900">#FFB71C1C</color>
<color name="red_a700">#FFD50000</color>
<string name="parent_folder">Parent folder:</string>
<string name="display_order">Display order:</string>
+ <!-- Block Lists. -->
+ <string name="requests">Requests</string>
+ <string name="request_details">Request details</string>
+ <string name="disposition">Disposition</string>
+ <string name="all">All</string>
+ <string name="default_label">Default</string>
+ <string name="default_allowed">Default - Allowed</string>
+ <string name="allowed">Allowed</string>
+ <string name="blocked">Blocked</string>
+ <string name="blocklist">Blocklist</string>
+ <string name="sublist">Sublist</string>
+ <string name="main_whitelist">Main whitelist</string>
+ <string name="final_whitelist">Final whitelist</string>
+ <string name="domain_whitelist">Domain whitelist</string>
+ <string name="domain_initial_whitelist">Domain initial whitelist</string>
+ <string name="domain_final_whitelist">Domain final whitelist</string>
+ <string name="third_party_whiteist">Third-party whitelist</string>
+ <string name="third_party_domain_whitelist">Third-party domain whitelist</string>
+ <string name="third_party_domain_initial_whitelist">Third-party domain initial whitelist</string>
+ <string name="main_blacklist">Main blacklist</string>
+ <string name="initial_blacklist">Initial blacklist</string>
+ <string name="final_blacklist">Final blacklist</string>
+ <string name="domain_blacklist">Domain blacklist</string>
+ <string name="domain_initial_blacklist">Domain initial blacklist</string>
+ <string name="domain_final_blacklist">Domain final blacklist</string>
+ <string name="domain_regular_expression_blacklist">Domain regular expression blacklist</string>
+ <string name="third_party_blacklist">Third-party blacklist</string>
+ <string name="third_party_initial_blacklist">Third-party blacklist</string>
+ <string name="third_party_domain_blacklist">Third-party domain blacklist</string>
+ <string name="third_party_domain_initial_blacklist">Third-party domain initial blacklist</string>
+ <string name="third_party_regular_expression_blacklist">Third-party regular expression blacklist</string>
+ <string name="third_party_domain_regular_expression_blacklist">Third-party domain regular expression blacklist</string>
+ <string name="regular_expression_blacklist">Regular expression blacklist</string>
+ <string name="blocklist_entries">Blocklist entries</string>
+ <string name="blocklist_original_entry">Blocklist original entry</string>
+
<!-- Domains. -->
<string name="domains">Domains</string>
<string name="domain_settings">Domain Settings</string>
<string name="do_not_track_summary">Send the Do Not Track header, which politely suggests that web servers not track this browser.</string>
<string name="allow_screenshots">Allow screenshots</string>
<string name="allow_screenshots_summary">Allow screenshots, video recording, and viewing on non-secure displays. Changing this setting will restart Privacy Browser.</string>
- <string name="block_lists">Block Lists</string>
+ <string name="blocklists">Blocklists</string>
<string name="easylist">EasyList</string>
<string name="easylist_summary">Main ad blocking list.</string>
<string name="easyprivacy">EasyPrivacy</string>
<item name="bookmarksSpinnerTextColorSelector">@color/bookmarks_spinner_color_selector_light</item>
<item name="bookmarksSpinnerBackground">@color/blue_750</item>
<item name="editBookmarkSpinnerTextColorSelector">@color/edit_bookmark_spinner_color_selector_light</item>
+ <item name="requestsSpinnerHeaderTextColor">@color/white</item>
+ <item name="requestsSpinnerTextColorSelector">@color/requests_spinner_color_selector_light</item>
+ <item name="requestsSpinnerBackground">@color/blue_750</item>
<item name="listSelectorDrawable">@drawable/list_selector_light</item>
<item name="aboutTitle">@color/blue_900</item>
<item name="aboutText">@color/blue_700</item>
<item name="bookmarksSpinnerTextColorSelector">@color/bookmarks_spinner_color_selector_dark</item>
<item name="bookmarksSpinnerBackground">@color/blue_830</item>
<item name="editBookmarkSpinnerTextColorSelector">@color/edit_bookmark_spinner_color_selector_dark</item>
+ <item name="requestsSpinnerHeaderTextColor">@color/gray_300</item>
+ <item name="requestsSpinnerTextColorSelector">@color/requests_spinner_color_selector_dark</item>
+ <item name="requestsSpinnerBackground">@color/blue_830</item>
<item name="aboutTitle">@color/blue_600</item>
<item name="aboutText">@color/blue_400</item>
<item name="aboutBackground">@color/gray_850</item>
</PreferenceCategory>
<PreferenceCategory
- android:key="block_lists"
- android:title="@string/block_lists" >
+ android:key="blocklists"
+ android:title="@string/blocklists" >
<SwitchPreference
android:key="easylist"