dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'com.android.support:design:27.1.0'
+ implementation 'com.android.support:design:27.0.2'
// Only compile `com.google.firebase:firebase-ads` for the free flavor.
freeImplementation 'com.google.firebase:firebase-ads:11.8.0'
}
<body>
<h3>2.8.1 (version code 31)</h3>
- <p>1 March 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 March 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Workaround a bug in recent versions of Android’s WebView that <a href="https://redmine.stoutner.com/issues/253">prevented users from saving cookies</a> when desired.</li>
</ul>
<body>
<h3>2.8.1 (version code 31)</h3>
- <p>1 March 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 March 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Workaround a bug in recent versions of Android’s WebView that <a href="https://redmine.stoutner.com/issues/253">prevented users from saving cookies</a> when desired.</li>
</ul>
<body>
<h3>2.8.1 (version code 31)</h3>
- <p>1 March 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 March 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Workaround a bug in recent versions of Android’s WebView that <a href="https://redmine.stoutner.com/issues/253">prevented users from saving cookies</a> when desired.</li>
</ul>
<body>
<h3>2.8.1 (version code 31)</h3>
- <p>1 March 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 March 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Workaround a bug in recent versions of Android’s WebView that <a href="https://redmine.stoutner.com/issues/253">prevented users from saving cookies</a> when desired.</li>
</ul>
<body>
<h3>2.8.1 (código de versión 31)</h3>
- <p>1 de marzo de 2018 - API mínimo 19, API dirigido 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 de marzo de 2018</a> - API mínimo 19, API dirigido 27</p>
<ul>
<li>Solución a un error en versiones recientes del WebView de Android que <a href="https://redmine.stoutner.com/issues/253">impedía a los usuarios guardar cookies</a> cuando lo deseaban.</li>
</ul>
<body>
<h3>2.8.1 (código de versión 31)</h3>
- <p>1 de marzo de 2018 - API mínimo 19, API dirigido 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 de marzo de 2018</a> - API mínimo 19, API dirigido 27</p>
<ul>
<li>Solución a un error en versiones recientes del WebView de Android que <a href="https://redmine.stoutner.com/issues/253">impedía a los usuarios guardar cookies</a> cuando lo deseaban.</li>
</ul>
<body>
<h3>2.8.1 (versione codice 31)</h3>
- <p>1 Marzo 2018 - minima API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 Marzo 2018</a> - minima API 19, target API 27</p>
<ul>
<li>Correzione di un baco dovuto alle più recenti versioni della WebView di Android che <a href="https://redmine.stoutner.com/issues/253">impediva il salvataggio dei cookies agli utenti</a>
quando desideravano farlo.</li>
<body>
<h3>2.8.1 (versione codice 31)</h3>
- <p>1 Marzo 2018 - minima API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 Marzo 2018</a> - minima API 19, target API 27</p>
<ul>
<li>Correzione di un baco dovuto alle più recenti versioni della WebView di Android che <a href="https://redmine.stoutner.com/issues/253">impediva il salvataggio dei cookies agli utenti</a>
quando desideravano farlo.</li>
<body>
<h3>2.8.1 (код версии 31)</h3>
- <p>1 марта 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 марта 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Исправление ошибки, препятствовавшей принудительному сохранению файлов cookie <a href="https://redmine.stoutner.com/issues/253">при использовании последних версий Android WebView</a>.</li>
</ul>
<body>
<h3>2.8.1 (код версии 31)</h3>
- <p>1 марта 2018 - minimum API 19, target API 27</p>
+ <p><a href="https://git.stoutner.com/?p=PrivacyBrowser.git;a=commitdiff;h=8d1060fb1148d2d2fd7af8261dc9956c3a5687a1">1 марта 2018</a> - minimum API 19, target API 27</p>
<ul>
<li>Исправление ошибки, препятствовавшей принудительному сохранению файлов cookie <a href="https://redmine.stoutner.com/issues/253">при использовании последних версий Android WebView</a>.</li>
</ul>
/*
- * 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>.
*
setContentView(R.layout.guide_coordinatorlayout);
// We need to use `SupportActionBar` from `android.support.v7.app.ActionBar` until the minimum API is >= 21.
- Toolbar guideAppBar = (Toolbar) findViewById(R.id.guide_toolbar);
+ Toolbar guideAppBar = findViewById(R.id.guide_toolbar);
setSupportActionBar(guideAppBar);
// Display the home arrow on `ppBar`.
appBar.setDisplayHomeAsUpEnabled(true);
// Setup the ViewPager.
- ViewPager aboutViewPager = (ViewPager) findViewById(R.id.guide_viewpager);
+ ViewPager aboutViewPager = findViewById(R.id.guide_viewpager);
assert aboutViewPager != null; // This assert removes the incorrect warning in Android Studio on the following line that aboutViewPager might be null.
aboutViewPager.setAdapter(new guidePagerAdapter(getSupportFragmentManager()));
// Setup the TabLayout and connect it to the ViewPager.
- TabLayout aboutTabLayout = (TabLayout) findViewById(R.id.guide_tablayout);
+ TabLayout aboutTabLayout = findViewById(R.id.guide_tablayout);
assert aboutTabLayout != null; // This assert removes the incorrect warning in Android Studio on the following line that aboutTabLayout might be null.
aboutTabLayout.setupWithViewPager(aboutViewPager);
}
// `reapplyDomainSettingsOnRestart` is used in `onCreate()`, `onOptionsItemSelected()`, `onNavigationItemSelected()`, `onRestart()`, and `onAddDomain()`, .
private boolean reapplyDomainSettingsOnRestart;
+ // `returnFromSettings` is used in `onNavigationItemSelected()` and `onRestart()`.
+ private boolean returnFromSettings;
+
// `currentDomainName` is used in `onCreate()`, `onOptionsItemSelected()`, `onNavigationItemSelected()`, `onAddDomain()`, and `applyDomainSettings()`.
private String currentDomainName;
@Override
public void onPageFinished(WebView view, String url) {
// Flush any cookies to persistent storage. `CookieManager` has become very lazy about flushing cookies in recent versions.
- if (Build.VERSION.SDK_INT >= 21) {
+ if (firstPartyCookiesEnabled && Build.VERSION.SDK_INT >= 21) {
cookieManager.flush();
}
// Sets the new intent as the activity intent, so that any future `getIntent()`s pick up this one instead of creating a new activity.
setIntent(intent);
+ // Check to see if the intent contains a new URL.
if (intent.getData() != null) {
// Get the intent data and convert it to a string.
final Uri intentUriData = intent.getData();
formattedUrlString = intentUriData.toString();
- }
- // Close the navigation drawer if it is open.
- if (drawerLayout.isDrawerVisible(GravityCompat.START)) {
- drawerLayout.closeDrawer(GravityCompat.START);
- }
+ // Load the website.
+ loadUrl(formattedUrlString);
- // Load the website.
- loadUrl(formattedUrlString);
+ // Close the navigation drawer if it is open.
+ if (drawerLayout.isDrawerVisible(GravityCompat.START)) {
+ drawerLayout.closeDrawer(GravityCompat.START);
+ }
- // Clear the keyboard if displayed and remove the focus on the urlTextBar if it has it.
- mainWebView.requestFocus();
+ // Clear the keyboard if displayed and remove the focus on the urlTextBar if it has it.
+ mainWebView.requestFocus();
+ }
}
@Override
// Run the default commands.
super.onRestart();
- // Apply the app settings, which may have been changed in `SettingsActivity`.
- applyAppSettings();
+ // Apply the app settings if returning from the Settings activity..
+ if (returnFromSettings) {
+ // Reset the return from settings flag.
+ returnFromSettings = false;
- // Apply the domain settings if returning from the Domains Activity.
- if (reapplyDomainSettingsOnRestart) {
- // Reset `reapplyDomainSettingsOnRestart`.
- reapplyDomainSettingsOnRestart = false;
+ // Apply the app settings.
+ applyAppSettings();
- // Reapply the domain settings.
- applyDomainSettings(formattedUrlString);
+ // Set the display webpage images mode.
+ setDisplayWebpageImages();
}
- // Update the privacy icon. `true` runs `invalidateOptionsMenu` as the last step.
- updatePrivacyIcons(true);
-
- // Set the display webpage images mode.
- setDisplayWebpageImages();
-
- // Reload the webpage if displaying of images has been disabled in `SettingsFragment`.
+ // Reload the webpage if displaying of images has been disabled in the Settings activity.
if (reloadOnRestart) {
// Reload `mainWebView`.
mainWebView.reload();
reloadOnRestart = false;
}
+ // Apply the domain settings if returning from the Domains activity.
+ if (reapplyDomainSettingsOnRestart) {
+ // Reset `reapplyDomainSettingsOnRestart`.
+ reapplyDomainSettingsOnRestart = false;
+
+ // Reapply the domain settings.
+ applyDomainSettings(formattedUrlString);
+ }
+
// Load the URL on restart to apply changes to night mode.
if (loadUrlOnRestart) {
// Load the current `formattedUrlString`.
loadUrlOnRestart = false;
}
- //
+ // Update the bookmarks drawer if returning from the Bookmarks activity.
if (restartFromBookmarksActivity) {
// Close the bookmarks drawer.
drawerLayout.closeDrawer(GravityCompat.END);
// Reset `restartFromBookmarksActivity`.
restartFromBookmarksActivity = false;
}
+
+ // Update the privacy icon. `true` runs `invalidateOptionsMenu` as the last step.
+ updatePrivacyIcons(true);
}
// `onResume()` runs after `onStart()`, which runs after `onCreate()` and `onRestart()`.
reapplyDomainSettingsOnRestart = true;
currentDomainName = "";
+ // Mark a flag to reapply app settings on restart only when returning from Settings.
+ returnFromSettings = true;
+
// Launch `SettingsActivity`.
Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsIntent);
<string name="incognito_mode_summary">Borrar el historial y el caché después de que cada página web termine de cargar.</string>
<string name="do_not_track">No rastrear</string>
<string name="do_not_track_summary">Enviar la cabecera de no rastrear (DNT) que educadamente sugiere que los servidores web no rastreen este navegador.</string>
- <string name="block_lists">Bloquear listas</string>
+ <string name="block_lists">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>