From 6e7f32d6d2060f68abbf9b86643bc56263d7f78f Mon Sep 17 00:00:00 2001 From: Muntashir Al-Islam Date: Mon, 22 Apr 2024 17:38:44 +0600 Subject: [PATCH] =?UTF-8?q?Disable=20=E2=80=9CIFW=E2=80=9D=20and=20?= =?UTF-8?q?=E2=80=9CIFW+Disable=E2=80=9D=20in=20the=20providers=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Rules settings, the description for “Default blocking method” is updated with a note that says IFW feature does not work with providers, “disable” is used instead. Signed-off-by: Muntashir Al-Islam --- .../AppManager/details/AppDetailsComponentsFragment.java | 9 ++++----- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/github/muntashirakon/AppManager/details/AppDetailsComponentsFragment.java b/app/src/main/java/io/github/muntashirakon/AppManager/details/AppDetailsComponentsFragment.java index 61b604cceb8..9eab9c5f84b 100644 --- a/app/src/main/java/io/github/muntashirakon/AppManager/details/AppDetailsComponentsFragment.java +++ b/app/src/main/java/io/github/muntashirakon/AppManager/details/AppDetailsComponentsFragment.java @@ -454,12 +454,11 @@ private void handleBlock(@NonNull ViewHolder holder, @NonNull AppDetailsComponen }); holder.toggleSwitch.setOnLongClickListener(v -> { PopupMenu popupMenu = new PopupMenu(activity, holder.toggleSwitch); + Menu menu = popupMenu.getMenu(); + boolean canBlockByIfw = !(item.mainItem instanceof ProviderInfo) && SelfPermissions.canBlockByIFW(); popupMenu.inflate(R.menu.fragment_app_details_components_selection_actions); - if (!SelfPermissions.canBlockByIFW()) { - Menu menu = popupMenu.getMenu(); - menu.findItem(R.id.action_ifw_and_disable).setEnabled(false); - menu.findItem(R.id.action_ifw).setEnabled(false); - } + menu.findItem(R.id.action_ifw_and_disable).setEnabled(canBlockByIfw); + menu.findItem(R.id.action_ifw).setEnabled(canBlockByIfw); popupMenu.setOnMenuItemClickListener(item1 -> { int id = item1.getItemId(); String componentStatus; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 065a9cadeb1..86a682e3381 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1122,7 +1122,7 @@ IFW + disable IFW Default blocking method - Method to use by default in places where there is no option to select a blocking method. + Method to use by default in places where there is no option to select a blocking method.\nNote: “IFW” does not work with providers, “disable” is used instead. Block components using Intent Firewall as well as disable them. Recommended method for root users. Block components using Intent Firewall only. Not recommended as some system apps can bypass firewalls. Disable components only. Not recommended for root users since the apps can bypass this. In ADB modes, the test-only apps can be disabled with this method.