mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 11:05:59 +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),
|
||||
|
||||
9
app/src/main/res/drawable/router_fill0.xml
Normal file
9
app/src/main/res/drawable/router_fill0.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:pathData="M200,840q-33,0 -56.5,-23.5T120,760v-160q0,-33 23.5,-56.5T200,520h400v-160h80v160h80q33,0 56.5,23.5T840,600v160q0,33 -23.5,56.5T760,840L200,840ZM200,760h560v-160L200,600v160ZM280,720q17,0 28.5,-11.5T320,680q0,-17 -11.5,-28.5T280,640q-17,0 -28.5,11.5T240,680q0,17 11.5,28.5T280,720ZM420,720q17,0 28.5,-11.5T460,680q0,-17 -11.5,-28.5T420,640q-17,0 -28.5,11.5T380,680q0,17 11.5,28.5T420,720ZM560,720q17,0 28.5,-11.5T600,680q0,-17 -11.5,-28.5T560,640q-17,0 -28.5,11.5T520,680q0,17 11.5,28.5T560,720ZM570,330 L512,272q26,-24 58,-38t70,-14q38,0 70,14t58,38l-58,58q-14,-14 -31.5,-22t-38.5,-8q-21,0 -38.5,8T570,330ZM470,230l-56,-56q44,-44 102,-69t124,-25q66,0 124,25t102,69l-56,56q-33,-33 -76.5,-51.5T640,160q-50,0 -93.5,18.5T470,230ZM200,760v-160,160Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
@@ -411,6 +411,7 @@
|
||||
<string name="sms">短信</string>
|
||||
<string name="outgoing_calls">拨出电话</string>
|
||||
<string name="download_esim">下载eSIM</string>
|
||||
<string name="thread_network">Thread网络</string>
|
||||
|
||||
<string name="bluetooth">蓝牙</string>
|
||||
<string name="bt_share">蓝牙分享</string>
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
<string name="sms">SMS</string>
|
||||
<string name="outgoing_calls">Outgoing calls</string>
|
||||
<string name="download_esim">Download eSIM</string>
|
||||
<string name="thread_network">Thread network</string>
|
||||
|
||||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="bt_share">Bluetooth sharing</string>
|
||||
|
||||
Reference in New Issue
Block a user