Commit Graph

140 Commits

Author SHA1 Message Date
Harsh Shandilya
e7e571a301 wg: Migrate menu visibility to AppCompat
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30 17:30:24 +05:30
Harsh Shandilya
425d194e4f wg: Add and use dummy AppTheme
Preparation for when the app will start carrying
colors reflecting the WireGuard brand.

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-30 17:30:24 +05:30
Jason A. Donenfeld
73b0c4ea81 TunnelEditorFragment: rewrite and simplify
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-30 05:29:54 +02:00
Jason A. Donenfeld
622f41f11f Allow exporting to zip file
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-29 07:53:56 +02:00
Jason A. Donenfeld
f4e462fabd Allow importing from zip file
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28 21:55:42 +02:00
Jason A. Donenfeld
63071f57b7 Use validation instead of two-way binding
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-28 04:51:43 +02:00
Jason A. Donenfeld
53d29b312f More javafication
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18 05:28:31 +02:00
Jason A. Donenfeld
b5360871e8 Remove sloppy java with enterprise java horrors
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-17 05:27:05 +02:00
Jason A. Donenfeld
0ea6f73332 GoBackend: integrate into app
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-02-17 21:14:09 +01:00
Samuel Holland
4f02817ef0 global: Fix or suppress most lints/warnings
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08 23:39:26 -06:00
Samuel Holland
710ffc7bb3 Fragment/Tile: Make success/error messages translatable
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08 20:30:03 -06:00
Jason A. Donenfeld
6361628e16 layout: never use suggestions
IP addresses and key material could be potentially sensitive. We also
don't want any interactions with the suggestive text APIs. So, we mark
it as both a visible password and we turn off suggestions. This will fix
the length limit, too, in Android 8.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-09 00:23:33 +01:00
Jason A. Donenfeld
5944efc13c QuickTileService: show toast for longer and use right messages
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08 20:30:25 +01:00
Jason A. Donenfeld
31ba7e6593 RootShell: multiplex commands
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-08 19:46:51 +01:00
Samuel Holland
c4e91f8040 Handle tunnel state change errors appropriately
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-08 04:33:54 -06:00
Samuel Holland
d645d69847 project: Global cleanup
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08 02:19:13 -06:00
Samuel Holland
08cca56388 ToolsInstaller: Extract to its own classes
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-08 00:34:55 -06:00
Samuel Holland
38b2aafce8 Remove primary configuration preference
It is no longer used.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-07 21:46:41 -06:00
Samuel Holland
0ab3e29432 Tunnel: Remove UNKNOWN state
It's never used.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-07 20:33:07 -06:00
Samuel Holland
4f2b6bef84 Keyed...: Rename all the things
Hooray for diamond interface inheritance.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 23:07:17 -06:00
Samuel Holland
4d38993832 project: Minor cleanups
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 22:14:10 -06:00
Samuel Holland
2206dfc432 TunnelDetailFragment: Allow copying peer public keys
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 05:18:34 -06:00
Samuel Holland
193de10972 TunnelDetailFragment: Remove state text and last change
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 05:18:34 -06:00
Samuel Holland
ff0bb081a0 Convert the list of tunnels to a KeyedObservableList
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 04:09:30 -06:00
Samuel Holland
609194fae2 Serviceless rewrite, part 1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 04:09:29 -06:00
Samuel Holland
4c0869393e Rename package widgets -> widget
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 04:08:01 -06:00
Samuel Holland
b7196e328a Rename package bindings -> databinding
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06 04:08:01 -06:00
Jason A. Donenfeld
9b92f4d3c5 SettingsActivity: allow for installing command line tools
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-19 02:42:00 +01:00
Jason A. Donenfeld
6d1117a94c tools: build required tools with apk
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-12-15 06:00:45 +01:00
Jason A. Donenfeld
9e028ae8d6 VpnService: require root access
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-30 21:46:56 +01:00
Jason A. Donenfeld
417e973c8f NotSupportedActivity: fix font size
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-29 13:24:40 +01:00
Samuel Holland
97e05ff965 ConfigListFragment: Use correct icon for FAB
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28 20:42:25 -06:00
Samuel Holland
4a672fc05d ConfigListFragment: Use a floating action menu
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28 20:14:47 -06:00
Samuel Holland
312816d4fd res/drawable: Fix icon sizes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28 17:30:56 -06:00
Jason A. Donenfeld
2f310f0fad EditFragment: do not autocomplete or capitalize ifnames
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28 22:14:00 +01:00
Jason A. Donenfeld
f00622a2a9 Open: better icon
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28 13:09:00 +01:00
Jason A. Donenfeld
bbe058418b NotSupported: Better sorry text
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27 21:29:40 +01:00
Jason A. Donenfeld
2cc7f6c2ea ConfigDetailFragment: wire up toggle switch
Finally no gross colors.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27 04:35:04 +01:00
Jason A. Donenfeld
6bc6aea2d0 NotSupported: check if the module exists
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27 04:28:48 +01:00
Jason A. Donenfeld
ad16d2cc7b Settings: show quick tile config if no primary is defined
This seems like a horrific set of hacks.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27 03:13:34 +01:00
Jason A. Donenfeld
d43c87a869 QuickTileService: show app if no profiles exist
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27 00:43:34 +01:00
Samuel Holland
283340f5dc ConfigList: A better toggle switch
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25 23:05:39 -06:00
Samuel Holland
f1febcf9b6 ConfigList: Poor man's switch
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-24 23:44:18 -06:00
Samuel Holland
50a7a12de2 VpnService: Move it to a backends package
It should be split into two pieces: configuration file management
(loading/saving/renaming/deleting) and calling into wg-quick via
RootShell. The configuration file management part should then go
back into the main package. This is in preparation for adding
additional backends based on wg(8) and wireguard-go.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-24 21:16:37 -06:00
Samuel Holland
4a98d07806 ConfigActivity: Add import menu item
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-08 00:50:24 -06:00
Samuel Holland
70156381a7 Bindings: Merge bugfixes and updates
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-08 00:07:29 -06:00
Samuel Holland
6231bb18ac Bindings: Move to a separate package
These are really app-independent reusable classes. Moving them to a
separate package helps avoid polluting the main app package, and makes
them easier to upgrade.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-07 23:34:22 -06:00
Samuel Holland
b7992d234c ConfigListFragment: Prevent config names from wrapping
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24 23:24:09 -05:00
Samuel Holland
292b16b1a1 ConfigActivity: Only use split layout on tablet-sized screens
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24 23:22:22 -05:00
Samuel Holland
dcc7ddcd3b ConfigEditFragment: Copy public key on click
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24 02:11:55 -05:00
Samuel Holland
4fdb3458ec ConfigEditFragment: Mark the persistent keepalive as optional
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24 02:01:51 -05:00
Samuel Holland
cd868bc997 ConfigEditFragment: Add a field for the optional pre-shared key
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24 02:01:19 -05:00
Samuel Holland
c1cdea42b6 Finish first pass of config editor fields
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-22 23:10:41 -05:00
Samuel Holland
353028420b Add an adapter for binding an ObservableList to a LinearLayout
EditTexts do not work in ListViews.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-22 23:10:35 -05:00
Samuel Holland
fb919a7226 Use data binding to provide EditText input filters
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-22 21:48:42 -05:00
Samuel Holland
5d04714eea ConfigAddActivity: Rename to AddActivity
Not everything needs to start with Config

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-22 01:27:29 -05:00
Samuel Holland
85fc5e7ebf ConfigListFragment: Restore the non-FAB add menu
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-17 06:06:35 -05:00
Samuel Holland
416d3adda7 QuickTileService: Implement and update from VpnService
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-17 05:45:40 -05:00
Samuel Holland
25412e0537 Convert to using the ObservableTreeMap and its adapter
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-17 02:43:15 -05:00
Samuel Holland
5023c937ad preferences: Control restoring enabled configs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 04:37:11 -05:00
Samuel Holland
08992185ec SettingsActivity: Implement primary config setting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 04:34:14 -05:00
Samuel Holland
4ac1a2fafc ConfigList: Denote the primary config with bold text
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 04:29:04 -05:00
Samuel Holland
452641a0eb Detail/Edit/ListFragment: Update the layouts
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 01:47:18 -05:00
Samuel Holland
645e263424 ConfigActivity: Inline PlaceholderFragment into the layout
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 01:43:15 -05:00
Samuel Holland
9e36e0d9c6 ConfigActivity: Make the two-pane layout more readable
Highlight the selected configuration, and add a border between the two
panes.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 01:38:46 -05:00
Samuel Holland
73217a098a ConfigListFragment: Implement config selection and removal
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16 00:55:44 -05:00
Samuel Holland
61d6b89bbe ConfigAddActivity: Add an standalone config-creating activity
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-15 17:36:11 -05:00
Samuel Holland
5e55d196be Major renaming and refactoring in activity and service
Apparently "configuration" is the proper term, not "profile".

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-13 07:24:03 -05:00
Samuel Holland
de53a1b50a ProfileEdit: Finish writing code-behind
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-10 01:05:20 -05:00
Samuel Holland
87d3200b29 ProfileActivity: Do menus correctly
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-10 01:04:46 -05:00
Samuel Holland
c199827b58 ProfileEdit: Add empty activity/fragment
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09 07:30:25 -05:00
Samuel Holland
39ed03f758 ProfileList: Add the list fragment in code so it knows the layout
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09 06:19:37 -05:00
Samuel Holland
52cdf3e7e5 ProfileActivity: Replace fragments instead of hiding
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09 05:12:00 -05:00
Samuel Holland
2e3daa8913 ProfileActivity: Extract base class for fixing fragments
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09 03:23:25 -05:00
Samuel Holland
f8d8e5e23e res: Add icons for quick settings tile
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-08 05:55:27 -05:00
Samuel Holland
0685d4a159 ProfileActivity: Refactor into clean layers of functionality
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-08 05:51:38 -05:00
Samuel Holland
01524c0dbf ProfileService: Use a map to store profile data
This has no visible changes at the moment, but will allow most functions
to pass around strings instead of Profile objects, obviating the need to
implement serialization for them. It also trades some naive linear
searches for the binary search in SimpleArrayMap.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-07 19:55:11 -05:00
Samuel Holland
2df899eae5 ProfileActivity: Add two-pane master-detail layout
This is designed for tablets, but for testing purposes, it is currently
enabled for all devices in landscape orientation.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-07 18:51:47 -05:00
Samuel Holland
2154306fcb PlaceholderFragment: Simple fragment that shows a message
This is used for the detail pane when no profile is selected.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-07 18:48:46 -05:00
Samuel Holland
372477d0e0 ProfileList: Load fragment programmatically
This is necessary to replace it with the profile detail fragment later.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-07 16:55:02 -05:00
Samuel Holland
81ab643d2b ProfileList: Convert to a fragment
This is required for a future two-fragment tablet layout, and simplifies
the code a bit since the profile detail (view/edit) will be implemented
as fragments anyway.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-04 12:24:18 -05:00
Samuel Holland
d0bf3b6b32 ProfileList: remove generated config from UI
It was only there for developing the parser.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-04 00:40:43 -05:00
Samuel Holland
f0ac53e29b icon: Remove transparency inside non-round dragon
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-04 00:35:02 -05:00
Samuel Holland
6c71b88abd ProfileList: Remove "Add" menu action, to be replaced by a FAB
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-01 02:06:17 -05:00
Samuel Holland
84e19d6c72 ProfileList: Add a simple menu
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-29 06:39:37 -05:00
Samuel Holland
411b0716f2 ProfileList: Toggle connection state on click
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-31 21:30:51 -05:00
Samuel Holland
465a969a70 ProfileList: Add indicator of profile connection state
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-31 21:29:29 -05:00
Samuel Holland
7ceafaf2bb ProfileList: Add minimal activity
For now, it simply reads the files in the app's data directory with
file names ending in ".conf" and displays them in a list.

This includes the generic list data binding setup for future use.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-29 06:09:55 -05:00
Samuel Holland
5a82ecf18a icon: Use the uncropped logo for the non-round icon
The round icon remains the same.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-30 22:47:24 -05:00
Samuel Holland
56cf8816d3 project: Create empty project with WireGuard icon
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-28 23:10:37 -05:00