Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFWall sometimes fails to get root on connection change #779

Open
cb474 opened this issue Dec 4, 2017 · 10 comments
Open

AFWall sometimes fails to get root on connection change #779

cb474 opened this issue Dec 4, 2017 · 10 comments
Labels

Comments

@cb474
Copy link

cb474 commented Dec 4, 2017

I'm having a problem where sometimes AFWall is not granted root status and it fails to apply iptables rules. This is on a Pixel 2, rooted with Magisk. I don't know for sure if this is an AFWall issue or might be a Magisk issue. But Magisk is showing no errors in catlog and I have no problem with other root apps.

This seems to happen when I have a change in connection (e.g. from wifi to cell) and AFWall is reapplying the rules (I have the "Active rules" setting enabled in preferences). But it only happens somtimes, not on every connection change. I get a notification saying AFWall could not apply rules and when I open AFWall an error from AFWall saying that it was unable to get root and my device needs to be rooted. If I move AFWall out of the recents menu and restart it that solves the problem (I can then manually apply rules with success and other automatic applications of the rules on connection changes seem to work). Most of the time AFWall works fine.

Attached are some logs, captured right after this happened, from the system through Catlog.

The only clear errors I see there are from the AFWall entries in catlog:

E/AFWall (22459): libsuperuser error -2 on command 'iptables -P OUTPUT DROP'

and:

E/AFWall (21817): CONNECTIVITY_CHANGE: applySavedIptablesRules() returned an error

afwall.catlog.txt
magisk.catlog.txt

Perhaps my issue is the same as this one (but almost no information is provided there): #776

@TripodKnight
Copy link

I was the one that posted the issue you linked. I disabled Magisk Hide Root settings in Magisk and noticed I stopped getting the error on connection change. Once I enabled Magisk hide again I started getting the errors. So it seems it's related to the Magisk hide root function.

@cb474
Copy link
Author

cb474 commented Dec 13, 2017

Thanks for the suggestion. It's funny, because I seem to be having the issue less, even though neither Magisk nor Afwall have been updated. But I do occasionally have it in unpredictable ways.

I do have the Magisk hide toggle switch enabled in my settings, but I don't have the hiding function enabled for any apps. Disabling the toggle switch seems to just remove the tab for enabling hiding from specific apps. Do you know if it also does other things? Otherwise, I don't quite understand how it would effect the issue. But I'll try it and see.

It does seem like even if that resolves the issue, it is still unclear whether this is a Magisk bug or an AFWall bug.

@ildar
Copy link

ildar commented Dec 13, 2017 via email

@TripodKnight
Copy link

I know I used to only pass safety net checks with magisk hide turned on, although lately I haven't been able to get the safety net check to work so I can't confirm.

@accnetdev
Copy link

Hi all,

I have exactly the same issue : sometimes AFWall+ is not granted root status and it fails to apply iptables rules.

It occurs randomly (perhaps at connection changes, but not sure of it) on all my phones, which are all rooted using Magisk (version 14.0 or 15.3) and have all Magisk Hide enabled. Whatever the Android version (Marshmallow or Nougat) and ROM used : Resurrection Remix or OxygenOS, I get the same problem.

I will test now your suggestion : disabling Magisk Hide (that I don't need) and I'll be back here to confirm or not, that it fixes the issue.

@accnetdev
Copy link

Unfortunately disabling Magisk Hide does not fix the issue on my devices.
Is there another workaround to test ?

@ghost
Copy link

ghost commented Apr 2, 2018

Same issue here on LinageOS 14.1.
The only workaround for me is force closing the app in systemsettings and clear afwalls cache.

@MSe1969
Copy link

MSe1969 commented May 13, 2018

Having same issue with LineageOS and Lineage's Root solution, not using Magisk, since several weeks. So seems not related to Magisk

@wistein
Copy link

wistein commented Mar 9, 2019

Have this issue on a LG G2 mini (D620r) with LineageOS 14.1 when applying the same ruleset I am using on a LG G4 (H815) with LineageOS 14.1 where is works as expected. The configuration of Afwall+ is identical on both phones. When I reduce the rule set to a subset of the rejecting rules it works stable on the G2 mini, too. But this is an unsatisfying compromise in safety and privacy.

So maybe, this effect has to do with some sort of memory shortage or lesser processor performance.
It would be nice if this could be checked and corrected, if possible.

(No Magisk, just the LineageOS addonsu. No power management for Afwall+).

@ukanth ukanth added the Review label Mar 6, 2021
@selurvedu
Copy link

Same issue here on LinageOS 14.1. The only workaround for me is force closing the app in systemsettings and clear afwalls cache.

Thanks, this actually helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants