ViewModel refactoring: Permissions part

Add MyDbHelper and MyRepository, use database to store dhizuku clients,
fix #168
This commit is contained in:
BinTianqi
2025-09-23 20:41:22 +08:00
parent 26c956a2cf
commit 2c72912ea6
11 changed files with 588 additions and 480 deletions

View File

@@ -7,7 +7,6 @@ import androidx.activity.viewModels
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.bintianqi.owndroid.ui.AppInstaller
import com.bintianqi.owndroid.ui.theme.OwnDroidTheme
@@ -15,11 +14,10 @@ class AppInstallerActivity:FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
val myVm by viewModels<MyViewModel>()
val vm by viewModels<AppInstallerViewModel>()
vm.initialize(intent)
val theme = ThemeSettings(SP.materialYou, SP.darkTheme, SP.blackTheme)
setContent {
val theme by myVm.theme.collectAsStateWithLifecycle()
OwnDroidTheme(theme) {
val uiState by vm.uiState.collectAsState()
AppInstaller(