aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard/android/util (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ui: raise min SDK to 24Harsh Shandilya2025-10-201-3/+0
| | | | | | | | The difference between the usage of 21 and 24 is not big enough to hold on to all the baggage from API 21 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* QrCodeFromFileScanner: more efficiently downscale images and release memoryJason A. Donenfeld2025-05-311-44/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* QrCodeFromFileScanner: catch OOM errorsJason A. Donenfeld2025-05-311-1/+1
| | | | | | | OutOfMemoryError is an Error which is a Throwable, but it isn't an exception. Try to catch it for downscaling by catching all Throwables. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update copyright noticesJason A. Donenfeld2025-05-1910-10/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: only show a snackbar for Android 12 and lowerSlipkHunter2023-09-121-1/+4
| | | | | Signed-off-by: SlipkHunter <abrito025@gmail.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: reformat all codeJason A. Donenfeld2023-05-058-63/+82
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: use .seconds instead of .toDurationJason A. Donenfeld2023-05-051-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: handle update signaturesJason A. Donenfeld2023-05-011-0/+30
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: display latest handshake timeJason A. Donenfeld2023-04-241-0/+45
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: always show visible localized error messagesJason A. Donenfeld2023-04-071-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: force dark theme in TV modeJason A. Donenfeld2023-04-041-0/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2023-03-2110-10/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: make validity check from QR code image scanner staticHarsh Shandilya2022-03-061-8/+8
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: allow importing tunnel from an QR image stored on the deviceNikita Pustovoi2022-03-062-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | Add a new feature to import a tunnel from a saved QR image, this feature integrates into 'import from file' flow, however adds a condition, if file is an image, attempt to parse it as QR image file. My use case for this feature, is to allow easier sharing of tunnels to family. Scanning QR code is ok when you have an external display to show it, but if you sent QR code to someone, there is no way to import it in the app. If you share a config file, that becomes way harder for a non-technical person to import as now they need to find a file with that name in the file picker etc etc, Where the images are very visible in the file picker, and user can easily recognize it for import. Testing: - Click "+" blue button, try to import a valid `.conf` file - the 'original' file flow should not be affected - Click "+" blue button, try to import a valid QR code image - if QR code was parsed, then a new tunnel will be added. - Click "+" blue button, try to import an invalid QR code image - Error message will be shown Signed-off-by: Nikita Pustovoi <deishelon@gmail.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: bump copyright yearJason A. Donenfeld2021-10-299-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: remove kernel module downloaderJason A. Donenfeld2021-10-291-7/+7
| | | | | | | | 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>
* tunnel: retry DNS resolution for 10 secondsJason A. Donenfeld2021-05-261-1/+2
| | | | | | | | | | 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>
* ui: update datastore and rework apiJason A. Donenfeld2021-05-061-11/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: replace deprecated string operationsHarsh Shandilya2021-05-051-4/+3
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ClipboardUtils: localize clipboard notification snackJason A. Donenfeld2021-01-011-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* DownloadsFileSaver: initialize callback in constructor, not on the flyJason A. Donenfeld2020-10-021-7/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* build: upgrade AndroidX biometricJason A. Donenfeld2020-10-021-5/+4
| | | | | | | The BiometricConstants class was removed and these were folded into BiometricPrompt. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: queue up tunnel mutating on activity scope instead of fragment scopeJason A. Donenfeld2020-09-261-2/+2
| | | | | | | | | | | | Fragment scopes get cancelled when the fragment goes away, but we don't actually want to cancel an in-flight transition in that case. Also, before when the fragment would cancel, there'd be an exception, and the exception handler would call Fragment::getString, which in turn called requireContext, which caused an exception. Work around this by using the `activity ?: Application.get()` idiom to always have a context for strings and toasts. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: cleanup code after churnJason A. Donenfeld2020-09-231-1/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: wire in statsJason A. Donenfeld2020-09-221-0/+22
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: abstract out tunnel importingJason A. Donenfeld2020-09-222-10/+150
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: initial draft of Android TV supportHarsh Shandilya2020-09-221-0/+11
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: move to Jetpack DataStore instead of SharedPrefsJason A. Donenfeld2020-09-181-0/+85
| | | | | | | Hopefully PreferencesPreferenceDataStore gets to go away sometime down the line. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: reformat codeJason A. Donenfeld2020-09-181-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: refactor AddTunnelsSheet's selection communicationHarsh Shandilya2020-09-171-5/+0
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* DownloadsFileSaver: encapsulate permission checksJason A. Donenfeld2020-09-171-34/+55
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ZipExporterPreference: don't ask for storage permissions on newer androidJason A. Donenfeld2020-09-161-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: replace GlobalScope with a hand-rolled CoroutineScopeHarsh Shandilya2020-09-161-0/+4
| | | | | | | | | | | | | | | | | GlobalScope has numerous problems[1] that make it unfit for use in most applications and making it behave correctly requires an excessive amount of verbosity that's alleviated simply by using any other scope. Since we run multiple operations in the context of the application's lifecycle, introduce a new scope that is created when our application is, and cancelled upon its termination. While at it, make the scope default to Dispatchers.IO to reduce pressure on the UI event loop. Tasks requiring access to the UI thread appropriately switch context making the change completely safe. 1: https://medium.com/@elizarov/the-reason-to-avoid-globalscope-835337445abc Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Extensions: use more idiomatic kotlinJason A. Donenfeld2020-09-161-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: lint codebase with recent changesJason A. Donenfeld2020-09-162-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* coroutines: use lifecycleScope where appropriateJason A. Donenfeld2020-09-152-21/+10
| | | | | | | There's still a bit of GlobalScope lingering around, which might be removable. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* coroutines: convert the restJason A. Donenfeld2020-09-152-70/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: remove hacky manual check for keyguardHarsh Shandilya2020-09-131-20/+1
| | | | | | Setting the correct value for the allowedAuthenticators field lets the library correctly detect this by itself as verified on an API 21 emulator Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: update BiometricAuthenticator for API changesHarsh Shandilya2020-09-131-2/+6
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: fix memory leak from statically held Handler instanceHarsh Shandilya2020-09-131-2/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: fix SDK 30 deprecation warning for implicit Looper in Handler initHarsh Shandilya2020-08-231-1/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* AdminKnobs: allow enterprise admins to disable private key exportJason A. Donenfeld2020-07-231-0/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: misc cleanups to AppListDialogFragmentHarsh Shandilya2020-04-061-0/+5
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: cleanup code styleJason A. Donenfeld2020-03-301-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* BiometricAuthenticator: rework logic and bugsJason A. Donenfeld2020-03-301-9/+27
| | | | | | | Otherwise there's a frameworks bug that causes the fragment's activity to become null. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* BiometricAuthenticator: implement biometric authentication for sensitive operationsHarsh Shandilya2020-03-301-0/+73
| | | | | | | | When biometric hardware is available, it will be used to authenticate the user before private keys are shown on screen or when zip exports are executed. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: hardcode tags so that minification doesn't ruin the logJason A. Donenfeld2020-03-281-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: Remove unnecessary non-null assertion in TAG fieldsHarsh Shandilya2020-03-281-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: use kotlin class instead of java class for tagJason A. Donenfeld2020-03-281-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ClipboardUtils: Update to handle TextInputEditTextHarsh Shandilya2020-03-281-9/+12
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>