You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Updated su screen with new arch
Added new Dialog for further use
This commit is contained in:
@@ -28,8 +28,12 @@ import java.util.concurrent.ThreadPoolExecutor
|
||||
open class App : Application(), Application.ActivityLifecycleCallbacks {
|
||||
|
||||
// Global resources
|
||||
val prefs: SharedPreferences get() = PreferenceManager.getDefaultSharedPreferences(deContext)
|
||||
val DB: MagiskDB by lazy { MagiskDB(deContext) }
|
||||
lateinit var protectedContext: Context
|
||||
val prefs: SharedPreferences
|
||||
get() = PreferenceManager.getDefaultSharedPreferences(
|
||||
protectedContext
|
||||
)
|
||||
val DB: MagiskDB by lazy { MagiskDB(protectedContext) }
|
||||
@Deprecated("Use dependency injection")
|
||||
val repoDB: RepoDatabaseHelper by inject()
|
||||
@Volatile
|
||||
@@ -49,12 +53,14 @@ open class App : Application(), Application.ActivityLifecycleCallbacks {
|
||||
override fun attachBaseContext(base: Context) {
|
||||
super.attachBaseContext(base)
|
||||
MultiDex.install(base)
|
||||
protectedContext = baseContext
|
||||
self = this
|
||||
deContext = base
|
||||
registerActivityLifecycleCallbacks(this)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
deContext = base.createDeviceProtectedStorageContext()
|
||||
protectedContext = base.createDeviceProtectedStorageContext()
|
||||
deContext = protectedContext
|
||||
deContext.moveSharedPreferencesFrom(base, base.defaultPrefsName)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user