Fix crash when using other su

This commit is contained in:
vvb2060 2018-10-22 17:58:12 +08:00 committed by John Wu
parent 018c0064cd
commit 01e7dff1a0

View File

@ -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);
} }