mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
Optimize code
New Privilege object, which follows Application lifecycle. Add Privilege.DPM and Privilege.DAR variable, instead of creating DPM and DAR instance every time.
This commit is contained in:
18
app/src/main/java/com/bintianqi/owndroid/MyApplication.kt
Normal file
18
app/src/main/java/com/bintianqi/owndroid/MyApplication.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.bintianqi.owndroid
|
||||
|
||||
import android.app.Application
|
||||
import android.os.Build.VERSION
|
||||
import org.lsposed.hiddenapibypass.HiddenApiBypass
|
||||
|
||||
class MyApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (VERSION.SDK_INT >= 28) HiddenApiBypass.setHiddenApiExemptions("")
|
||||
SP = SharedPrefs(applicationContext)
|
||||
Privilege.initialize(applicationContext)
|
||||
Privilege.updateStatus()
|
||||
}
|
||||
}
|
||||
|
||||
lateinit var SP: SharedPrefs
|
||||
private set
|
||||
Reference in New Issue
Block a user