summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java
AgeCommit message (Collapse)Author
2018-04-30ZipExporterPreference: Correctly get preference activityHarsh Shandilya
In AppCompat based preferences, this#getContext returns an object of android.view.ContextThemeWrapper class from where we can safely extract a reference to our parent activity. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30TunnelListFragment: Use Collections methods in place of ArraysHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30wg: Break out crossport dependencyHarsh Shandilya
Replace all crossport uses with upstream design support library components. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30SettingsActivity: Gracefully exit when options menu home is pressedHarsh Shandilya
This is an activity, so it does not join the fragment backstack, but instead piles on top SettingsActivity | -> MainActivity | -> EditorFragment | -> DetailFragment | -> ListFragment Without overriding the back button in the toolbar, it simply kills the entire state on MainActivity and causes it to reload. By calling finish() on the activity when home is pressed from the item menu we can silently make it die without affecting any underlying states held by MainActivity and instead return to the exact fragment we launched settings from. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30Prefer AppCompat classesHarsh Shandilya
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-30TunnelDetailFragment: rewrite and simplifyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-30TunnelEditorFragment: rewrite and simplifyJason A. Donenfeld
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-29Allow exporting to zip fileJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28Allow importing from zip fileJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28config: Minor cleanupHarsh Shandilya
- 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-28Quick cleanup across the boardHarsh Shandilya
- 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-28Use validation instead of two-way bindingJason A. Donenfeld
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-27Do not do DNS lookups for IPsJason A. Donenfeld
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-27Throw IllegalArgumentExceptions when arguments are badJason A. Donenfeld
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-26WgQuickBackend: always create configuration fileJason A. Donenfeld
It might be removed on an update. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-25GoBackend: bring down tunnels when revoked or disconnectedJason A. Donenfeld
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-25Curve25519: fix up spacingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-23Update application state based on wg-quickJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18Determine MTU automaticallyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18More javaficationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: default MTU is 1280Jason A. Donenfeld
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-17Remove sloppy java with enterprise java horrorsJason A. Donenfeld
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-17GoBackend: Handle vpn service expirationAurélien Chabot
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-17Config: Handle multiple address or dns in config fileAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: Add support for multiple address and dns as a comma separated listAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: parse allowed ipsAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: Parse the dns addressAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: IPv6 handlingAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: Resolve endpoint before passing it to the go libAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17GoBackend: Use the android VpnService to encapsulate the go backendAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-02-17GoBackend: integrate into appJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-02-13KeyEncoding: add constant time hex implementationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-18FileConfigStore: Warn for deletion failure in exception pathSamuel Holland
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-18WgQuickBackend: Always pass the full path to wg-quickSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-18fragments: Be extra paranoid about the binding getting destroyedSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17TunnelManager: Use constants directly where appropriateSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17Peer: Add missing @OverrideSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17WgQuickBackend: Clean up unused fields and importsSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-17ToolsInstaller: Remove double-checked lockingSamuel Holland
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-17RootShell: Use a lock object instead of sync methodsSamuel Holland
This avoids exposing the synchronization implementation details in the class's interface. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10ToolsInstaller: symlink tools alwaysJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10FileConfigStore: cleanup on rename problemJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10QuickTileService: Fix crash opening activitySamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10TunnelController: Use helper function to unwrap the ThrowableSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10model: Use ConfigStore.rename() to avoid recreating tunnelsSamuel Holland
Rename all of the functions to be in line with setConfig/setState Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10ConfigStore: Add a rename method and implement itSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09FileConfigStore: Simplify error handlingSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-10WgQuickBackend: properly report exception so alert showsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10Tunnel: ifname has max len 15Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-10TunnelEditorFragment: do not pass null localConfigJason A. Donenfeld
Otherwise we might dereference it, per this play store gathered trace: Xiaomi Redmi 3S (land), 2048MB RAM, Android 7.1 java.lang.NullPointerException: at com.wireguard.android.model.Tunnel.setConfig (Tunnel.java:118) at com.wireguard.android.fragment.TunnelEditorFragment.onOptionsItemSelected (TunnelEditorFragment.java:160) at android.app.Fragment.performOptionsItemSelected (Fragment.java:2478) at android.app.FragmentManagerImpl.dispatchOptionsItemSelected (FragmentManager.java:2182) at android.app.FragmentController.dispatchOptionsItemSelected (FragmentController.java:336) at android.app.Activity.onMenuItemSelected (Activity.java:3211) at com.android.internal.policy.PhoneWindow.onMenuItemSelected (PhoneWindow.java:1219) at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected (MenuBuilder.java:761) at com.android.internal.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:152) at com.android.internal.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:904) at com.android.internal.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:894) at android.widget.ActionMenuView.invokeItem (ActionMenuView.java:616) at com.android.internal.view.menu.ActionMenuItemView.onClick (ActionMenuItemView.java:152) at android.view.View.performClick (View.java:5637) at android.view.View$PerformClick.run (View.java:22433) at android.os.Handler.handleCallback (Handler.java:751) at android.os.Handler.dispatchMessage (Handler.java:95) at android.os.Looper.loop (Looper.java:153) at android.app.ActivityThread.main (ActivityThread.java:6244) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:891) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:781) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>