From 13c2695e98fcaddf39056a54da36c60c8e5d34a0 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Thu, 15 Sep 2022 00:44:49 +0800 Subject: [PATCH] simplify denylist rm --- .../com/topjohnwu/magisk/ui/deny/DenyListRvItem.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/deny/DenyListRvItem.kt b/app/src/main/java/com/topjohnwu/magisk/ui/deny/DenyListRvItem.kt index 678734cea..512ff6d02 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/deny/DenyListRvItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/deny/DenyListRvItem.kt @@ -44,9 +44,18 @@ class DenyListRvItem( processes .filterNot { it.isEnabled } .filter { isExpanded || it.defaultSelection } + .forEach { it.toggle() } } else { - processes.filter { it.isEnabled } - }.forEach { it.toggle() } + Shell.cmd("magisk --denylist rm ${info.packageName}").submit() + processes.filter { it.isEnabled }.forEach { + if (it.process.isIsolated) { + it.toggle() + } else { + it.isEnabled = !it.isEnabled + notifyPropertyChanged(BR.enabled) + } + } + } } init {