[Magisk] lenbok:
Magisk Manager Crash

I'm on OmniROM with OnePlus 3T, and originally have been having problems with MagiskManager 15.x not remembering permissions that I've granted. I have tried running the uninstaller, uninstalling, reinstalling etc, but eventually MagiskManager was just crashing on me.

So, I ran the most recent uninstaller (20180213), uninstalled MagiskManager (clear data first) and started from scratch, installing Magisk 15.4 and MagiskManager 5.6.0. However, I am still getting MagiskManager crashes whenever I try to open it. Here is the relevant stack trace from logcat:

02-13 20:37:43.337 E/AndroidRuntime(10423): FATAL EXCEPTION: main
02-13 20:37:43.337 E/AndroidRuntime(10423): Process: com.topjohnwu.magisk, PID: 10423
02-13 20:37:43.337 E/AndroidRuntime(10423): java.lang.RuntimeException: Unable to create application com.topjohnwu.magisk.MagiskManager: android.database.sqlite.SQLiteException: Failed to change locale for db '/sbin/.core/db-0/magisk.db' to 'en_GB'.
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.ActivityThread.-wrap1(Unknown Source:0)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.os.Handler.dispatchMessage(Handler.java:106)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.os.Looper.loop(Looper.java:164)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.ActivityThread.main(ActivityThread.java:6494)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at java.lang.reflect.Method.invoke(Native Method)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
02-13 20:37:43.337 E/AndroidRuntime(10423): Caused by: android.database.sqlite.SQLiteException: Failed to change locale for db '/sbin/.core/db-0/magisk.db' to 'en_GB'.
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:394)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:219)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:194)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:493)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:200)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:192)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:864)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:849)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:750)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:767)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:759)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.topjohnwu.magisk.database.SuDatabaseHelper.openDatabase(Unknown Source:283)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.topjohnwu.magisk.database.SuDatabaseHelper.<init>(Unknown Source:10)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.topjohnwu.magisk.database.SuDatabaseHelper.getInstance(Unknown Source:14)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at com.topjohnwu.magisk.MagiskManager.onCreate(Unknown Source:76)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
02-13 20:37:43.337 E/AndroidRuntime(10423):	... 8 more
02-13 20:37:43.337 E/AndroidRuntime(10423): Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 7434)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:556)
02-13 20:37:43.337 E/AndroidRuntime(10423):	at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:372)
02-13 20:37:43.337 E/AndroidRuntime(10423):	... 24 more

Either it looks like uninstalling didn't clean up properly, or there is some bug in the database initialization. Either way, it looks like MagiskManager needs the ability to gracefully handle the case where there is a problem trying to open it's SuDatabase.