summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src
AgeCommit message (Collapse)Author
2023-09-27ui,tunnel: implement http proxy for Android 10+Mikael Magnusson
Allow getting package names of tv apps.
2023-09-27tunnel: add Error in libwg.protoMikael Magnusson
2023-09-27tunnel: add gRPC over unix domain socket to the go backendMikael Magnusson
With gRPC it will be easier to extend the go backend API. In this commit the Version function is reimplemented in gRPC. Gitignore generated protobuf files.
2023-09-27tunnel: add ConfigDetail and PeerDetailMikael Magnusson
2023-09-27ui,tunnel: auto-detect IPv6/IPv4 preferenceMikael Magnusson
Detect IP address change. Request non-VPN network. Update endpoint when needed. Unregister network on wgTurnOff and use IPv4 if network is not known.
2023-09-27ui,tunnel: add HTTP proxy setting to Go backendMikael Magnusson
Only make the HTTP proxy settings visible on supported Android versions, i.e. Android 10 (AKA Android Q) and later. Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2023-07-05tunnel: use record class where possibleJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-06-08tunnel: add quotes around calling packageJason A. Donenfeld
Judging by the previous check, this was clearly intended. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-06-06tunnel: account for recent magisk using UID in sqlJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-04-24tunnel: export latest handshake statJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-04-11tunnel: do not keep service running when bringing tunnel downJason A. Donenfeld
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>
2023-03-21global: bump copyright dateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-01-20gradle: migrate to namespace attributeHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2022-12-01ui: un-export VpnServiceHwanseung Lee
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>
2022-04-26ui: move target SDK to 31Shahzain Ali
Signed-off-by: Shahzain Ali <shahzainali93@gmail.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2022-02-09tunnel: fix BadConfigExceptionTestMichal Murin
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>
2022-01-21ToolsInstaller: set id=wireguard magisk module paramJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-29global: bump copyright yearJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-29tunnel: remove kernel module downloaderJason A. Donenfeld
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>
2021-09-25ui,tunnel: support DNS search domainsJason A. Donenfeld
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>
2021-05-26tunnel: retry DNS resolution for 10 secondsJason A. Donenfeld
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>
2021-05-07tunnel: download hash list in chunks if necessaryJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-05-06tunnel: avoid race between shutdown and statsJason A. Donenfeld
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>
2021-02-12tunnel: report git commit as wgVersionJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-10-27ToolsInstaller: unbreak cleanupJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-10-26tunnel: do not constantly raise toasts when process is opportunistically killedJason A. Donenfeld
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>
2020-10-20tunnel: clean up some docstring wordingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-21Statistics: only do one hash lookupJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-21TunnelManager: catch exception in intent receiverJason A. Donenfeld
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-16tunnel: document more public API from backend packageHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-16Ed25519: use implementation from TinkJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-09-15gradle: desugar retrofuture and remove old depsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-05-04tunnel: add windows-style killswitch semantics for GoBackendJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-23ToolsInstaller: update Magisk directoryHarsh Shandilya
/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-05tunnel: support IncludedApplications as whitelistJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-06tunnel: hold peers in an ArrayListHarsh Shandilya
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-03-30global: cleanup code styleJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-28global: hardcode tags so that minification doesn't ruin the logJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-19InetEndpoint: return proper parser exceptionJason A. Donenfeld
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-14tunnel: Add an initial set of unit testsHarsh Shandilya
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-14tunnel: Remove MISSING_VALUE from BadConfigException reasonsHarsh Shandilya
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-13config: show missing section error correctlyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-12tunnel: replace CompletableFuture with GhettoCompletableFutureJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-11tunnel: add javadoc supportJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-10tunnel: make use of @RestrictToJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-10global: java access control has important semantic meaningJason A. Donenfeld
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-10tunnel: Codestyle cleanupsHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-10ui: Codestyle cleanupsHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-09global: format codeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-09global: optimize importsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>