Harsh Shandilya
e7e571a301
wg: Migrate menu visibility to AppCompat
...
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30 17:30:24 +05:30
Harsh Shandilya
425d194e4f
wg: Add and use dummy AppTheme
...
Preparation for when the app will start carrying
colors reflecting the WireGuard brand.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30 17:30:24 +05:30
Harsh Shandilya
4ec0b3a908
Prefer AppCompat classes
...
AppCompat is the preferred way to go for any app targetting
a wider range of SDKs.
Replace all activities and fragments with their AppCompat
variants and fixup method calls to use support variants.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30 17:30:24 +05:30
Jason A. Donenfeld
596904977a
TunnelDetailFragment: rewrite and simplify
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-30 05:29:54 +02:00
Jason A. Donenfeld
73b0c4ea81
TunnelEditorFragment: rewrite and simplify
...
This should remove some null pointer dereferences and overall make the
thing more robust.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-30 05:29:54 +02:00
Jason A. Donenfeld
622f41f11f
Allow exporting to zip file
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-29 07:53:56 +02:00
Jason A. Donenfeld
f4e462fabd
Allow importing from zip file
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28 21:55:42 +02:00
Harsh Shandilya
217ab5e17f
config: Minor cleanup
...
- Stop implicitly assuming locales in String.format
- Cleanup method visibilities
- Improve uses of Integer methods
- Remove unused getToken method
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-28 06:07:48 +02:00
Harsh Shandilya
ba862b166b
Quick cleanup across the board
...
- Clean up imports
- Adjust method visibility
- Drop in NonNull annotations where needed
- Prevent potential NPEs from nulled getActivity calls
- Remove unused methods
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-28 06:07:48 +02:00
Jason A. Donenfeld
63071f57b7
Use validation instead of two-way binding
...
This is insane, but it appears to be working. We essentially store
things in a separate class for editing, and then commit it back at a
given time.
This business with onViewStateRestored in both TunnelEditorFragment and
in TunnelDetailFragment is buggy and likely wrong.
In general TunnelEditorFragment should probably be rewritten. The
relationship with the changed name is not clear.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28 04:51:43 +02:00
Jason A. Donenfeld
693228985d
Do not do DNS lookups for IPs
...
This involves reflection, which is a bummer, but it's better than doing
unnecessary DNS lookups.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-27 18:34:52 +02:00
Jason A. Donenfeld
9ee976823d
Throw IllegalArgumentExceptions when arguments are bad
...
This will make the two way data binding crash more, but it will improve
the robustness of the config file parser, which deals with exceptions
gracefully, and when we move to one way data binding, it will help with
that too.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-27 05:43:07 +02:00
Jason A. Donenfeld
31101f2418
WgQuickBackend: always create configuration file
...
It might be removed on an update.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-26 19:42:55 +02:00
Jason A. Donenfeld
8d2510ae9e
Manifest: disable always-on VPN
...
We don't actually comprehend how this works yet, so disable it. But
we'll need to add support for this at some point.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-26 02:25:55 +02:00
Jason A. Donenfeld
532edf774a
GoBackend: bring down tunnels when revoked or disconnected
...
This synchronizes the OS's connection state with ours, such as when the
user disconnects using the system UI.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-25 18:27:18 +02:00
Jason A. Donenfeld
2c9e11f4f2
Curve25519: fix up spacing
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-25 14:36:51 +02:00
Jason A. Donenfeld
88cf839c90
Update application state based on wg-quick
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-23 17:04:17 +02:00
Jason A. Donenfeld
80f22e6c3d
Determine MTU automatically
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18 16:44:05 +02:00
Jason A. Donenfeld
53d29b312f
More javafication
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18 05:28:31 +02:00
Jason A. Donenfeld
140fb395dc
GoBackend: default MTU is 1280
...
This sucks, but it works with mobile networks. Later we can do something
sophisticated like we do with wg-quick.c, but not now.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 05:59:23 +02:00
Jason A. Donenfeld
b5360871e8
Remove sloppy java with enterprise java horrors
...
Since the amount of mind numbing boiler plate has been increased, this
must be the proper way to do things.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 05:27:05 +02:00
Aurélien Chabot
4c9143c835
GoBackend: Handle vpn service expiration
...
After a timeout the android system is destroying the vpn service when it
is not used. By using a completable future we can wait for the service
to be relaunch on demand.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
74eae55c87
Config: Handle multiple address or dns in config file
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
44698bb000
GoBackend: Add support for multiple address and dns as a comma separated list
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
175f7e16dd
GoBackend: parse allowed ips
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
c6d311923a
GoBackend: Parse the dns address
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
6878aba911
GoBackend: IPv6 handling
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
d97312b96a
GoBackend: Resolve endpoint before passing it to the go lib
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Aurélien Chabot
9dfab4d60f
GoBackend: Use the android VpnService to encapsulate the go backend
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17 02:15:24 +02:00
Jason A. Donenfeld
0ea6f73332
GoBackend: integrate into app
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-02-17 21:14:09 +01:00
Jason A. Donenfeld
d1c863b16e
KeyEncoding: add constant time hex implementation
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-02-13 19:47:31 +01:00
Samuel Holland
b22e2b259b
manifest: Add permission to read external storage
...
This fixes support for file managers that don't proxy the file access
from the file selection dialog through a content provider, and just
return a raw file:// URL. In this case, resolver.openInputStream() tries
to open the file directly, and fails with "Permission denied".
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-02-03 12:47:14 -06:00
Samuel Holland
c683d23125
FileConfigStore: Warn for deletion failure in exception path
...
There's nothing we can do about it at this point; we're already rolling
back changes.
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-18 04:12:54 -06:00
Samuel Holland
23535c0577
WgQuickBackend: Always pass the full path to wg-quick
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-18 04:10:58 -06:00
Samuel Holland
8dde6c3c0f
fragments: Be extra paranoid about the binding getting destroyed
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-18 04:10:58 -06:00
Samuel Holland
54f201174d
TunnelManager: Use constants directly where appropriate
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17 14:35:39 -06:00
Samuel Holland
fb3138bdda
Peer: Add missing @Override
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17 14:35:39 -06:00
Samuel Holland
f63aeea6b8
WgQuickBackend: Clean up unused fields and imports
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17 14:35:39 -06:00
Samuel Holland
09c207b8a3
ToolsInstaller: Remove double-checked locking
...
It can't work and may be crashing the runtime.
Use a lock object to avoid exposing the synchronization in the class's
interface.
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17 14:35:39 -06:00
Samuel Holland
d56eda2fd6
RootShell: Use a lock object instead of sync methods
...
This avoids exposing the synchronization implementation details
in the class's interface.
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17 14:35:14 -06:00
Jason A. Donenfeld
c1cc2774be
Manifest: show back arrow on sub activities
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10 23:52:02 +01:00
Jason A. Donenfeld
7e06768f75
ToolsInstaller: symlink tools always
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10 23:47:13 +01:00
Jason A. Donenfeld
7a618c1463
FileConfigStore: cleanup on rename problem
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10 23:26:12 +01:00
Samuel Holland
f8ee7dcce9
QuickTileService: Fix crash opening activity
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10 11:13:16 -06:00
Samuel Holland
30901a6152
TunnelController: Use helper function to unwrap the Throwable
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10 00:03:45 -06:00
Samuel Holland
7b9c1a536c
model: Use ConfigStore.rename() to avoid recreating tunnels
...
Rename all of the functions to be in line with setConfig/setState
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10 00:03:03 -06:00
Samuel Holland
951afaa9b2
ConfigStore: Add a rename method and implement it
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10 00:01:52 -06:00
Samuel Holland
5ce7eba2bf
FileConfigStore: Simplify error handling
...
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09 23:57:15 -06:00
Jason A. Donenfeld
dfa4a2eb9d
WgQuickBackend: properly report exception so alert shows
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10 03:16:42 +01:00
Jason A. Donenfeld
df3062c7ad
Tunnel: ifname has max len 15
...
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10 02:49:06 +01:00