Commit Graph

29 Commits

Author SHA1 Message Date
Jason A. Donenfeld
d738161a2e Statistics: only do one hash lookup
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-21 11:16:33 +02:00
Jason A. Donenfeld
52c2e9cd24 TunnelManager: catch exception in intent receiver
java.lang.IllegalStateException:
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1720)
  at android.app.ContextImpl.startService (ContextImpl.java:1675)
  at android.content.ContextWrapper.startService (ContextWrapper.java:669)
  at com.wireguard.android.backend.GoBackend.startVpnService (GoBackend.java:4)
  at com.wireguard.android.backend.GoBackend.setStateInternal (GoBackend.java:4)
  at com.wireguard.android.backend.GoBackend.setState (GoBackend.java:2)
  at com.wireguard.android.model.TunnelManager$setTunnelState$2$1.invokeSuspend (TunnelManager.java:6)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:2)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:2)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.java:7)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.java:7)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.java:7)

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-21 10:54:07 +02:00
Harsh Shandilya
ff7d7e0edd tunnel: document more public API from backend package
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-16 18:01:06 +02:00
Jason A. Donenfeld
53adb0e9a6 Ed25519: use implementation from Tink
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-16 18:01:06 +02:00
Jason A. Donenfeld
f20d0f0659 gradle: desugar retrofuture and remove old deps
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-15 12:30:15 +02:00
Jason A. Donenfeld
8e2d63db75 tunnel: add windows-style killswitch semantics for GoBackend
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-05-04 02:30:44 -06:00
Harsh Shandilya
f3ac787f5a
ToolsInstaller: update Magisk directory
/data/adb/modules has been the location for modules since v18.0 and nobody
should reasonably be on any older version anymore. This has continued to
work for this long because Magisk created symlinks for backwards compat. However,
these symlinks are not created anymore on Android 11, which is where this
problem	first surfaced.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-23 01:40:50 +05:30
Jason A. Donenfeld
e424765a61 tunnel: support IncludedApplications as whitelist
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-05 20:04:51 -06:00
Harsh Shandilya
1ca4dbf1a2
tunnel: hold peers in an ArrayList
A set will cause identical peers to be dropped during save

Reported-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-06 01:22:44 +05:30
Jason A. Donenfeld
d74b988f75 global: cleanup code style
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-30 13:57:43 -06:00
Jason A. Donenfeld
456a74db05 global: hardcode tags so that minification doesn't ruin the log
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-28 23:21:12 -06:00
Jason A. Donenfeld
240e049e46 InetEndpoint: return proper parser exception
Wrapping this in something foreign doesn't make sense.

Reported-by: Luis Ressel <aranea@aixah.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-19 13:04:31 -06:00
Harsh Shandilya
093139bc91 tunnel: Add an initial set of unit tests
Includes a control set of broken configuration files that we attempt to parse and
verify that the parser fails in a predictable and consistent manner.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-14 10:32:12 +05:30
Harsh Shandilya
6c8a4a6a28 tunnel: Remove MISSING_VALUE from BadConfigException reasons
This is covered under SYNTAX_ERROR which feels like a reasonable choice,
so get rid of this unused field and associated resource string.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-14 10:25:57 +05:30
Jason A. Donenfeld
f5d2fd6190 config: show missing section error correctly
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-13 13:20:34 -06:00
Jason A. Donenfeld
86fc518585 tunnel: replace CompletableFuture with GhettoCompletableFuture
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-12 01:14:13 -06:00
Jason A. Donenfeld
56f2dcc073 tunnel: add javadoc support
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-11 00:29:18 -06:00
Jason A. Donenfeld
d4875afe31 tunnel: make use of @RestrictTo
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-10 22:12:16 +05:30
Jason A. Donenfeld
6b304391b5 global: java access control has important semantic meaning
It's not right to blindly follow all of AndroidStudio's suggestions,
especially for things in tunnel/ which comprise useful API.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-10 08:44:38 -06:00
Harsh Shandilya
8f85e4c88f tunnel: Codestyle cleanups
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-10 13:20:16 +05:30
Harsh Shandilya
a3b9c3b884 ui: Codestyle cleanups
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-10 13:08:28 +05:30
Jason A. Donenfeld
2e55e5fd05 global: format code
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 12:36:47 -06:00
Jason A. Donenfeld
40ebf8006e global: optimize imports
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 12:21:35 -06:00
Jason A. Donenfeld
8e8643122e global: get rid of nonnull gradle hack
Hacking things up via gradle is not right, and package-info.java poses
problems with two modules, so instead we just apply it manually to every
class.

Remember to add this to new classes!

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 12:19:15 -06:00
Jason A. Donenfeld
d62526fde6 WgQuickBackend: by default use single-tunnel mode like GoBackend, but add option
Note that this currently doesn't play well with people activating
wg-quick tunnels from outside the app. Those tunnels won't be
deactivated. But presumably that's desired behavior anyway, considering
people are mucking around at the command line.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 10:02:00 -06:00
Jason A. Donenfeld
056cf472d9 ModuleLoader: move to right project
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 09:07:48 -06:00
Jason A. Donenfeld
0c161cc0c2 AsyncWorker: move back to original location
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09 08:59:37 -06:00
Harsh Shandilya
7894894610 Use AndroidX Nullable annotation everywhere
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-09 19:24:27 +05:30
Harsh Shandilya
adc613d801 Migrate tunnel related classes to tunnel/ Gradle module
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-09 19:24:26 +05:30