Skip unblocking for root process

This commit is contained in:
Mygod
2021-12-08 14:02:48 -05:00
parent 1c4a696982
commit b81633b1e7
2 changed files with 5 additions and 1 deletions

View File

@@ -15,10 +15,11 @@ import be.mygod.vpnhotspot.App.Companion.app
@SuppressLint("BlockedPrivateApi", "DiscouragedPrivateApi")
@Suppress("FunctionName")
object UnblockCentral {
var needInit = true
/**
* Retrieve this property before doing dangerous shit.
*/
private val init by lazy { UnblockHelper(app.deviceStorage) }
private val init by lazy { if (needInit) UnblockHelper(app.deviceStorage) }
@RequiresApi(31)
fun setUserConfiguration(clazz: Class<*>) = init.let {