Making magic with the network stack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

411 lines
19 KiB

  1. # NetGuard
  2. # Edits in NetGuard Code
  3. The NetGuard code has been taken from https://github.com/M66B/NetGuard
  4. The compilation of the code was problematic and the problem was solved by modifiying the following lines of code in app --> Gradle Scripts --> build.gradle (Module :app)
  5. Add the following lines:
  6. storeFile file("my.keystore")
  7. storePassword "store_password"
  8. keyAlias "my_key_alias"
  9. keyPassword "key_password"
  10. and comment out the following lines:
  11. // def keystorePropertiesFile = rootProject.file("keystore.properties")
  12. // def keystoreProperties = new Properties()
  13. // keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  14. // storeFile file(keystoreProperties['storeFile'])
  15. // storePassword keystoreProperties['storePassword']
  16. // keyAlias keystoreProperties['keyAlias']
  17. // keyPassword keystoreProperties['keyPassword']
  18. # The readme file from this point onwards is the original readme file.
  19. *NetGuard* provides simple and advanced ways to block access to the internet - no root required.
  20. Applications and addresses can individually be allowed or denied access to your Wi-Fi and/or mobile connection.
  21. <br>
  22. **WARNING: there is an app in the Samsung Galaxy app store "*Play Music - MP3 Music player*"
  23. with the same package name as NetGuard, which will be installed as update without your confirmation.
  24. This app is probably malicious and was reported to Samsung on December 8, 2021.**
  25. <br>
  26. Blocking access to the internet can help:
  27. * reduce your data usage
  28. * save your battery
  29. * increase your privacy
  30. NetGuard is the first free and open source no-root firewall for Android.
  31. Features:
  32. * Simple to use
  33. * No root required
  34. * 100% open source
  35. * No calling home
  36. * No tracking or analytics
  37. * Actively developed and supported
  38. * Android 5.1 and later supported
  39. * IPv4/IPv6 TCP/UDP supported
  40. * Tethering supported
  41. * Optionally allow when screen on
  42. * Optionally block when roaming
  43. * Optionally block system applications
  44. * Optionally forward ports, also to external addresses (not available if installed from the Play store)
  45. * Optionally notify when an application accesses the internet
  46. * Optionally record network usage per application per address
  47. * Optionally [block ads using a hosts file](https://github.com/M66B/NetGuard/blob/master/ADBLOCKING.md) (not available if installed from the Play store)
  48. * Material design theme with light and dark theme
  49. PRO features:
  50. * Log all outgoing traffic; search and filter access attempts; export PCAP files to analyze traffic
  51. * Allow/block individual addresses per application
  52. * New application notifications; configure NetGuard directly from the notification
  53. * Display network speed graph in a status bar notification
  54. * Select from five additional themes in both light and dark version
  55. There is no other no-root firewall offering all these features.
  56. Requirements:
  57. * Android 5.1 or later
  58. * A [compatible device](#compatibility)
  59. Downloads:
  60. * [GitHub](https://github.com/M66B/NetGuard/releases)
  61. * [Google Play](https://play.google.com/store/apps/details?id=eu.faircode.netguard)
  62. Certificate fingerprints:
  63. * MD5: B6:4A:E8:08:1C:3C:9C:19:D6:9E:29:00:46:89:DA:73
  64. * SHA1: EF:46:F8:13:D2:C8:A0:64:D7:2C:93:6B:9B:96:D1:CC:CC:98:93:78
  65. * SHA256: E4:A2:60:A2:DC:E7:B7:AF:23:EE:91:9C:48:9E:15:FD:01:02:B9:3F:9E:7C:9D:82:B0:9C:0B:39:50:00:E4:D4
  66. Usage:
  67. * Enable the firewall using the switch in the action bar
  68. * Allow/deny Wi-Fi/mobile internet access using the icons along the right side of the application list
  69. You can use the settings menu to change from blacklist mode (allow all in *Settings* but block unwanted applications in list) to whitelist mode (block all in *Settings* but allow favorite applications in list).
  70. * Red/orange/yellow/amber = internet access denied
  71. * Teal/blue/purple/grey = internet access allowed
  72. <img src="https://raw.githubusercontent.com/M66B/NetGuard/master/screenshots/01-main.png" width="320" height="569" />
  73. <img src="https://raw.githubusercontent.com/M66B/NetGuard/master/screenshots/02-main-details.png" width="320" height="569" />
  74. <img src="https://raw.githubusercontent.com/M66B/NetGuard/master/screenshots/03-main-access.png" width="320" height="569" />
  75. <img src="https://raw.githubusercontent.com/M66B/NetGuard/master/screenshots/08-notifications.png" width="320" height="569" />
  76. For more screenshots, see [here](https://github.com/M66B/NetGuard/tree/master/screenshots).
  77. Compatibility
  78. -------------
  79. The only way to build a no-root firewall on Android is to use the Android VPN service.
  80. Android doesn't allow chaining of VPN services, so you cannot use NetGuard together with other VPN based applications.
  81. See also [this FAQ](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq2).
  82. NetGuard can be used on rooted devices too and even offers more features than most root firewalls.
  83. Some older Android versions, especially Samsung's Android versions, have a buggy VPN implementation,
  84. which results in Android refusing to start the VPN service in certain circumstances,
  85. like when there is no internet connectivity yet (when starting up your device)
  86. or when incorrectly requiring manual approval of the VPN service again (when starting up your device).
  87. NetGuard will try to workaround this and remove the error message when it succeeds, else you are out of luck.
  88. Some LineageOS versions have a broken Android VPN implementation, causing all traffic to be blocked,
  89. please see [this FAQ](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq51) for more information.
  90. NetGuard is not supported for apps installed in a [work profile](https://developer.android.com/work/managed-profiles),
  91. or in a [Secure Folder](https://www.samsung.com/uk/support/mobile-devices/what-is-the-secure-folder-and-how-do-i-use-it/) (Samsung),
  92. or as second instance (MIUI), or as Parallel app (OnePlus), or as Xiaomi dual app
  93. because the Android VPN service too often does not work correctly in this situation, which can't be fixed by NetGuard.
  94. Filtering mode cannot be used on [CopperheadOS](https://copperhead.co/android/).
  95. NetGuard will not work or crash when the package *com.android.vpndialogs* has been removed or otherwise is unavailable.
  96. Removing this package is possible with root permissions only.
  97. If you disable this package, you can enable it with this command again:
  98. ```
  99. adb shell pm enable --user 0 com.android.vpndialogs
  100. ```
  101. NetGuard is supported for phones and tablets only, so not for other device types like on a television or in a car.
  102. Android does not allow incoming connections (not the same as incoming traffic) and the Android VPN service has no support for this either.
  103. Therefore managing incoming connections for servers running on your device is not supported.
  104. Wi-Fi or IP calling will not work if your provider uses [IPsec](https://en.wikipedia.org/wiki/IPsec) to encrypt your phone calls, SMS messages and/or MMS messages,
  105. unless there was made an exception in NetGuard for your provider (currently for T-Mobile and Verizon).
  106. I am happy to add exceptions for other providers, but I need the [MCC](https://en.wikipedia.org/wiki/Mobile_country_code) codes, [MNC](https://en.wikipedia.org/wiki/MNC) codes and [IP address](https://en.wikipedia.org/wiki/IP_address) ranges your provider is using.
  107. As an alternative you can enable the option '*Disable on call*', which is available since version 2.113.
  108. <a name="FAQ"></a>
  109. Frequently Asked Questions (FAQ)
  110. --------------------------------
  111. <a name="FAQ0"></a>
  112. [**(0) How do I use NetGuard?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq0)
  113. <a name="FAQ1"></a>
  114. [**(1) Can NetGuard completely protect my privacy?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq1)
  115. <a name="FAQ2"></a>
  116. [**(2) Can I use another VPN application while using NetGuard?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq2)
  117. <a name="FAQ3"></a>
  118. [**(3) Can I use NetGuard on any Android version?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq3)
  119. <a name="FAQ4"></a>
  120. [**(4) Will NetGuard use extra battery power?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq4)
  121. <a name="FAQ6"></a>
  122. [**(6) Will NetGuard send my internet traffic to an external (VPN) server?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq6)
  123. <a name="FAQ7"></a>
  124. [**(7) Why are applications without internet permission shown?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq7)
  125. <a name="FAQ8"></a>
  126. [**(8) What do I need to enable for the Google Play™ store app to work?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq8)
  127. <a name="FAQ9"></a>
  128. [**(9) Why is the VPN service being restarted?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq9)
  129. <a name="FAQ10"></a>
  130. [**(10) Will you provide a Tasker plug-in?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq10)
  131. <a name="FAQ13"></a>
  132. [**(13) How can I remove the ongoing NetGuard entry in the notification screen?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq13)
  133. <a name="FAQ14"></a>
  134. [**(14) Why can't I select OK to approve the VPN connection request?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq14)
  135. <a name="FAQ15"></a>
  136. [**(15) Are F-Droid builds supported?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq15)
  137. <a name="FAQ16"></a>
  138. [**(16) Why are some applications shown dimmed?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq16)
  139. <a name="FAQ17"></a>
  140. [**(17) Why is NetGuard using so much memory?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq17)
  141. <a name="FAQ18"></a>
  142. [**(18) Why can't I find NetGuard in the Google Play™ store app?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq18)
  143. <a name="FAQ19"></a>
  144. [**(19) Why does application XYZ still have internet access?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq19)
  145. <a name="FAQ20"></a>
  146. [**(20) Can I Greenify/hibernate NetGuard?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq20)
  147. <a name="FAQ21"></a>
  148. [**(21) Does doze mode affect NetGuard?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq21)
  149. <a name="FAQ22"></a>
  150. [**(22) Can I tether (use the Android hotspot) / use Wi-Fi calling while using NetGuard?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq22)
  151. <a name="FAQ24"></a>
  152. [**(24) Can you remove the notification from the status bar?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq24)
  153. <a name="FAQ25"></a>
  154. [**(25) Can you add a 'select all'?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq25)
  155. <a name="FAQ27"></a>
  156. [**(27) How do I read the blocked traffic log?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq27)
  157. <a name="FAQ28"></a>
  158. [**(28) Why is Google connectivity services allowed internet access by default?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq28)
  159. <a name="FAQ29"></a>
  160. [**(29) Why do I get 'The item you requested is not available for purchase'?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq29)
  161. <a name="FAQ30"></a>
  162. [**(30) Can I also run AFWall+ on the same device?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq30)
  163. <a name="FAQ31"></a>
  164. [**(31) Why can some applications be configured as a group only?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq31)
  165. <a name="FAQ32"></a>
  166. [**(32) Why is the battery/network usage of NetGuard so high**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq32)
  167. <a name="FAQ33"></a>
  168. [**(33) Can you add profiles?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq33)
  169. <a name="FAQ34"></a>
  170. [**(34) Can you add the condition 'when on foreground'?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq34)
  171. <a name="FAQ35"></a>
  172. [**(35) Why does the VPN not start?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq35)
  173. <a name="FAQ36"></a>
  174. [**(36) Can you add PIN or password protection?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq36)
  175. <a name="FAQ37"></a>
  176. [**(37) Why are the pro features so expensive?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq37)
  177. <a name="FAQ38"></a>
  178. [**(38) Why did NetGuard stop running?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq38)
  179. <a name="FAQ39"></a>
  180. [**(39) How does a VPN based firewall differ from a iptables based firewall?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq39)
  181. <a name="FAQ40"></a>
  182. [**(40) Can you add schedules?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq40)
  183. <a name="FAQ41"></a>
  184. [**(41) Can you add wildcards?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq41)
  185. <a name="FAQ42"></a>
  186. [**(42) Why is permission ... needed?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq42)
  187. <a name="FAQ43"></a>
  188. [**(43) I get 'This app is causing your device to run slowly'**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq43)
  189. <a name="FAQ44"></a>
  190. [**(44) I don't get notifications on access**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq44)
  191. <a name="FAQ45"></a>
  192. [**(45) Does NetGuard handle incoming connections?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq45)
  193. <a name="FAQ46"></a>
  194. [**(46) Can I get a refund?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq46)
  195. <a name="FAQ47"></a>
  196. [**(47) Why are there in application advertisements?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq47)
  197. <a name="FAQ48"></a>
  198. [**(48) Why are some domain names blocked while they are set to be allowed?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq48)
  199. <a name="FAQ49"></a>
  200. [**(49) Does NetGuard encrypt my internet traffic / hide my IP address?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq49)
  201. <a name="FAQ50"></a>
  202. [**(50) Will NetGuard automatically start on boot?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq50)
  203. <a name="FAQ51"></a>
  204. [**(51) NetGuard blocks all internet traffic!**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq51)
  205. <a name="FAQ52"></a>
  206. [**(52) What is lockdown mode?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq52)
  207. <a name="FAQ53"></a>
  208. [**(53) The translation in my language is missing / incorrect / incomplete!**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq53)
  209. <a name="FAQ54"></a>
  210. [**(54) How to tunnel all TCP connections through the Tor network?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq54)
  211. <a name="FAQ55"></a>
  212. [**(55) Why does NetGuard connect to Amazon / ipinfo.io?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq55)
  213. <a name="FAQ56"></a>
  214. [**(56) NetGuard allows all internet traffic!**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq56)
  215. <a name="FAQ57"></a>
  216. [**(57) Why does NetGuard use so much data?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq57)
  217. <a name="FAQ58"></a>
  218. [**(58) Why does loading the application list take a long time?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq58)
  219. <a name="FAQ59"></a>
  220. [**(59) Can you help me restore my purchase?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq59)
  221. <a name="FAQ60"></a>
  222. [**(60) Why does IP (Wi-Fi) calling/SMS/MMS not work?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq60)
  223. <a name="FAQ61"></a>
  224. [**(61) Help, NetGuard crashed!**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq61)
  225. <a name="FAQ62"></a>
  226. [**(62) How can I solve 'There was a problem parsing the package' ?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq62)
  227. <a name="FAQ63"></a>
  228. [**(63) Why is all DNS traffic allowed?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq63)
  229. <a name="FAQ64"></a>
  230. [**(64) Can you add DNS over TLS?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq64)
  231. <a name="FAQ65"></a>
  232. [**(65) Why can NetGuard not block itself?**](https://github.com/M66B/NetGuard/blob/master/FAQ.md#user-content-faq65)
  233. Support
  234. -------
  235. For questions, feature requests and bug reports, please [use this XDA-Developers forum thread](http://forum.xda-developers.com/showthread.php?t=3233012).
  236. There is support on the latest version of NetGuard only.
  237. There is no support on things that are not directly related to NetGuard.
  238. There is no support on building and developing things by yourself.
  239. **NetGuard is supported for phones and tablets only, so not for other device types like on a television or in a car.**
  240. Contributing
  241. ------------
  242. *Building*
  243. Building is simple, if you install the right tools:
  244. * [Android Studio](http://developer.android.com/sdk/)
  245. * [Android NDK](http://developer.android.com/tools/sdk/ndk/)
  246. The native code is built as part of the Android Studio project.
  247. It is expected that you can solve build problems yourself, so there is no support on building.
  248. If you cannot build yourself, there are prebuilt versions of NetGuard available [here](https://github.com/M66B/NetGuard/releases).
  249. *Translating*
  250. * Translations to other languages are welcomed
  251. * You can translate online [here](https://crowdin.com/project/netguard/)
  252. * If your language is not listed, please send a message to marcel(plus)netguard(at)faircode(dot)eu
  253. * You can see the status of all translations [here](https://crowdin.com/project/netguard).
  254. Please note that by contributing you agree to the license below, including the copyright, without any additional terms or conditions.
  255. Attribution
  256. -----------
  257. NetGuard uses:
  258. * [Glide](https://bumptech.github.io/glide/)
  259. * [Android Support Library](https://developer.android.com/tools/support-library/)
  260. License
  261. -------
  262. [GNU General Public License version 3](http://www.gnu.org/licenses/gpl.txt)
  263. Copyright (c) 2015-2018 Marcel Bokhorst ([M66B](https://contact.faircode.eu/))
  264. All rights reserved
  265. This file is part of NetGuard.
  266. NetGuard is free software: you can redistribute it and/or modify
  267. it under the terms of the GNU General Public License as published by
  268. the Free Software Foundation, either version 3 of the License, or
  269. (at your discretion) any later version.
  270. NetGuard is distributed in the hope that it will be useful,
  271. but WITHOUT ANY WARRANTY; without even the implied warranty of
  272. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  273. GNU General Public License for more details.
  274. You should have received a copy of the GNU General Public License
  275. along with NetGuard. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
  276. Trademarks
  277. ----------
  278. *Android is a trademark of Google Inc. Google Play is a trademark of Google Inc*