Skip to content

Commit

Permalink
Disable “IFW” and “IFW+Disable” in the providers tab
Browse files Browse the repository at this point in the history
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 <muntashirakon@riseup.net>
  • Loading branch information
MuntashirAkon committed Apr 22, 2024
1 parent b6806be commit 6e7f32d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@
<string name="intent_firewall_and_disable">IFW + disable</string>
<string name="intent_firewall">IFW</string>
<string name="pref_default_blocking_method">Default blocking method</string>
<string name="pref_default_blocking_method_description">Method to use by default in places where there is no option to select a blocking method.</string>
<string name="pref_default_blocking_method_description">Method to use by default in places where there is no option to select a blocking method.\n<b>Note:</b> “IFW” does not work with providers, “disable” is used instead.</string>
<string name="pref_intent_firewall_and_disable_description">Block components using Intent Firewall as well as disable them. Recommended method for root users.</string>
<string name="pref_intent_firewall_description">Block components using Intent Firewall only. Not recommended as some system apps can bypass firewalls.</string>
<string name="pref_disable_description">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.</string>
Expand Down

0 comments on commit 6e7f32d

Please sign in to comment.