Commit Graph
1018 Commits
Author SHA1 Message Date
Tobias Brunner 5019e3ece0 nm: Update build files and switch from intltool to gettext
gnome-common has been deprecated, so has intltool.  This follows GNOME's
recommended migration paths.
2024-10-16 08:16:43 +02:00
Tobias Brunner 9b9cf2001f android: Fix import of an already existing VPN profile 2024-08-07 08:58:12 +02:00
Tobias Brunner fe1c9dedb7 android: New release after updating target SDK and fixing some compatibility issues 2024-08-06 18:01:54 +02:00
Tobias Brunner 6064209872 android: Increase targetSdkVersion to 34 (Android 14) 2024-08-06 18:01:54 +02:00
Tobias Brunner 880e273985 android: Avoid using deprecated ViewCompat methods 2024-08-06 18:01:54 +02:00
Tobias Brunner 01c81ca15f android: Replace deprecated Observer/Observable with PropertyChangeListener etc.
Kinda misusing the interface as there is no specific property, but
otherwise seems like a 1:1 replacement.
2024-08-06 18:01:54 +02:00
Tobias Brunner 51f746161d android: Add workaround for a bug preventing background service starts from TileService
When targeting Android 14, we get a "Background activity launch blocked!"
exception when trying to start the connection in the background (closing
the drawer works).  Which is apparently a bug:

  https://issuetracker.google.com/issues/305035828

The workaround here is kinda ugly.  In particular, because it's not
possible anymore since a few versions to open a dialog that allows users
to directly grant the required permission to the app.  We can only open
the generic settings dialog where users have to search for the app and
grant the permission themselves (we could add a dialog with an explanation
similar to the one for the power whitelist if necessary).  Hopefully this
gets fixed at some point (the current beta of Android 15 still has the
same bug, though).
2024-08-06 18:01:54 +02:00
Tobias Brunner 3286f75ffe android: Use PendingIntent-version of startActivityAndCollapse()
The other version has been deprecated and throws an exception when
targeting Android 14+.
2024-08-06 18:01:54 +02:00
Tobias Brunner 38160c5cb7 android: Explicitly mark receiver as not exported during registration 2024-08-06 18:01:54 +02:00
Tobias Brunner 9c4ceced1c android: Declare foreground service type for VpnService instance
Required for Android 14 (34).  Since no other type fits we use specialUse,
which also requires a new permission and a description for why we use it.
2024-08-06 18:01:54 +02:00
Tobias Brunner 4f2e65f3d0 android: Fix label for name field in managed profiles
The field is not actually optional.
2024-08-06 18:01:54 +02:00
Tobias Brunner 81041b55d2 android: Fix crash when opening list of apps for new profiles
Fixes: 150dc5ab64 ("android: Make selected apps read-only")
2024-08-06 18:01:54 +02:00
Tobias Brunner 8a14c20ec7 android: Update dependencies 2024-08-06 18:01:54 +02:00
Tobias Brunner 7b78e35ff6 android: Update Gradle plugin 2024-08-06 18:01:54 +02:00
Tobias Brunner b21178b43c android: New release after adding fix for existing shortcuts/Intents 2024-02-26 11:14:14 +01:00
Tobias Brunner 45371da846 android: Add fallback for the old name of the profile ID extra
This fixes existing shortcuts and automation via Intents.

Fixes: 8e3b921abe ("android: Always use UUID to access profiles")
2024-02-26 11:01:55 +01:00
Tobias Brunner 7db629e4bc android: New release after adding support for managed configurations 2024-02-21 12:24:53 +01:00
Tobias Brunner 51a5d96b36 android: Add translations for managed configuration strings
Not actually translating anything, but making the linter happy.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 8c6b3019a7 android: Update managed certificates if config changes 2024-02-21 12:24:53 +01:00
Markus Pfeiffer b0ba845e27 android: Add manager for managed user certificates
This can be used to install, replace or delete currently installed user
certificates based on the app's current managed configuration.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer aa06d75491 android: Add manager for managed trusted certificates
This is used to install, replace or delete currently installed trusted
certificates based on the app's current managed configuration.

Certificates that are shared between multiple profiles are protected
and not uninstalled if a profile that uses it remains.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 9cb23f650a android: Add utility class to determine differences in two lists of objects
This allows determining the difference between two lists in the form of
inserts, updates and deletes (and unchanged elements).
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 97cb35afe5 android: Add repository for managed user certificates 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 99dfa8cb0e android: Add repository for managed trusted certificates 2024-02-21 12:24:53 +01:00
Markus Pfeiffer a04798a796 android: Add base repository for installed managed certificates 2024-02-21 12:24:53 +01:00
Markus Pfeiffer cd67c30fd1 android: Add installer for managed user certificates/keys
This installs the configured user certificate into Android's key store
using the DevicePolicyManager.

This is only accessible if the app is installed on an enrolled device and
has been granted the CERT_INSTALL delegate scope.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer fb302d967c android: Add installer for managed trusted certificates
This installs a configured CA or server certificate into the app's local
key store.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer e2f505350e android: Add database migration for managed certificates 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 6882f17741 android: Add trusted and user certificates to ManagedVpnProfile 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 9cbc03e84f android: Add entities for CA/server and user certificates 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 22bce57e4c android: Add utility that parses a PKCS#12 container and extracts a KeyPair 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 4ac9fc327e android: Add utility that converts a Base64 string to a X509Certificate 2024-02-21 12:24:53 +01:00
Markus Pfeiffer afcb56400e android: Add utility class that pairs a certificate with a private key 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 8a50651212 android: Add password for client certificate to managed config 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 9a917252e2 android: Provide global database helper instance 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 861ac0109a android: Extend database helper with table definition
This simplifies database migration.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 802047cae8 android: Move database helper into separate class
Reduce strong coupling between database helper and VPN profiles, to
prepare for the addition of other tables.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 42626c1dd8 android: Hide unmanaged profiles by default
Such profiles could exist if a user already had strongSwan installed.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 0af501ef26 android: Disable access to settings depending on managed configuration 2024-02-21 12:24:53 +01:00
Markus Pfeiffer fe13782e3c android: Hide menu items depending on managed configuration
Hide and disable menu items when disabled by the managed configuration.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 4bfeb3b000 android: Add data source for managed VPN profiles
Include the managed VPN profile data source in the profile source,
to show profiles from both sources in the UI.
2024-02-21 12:24:53 +01:00
Tobias Brunner 8f04d15dfd android: Expose static instance for Application object
While it seems to be possible to cast Context.getApplicationContext()
to the application class, there really is no documented reason why that
should actually be the same object.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 36f62585bb android: Expose managed configuration globally and notify listeners on changes
Triggers a broadcast if the configuration changed and updates the
profile list accordingly (previously only handled removal of multiple
profiles).

If the app resumes, the configuration is also loaded and listeners are
notified in case the config was updated while the app was in the
background.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 8796e9bb31 android: Add ManagedConfigurationService and related classes
Add service that provides access to managed configurations.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer c2007d5b09 android: Add managed_configuration.xml
Add managed configuration and associated English strings.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer 01ea7b92bd android: Make VpnType#fromIdentifier null-safe 2024-02-21 12:24:53 +01:00
Markus Pfeiffer a5167a69e0 android: Add data source to VpnProfile 2024-02-21 12:24:53 +01:00
Markus Pfeiffer 5f9f279a33 android: Show warning message for read-only profiles in detail view
Show a message explaining that a managed profile can't be edited in
its detail view.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer c9c65a94c9 android: Add label to read-only profiles in list
Show "Managed profile" in the list of VPN profiles, to make it
immediately obvious that a profile is managed/read-only.
2024-02-21 12:24:53 +01:00
Markus Pfeiffer d3f5c3a760 android: Disable copy/delete for read-only profiles
If a profile is marked as read-only, do not allow users to copy or
delete the profile.
2024-02-21 12:24:53 +01:00