mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
Fix unable to revoke dhizuku client permission
Add a new user restriction
This commit is contained in:
@@ -506,7 +506,7 @@ fun DhizukuServerSettingsScreen(onNavigateUp: () -> Unit) {
|
||||
sp.dhizukuServer = status
|
||||
}
|
||||
fun writeList() {
|
||||
file.writeText(Json.encodeToString(clients))
|
||||
file.writeText(Json.encodeToString(clients.toList()))
|
||||
}
|
||||
LaunchedEffect(Unit) {
|
||||
if (!file.exists()) file.writeText("[]")
|
||||
@@ -544,7 +544,10 @@ fun DhizukuServerSettingsScreen(onNavigateUp: () -> Unit) {
|
||||
)
|
||||
Text(info.loadLabel(pm).toString(), style = typography.titleLarge)
|
||||
}
|
||||
Switch(client.allow, { clients[index] = client.copy(allow = it) })
|
||||
Switch(client.allow, {
|
||||
clients[index] = client.copy(allow = it)
|
||||
writeList()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import android.net.Uri
|
||||
import android.os.Build.VERSION
|
||||
import android.os.HardwarePropertiesManager
|
||||
import android.os.UserManager
|
||||
import android.widget.Button
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
|
||||
@@ -219,7 +219,8 @@ object RestrictionData {
|
||||
Restriction(UserManager.DISALLOW_CONFIG_CELL_BROADCASTS, R.string.config_cell_broadcasts, R.drawable.cell_tower_fill0),
|
||||
Restriction(UserManager.DISALLOW_SMS, R.string.sms, R.drawable.sms_fill0),
|
||||
Restriction(UserManager.DISALLOW_OUTGOING_CALLS, R.string.outgoing_calls, R.drawable.phone_forwarded_fill0),
|
||||
Restriction(UserManager.DISALLOW_SIM_GLOBALLY, R.string.download_esim, R.drawable.sim_card_download_fill0)
|
||||
Restriction(UserManager.DISALLOW_SIM_GLOBALLY, R.string.download_esim, R.drawable.sim_card_download_fill0),
|
||||
Restriction(UserManager.DISALLOW_THREAD_NETWORK, R.string.thread_network, R.drawable.router_fill0, 36)
|
||||
)
|
||||
val connectivity = listOf(
|
||||
Restriction(UserManager.DISALLOW_BLUETOOTH, R.string.bluetooth, R.drawable.bluetooth_fill0, 26),
|
||||
|
||||
Reference in New Issue
Block a user