From: Soren Stoutner
Date: Fri, 7 Apr 2017 03:54:26 +0000 (-0700)
Subject: Delete the entire private `cache` folder on `Clear and Exit`.
X-Git-Tag: v2.2~21
X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=aeb0d3aa4aef1c48fcbf951f816d5d750d87c814;p=PrivacyBrowserAndroid.git
Delete the entire private `cache` folder on `Clear and Exit`.
---
diff --git a/app/build.gradle b/app/build.gradle
index 822563b3..208ca35a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -55,7 +55,7 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
- compile 'com.android.support:design:25.3.0'
+ compile 'com.android.support:design:25.3.1'
// Only compile `com.google.firebase:firebase-ads:9.8.0` for the free flavor.
freeCompile 'com.google.firebase:firebase-ads:9.8.0'
diff --git a/app/src/main/assets/de/about_changelog.html b/app/src/main/assets/de/about_changelog.html
index 21632131..fcae7d2a 100644
--- a/app/src/main/assets/de/about_changelog.html
+++ b/app/src/main/assets/de/about_changelog.html
@@ -32,7 +32,7 @@
2.1 (version code 21)
- 25. März 2017 - Mindest-API 19, Ziel-API 25
+ 25. März 2017 - Mindest-API 19, Ziel-API 25
- Fix a crash on load introduced in version 2.0.1 if the homepage is set to be blank.
- Fix a bug that prevented websites with a localhost domain from loading.
diff --git a/app/src/main/assets/en/about_changelog.html b/app/src/main/assets/en/about_changelog.html
index 1e4270cd..f0078119 100644
--- a/app/src/main/assets/en/about_changelog.html
+++ b/app/src/main/assets/en/about_changelog.html
@@ -27,7 +27,7 @@
2.1 (version code 21)
- 25 March 2017 - minimum API 19, target API 25
+ 25 March 2017 - minimum API 19, target API 25
- Fix a crash on load introduced in version 2.0.1 if the homepage is set to be blank.
- Fix a bug that prevented websites with a localhost domain from loading.
diff --git a/app/src/main/assets/en/guide_user_agent.html b/app/src/main/assets/en/guide_user_agent.html
index 2c7d7072..d487b697 100644
--- a/app/src/main/assets/en/guide_user_agent.html
+++ b/app/src/main/assets/en/guide_user_agent.html
@@ -58,6 +58,6 @@
as their user agent, it will be a good choice for privacy. Firefox or Chrome are the most common user agents, but they auto-update and their version numbers change so quickly that it is likely the user agents included in Privacy Browser
will often be out of step with the majority of user agents in the server logs.
- Android's WebView does not allow the user agent to be blank. If it is, WebView simply sends the default user agent to the server.
+ Android’s WebView does not allow the user agent to be blank. If it is, WebView simply sends the default user agent to the server.
\ No newline at end of file
diff --git a/app/src/main/assets/es/about_changelog.html b/app/src/main/assets/es/about_changelog.html
index 738a08c0..7b2fc4dc 100644
--- a/app/src/main/assets/es/about_changelog.html
+++ b/app/src/main/assets/es/about_changelog.html
@@ -29,7 +29,7 @@
2.1 (código de versión 21)
- 25 de marzo de 2017 - API mínimo 19, API dirigido 25
+ 25 de marzo de 2017 - API mínimo 19, API dirigido 25
- Arreglar un problema al cargar introducido en la versión 2.0.1 si la página de inicio está en blanco.
- Arreglar un error que impedía la carga de páginas web con un dominio localhost.
diff --git a/app/src/main/assets/it/about_changelog.html b/app/src/main/assets/it/about_changelog.html
index f68652d4..98257fca 100644
--- a/app/src/main/assets/it/about_changelog.html
+++ b/app/src/main/assets/it/about_changelog.html
@@ -29,7 +29,7 @@
2.1 (versione codice 21)
- 25 Marzo 2017 - minima API 19, target API 25
+ 25 Marzo 2017 - minima API 19, target API 25
- Eliminazione di un crash durante il caricamento introdotto nella versione 2.0.1 quando la homepage è impostata per essere una pagina vuota.
- Eliminazione di un bug che impediva il caricamento di siti con dominio localhost.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
index 5f82807c..292292fa 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
@@ -1379,13 +1379,17 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
// Destroy the internal state of `mainWebView`.
mainWebView.destroy();
- // Manually delete the `app_webview` folder, which contains an additional `WebView` cache. See `https://code.google.com/p/android/issues/detail?id=233826&thanks=233826&ts=1486670530`.
+ // Manually delete folders.
Runtime runtime = Runtime.getRuntime();
String dataDirString = getApplicationInfo().dataDir; // `dataDir` will vary, but will be something like `/data/user/0/com.stoutner.privacybrowser.standard`, which links to `/data/data/com.stoutner.privacybrowser.standard`.
try {
+ // Delete the main `cache` folder.
+ runtime.exec("rm -rf " + dataDirString + "/cache");
+
+ // Delete the `app_webview` folder, which contains an additional `WebView` cache. See `https://code.google.com/p/android/issues/detail?id=233826&thanks=233826&ts=1486670530`.
runtime.exec("rm -rf " + dataDirString + "/app_webview");
} catch (IOException e) {
- // Do nothing if the files do not exist.
+ // Do nothing if an error is thrown.
}
// Close Privacy Browser. `finishAndRemoveTask` also removes Privacy Browser from the recent app list.
diff --git a/build.gradle b/build.gradle
index c6f2f500..072e693a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
+ classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files