Rather than always toggle all elements, elect to unselect all if any are selected. This allows
returning to a clean state in at most two clicks.
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
- Using the require_() methods provides helpful error messages when things are null
compared to the get_() methods which throw NPEs.
- Ensure currentlyExcludedApps is empty but never null
- Rename inner variable to silence name shadowing lint
- Make setExclusionsAndDismiss private
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Change functionality in excluded apps dialog for better user experience
when user wants only one or few apps to use WireGuard.
Signed-off-by: Sébastien LEBEAU <sebcbi1@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
If this is to be JRE-only, then it doesn't make sense to rely on the
android class, especially since this is so trivial to inline.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
On Android 10, apps cannot start services when they're in the
background. This means that starting VpnService from within
QuickTileService when the app is not active ends badly. To mitigate this
situation, we introduce a proxy activity of sorts that will handle
starting VpnService for us. The activity is completely transparent and
invisible, and does only four things:
- Toggle the tunnel state
- Request the Tile bound by QuickTileService to refresh its state
- Handle any error that might have been thrown during toggle
- Call finishAffinity() and go away
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Revert "preferences: add donation link"
This reverts commit e5455f579aec48abb30ba68b0248b02d79303126.
The app was removed from the Play Store for violating their payments
policy. Upon filing an appeal, I was told that they do not allow
donations to projects like WireGuard.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ContextThemeWrapper#getContext seems to be an instance of ContextImpl now which
is not public API and also not what we want. Directly cast context as SettingsActivity
which seems to work exactly how we need this to.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
The old one didn't account for trailing digits.
Reported-by: Brandon Jackson <bjackson@napshome.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
People installing magisk modules are people capable of updating Magisk.
No need to leave around old compat cruft.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
restorecon probes file_contexts to get the context
to be applied to the file. /sbin/.magisk does not
exist in file_contexts for obvious reasons so restorecon
always fails. Use chcon directly with the system_file
context to allow contexts to be applied.
Suggested-by: Chris Renshaw <osm0sis@outlook.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>