Request Shizuku permission before enter Shizuku screen

Bind Shizuku service automatically after enter Shizuku functions page
This commit is contained in:
BinTianqi
2024-12-15 12:01:09 +08:00
parent 867668832e
commit 3fb4fb078f
10 changed files with 84 additions and 155 deletions

View File

@@ -2,6 +2,7 @@ package com.bintianqi.owndroid
import android.content.Context
import android.os.Build
import android.os.IBinder
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.flow.MutableStateFlow
@@ -9,6 +10,7 @@ import kotlinx.coroutines.launch
class MyViewModel: ViewModel() {
val theme = MutableStateFlow(ThemeSettings())
val shizukuBinder = MutableStateFlow<IBinder?>(null)
var initialized = false
fun initialize(context: Context) {