• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[5.0+][ROOT][3.5.2] AFWall+ IPTables Firewall [16 May 2021]

Search This thread

temporarium

Senior Member
Does Afwall drain battery?

Before using afwall, i got 3-5 percent drain.
After installed afwall, almost 15-18 percent drain overnight.

Any suggestions? Im on miui 12.5. Redmi xiaomi
It's probably your MIUI persistently trying to phone home 😁

Check your battery stats to see what app is causing that. You may have to disable/freeze some of the bloatware that comes with MIUI or switch to a custom ROM.
 

Trovies

Senior Member
Nov 8, 2016
97
2
It's probably your MIUI persistently trying to phone home 😁

Check your battery stats to see what app is causing that. You may have to disable/freeze some of the bloatware that comes with MIUI or switch to a custom ROM.

I did delete some bloatware. And block some from connect to internet, but it drains battery. But this only happen after i use Afwall.

After googling, some users recommend to turn off miui optimization. I will try that tonight.
 

IronTechmonkey

Recognized Contributor
Feb 12, 2013
8,005
11,766
Does Afwall drain battery?

Before using afwall, i got 3-5 percent drain.
After installed afwall, almost 15-18 percent drain overnight.

Any suggestions? Im on miui 12.5. Redmi xiaomi

In the past I've seen Google services cause battery drain when blocked but that was some time ago and these things vary a lot across different Android versions and ROMS. You might want to track the source of the battery drain with the native battery information from the ROM or with an app such as Better Battery Stats.
 
  • Like
Reactions: zputnyq

Trovies

Senior Member
Nov 8, 2016
97
2
In the past I've seen Google services cause battery drain when blocked but that was some time ago and these things vary a lot across different Android versions and ROMS. You might want to track the source of the battery drain with the native battery information from the ROM or with an app such as Better Battery Stats.
i turn off miui optimization , and seems to work. it reduces overnight drain.

now i have an issue with one payment app (not banking app).
whenever i do payment, it always fails due to security reason. i have to turn off Afwall and use the app and then turn on afwall again.

is there something else i need to allow in Afwall so that the app can work with afwall?
 

temporarium

Senior Member
i turn off miui optimization , and seems to work. it reduces overnight drain.

now i have an issue with one payment app (not banking app).
whenever i do payment, it always fails due to security reason. i have to turn off Afwall and use the app and then turn on afwall again.

is there something else i need to allow in Afwall so that the app can work with afwall?
Enable and check the AFWall+ log to see what's being blocked when you try to use the app. That might give you an indication.
 
  • Like
Reactions: IronTechmonkey

ukanth

Recognized Developer
Nov 30, 2010
1,528
5,271
Nexus 7 (2013)
OnePlus X
Does Afwall drain battery?

Before using afwall, i got 3-5 percent drain.
After installed afwall, almost 15-18 percent drain overnight.

Any suggestions? Im on miui 12.5. Redmi xiaomi
Typically it should not drain battery until something is going wrong. Can you share more details please (configuration/setup etc.,)
 

EEngineer

Senior Member
Oct 20, 2011
921
164
USA
T-Mobile LG G5
Does Afwall drain battery?

Before using afwall, i got 3-5 percent drain.
After installed afwall, almost 15-18 percent drain overnight.

Any suggestions? Im on miui 12.5. Redmi xiaomi
AFWall+ never a battery drain on my devices. This might seem counter-intuitive, but makes sure AFWall+ is not battery optimized in Settings.

Also, USE the app, block all internet access for flashlights, note takers, cameras, etc. that have no excuse for accessing the internet. Then watch your battery life improve.
 
  • Like
Reactions: Trovies and TiTiB

temporarium

Senior Member
I'd like to ask what ad blockers are many of you using with AFWall+? I'm wondering if there are any compatibility issues with AFWall+ and ad blockers, especially those ad blockers that modify iptables.
AdAway works splendidly on rooted devices It modifies the hosts file, not iptables
 

RyLoS2000

Member
Mar 12, 2009
47
1
Currently all I want to do is to port forward all incoming ports to my router with USB tethering, I'm not able to find a working script solution to make it work. Any suggestions?
Thanks in advance
 

EEngineer

Senior Member
Oct 20, 2011
921
164
USA
T-Mobile LG G5
Despite being blocked by AFWall+, occasionally Google Play still used to notify me of app updates and even worse I could access Play Store, again despite Play Services & Store being blocked by AFWall+.

So in LOS PrivacyGuard I disabled Modify Systems Settings for both packages. So far, no more successful network access. I do see from time to time Store or Services trying to access the internet. AFWall+ logging notifies me of this. Oddly, whenever Google Play Services/Store attempts to access the network I also see AFWall+ reapplying rules.
 
  • Like
Reactions: TiTiB

x-pve

Member
Aug 30, 2020
20
11
Prague
android.permission.READ_LOGS missing?
It's well known on some (most?) devices standard LOG doesn't work even packets are logged (see https://forum.xda-developers.com/t/...ll-16-may-2021.1957231/page-314#post-85485295 )
Maybe Afwall can't read logs because of missing android.permission.READ_LOGS ?
I tried:
Code:
pm grant dev.ukanth.ufirewall android.permission.READ_LOGS
but unsuccessfully:
Code:
java.lang.SecurityException: Package dev.ukanth.ufirewall has not requested permission android.permission.READ_LOGS
Maybe adding READ_LOGS to manifest can help?
 

ukanth

Recognized Developer
Nov 30, 2010
1,528
5,271
Nexus 7 (2013)
OnePlus X
Hello. I have a question, i'm using LSPosed with AFWall right now, my question is, how to use AFWall with LSPosed, what to check inside LSPosed module app? Can someone enlighten me? Thank you.
I did not add support for LSPosed. Also going forward, xposed module will be independent and not to be part of AFWall+ itself.
 

markd89

Senior Member
Jul 26, 2007
121
24
Hi, I have used AFWall+ for years (and Donated).

I have a new phone. Lineage OS 18.1 no GAPPS, rooted LSPOSED. All is working. AFWall 3.5.2 is working. On the old phone, I used 3.3.1.

I have custom scripts which I have used on another phone. However when I try to apply the firewall I get error applying iptables rules.

The scripts are in /data/local and I can execute them without error in the terminal.

The only additional clue I have is that I had to use #!/system/bin/sh instead of Bash or I would get errors running the script in the terminal. On my old phone I used Bash.

I tried various combinations of iptables binaries and BusyBox binaries but still no luck.

What am missing?

Thanks!
Mark
 

EEngineer

Senior Member
Oct 20, 2011
921
164
USA
T-Mobile LG G5
AFWall+ has it's own bulit-in BusyBox, but in Preferences > Binaries there is the option to use my system BusyBox.

Is there any advantage or disadvantage to one or the other? Isn't AFWall+ more secure using it's own built-in BusyBox?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    I am using the build-in VPN with IPsec XAUTH PSK to communicate with my FritzBox Modem/Router. In fact I just want to access all services as I would be at home, especially my mediathek and live TV apps (Zapp, MTCast, ZDF mediathek ....).
    And I do have the AFWall. Without that it seems I don't have problems. But with active AFWall it is strange.
    As stated before I use for rules LAN, WIFI and 4G. LAN only for apps that should be controlled inside my network (as Heater, who don't have to access to outer world).
    For a comparison I set my terminal so that I can ping the address and than used same setting for my TV app. But that doesn't work.
    First and most important question: Do I need the VPN setting in AFWall if I don't want other rules than lets say WIFI?
    What happens If I once set rules in VPN setting and disabled that again? Does the rules keep active and will just not displayed?
    As far as I'm aware, in Android VPN is global. So once you establish a VPN connection, everything has to go through it.

    In AFWall+, you need to enable your VPN app for wifi or mobile access, and you need to enable the apps for VPN access that you want to be able to connect through the tunnel, regardless of how the tunnel is connected.
    2
    Afwall Xposed module, what is it exactly for? If I use LSPosed, to what apps should I appy this module?
    @ukanth statement here might be of useto you. No timeline, but...
    2
    It depends :), why do you use VPN and how routing table is configured and what do you want to reach.
    Do you want to access your home computer? Do you want access internet from your mobile device via your home router? Which VPN software do you use and what is your goal? I use VPN, bit can't aswer your question yet. Describe more your situation.
    1
    I would expect that those modules have something to do with issues with tethering such as an unknown app /service being blocked therefore requiring firewall be disabled in order to tether, eg the modules might be required to help tethering function at all. I could be wrong and there are more knowledgeable people here that might be able to speak to this but I don't think a hack to circumvent service provider limits would go over well at Playstore. No moral judgement, I just think it might not be worth the risk for an app to allow that. Let's see what others and the developer have to say.
    I totally understand what you are saying.

    I would think it shouldn't be much of a risk because the NetShare app allows tether limit circumvention and it is still in the playstore with 1M+ downloads.
    1
    If the developer sends me the apk, I guess I can't update it via f-droid, right?
    Then I would have to manually check for updates because there is no auto update checker/reminder?
    No, these are two different apks.
    You can install the main apk from F-Droid and get it updated from there. For the paid version you receive a second apk (AFWall+ Unlock Key) from the developer which turns your installed apk into the donation version.
  • 386
    Welcome to official support page for AFWall+

    Disclaimer - As Usual. I'll not take any responsible if something goes wrong when using AFWall+

    Introduction
    AFWall+ is an improved version of DroidWall(front-end application for the powerful iptables Linux firewall). It allows you to restrict which applications are permitted to access your data networks (2G/3G/4G/LTE and/or Wi-Fi and while in roaming).Since the original author of Droidwall
    discontinued the project, I decided to keep the app instead of Avast Firewall. I'll continue to add more features as I can.


    Features
    - Supports 5.x to 11.x
    - Import/Export Rules to external storage
    - Search Applications
    - Multiple Profiles with custom names
    - Tasker/Locale support
    - Select All/None/Invert/Clear applications with single click
    - Revamped Rules/Logs Viewer with copy/export to external storage
    - Ability to view the network interfaces
    - Highlight system applications with custom color
    - Notify on new installations
    - Ability to hide application icons( faster loading )
    - Use LockPattern for application protection.
    - Show/Hide application ID.
    - Roaming Control for 3G/Edge
    - VPN Control
    - LAN Control
    - Tether Control
    - IPV6 Control
    - Tor Control
    - Choose able languages
    - Choose able iptables/busybox binary
    - Supports MIPS/x86/ARM
    - DNS Hostname

    Changelog - See third Post
    Current Version - 3.5.2

    To get Unlocker without Google services - Please follow the instructions here

    AFWall+ BETA Program
    1) AFWall+ opt-in for beta program
    2) Install AFWall+ and If you have any issues, just send email from (Menu -> Firewall Rules - > Send error report)

    Source Code/Wiki/FAQ
    AFWall+ is an free & opensource application
    Github
    Log an issue
    Frequently Asked Questions
    Many Thanks to @CHEF-KOCH

    Translations
    Translations - Please help me with translations in your language.
    http://crowdin.net/project/afwall

    Thanks To/Credits
    - German translations by [email protected] & [email protected] & [email protected]
    - French translations by [email protected] & [email protected]
    - Russian translations by [email protected] & YaroslavKa78
    - Spanish translations by [email protected]
    - Dutch translations by [email protected]
    - Japanese translation by [email protected]
    - Ukrainian translation by [email protected]
    - Slovenian translation by bunga [email protected]
    - Chinese Simplified translation by [email protected]
    - Polish translations by tst,Piotr [email protected]
    - Swedish translations by [email protected]
    - Greek Translations by [email protected]
    - Portuguese translations by [email protected]
    - Chinese Traditional by [email protected]
    - Chinese Simplified by wuwufei,tianchaoren @ crowdin
    - Italian translations by [email protected]
    - Romanian tranlations by [email protected]
    - Czech translations by Syk3s

    Cheers,
    ukanth

    XDA:DevDB Information
    AFWall+ [ IPTables Firewall ], App for the Android General

    Contributors
    ukanth
    Source Code: https://github.com/ukanth/afwall


    Version Information
    Status:
    Stable
    Current Stable Version: 3.4.0
    Stable Release Date: 2020-02-09
    Current Beta Version: 3.5.0-BETA1
    Beta Release Date: 2020-09-05

    Created 2013-12-03
    Last Updated 2020-09-05
    70
    Version 3.0.1

    * Fix: Status toggle widget 1x1
    * Fix: Ability to hide ongoing notification (Stop firewall and restart to hide after disable it in preferences)
    * Fix: Firewall error notification on oreo and above
    * Security: Tile toggle checks for password
    * User reported crashes
    * Updated translations

    Previous version 3.0.0

    Features:
    * Better support for nougat/oreo and pie.
    * Firewall toggle tile
    * Adaptive Icons
    * Notification channels
    * Tor support

    Bugs:
    * General bug fixes and crash reports.
    * Language selection bug
    * Filter selection bug
    * Compatible with magisk 17.x
    * Better handling of background process
    * Drops support for 4.x devices
    * Update languages
    * Updated libraries

    Complete Changelog

    41
    Hello All,

    After careful analysis and testing, I decided not to rewrite the way rules are being applied due to lot of under hood changes required. Instead added few enhancements. Now applying rules from menu will show how many rules are getting applied with progress status. Also when adding/removing few rules , it will apply only those related rules instead of full apply.

    Also fixed couple of bugs and enhancements. You can get the full changelog from https://github.com/ukanth/afwall/blob/beta/Changelog.md

    This is BETA Version which is not released on playstore. I have been using this for past week and it's stable. But there might be bugs which I haven't encountered. Please test it and report it in case of any issues.

    Also I have been following XPrivacy thread on the decision by it's author. Just as FYI, I might fix it for my own usage when I update to nougat, I will share it here if anybody uses it here.

    BETA Link - https://www.dropbox.com/s/isvi413qyx6vb4d/AFWall+ 2.9.7-BETA-TESTER.apk?dl=0
    40
    Hello everyone,

    I have released 3.0.0 stable on playstore today. It's been a crazy month so far. After going through lot of dilemma of whether to support the existing afwall or write a new one from scratch, finally able to pull myself and release stable version of afwall with lots of bug fixes and new features along with pie support. Since I don't do full time Android development, it was hard to keep track of what's going on with sdk level changes.

    Thank you all for your support in AFWall+ development. Without your support it would simply not possible to pull through this.

    I will be out for couple of days ( taking off to spend time with my family ) and hopefully will be able to reply to questions once back.

    Thanks again and have a great day.
    35
    Hello everyone,

    I have released stable version of 3.1.0 to playstore and github. Its live on playstore. You can find the changelog along with md5/sha here

    https://github.com/ukanth/afwall/releases/tag/v3.1.0

    Thank you all for your continuous support in AFWall+ development.