Commit 01e7dff1 authored by vvb2060's avatar vvb2060 Committed by John Wu

Fix crash when using other su

parent 018c0064
...@@ -80,7 +80,7 @@ public class MagiskDatabaseHelper { ...@@ -80,7 +80,7 @@ public class MagiskDatabaseHelper {
Context de = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N Context de = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
? mm.createDeviceProtectedStorageContext() : mm; ? mm.createDeviceProtectedStorageContext() : mm;
if (!MANAGER_DB.canWrite()) { if (!MANAGER_DB.canWrite()) {
if (!Shell.rootAccess()) { if (!Shell.rootAccess() || Data.magiskVersionCode < 0) {
// We don't want the app to crash, create a db and return // We don't want the app to crash, create a db and return
return mm.openOrCreateDatabase("su.db", Context.MODE_PRIVATE, null); return mm.openOrCreateDatabase("su.db", Context.MODE_PRIVATE, null);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment