diff --git a/app-core/src/main/java/com/topjohnwu/magisk/App.java b/app-core/src/main/java/com/topjohnwu/magisk/App.java index 5d63f0b5e..205baaee7 100644 --- a/app-core/src/main/java/com/topjohnwu/magisk/App.java +++ b/app-core/src/main/java/com/topjohnwu/magisk/App.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.AsyncTask; +import android.os.Build; import android.preference.PreferenceManager; import com.topjohnwu.magisk.core.BuildConfig; @@ -40,9 +41,13 @@ public class App extends Application { super.attachBaseContext(base); self = this; - prefs = PreferenceManager.getDefaultSharedPreferences(this); + Context de = this; + if (Build.VERSION.SDK_INT >= 24) { + de = createDeviceProtectedStorageContext(); + de.moveSharedPreferencesFrom(this, PreferenceManager.getDefaultSharedPreferencesName(base)); + } + prefs = PreferenceManager.getDefaultSharedPreferences(de); mDB = new MagiskDB(this); - repoDB = new RepoDatabaseHelper(this); Networking.init(this); LocaleManager.setLocale(this); diff --git a/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java b/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java index 75c3ab9d2..7e74ded31 100644 --- a/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java +++ b/app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java @@ -8,7 +8,6 @@ import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.container.TarEntry; -import com.topjohnwu.magisk.core.R; import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.net.DownloadProgressListener; import com.topjohnwu.net.Networking; diff --git a/app/src/full/AndroidManifest.xml b/app/src/full/AndroidManifest.xml index 3b61d54e9..1bd8a99e9 100644 --- a/app/src/full/AndroidManifest.xml +++ b/app/src/full/AndroidManifest.xml @@ -5,13 +5,12 @@ - + tools:ignore="UnusedAttribute,GoogleAppIndexingWarning"> @@ -39,14 +38,17 @@ - + @@ -54,13 +56,14 @@ + - + 0) { // Load modules diff --git a/app/src/full/java/com/topjohnwu/magisk/SuRequestActivity.java b/app/src/full/java/com/topjohnwu/magisk/SuRequestActivity.java index 4dec0471f..52cfec56e 100644 --- a/app/src/full/java/com/topjohnwu/magisk/SuRequestActivity.java +++ b/app/src/full/java/com/topjohnwu/magisk/SuRequestActivity.java @@ -21,6 +21,7 @@ import com.topjohnwu.magisk.components.BaseActivity; import com.topjohnwu.magisk.container.Policy; import com.topjohnwu.magisk.utils.FingerprintHelper; import com.topjohnwu.magisk.utils.SuConnector; +import com.topjohnwu.magisk.utils.Utils; import java.io.IOException; @@ -75,7 +76,7 @@ public class SuRequestActivity extends BaseActivity { PackageManager pm = getPackageManager(); app.mDB.clearOutdated(); - timeoutPrefs = getSharedPreferences("su_timeout", 0); + timeoutPrefs = Utils.getDEContext().getSharedPreferences("su_timeout", 0); // Get policy Intent intent = getIntent(); diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 01adc1fa4..7e52d762b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,10 +8,9 @@ @@ -28,4 +27,4 @@ - \ No newline at end of file +