mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 11:05:59 +00:00
catch error when using Dhizuku API
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.bintianqi.owndroid
|
||||
|
||||
import android.app.admin.DevicePolicyManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.os.Build.VERSION
|
||||
import android.os.Bundle
|
||||
@@ -22,11 +21,13 @@ import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme.colorScheme
|
||||
import androidx.compose.material3.MaterialTheme.typography
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.MutableState
|
||||
@@ -58,6 +59,7 @@ import com.bintianqi.owndroid.dpm.Password
|
||||
import com.bintianqi.owndroid.dpm.SystemManage
|
||||
import com.bintianqi.owndroid.dpm.UserManage
|
||||
import com.bintianqi.owndroid.dpm.UserRestriction
|
||||
import com.bintianqi.owndroid.dpm.dhizukuErrorStatus
|
||||
import com.bintianqi.owndroid.dpm.getDPM
|
||||
import com.bintianqi.owndroid.dpm.getReceiver
|
||||
import com.bintianqi.owndroid.dpm.isDeviceOwner
|
||||
@@ -65,6 +67,7 @@ import com.bintianqi.owndroid.dpm.isProfileOwner
|
||||
import com.bintianqi.owndroid.ui.Animations
|
||||
import com.bintianqi.owndroid.ui.theme.OwnDroidTheme
|
||||
import com.rosan.dhizuku.api.Dhizuku
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import org.lsposed.hiddenapibypass.HiddenApiBypass
|
||||
import java.util.Locale
|
||||
@@ -80,12 +83,7 @@ class MainActivity : FragmentActivity() {
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
super.onCreate(savedInstanceState)
|
||||
val sharedPref = applicationContext.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
if (sharedPref.getBoolean("dhizuku", false)) {
|
||||
if (VERSION.SDK_INT >= 28) HiddenApiBypass.setHiddenApiExemptions("")
|
||||
if(!Dhizuku.init(applicationContext)) {
|
||||
Toast.makeText(applicationContext, R.string.failed_to_init_dhizuku, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
if (VERSION.SDK_INT >= 28) HiddenApiBypass.setHiddenApiExemptions("")
|
||||
if(sharedPref.getBoolean("auth", false)) {
|
||||
showAuth.value = true
|
||||
}
|
||||
@@ -112,6 +110,10 @@ class MainActivity : FragmentActivity() {
|
||||
) {
|
||||
showAuth.value = true
|
||||
}
|
||||
if (sharedPref.getBoolean("dhizuku", false)) {
|
||||
if (!Dhizuku.init(applicationContext)) { dhizukuErrorStatus.value = 1 }
|
||||
if (!Dhizuku.isPermissionGranted()) { dhizukuErrorStatus.value = 2 }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -159,13 +161,14 @@ fun Home(materialYou:MutableState<Boolean>, blackTheme:MutableState<Boolean>) {
|
||||
}
|
||||
LaunchedEffect(Unit) {
|
||||
val profileInited = sharedPref.getBoolean("ManagedProfileActivated", false)
|
||||
val profileNotActivated = !profileInited && dpm.isProfileOwner(context) && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))
|
||||
val profileNotActivated = !profileInited && context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))
|
||||
if(profileNotActivated) {
|
||||
dpm.setProfileEnabled(receiver)
|
||||
sharedPref.edit().putBoolean("ManagedProfileActivated", true).apply()
|
||||
Toast.makeText(context, R.string.work_profile_activated, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
DhizukuErrorDialog()
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -173,13 +176,15 @@ private fun HomePage(navCtrl:NavHostController, pkgName: MutableState<String>) {
|
||||
val context = LocalContext.current
|
||||
val dpm = context.getDPM()
|
||||
val receiver = context.getReceiver()
|
||||
val activateType = stringResource(
|
||||
if(dpm.isDeviceOwner(context)) { R.string.device_owner }
|
||||
else if(dpm.isProfileOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)) R.string.work_profile_owner else R.string.profile_owner
|
||||
}
|
||||
else if(dpm.isAdminActive(receiver)) R.string.device_admin else R.string.click_to_activate
|
||||
)
|
||||
val sharedPref = LocalContext.current.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
var activateType = if(sharedPref.getBoolean("dhizuku", false)) stringResource(R.string.dhizuku) + " - " else ""
|
||||
activateType += stringResource(
|
||||
if(context.isDeviceOwner) { R.string.device_owner }
|
||||
else if(context.isProfileOwner) {
|
||||
if(VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)) R.string.work_profile_owner else R.string.profile_owner
|
||||
}
|
||||
else if(dpm.isAdminActive(receiver)) R.string.device_admin else R.string.click_to_activate
|
||||
)
|
||||
LaunchedEffect(Unit) { pkgName.value = "" }
|
||||
Column(modifier = Modifier.background(colorScheme.background).statusBarsPadding().verticalScroll(rememberScrollState())) {
|
||||
Spacer(Modifier.padding(vertical = 25.dp))
|
||||
@@ -216,11 +221,11 @@ private fun HomePage(navCtrl:NavHostController, pkgName: MutableState<String>) {
|
||||
}
|
||||
}
|
||||
HomePageItem(R.string.system_manage, R.drawable.mobile_phone_fill0, "SystemManage", navCtrl)
|
||||
if(VERSION.SDK_INT >= 24 && (dpm.isDeviceOwner(context)) || dpm.isProfileOwner(context)) { HomePageItem(R.string.network, R.drawable.wifi_fill0, "Network", navCtrl) }
|
||||
if(VERSION.SDK_INT >= 24 && (context.isDeviceOwner) || context.isProfileOwner) { HomePageItem(R.string.network, R.drawable.wifi_fill0, "Network", navCtrl) }
|
||||
if(
|
||||
(VERSION.SDK_INT < 24 && !dpm.isDeviceOwner(context)) || (
|
||||
(VERSION.SDK_INT < 24 && !context.isDeviceOwner) || (
|
||||
VERSION.SDK_INT >= 24 && (dpm.isProvisioningAllowed(DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE) ||
|
||||
(dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver)))
|
||||
(context.isProfileOwner && dpm.isManagedProfile(receiver)))
|
||||
)
|
||||
) {
|
||||
HomePageItem(R.string.work_profile, R.drawable.work_fill0, "ManagedProfile", navCtrl)
|
||||
@@ -261,3 +266,36 @@ fun HomePageItem(name: Int, imgVector: Int, navTo: String, navCtrl: NavHostContr
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DhizukuErrorDialog() {
|
||||
val status by dhizukuErrorStatus.collectAsState()
|
||||
if (status != 0) {
|
||||
val context = LocalContext.current
|
||||
val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
LaunchedEffect(Unit) {
|
||||
delay(200)
|
||||
sharedPref.edit().putBoolean("dhizuku", false).apply()
|
||||
}
|
||||
AlertDialog(
|
||||
onDismissRequest = { dhizukuErrorStatus.value = 0 },
|
||||
confirmButton = {
|
||||
TextButton(onClick = { dhizukuErrorStatus.value = 0 }) {
|
||||
Text(stringResource(R.string.confirm))
|
||||
}
|
||||
},
|
||||
title = { Text(stringResource(R.string.dhizuku)) },
|
||||
text = {
|
||||
var text = stringResource(
|
||||
when(status){
|
||||
1 -> R.string.failed_to_init_dhizuku
|
||||
2 -> R.string.dhizuku_permission_not_granted
|
||||
else -> R.string.failed_to_init_dhizuku
|
||||
}
|
||||
)
|
||||
if(sharedPref.getBoolean("dhizuku", false)) text += "\n" + stringResource(R.string.dhizuku_mode_disabled)
|
||||
Text(text)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Receiver : DeviceAdminReceiver() {
|
||||
super.onEnabled(context, intent)
|
||||
val dpm = context.getDPM()
|
||||
val receiver = ComponentName(context, this::class.java)
|
||||
if(dpm.isAdminActive(receiver) || dpm.isProfileOwner(context) || dpm.isDeviceOwner(context)){
|
||||
if(dpm.isAdminActive(receiver) || context.isProfileOwner || context.isDeviceOwner){
|
||||
Toast.makeText(context, context.getString(R.string.onEnabled), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ private fun Home(
|
||||
val dpm = context.getDPM()
|
||||
val receiver = context.getReceiver()
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
if(VERSION.SDK_INT >= 24&&dpm.isProfileOwner(context)&&dpm.isManagedProfile(receiver)) {
|
||||
if(VERSION.SDK_INT >= 24&&context.isProfileOwner&&dpm.isManagedProfile(receiver)) {
|
||||
Text(text = stringResource(R.string.scope_is_work_profile), textAlign = TextAlign.Center,modifier = Modifier.fillMaxWidth())
|
||||
}
|
||||
SubPageItem(R.string.app_info,"", R.drawable.open_in_new) {
|
||||
@@ -210,7 +210,7 @@ private fun Home(
|
||||
intent.setData(Uri.parse("package:$pkgName"))
|
||||
startActivity(context, intent, null)
|
||||
}
|
||||
if(VERSION.SDK_INT>=24 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT>=24 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
val getSuspendStatus = {
|
||||
try{ dpm.isPackageSuspended(receiver, pkgName) }
|
||||
catch(e:NameNotFoundException) { false }
|
||||
@@ -228,7 +228,7 @@ private fun Home(
|
||||
}
|
||||
)
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SwitchItem(
|
||||
title = R.string.hide, desc = stringResource(R.string.isapphidden_desc), icon = R.drawable.visibility_off_fill0,
|
||||
getState = { dpm.isApplicationHidden(receiver,pkgName) },
|
||||
@@ -241,7 +241,7 @@ private fun Home(
|
||||
}
|
||||
)
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SwitchItem(
|
||||
title = R.string.block_uninstall, desc = "", icon = R.drawable.delete_forever_fill0,
|
||||
getState = { dpm.isUninstallBlocked(receiver,pkgName) },
|
||||
@@ -254,44 +254,44 @@ private fun Home(
|
||||
}
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT>=24 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT>=24 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.always_on_vpn, "", R.drawable.vpn_key_fill0) { navCtrl.navigate("AlwaysOnVpn") }
|
||||
}
|
||||
if((VERSION.SDK_INT>=33&&dpm.isProfileOwner(context))||(VERSION.SDK_INT>=30&&dpm.isDeviceOwner(context))) {
|
||||
if((VERSION.SDK_INT>=33&&context.isProfileOwner)||(VERSION.SDK_INT>=30&&context.isDeviceOwner)) {
|
||||
SubPageItem(R.string.ucd, "", R.drawable.do_not_touch_fill0) { navCtrl.navigate("UserControlDisabled") }
|
||||
}
|
||||
if(VERSION.SDK_INT>=23&&(dpm.isDeviceOwner(context)||dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT>=23&&(context.isDeviceOwner||context.isProfileOwner)) {
|
||||
SubPageItem(R.string.permission_manage, "", R.drawable.key_fill0) { navCtrl.navigate("PermissionManage") }
|
||||
}
|
||||
if(VERSION.SDK_INT>=30&&dpm.isProfileOwner(context)&&dpm.isManagedProfile(receiver)) {
|
||||
if(VERSION.SDK_INT>=30&&context.isProfileOwner&&dpm.isManagedProfile(receiver)) {
|
||||
SubPageItem(R.string.cross_profile_package, "", R.drawable.work_fill0) { navCtrl.navigate("CrossProfilePackage") }
|
||||
}
|
||||
if(dpm.isProfileOwner(context)) {
|
||||
if(context.isProfileOwner) {
|
||||
SubPageItem(R.string.cross_profile_widget, "", R.drawable.widgets_fill0) { navCtrl.navigate("CrossProfileWidget") }
|
||||
}
|
||||
if(VERSION.SDK_INT>=34&&dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT>=34&&context.isDeviceOwner) {
|
||||
SubPageItem(R.string.credential_manage_policy, "", R.drawable.license_fill0) { navCtrl.navigate("CredentialManagePolicy") }
|
||||
}
|
||||
if(dpm.isProfileOwner(context)||dpm.isDeviceOwner(context)) {
|
||||
if(context.isProfileOwner||context.isDeviceOwner) {
|
||||
SubPageItem(R.string.permitted_accessibility_services, "", R.drawable.settings_accessibility_fill0) { navCtrl.navigate("Accessibility") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context)||dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner||context.isProfileOwner) {
|
||||
SubPageItem(R.string.permitted_ime, "", R.drawable.keyboard_fill0) { navCtrl.navigate("IME") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.enable_system_app, "", R.drawable.enable_fill0) { enableSystemAppDialog.value = true }
|
||||
}
|
||||
if(VERSION.SDK_INT>=28&&dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT>=28&&context.isDeviceOwner) {
|
||||
SubPageItem(R.string.keep_uninstalled_packages, "", R.drawable.delete_fill0) { navCtrl.navigate("KeepUninstalled") }
|
||||
}
|
||||
if(VERSION.SDK_INT>=28 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT>=28 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.clear_app_storage, "", R.drawable.mop_fill0) {
|
||||
if(pkgName != "") { clearAppDataDialog.value = true }
|
||||
}
|
||||
}
|
||||
SubPageItem(R.string.install_app, "", R.drawable.install_mobile_fill0) { navCtrl.navigate("InstallApp") }
|
||||
SubPageItem(R.string.uninstall_app, "", R.drawable.delete_fill0) { navCtrl.navigate("UninstallApp") }
|
||||
if(VERSION.SDK_INT >= 34 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 34 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.set_default_dialer, "", R.drawable.call_fill0) { defaultDialerAppDialog.value = true }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
|
||||
@@ -8,13 +8,13 @@ import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageInstaller
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build.VERSION
|
||||
import androidx.activity.ComponentActivity.CONTEXT_IGNORE_SECURITY
|
||||
import androidx.activity.ComponentActivity.DEVICE_POLICY_SERVICE
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import com.bintianqi.owndroid.PackageInstallerReceiver
|
||||
import com.bintianqi.owndroid.Receiver
|
||||
import com.bintianqi.owndroid.backToHomeStateFlow
|
||||
import com.rosan.dhizuku.api.Dhizuku
|
||||
import com.rosan.dhizuku.api.Dhizuku.binderWrapper
|
||||
import com.rosan.dhizuku.api.DhizukuBinderWrapper
|
||||
@@ -26,27 +26,34 @@ var selectedPermission = MutableStateFlow("")
|
||||
lateinit var createManagedProfile: ActivityResultLauncher<Intent>
|
||||
lateinit var addDeviceAdmin: ActivityResultLauncher<Intent>
|
||||
|
||||
fun DevicePolicyManager.isDeviceOwner(context: Context): Boolean {
|
||||
val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
return this.isDeviceOwnerApp(
|
||||
if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
Dhizuku.getOwnerPackageName()
|
||||
} else {
|
||||
"com.bintianqi.owndroid"
|
||||
}
|
||||
)
|
||||
}
|
||||
val Context.isDeviceOwner: Boolean
|
||||
get() {
|
||||
val sharedPref = getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
val dpm = getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
return dpm.isDeviceOwnerApp(
|
||||
if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
Dhizuku.getOwnerPackageName()
|
||||
} else {
|
||||
"com.bintianqi.owndroid"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun DevicePolicyManager.isProfileOwner(context: Context): Boolean {
|
||||
val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
return this.isProfileOwnerApp(
|
||||
if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
val Context.isProfileOwner: Boolean
|
||||
get() {
|
||||
val dpm = getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
return dpm.isProfileOwnerApp("com.bintianqi.owndroid")
|
||||
}
|
||||
|
||||
val Context.dpcPackageName: String
|
||||
get() {
|
||||
val sharedPref = getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
return if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
Dhizuku.getOwnerPackageName()
|
||||
} else {
|
||||
"com.bintianqi.owndroid"
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun DevicePolicyManager.isOrgProfile(receiver: ComponentName): Boolean {
|
||||
return VERSION.SDK_INT >= 30 && this.isProfileOwnerApp("com.bintianqi.owndroid") && isManagedProfile(receiver) && isOrganizationOwnedDeviceWithManagedProfile
|
||||
@@ -71,7 +78,7 @@ fun installPackage(context: Context, inputStream: InputStream) {
|
||||
}
|
||||
|
||||
@SuppressLint("PrivateApi")
|
||||
fun binderWrapperDevicePolicyManager(appContext: Context): DevicePolicyManager {
|
||||
fun binderWrapperDevicePolicyManager(appContext: Context): DevicePolicyManager? {
|
||||
try {
|
||||
val context = appContext.createPackageContext(Dhizuku.getOwnerComponent().packageName, CONTEXT_IGNORE_SECURITY)
|
||||
val manager = context.getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
@@ -84,21 +91,23 @@ fun binderWrapperDevicePolicyManager(appContext: Context): DevicePolicyManager {
|
||||
val newInterface = IDevicePolicyManager.Stub.asInterface(newBinder)
|
||||
field[manager] = newInterface
|
||||
return manager
|
||||
} catch (e: NoSuchFieldException) {
|
||||
throw RuntimeException(e)
|
||||
} catch (e: IllegalAccessException) {
|
||||
throw RuntimeException(e)
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
throw RuntimeException(e)
|
||||
} catch (e: Exception) {
|
||||
dhizukuErrorStatus.value = 1
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun Context.getDPM(): DevicePolicyManager {
|
||||
val sharedPref = this.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
return if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
binderWrapperDevicePolicyManager(this)
|
||||
if(sharedPref.getBoolean("dhizuku", false)) {
|
||||
if (!Dhizuku.isPermissionGranted()) {
|
||||
dhizukuErrorStatus.value = 2
|
||||
backToHomeStateFlow.value = true
|
||||
return this.getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
}
|
||||
return binderWrapperDevicePolicyManager(this) ?: this.getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
} else {
|
||||
this.getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
return this.getSystemService(DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,3 +119,5 @@ fun Context.getReceiver(): ComponentName {
|
||||
ComponentName(this, Receiver::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
val dhizukuErrorStatus = MutableStateFlow(0)
|
||||
|
||||
@@ -104,7 +104,7 @@ private fun Home(navCtrl: NavHostController) {
|
||||
style = typography.headlineLarge,
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
if(VERSION.SDK_INT >= 30 && dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver)) {
|
||||
if(VERSION.SDK_INT >= 30 && context.isProfileOwner && dpm.isManagedProfile(receiver)) {
|
||||
SubPageItem(R.string.org_owned_work_profile, "", R.drawable.corporate_fare_fill0) { navCtrl.navigate("OrgOwnedWorkProfile") }
|
||||
}
|
||||
if(VERSION.SDK_INT<24 || (VERSION.SDK_INT>=24 && dpm.isProvisioningAllowed(ACTION_PROVISION_MANAGED_PROFILE))) {
|
||||
@@ -113,10 +113,10 @@ private fun Home(navCtrl: NavHostController) {
|
||||
if(dpm.isOrgProfile(receiver)) {
|
||||
SubPageItem(R.string.suspend_personal_app, "", R.drawable.block_fill0) { navCtrl.navigate("SuspendPersonalApp") }
|
||||
}
|
||||
if(dpm.isProfileOwner(context) && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
if(context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
SubPageItem(R.string.intent_filter, "", R.drawable.filter_alt_fill0) { navCtrl.navigate("IntentFilter") }
|
||||
}
|
||||
if(dpm.isProfileOwner(context) && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
if(context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
SubPageItem(R.string.delete_work_profile, "", R.drawable.delete_forever_fill0) { navCtrl.navigate("DeleteWorkProfile") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
|
||||
@@ -157,28 +157,28 @@ private fun Home(navCtrl:NavHostController, scrollState: ScrollState, wifiMacDia
|
||||
style = typography.headlineLarge,
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
if(VERSION.SDK_INT >= 24 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 24 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.wifi_mac_addr, "", R.drawable.wifi_fill0) { wifiMacDialog.value = true }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 30) {
|
||||
SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Switches") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 33 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 33 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.min_wifi_security_level, "", R.drawable.wifi_password_fill0) { navCtrl.navigate("MinWifiSecurityLevel") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 33 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 33 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.wifi_ssid_policy, "", R.drawable.wifi_fill0) { navCtrl.navigate("WifiSsidPolicy") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 29 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 29 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.private_dns, "", R.drawable.dns_fill0) { navCtrl.navigate("PrivateDNS") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26&&(dpm.isDeviceOwner(context) || (dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver)))) {
|
||||
if(VERSION.SDK_INT >= 26&&(context.isDeviceOwner || (context.isProfileOwner && dpm.isManagedProfile(receiver)))) {
|
||||
SubPageItem(R.string.retrieve_net_logs, "", R.drawable.description_fill0) { navCtrl.navigate("NetworkLog") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 31 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 31 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.wifi_auth_keypair, "", R.drawable.key_fill0) { navCtrl.navigate("WifiAuthKeypair") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 28 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.override_apn_settings, "", R.drawable.cell_tower_fill0) { navCtrl.navigate("APN") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
@@ -192,13 +192,13 @@ private fun Switches() {
|
||||
val receiver = context.getReceiver()
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
if(VERSION.SDK_INT >= 33 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 33 && context.isDeviceOwner) {
|
||||
SwitchItem(
|
||||
R.string.preferential_network_service, stringResource(R.string.developing), R.drawable.globe_fill0,
|
||||
{ dpm.isPreferentialNetworkServiceEnabled }, { dpm.isPreferentialNetworkServiceEnabled = it }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT>=30 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT>=30 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SwitchItem(R.string.lockdown_admin_configured_network, "", R.drawable.wifi_password_fill0,
|
||||
{ dpm.hasLockdownAdminConfiguredNetworks(receiver) }, { dpm.setConfiguredNetworksLockdownState(receiver,it) }
|
||||
)
|
||||
|
||||
@@ -136,19 +136,19 @@ private fun Home(navCtrl:NavHostController,scrollState: ScrollState) {
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
SubPageItem(R.string.password_info, "", R.drawable.info_fill0) { navCtrl.navigate("PasswordInfo") }
|
||||
if(VERSION.SDK_INT >= 26 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.reset_password_token, "", R.drawable.key_vertical_fill0) { navCtrl.navigate("ResetPasswordToken") }
|
||||
}
|
||||
if(dpm.isAdminActive(receiver) || dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(dpm.isAdminActive(receiver) || context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.reset_password, "", R.drawable.lock_reset_fill0) { navCtrl.navigate("ResetPassword") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 31 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 31 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.required_password_complexity, "", R.drawable.password_fill0) { navCtrl.navigate("RequirePasswordComplexity") }
|
||||
}
|
||||
if(dpm.isAdminActive(receiver)) {
|
||||
SubPageItem(R.string.disable_keyguard_features, "", R.drawable.screen_lock_portrait_fill0) { navCtrl.navigate("DisableKeyguardFeatures") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context)) {
|
||||
if(context.isDeviceOwner) {
|
||||
SubPageItem(R.string.max_time_to_lock, "", R.drawable.schedule_fill0) { navCtrl.navigate("MaxTimeToLock") }
|
||||
SubPageItem(R.string.pwd_expiration_timeout, "", R.drawable.lock_clock_fill0) { navCtrl.navigate("PasswordTimeout") }
|
||||
SubPageItem(R.string.max_pwd_fail, "", R.drawable.no_encryption_fill0) { navCtrl.navigate("MaxPasswordFail") }
|
||||
@@ -156,10 +156,10 @@ private fun Home(navCtrl:NavHostController,scrollState: ScrollState) {
|
||||
if(dpm.isAdminActive(receiver)){
|
||||
SubPageItem(R.string.pwd_history, "", R.drawable.history_fill0) { navCtrl.navigate("PasswordHistoryLength") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.required_strong_auth_timeout, "", R.drawable.fingerprint_off_fill0) { navCtrl.navigate("RequiredStrongAuthTimeout") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.required_password_quality, "", R.drawable.password_fill0) { navCtrl.navigate("RequirePasswordQuality") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
@@ -185,14 +185,14 @@ private fun PasswordInfo() {
|
||||
val pwdComplex = passwordComplexity[dpm.passwordComplexity]
|
||||
Text(text = stringResource(R.string.current_password_complexity_is, pwdComplex?:stringResource(R.string.unknown)))
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
Text(stringResource(R.string.is_password_sufficient, dpm.isActivePasswordSufficient))
|
||||
}
|
||||
if(dpm.isAdminActive(receiver)) {
|
||||
val pwdFailedAttempts = dpm.currentFailedPasswordAttempts
|
||||
Text(text = stringResource(R.string.password_failed_attempts_is, pwdFailedAttempts))
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver)) {
|
||||
if(VERSION.SDK_INT >= 28 && context.isProfileOwner && dpm.isManagedProfile(receiver)) {
|
||||
val unifiedPwd = dpm.isUsingUnifiedPassword(receiver)
|
||||
Text(stringResource(R.string.is_using_unified_password, unifiedPwd))
|
||||
}
|
||||
@@ -317,7 +317,7 @@ private fun ResetPassword() {
|
||||
confirmed=false
|
||||
},
|
||||
colors = ButtonDefaults.buttonColors(containerColor = colorScheme.error, contentColor = colorScheme.onError),
|
||||
enabled = confirmed && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)),
|
||||
enabled = confirmed && (context.isDeviceOwner || context.isProfileOwner),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(stringResource(R.string.reset_password_with_token))
|
||||
|
||||
@@ -36,7 +36,6 @@ import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.bintianqi.owndroid.R
|
||||
import com.bintianqi.owndroid.Receiver
|
||||
import com.bintianqi.owndroid.backToHomeStateFlow
|
||||
import com.bintianqi.owndroid.ui.*
|
||||
import com.rosan.dhizuku.api.Dhizuku
|
||||
@@ -99,75 +98,86 @@ private fun Home(localNavCtrl:NavHostController,listScrollState:ScrollState) {
|
||||
style = typography.headlineLarge,
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
SwitchItem(
|
||||
R.string.dhizuku, "", null,
|
||||
{ dhizukuStatus },
|
||||
{
|
||||
if(!it) {
|
||||
sharedPref.edit().putBoolean("dhizuku", false).apply()
|
||||
if(!dpm.isDeviceOwnerApp(context.packageName)) {
|
||||
SwitchItem(
|
||||
R.string.dhizuku, "", null,
|
||||
{ dhizukuStatus },
|
||||
{
|
||||
toggleDhizukuMode(it, context)
|
||||
dhizukuStatus = sharedPref.getBoolean("dhizuku", false)
|
||||
return@SwitchItem
|
||||
}
|
||||
Dhizuku.init(context)
|
||||
if(Dhizuku.isPermissionGranted()) {
|
||||
sharedPref.edit().putBoolean("dhizuku", true).apply()
|
||||
dhizukuStatus = sharedPref.getBoolean("dhizuku", false)
|
||||
} else {
|
||||
Dhizuku.requestPermission(object: DhizukuRequestPermissionListener() {
|
||||
@Throws(RemoteException::class)
|
||||
override fun onRequestPermission(grantResult: Int) {
|
||||
if(grantResult == PackageManager.PERMISSION_GRANTED) {
|
||||
sharedPref.edit().putBoolean("dhizuku", true).apply()
|
||||
dhizukuStatus = sharedPref.getBoolean("dhizuku", false)
|
||||
} else {
|
||||
Toast.makeText(context, R.string.permission_not_granted, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
SubPageItem(
|
||||
R.string.device_admin, stringResource(if(dpm.isAdminActive(receiver)) R.string.activated else R.string.deactivated),
|
||||
operation = { localNavCtrl.navigate("DeviceAdmin") }
|
||||
)
|
||||
if(!dpm.isDeviceOwner(context)) {
|
||||
if(!context.isDeviceOwner) {
|
||||
SubPageItem(
|
||||
R.string.profile_owner, stringResource(if(dpm.isProfileOwner(context)) R.string.activated else R.string.deactivated),
|
||||
R.string.profile_owner, stringResource(if(context.isProfileOwner) R.string.activated else R.string.deactivated),
|
||||
operation = { localNavCtrl.navigate("ProfileOwner") }
|
||||
)
|
||||
}
|
||||
if(!dpm.isProfileOwner(context)) {
|
||||
if(!context.isProfileOwner) {
|
||||
SubPageItem(
|
||||
R.string.device_owner, stringResource(if(dpm.isDeviceOwner(context)) R.string.activated else R.string.deactivated),
|
||||
R.string.device_owner, stringResource(if(context.isDeviceOwner) R.string.activated else R.string.deactivated),
|
||||
operation = { localNavCtrl.navigate("DeviceOwner") }
|
||||
)
|
||||
}
|
||||
SubPageItem(R.string.shizuku,"") { localNavCtrl.navigate("Shizuku") }
|
||||
SubPageItem(R.string.device_info, "", R.drawable.perm_device_information_fill0) { localNavCtrl.navigate("DeviceInfo") }
|
||||
if((VERSION.SDK_INT >= 26 && dpm.isDeviceOwner(context)) || (VERSION.SDK_INT>=24 && dpm.isProfileOwner(context))) {
|
||||
if((VERSION.SDK_INT >= 26 && context.isDeviceOwner) || (VERSION.SDK_INT>=24 && context.isProfileOwner)) {
|
||||
SubPageItem(R.string.org_name, "", R.drawable.corporate_fare_fill0) { localNavCtrl.navigate("OrgName") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 31 && (dpm.isProfileOwner(context) || dpm.isDeviceOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 31 && (context.isProfileOwner || context.isDeviceOwner)) {
|
||||
SubPageItem(R.string.org_id, "", R.drawable.corporate_fare_fill0) { localNavCtrl.navigate("OrgID") }
|
||||
SubPageItem(R.string.enrollment_specific_id, "", R.drawable.id_card_fill0) { localNavCtrl.navigate("SpecificID") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.disable_account_management, "", R.drawable.account_circle_fill0) { localNavCtrl.navigate("DisableAccountManagement") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 24 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 24 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.device_owner_lock_screen_info, "", R.drawable.screen_lock_portrait_fill0) { localNavCtrl.navigate("LockScreenInfo") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 24 && dpm.isAdminActive(receiver)) {
|
||||
SubPageItem(R.string.support_msg, "", R.drawable.chat_fill0) { localNavCtrl.navigate("SupportMsg") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 28 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.transfer_ownership, "", R.drawable.admin_panel_settings_fill0) { localNavCtrl.navigate("TransformOwnership") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleDhizukuMode(status: Boolean, context: Context) {
|
||||
val sharedPref = context.getSharedPreferences("data", Context.MODE_PRIVATE)
|
||||
if(!status) {
|
||||
sharedPref.edit().putBoolean("dhizuku", false).apply()
|
||||
backToHomeStateFlow.value = true
|
||||
return
|
||||
}
|
||||
if(!Dhizuku.init(context)) {
|
||||
dhizukuErrorStatus.value = 1
|
||||
return
|
||||
}
|
||||
if(Dhizuku.isPermissionGranted()) {
|
||||
sharedPref.edit().putBoolean("dhizuku", true).apply()
|
||||
backToHomeStateFlow.value = true
|
||||
} else {
|
||||
Dhizuku.requestPermission(object: DhizukuRequestPermissionListener() {
|
||||
@Throws(RemoteException::class)
|
||||
override fun onRequestPermission(grantResult: Int) {
|
||||
if(grantResult == PackageManager.PERMISSION_GRANTED) {
|
||||
sharedPref.edit().putBoolean("dhizuku", true).apply()
|
||||
backToHomeStateFlow.value = true
|
||||
} else {
|
||||
dhizukuErrorStatus.value = 2
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Composable
|
||||
private fun LockScreenInfo() {
|
||||
@@ -222,7 +232,7 @@ private fun DeviceAdmin() {
|
||||
AnimatedVisibility(showDeactivateButton) {
|
||||
Button(
|
||||
onClick = { deactivateDialog = true },
|
||||
enabled = !dpm.isProfileOwner(context) && !dpm.isDeviceOwner(context),
|
||||
enabled = !context.isProfileOwner && !context.isDeviceOwner,
|
||||
colors = ButtonDefaults.buttonColors(containerColor = colorScheme.error, contentColor = colorScheme.onError)
|
||||
) {
|
||||
Text(stringResource(R.string.deactivate))
|
||||
@@ -277,12 +287,12 @@ private fun ProfileOwner() {
|
||||
val context = LocalContext.current
|
||||
val dpm = context.getDPM()
|
||||
val receiver = context.getReceiver()
|
||||
var showDeactivateButton by remember { mutableStateOf(dpm.isProfileOwner(context)) }
|
||||
var showDeactivateButton by remember { mutableStateOf(context.isProfileOwner) }
|
||||
var deactivateDialog by remember { mutableStateOf(false) }
|
||||
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 8.dp)) {
|
||||
Spacer(Modifier.padding(vertical = 10.dp))
|
||||
Text(text = stringResource(R.string.profile_owner), style = typography.headlineLarge)
|
||||
Text(stringResource(if(dpm.isProfileOwner(context)) R.string.activated else R.string.deactivated), style = typography.titleLarge)
|
||||
Text(stringResource(if(context.isProfileOwner) R.string.activated else R.string.deactivated), style = typography.titleLarge)
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
if(VERSION.SDK_INT >= 24) {
|
||||
AnimatedVisibility(showDeactivateButton) {
|
||||
@@ -323,8 +333,8 @@ private fun ProfileOwner() {
|
||||
co.launch{
|
||||
delay(300)
|
||||
deactivateDialog = false
|
||||
showDeactivateButton = dpm.isProfileOwner(context)
|
||||
backToHomeStateFlow.value = !dpm.isProfileOwner(context)
|
||||
showDeactivateButton = context.isProfileOwner
|
||||
backToHomeStateFlow.value = !context.isProfileOwner
|
||||
}
|
||||
}
|
||||
) {
|
||||
@@ -339,12 +349,12 @@ private fun ProfileOwner() {
|
||||
private fun DeviceOwner() {
|
||||
val context = LocalContext.current
|
||||
val dpm = context.getDPM()
|
||||
var showDeactivateButton by remember { mutableStateOf(dpm.isDeviceOwner(context)) }
|
||||
var showDeactivateButton by remember { mutableStateOf(context.isDeviceOwner) }
|
||||
var deactivateDialog by remember { mutableStateOf(false) }
|
||||
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 8.dp)) {
|
||||
Spacer(Modifier.padding(vertical = 10.dp))
|
||||
Text(text = stringResource(R.string.device_owner), style = typography.headlineLarge)
|
||||
Text(text = stringResource(if(dpm.isDeviceOwner(context)) R.string.activated else R.string.deactivated), style = typography.titleLarge)
|
||||
Text(text = stringResource(if(context.isDeviceOwner) R.string.activated else R.string.deactivated), style = typography.titleLarge)
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
AnimatedVisibility(showDeactivateButton) {
|
||||
Button(
|
||||
@@ -378,12 +388,12 @@ private fun DeviceOwner() {
|
||||
confirmButton = {
|
||||
TextButton(
|
||||
onClick = {
|
||||
dpm.clearDeviceOwnerApp(context.packageName)
|
||||
dpm.clearDeviceOwnerApp(context.dpcPackageName)
|
||||
co.launch{
|
||||
delay(300)
|
||||
deactivateDialog = false
|
||||
showDeactivateButton = dpm.isDeviceOwner(context)
|
||||
backToHomeStateFlow.value = !dpm.isDeviceOwner(context)
|
||||
showDeactivateButton = context.isDeviceOwner
|
||||
backToHomeStateFlow.value = !context.isDeviceOwner
|
||||
}
|
||||
}
|
||||
) {
|
||||
@@ -403,7 +413,7 @@ fun DeviceInfo() {
|
||||
Spacer(Modifier.padding(vertical = 10.dp))
|
||||
Text(text = stringResource(R.string.device_info), style = typography.headlineLarge)
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
if(VERSION.SDK_INT>=34 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT>=34 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
val financed = dpm.isDeviceFinanced
|
||||
Text(stringResource(R.string.is_device_financed, financed))
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ fun ShizukuActivate() {
|
||||
var bindShizuku by remember { mutableStateOf(false) }
|
||||
var outputText by remember { mutableStateOf("") }
|
||||
var showDeviceAdminButton by remember { mutableStateOf(!dpm.isAdminActive(receiver)) }
|
||||
var showProfileOwnerButton by remember { mutableStateOf(!dpm.isProfileOwner(context)) }
|
||||
var showDeviceOwnerButton by remember { mutableStateOf(!dpm.isDeviceOwner(context)) }
|
||||
var showProfileOwnerButton by remember { mutableStateOf(!context.isProfileOwner) }
|
||||
var showDeviceOwnerButton by remember { mutableStateOf(!context.isDeviceOwner) }
|
||||
var showOrgProfileOwnerButton by remember { mutableStateOf(true) }
|
||||
val service by shizukuService.collectAsState()
|
||||
LaunchedEffect(service) {
|
||||
@@ -140,7 +140,7 @@ fun ShizukuActivate() {
|
||||
outputText = service!!.execute(context.getString(R.string.dpm_activate_po_command))
|
||||
outputTextScrollState.animateScrollTo(0)
|
||||
delay(500)
|
||||
showProfileOwnerButton = !dpm.isProfileOwner(context)
|
||||
showProfileOwnerButton = !context.isProfileOwner
|
||||
}
|
||||
},
|
||||
enabled = enabled
|
||||
@@ -156,7 +156,7 @@ fun ShizukuActivate() {
|
||||
outputText = service!!.execute(context.getString(R.string.dpm_activate_do_command))
|
||||
outputTextScrollState.animateScrollTo(0)
|
||||
delay(500)
|
||||
showDeviceOwnerButton = !dpm.isDeviceOwner(context)
|
||||
showDeviceOwnerButton = !context.isDeviceOwner
|
||||
}
|
||||
},
|
||||
enabled = enabled
|
||||
@@ -165,7 +165,7 @@ fun ShizukuActivate() {
|
||||
}
|
||||
}
|
||||
|
||||
if(VERSION.SDK_INT >= 30 && dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver) && !dpm.isOrganizationOwnedDeviceWithManagedProfile) {
|
||||
if(VERSION.SDK_INT >= 30 && context.isProfileOwner && dpm.isManagedProfile(receiver) && !dpm.isOrganizationOwnedDeviceWithManagedProfile) {
|
||||
AnimatedVisibility(showOrgProfileOwnerButton) {
|
||||
Button(
|
||||
onClick = {
|
||||
|
||||
@@ -183,48 +183,48 @@ private fun Home(navCtrl: NavHostController, scrollState: ScrollState, rebootDia
|
||||
style = typography.headlineLarge,
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.options, "", R.drawable.tune_fill0) { navCtrl.navigate("Switches") }
|
||||
}
|
||||
SubPageItem(R.string.keyguard, "", R.drawable.screen_lock_portrait_fill0) { navCtrl.navigate("Keyguard") }
|
||||
if(VERSION.SDK_INT >= 24 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 24 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.reboot, "", R.drawable.restart_alt_fill0) { rebootDialog.value = true }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) && ((VERSION.SDK_INT >= 28 && dpm.isAffiliatedUser) || VERSION.SDK_INT >= 24)) {
|
||||
if(context.isDeviceOwner && ((VERSION.SDK_INT >= 28 && dpm.isAffiliatedUser) || VERSION.SDK_INT >= 24)) {
|
||||
SubPageItem(R.string.bug_report, "", R.drawable.bug_report_fill0) { bugReportDialog.value = true }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 28 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.edit_time, "", R.drawable.schedule_fill0) { navCtrl.navigate("EditTime") }
|
||||
SubPageItem(R.string.edit_timezone, "", R.drawable.schedule_fill0) { navCtrl.navigate("EditTimeZone") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 23 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 23 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.permission_policy, "", R.drawable.key_fill0) { navCtrl.navigate("PermissionPolicy") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 34 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 34 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.mte_policy, "", R.drawable.memory_fill0) { navCtrl.navigate("MTEPolicy") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 31 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 31 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.nearby_streaming_policy, "", R.drawable.share_fill0) { navCtrl.navigate("NearbyStreamingPolicy") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 28 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.lock_task_mode, "", R.drawable.lock_fill0) { navCtrl.navigate("LockTaskMode") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.ca_cert, "", R.drawable.license_fill0) { navCtrl.navigate("CaCert") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.security_logs, "", R.drawable.description_fill0) { navCtrl.navigate("SecurityLogs") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 23 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 23 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.system_update_policy, "", R.drawable.system_update_fill0) { navCtrl.navigate("SystemUpdatePolicy") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 29 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 29 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.install_system_update, "", R.drawable.system_update_fill0) { navCtrl.navigate("InstallSystemUpdate") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 30 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 30 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SubPageItem(R.string.frp_policy, "", R.drawable.device_reset_fill0) { navCtrl.navigate("FRP") }
|
||||
}
|
||||
if(dangerousFeatures && dpm.isAdminActive(receiver) && !(VERSION.SDK_INT >= 24 && dpm.isProfileOwner(context) && dpm.isManagedProfile(receiver))) {
|
||||
if(dangerousFeatures && dpm.isAdminActive(receiver) && !(VERSION.SDK_INT >= 24 && context.isProfileOwner && dpm.isManagedProfile(receiver))) {
|
||||
SubPageItem(R.string.wipe_data, "", R.drawable.device_reset_fill0) { navCtrl.navigate("WipeData") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
@@ -239,22 +239,22 @@ private fun Switches() {
|
||||
val receiver = context.getReceiver()
|
||||
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) {
|
||||
Spacer(Modifier.padding(vertical = 10.dp))
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SwitchItem(R.string.disable_cam,"", R.drawable.photo_camera_fill0,
|
||||
{ dpm.getCameraDisabled(null) }, { dpm.setCameraDisabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SwitchItem(R.string.disable_screen_capture, stringResource(R.string.also_disable_aosp_screen_record), R.drawable.screenshot_fill0,
|
||||
{ dpm.getScreenCaptureDisabled(null) }, { dpm.setScreenCaptureDisabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT >= 34 && (dpm.isDeviceOwner(context) || (dpm.isProfileOwner(context) && dpm.isAffiliatedUser))) {
|
||||
if(VERSION.SDK_INT >= 34 && (context.isDeviceOwner || (context.isProfileOwner && dpm.isAffiliatedUser))) {
|
||||
SwitchItem(R.string.disable_status_bar, "", R.drawable.notifications_fill0,
|
||||
{ dpm.isStatusBarDisabled}, { dpm.setStatusBarDisabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver)) {
|
||||
if(context.isDeviceOwner || dpm.isOrgProfile(receiver)) {
|
||||
if(VERSION.SDK_INT >= 30) {
|
||||
SwitchItem(R.string.auto_time, "", R.drawable.schedule_fill0,
|
||||
{ dpm.getAutoTimeEnabled(receiver) }, { dpm.setAutoTimeEnabled(receiver,it) }
|
||||
@@ -266,27 +266,27 @@ private fun Switches() {
|
||||
SwitchItem(R.string.require_auto_time, "", R.drawable.schedule_fill0, { dpm.autoTimeRequired}, { dpm.setAutoTimeRequired(receiver,it) })
|
||||
}
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SwitchItem(R.string.master_mute, "", R.drawable.volume_up_fill0,
|
||||
{ dpm.isMasterVolumeMuted(receiver) }, { dpm.setMasterVolumeMuted(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SwitchItem(R.string.backup_service, "", R.drawable.backup_fill0,
|
||||
{ dpm.isBackupServiceEnabled(receiver) }, { dpm.setBackupServiceEnabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT >= 23 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 23 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SwitchItem(R.string.disable_bt_contact_share, "", R.drawable.account_circle_fill0,
|
||||
{ dpm.getBluetoothContactSharingDisabled(receiver) }, { dpm.setBluetoothContactSharingDisabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT >= 30 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 30 && context.isDeviceOwner) {
|
||||
SwitchItem(R.string.common_criteria_mode, stringResource(R.string.common_criteria_mode_desc),R.drawable.security_fill0,
|
||||
{ dpm.isCommonCriteriaModeEnabled(receiver) }, { dpm.setCommonCriteriaModeEnabled(receiver,it) }
|
||||
)
|
||||
}
|
||||
if(VERSION.SDK_INT >= 31 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if(VERSION.SDK_INT >= 31 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
SwitchItem(
|
||||
R.string.usb_signal, "", R.drawable.usb_fill0, { dpm.isUsbDataSignalingEnabled },
|
||||
{
|
||||
@@ -316,7 +316,7 @@ private fun Keyguard() {
|
||||
onClick = {
|
||||
Toast.makeText(context, if(dpm.setKeyguardDisabled(receiver,true)) R.string.success else R.string.failed, Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
enabled = dpm.isDeviceOwner(context) || (VERSION.SDK_INT >= 28 && dpm.isProfileOwner(context) && dpm.isAffiliatedUser),
|
||||
enabled = context.isDeviceOwner || (VERSION.SDK_INT >= 28 && context.isProfileOwner && dpm.isAffiliatedUser),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(stringResource(R.string.disable))
|
||||
@@ -325,7 +325,7 @@ private fun Keyguard() {
|
||||
onClick = {
|
||||
Toast.makeText(context, if(dpm.setKeyguardDisabled(receiver,false)) R.string.success else R.string.failed, Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
enabled = dpm.isDeviceOwner(context) || (VERSION.SDK_INT >= 28 && dpm.isProfileOwner(context) && dpm.isAffiliatedUser),
|
||||
enabled = context.isDeviceOwner || (VERSION.SDK_INT >= 28 && context.isProfileOwner && dpm.isAffiliatedUser),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(stringResource(R.string.enable))
|
||||
@@ -1091,7 +1091,7 @@ private fun WipeData() {
|
||||
stringResource(R.string.wipe_external_storage),
|
||||
externalStorage, { externalStorage = it }
|
||||
)
|
||||
if(VERSION.SDK_INT >= 22 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 22 && context.isDeviceOwner) {
|
||||
CheckBoxItem(stringResource(R.string.wipe_reset_protection_data),
|
||||
protectionData, { protectionData = it }
|
||||
)
|
||||
@@ -1119,7 +1119,7 @@ private fun WipeData() {
|
||||
Text("WipeData")
|
||||
}
|
||||
}
|
||||
if (VERSION.SDK_INT >= 34 && (dpm.isDeviceOwner(context) || dpm.isOrgProfile(receiver))) {
|
||||
if (VERSION.SDK_INT >= 34 && (context.isDeviceOwner || dpm.isOrgProfile(receiver))) {
|
||||
Button(
|
||||
onClick = {
|
||||
focusMgr.clearFocus()
|
||||
|
||||
@@ -116,22 +116,22 @@ private fun Home(navCtrl: NavHostController,scrollState: ScrollState) {
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 5.dp, start = 15.dp)
|
||||
)
|
||||
SubPageItem(R.string.user_info, "", R.drawable.person_fill0) { navCtrl.navigate("UserInfo") }
|
||||
if(dpm.isDeviceOwner(context)) {
|
||||
if(context.isDeviceOwner) {
|
||||
SubPageItem(R.string.user_operation, "", R.drawable.sync_alt_fill0) { navCtrl.navigate("UserOperation") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 24 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 24 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.create_user, "", R.drawable.person_add_fill0) { navCtrl.navigate("CreateUser") }
|
||||
}
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
SubPageItem(R.string.edit_username, "", R.drawable.edit_fill0) { navCtrl.navigate("EditUsername") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 23 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 23 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.change_user_icon, "", R.drawable.account_circle_fill0) { navCtrl.navigate("ChangeUserIcon") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 28 && dpm.isDeviceOwner(context)) {
|
||||
if(VERSION.SDK_INT >= 28 && context.isDeviceOwner) {
|
||||
SubPageItem(R.string.user_session_msg, "", R.drawable.notifications_fill0) { navCtrl.navigate("UserSessionMessage") }
|
||||
}
|
||||
if(VERSION.SDK_INT >= 26 && (dpm.isDeviceOwner(context) || dpm.isProfileOwner(context))) {
|
||||
if(VERSION.SDK_INT >= 26 && (context.isDeviceOwner || context.isProfileOwner)) {
|
||||
SubPageItem(R.string.affiliation_id, "", R.drawable.id_card_fill0) { navCtrl.navigate("AffiliationID") }
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 30.dp))
|
||||
@@ -158,7 +158,7 @@ private fun CurrentUserInfo() {
|
||||
if (VERSION.SDK_INT >= 28) {
|
||||
val logoutable = dpm.isLogoutEnabled
|
||||
Text(text = stringResource(R.string.user_can_logout, logoutable))
|
||||
if(dpm.isDeviceOwner(context) || dpm.isProfileOwner(context)) {
|
||||
if(context.isDeviceOwner || context.isProfileOwner) {
|
||||
val ephemeralUser = dpm.isEphemeralUser(receiver)
|
||||
Text(text = stringResource(R.string.is_ephemeral_user, ephemeralUser))
|
||||
}
|
||||
@@ -208,7 +208,7 @@ private fun UserOperation() {
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 5.dp))
|
||||
if(VERSION.SDK_INT > 28) {
|
||||
if(dpm.isProfileOwner(context)&&dpm.isAffiliatedUser) {
|
||||
if(context.isProfileOwner&&dpm.isAffiliatedUser) {
|
||||
Button(
|
||||
onClick = {
|
||||
val result = dpm.logoutUser(receiver)
|
||||
|
||||
@@ -103,8 +103,8 @@ private fun Home(navCtrl:NavHostController, scrollState: ScrollState) {
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 7.dp, start = 15.dp)
|
||||
)
|
||||
Text(text = stringResource(R.string.switch_to_disable_feature), modifier = Modifier.padding(start = 15.dp))
|
||||
if(dpm.isProfileOwner(context)) { Text(text = stringResource(R.string.profile_owner_is_restricted), modifier = Modifier.padding(start = 15.dp)) }
|
||||
if(dpm.isProfileOwner(context) && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
if(context.isProfileOwner) { Text(text = stringResource(R.string.profile_owner_is_restricted), modifier = Modifier.padding(start = 15.dp)) }
|
||||
if(context.isProfileOwner && (VERSION.SDK_INT < 24 || (VERSION.SDK_INT >= 24 && dpm.isManagedProfile(receiver)))) {
|
||||
Text(text = stringResource(R.string.some_features_invalid_in_work_profile), modifier = Modifier.padding(start = 15.dp))
|
||||
}
|
||||
Spacer(Modifier.padding(vertical = 2.dp))
|
||||
@@ -193,7 +193,7 @@ private fun UserRestrictionItem(
|
||||
val receiver = context.getReceiver()
|
||||
SwitchItem(
|
||||
itemName,restrictionDescription,leadIcon,
|
||||
{ if(dpm.isDeviceOwner(context)||dpm.isProfileOwner(context)) { dpm.getUserRestrictions(receiver).getBoolean(restriction) }else{ false } },
|
||||
{ if(context.isDeviceOwner||context.isProfileOwner) { dpm.getUserRestrictions(receiver).getBoolean(restriction) }else{ false } },
|
||||
{
|
||||
try{
|
||||
if(it) {
|
||||
@@ -202,12 +202,12 @@ private fun UserRestrictionItem(
|
||||
dpm.clearUserRestriction(receiver,restriction)
|
||||
}
|
||||
}catch(e:SecurityException) {
|
||||
if(dpm.isProfileOwner(context)) {
|
||||
if(context.isProfileOwner) {
|
||||
Toast.makeText(context, R.string.require_device_owner, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
},
|
||||
dpm.isDeviceOwner(context)||dpm.isProfileOwner(context)
|
||||
context.isDeviceOwner||context.isProfileOwner
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -99,9 +99,11 @@
|
||||
<string name="onDisabled">OwnDroid: Devre Dışı</string>
|
||||
<string name="create_work_profile_success">OwnDroid: İş Profili Başarıyla Oluşturuldu</string>
|
||||
|
||||
<!--Dhizuku-->
|
||||
<string name="permission_not_granted">Permission not granted</string> <!--TODO-->
|
||||
<string name="failed_to_init_dhizuku">Failed to initialize Dhizuku</string> <!--TODO-->
|
||||
<!--Dhizuku--> <!--TODO-->
|
||||
<string name="failed_to_init_dhizuku">Failed to initialize Dhizuku</string>
|
||||
<string name="dhizuku_permission_not_granted">Dhizuku permission not granted</string>
|
||||
<string name="dhizuku_mode_disabled">Dhizuku mode disabled</string>
|
||||
|
||||
<!--Shizuku-->
|
||||
<string name="check_shizuku">İzni Kontrol Et</string>
|
||||
<string name="list_owners">Sahipleri Listele</string>
|
||||
|
||||
@@ -95,8 +95,10 @@
|
||||
<string name="create_work_profile_success">OwnDroid:创建工作资料成功</string>
|
||||
|
||||
<!--Dhizuku-->
|
||||
<string name="permission_not_granted">未授权</string>
|
||||
<string name="failed_to_init_dhizuku">Dhizuku初始化失败</string>
|
||||
<string name="dhizuku_permission_not_granted">Dhizuku未授权</string>
|
||||
<string name="dhizuku_mode_disabled">Dhizuku模式已禁用</string>
|
||||
|
||||
<!--Shizuku-->
|
||||
<string name="check_shizuku">检查Shizuku</string>
|
||||
<string name="list_owners">列出Owners</string>
|
||||
|
||||
@@ -103,8 +103,9 @@
|
||||
|
||||
<!--Dhizuku-->
|
||||
<string name="dhizuku" translatable="false">Dhizuku</string>
|
||||
<string name="permission_not_granted">Permission not granted</string>
|
||||
<string name="failed_to_init_dhizuku">Failed to initialize Dhizuku</string>
|
||||
<string name="dhizuku_permission_not_granted">Dhizuku permission not granted</string>
|
||||
<string name="dhizuku_mode_disabled">Dhizuku mode disabled</string>
|
||||
<!--Shizuku-->
|
||||
<string name="shizuku" translatable="false">Shizuku</string>
|
||||
<string name="check_shizuku">Check permission</string>
|
||||
|
||||
Reference in New Issue
Block a user