aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: update copyright noticesJason A. Donenfeld2025-05-1926-26/+26
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: use record class where possibleJason A. Donenfeld2023-07-051-26/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add quotes around calling packageJason A. Donenfeld2023-06-081-1/+1
| | | | | | Judging by the previous check, this was clearly intended. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: account for recent magisk using UID in sqlJason A. Donenfeld2023-06-061-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: export latest handshake statJason A. Donenfeld2023-04-243-42/+74
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: do not keep service running when bringing tunnel downJason A. Donenfeld2023-04-111-0/+3
| | | | | | | | Doing so causes the process to restart when the activity is cleared, even when no tunnel is running. I fear this might also lead to the current flurry of DeadSystemExceptions. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2023-03-2126-26/+26
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* gradle: migrate to namespace attributeHarsh Shandilya2023-01-201-2/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: un-export VpnServiceHwanseung Lee2022-12-011-1/+1
| | | | | | | | | There is no reason to expose this service to external apps.[1] [1] https://developer.android.com/guide/topics/manifest/activity-element#exported Signed-off-by: Hwanseung Lee <hwanseung@chromium.org> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: move target SDK to 31Shahzain Ali2022-04-261-1/+2
| | | | | Signed-off-by: Shahzain Ali <shahzainali93@gmail.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* tunnel: fix BadConfigExceptionTestMichal Murin2022-02-091-1/+1
| | | | | | | | Fix the test by changing the DNS to a string with an invalid char in the `invalid-value.conf` test configuration file. Signed-off-by: Michal Murin <michal.murin@jamf.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ToolsInstaller: set id=wireguard magisk module paramJason A. Donenfeld2022-01-211-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright yearJason A. Donenfeld2021-10-2926-26/+26
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: remove kernel module downloaderJason A. Donenfeld2021-10-293-2723/+4
| | | | | | | | Nathan Chance dropped the ball repeatedly and never maintained this in a consistent way that anybody could use. With Android 12 out now, just drop it all together. A bummer, but I don't see much of a choice. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui,tunnel: support DNS search domainsJason A. Donenfeld2021-09-253-2/+49
| | | | | | | | wg-quick has supported this for a while, but not the config layer, and not the Go backend, so wire this all up. Requested-by: Alexis Geoffrey <alexis.geoffrey97@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: retry DNS resolution for 10 secondsJason A. Donenfeld2021-05-262-1/+23
| | | | | | | | | | This has several problems: 1) it blocks the main thread; 2) it doesn't distinguish between a permanent error and a transient one; 3) the 10 seconds is hard coded; 4) there's no way for the user to cancel it. We'll have to improve this. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: download hash list in chunks if necessaryJason A. Donenfeld2021-05-071-1/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: avoid race between shutdown and statsJason A. Donenfeld2021-05-061-5/+6
| | | | | | | | | | | | | | wgTurnOff can block for a while, in which case, calling getStatistics will use a stale handle and stale tunnel. Not only that, but wgGetConfig might return null, in which case string.split throws. java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null at com.wireguard.android.backend.GoBackend.getStatistics Reported-by: tomt@adslweb.co.uk Link: https://lists.zx2c4.com/pipermail/wireguard/2021-May/006709.html Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: report git commit as wgVersionJason A. Donenfeld2021-02-121-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ToolsInstaller: unbreak cleanupJason A. Donenfeld2020-10-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: do not constantly raise toasts when process is opportunistically killedJason A. Donenfeld2020-10-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | Modern Android likes to kill processes to free ram and resources. When kernel-mode WireGuard is in use, this is quite alright with us, since the app doesn't actually need to consume any resources at all in order for the tunnel to run. So, we want to allow and encourage this resource frugality. However, when the quick settings tile is being used or when the app is referenced otherwise, the app will occasionally be restarted, to, for example, repaint the quick settings tile. This is also fine, as the process winds up being short-lived again. But, since process initialization means asking for a new root shell in order to check on kernel-mode WireGuard, this means that Magisk raises a systemwide toast. On some phones, this happens each and every time that the notification shade is pulled down. It's not only annoying but it sometimes obscures other notifications that users want to see, prompting their pulling down of the notification shade in the first place. In order to get rid of this nuisance, just disable these notifications and extraneous logs, so that we don't clutter the system every time that the process is opportunistically killed and restarted. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: clean up some docstring wordingJason A. Donenfeld2020-10-203-3/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Statistics: only do one hash lookupJason A. Donenfeld2020-09-211-4/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: catch exception in intent receiverJason A. Donenfeld2020-09-211-7/+4
| | | | | | | | | | | | | | | | | | | 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>
* tunnel: document more public API from backend packageHarsh Shandilya2020-09-166-1/+174
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Ed25519: use implementation from TinkJason A. Donenfeld2020-09-163-22/+2513
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* gradle: desugar retrofuture and remove old depsJason A. Donenfeld2020-09-155-19/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add windows-style killswitch semantics for GoBackendJason A. Donenfeld2020-05-041-1/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ToolsInstaller: update Magisk directoryHarsh Shandilya2020-04-231-6/+6
| | | | | | | | | | /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>
* tunnel: support IncludedApplications as whitelistJason A. Donenfeld2020-04-053-0/+42
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: hold peers in an ArrayListHarsh Shandilya2020-04-061-3/+1
| | | | | | | 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>
* global: cleanup code styleJason A. Donenfeld2020-03-306-18/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: hardcode tags so that minification doesn't ruin the logJason A. Donenfeld2020-03-285-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* InetEndpoint: return proper parser exceptionJason A. Donenfeld2020-03-191-1/+1
| | | | | | | 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>
* tunnel: Add an initial set of unit testsHarsh Shandilya2020-03-1412-0/+302
| | | | | | | 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>
* tunnel: Remove MISSING_VALUE from BadConfigException reasonsHarsh Shandilya2020-03-141-1/+0
| | | | | | | 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>
* config: show missing section error correctlyJason A. Donenfeld2020-03-131-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: replace CompletableFuture with GhettoCompletableFutureJason A. Donenfeld2020-03-121-2/+33
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add javadoc supportJason A. Donenfeld2020-03-113-4/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: make use of @RestrictToJason A. Donenfeld2020-03-102-0/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: java access control has important semantic meaningJason A. Donenfeld2020-03-103-3/+3
| | | | | | | 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>
* tunnel: Codestyle cleanupsHarsh Shandilya2020-03-106-37/+33
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: Codestyle cleanupsHarsh Shandilya2020-03-101-3/+3
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: format codeJason A. Donenfeld2020-03-0911-184/+195
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: optimize importsJason A. Donenfeld2020-03-0915-44/+29
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: get rid of nonnull gradle hackJason A. Donenfeld2020-03-0924-0/+70
| | | | | | | | | | 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>
* WgQuickBackend: by default use single-tunnel mode like GoBackend, but add optionJason A. Donenfeld2020-03-091-3/+35
| | | | | | | | | 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>
* ModuleLoader: move to right projectJason A. Donenfeld2020-03-091-0/+186
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AsyncWorker: move back to original locationJason A. Donenfeld2020-03-091-63/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Use AndroidX Nullable annotation everywhereHarsh Shandilya2020-03-091-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>