summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com
AgeCommit message (Collapse)Author
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>
2018-01-10QuickTileService: sometimes tile is nullJason A. Donenfeld
According to play store reports, such as: wt88047, 0MB RAM, Android 8.1 java.lang.NullPointerException: at com.wireguard.android.QuickTileService.updateTile (QuickTileService.java:97) at com.wireguard.android.QuickTileService.onStartListening (QuickTileService.java:56) at android.service.quicksettings.TileService$H.handleMessage (TileService.java:407) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:164) at android.app.ActivityThread.main (ActivityThread.java:6520) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:442) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09WgQuickBackend: Finish the implementationSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09model: Chain completions to avoid race conditionsSamuel Holland
Otherwise getConfigAsync().thenCompose(x -> setState()) would be unsafe. This reverts commit a6595a273afd50524cc66765c6bfbdcc34cb12e4. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09global: Clean up error loggingSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09WgQuickBackend: Log when tunnels can't be enumeratedSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09RootShell: Improve shell start error handlingSamuel Holland
No need to catch and re-throw exceptions before starting the process. If running `su` itself fails, there's no (functional) root, so report that. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09RootShell: Be stricter about command delimitersSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09RootShell: stop if we can't startJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09RootShell: hoist out synchronizationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09ToolsInstaller: Propagate NoRootException properlySamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09RootShell: Simplify, synchronize, clean upSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09TunnelListFragment: Remove useless keywordSamuel Holland
final doesn't do anything in try-with-resources (it's always final). Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09ToolsInstaller: terminators are better than seperatorsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09RootShell: synchronize accesses to single shellJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08RootShell: Simplify constructorSamuel Holland
ToolsInstaller now takes care of installing the tools. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08WgQuickBackend: Ensure tools are available before useSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToolsInstaller: Add a method to ensure tool availabilitySamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08WgQuickBackend: Inline resolveState()Samuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToolsInstaller: Add methods to check/make symlinksSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToolsInstallerPreference: Examine current state on loadSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToolsInstaller: Add method to check installation statusSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08TunnelEditorFragment: Fix dismissing creator activitySamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08global: Fix or suppress most lints/warningsSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08project: Remove currently-unused librarySamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08Fragment/Tile: Make success/error messages translatableSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-09TunnelListFragment: fix plural grammarJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08RootShell: fix off by oneJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08QuickTileService: show toast for longer and use right messagesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08global: Prefix tags with WireGuard/Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08RootShell: multiplex commandsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08Port over remaining error handlingSamuel Holland
This doesn't really belong here, but there's no sense in throwing it away--even here, it's a minor optimization. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08Handle tunnel state change errors appropriatelySamuel Holland
This class should probably be renamed and moved, but I don't know to what or where. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08TunnelListFragment: Fix crash on deleting multiple tunnelsSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToggleSwitch: Improve reliabilitySamuel Holland
It's not great, but it's better than it was. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08WgQuickBackend: Improve error handlingSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08Tunnel: Add a State factory methodSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08project: Global cleanupSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08Application: Remove unneeded exported componentSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08ToolsInstaller: Extract to its own classesSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>