aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard/android/preference (follow)
Commit message (Collapse)AuthorAgeFilesLines
* DonatePreferences: use toUri() extensionJason A. Donenfeld2025-05-211-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update copyright noticesJason A. Donenfeld2025-05-197-7/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: add shortcut for adding quick settings tileJason A. Donenfeld2023-05-101-0/+50
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* gradle: restore play runtime detectionJason A. Donenfeld2023-05-081-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: reformat all codeJason A. Donenfeld2023-05-051-6/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* gradle: remove runtime detection of play storeJason A. Donenfeld2023-05-041-3/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: handle update signaturesJason A. Donenfeld2023-05-011-14/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: distinguish play store installs at runtime for reproducible buildsJason A. Donenfeld2023-04-051-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change lets us use the same build for F-Droid, Play Store, self builds, and elsewhere, which makes everything more easily publicly verifiable, since the build system is reproducible. That means that all APKs will have the same code and be completely interchangeable, no matter where they come from. It does this by removing the build-time branch for special Play Store builds, and replacing it with a simple runtime check using the PackageManager APIs that return the name of the installer. If the app is installed by "com.android.vending", then it's a Play Store install. It's possible to test this with: $ pm install -i com.android.vending path/to/package.apk And it appears to work well. One potential concern is that it's unclear whether the Play Store reviewers install the app using utilities that set com.android.vending like this. If not, that might be a problem. However, it looks like various banking apps also use the installer package name check in the same way, and refuse to start if it's not right. That suggests that it would be impossible for Play Store reviewers to even review those banking apps if they did not set com.android.vending properly. Out of an abundance of caution, though, and in order to avoid a Play Store suspension that's harder to appeal, I sent a support request today (which just managed to fit exactly in the 1000 character limit): Hi, My app pays special attention to Google Play Store guidelines. For that reason, there is some code in the app that looks like this: if (BuildConfig.IS_GOOGLE_PLAY) ... else ... This means that I compile two versions of my app, one for Google Play, and another for other app stores. This has worked well for many years and it satisfies Google's policy requirements. However, compiling two versions of my app is a bit of a pain. Instead, I would like to do this check at runtime, with code like this: if (pm.getInstallSourceInfo(package).installingPackageName == "com.android.vending") ... else ... I have tested that this code works well, and I've installed my app with: $ pm install -i com.android.vending ui-release.apk This works and successfully satisfies the policy requirements. My question is how this works during the review process. Are reviewed apps installed with the necessary -i com.android.vending switch to make this work? Thanks. They responded fairly quickly: Hi Jason, Thanks for contacting the Google Play team. Unfortunately I'm not able to comment on your planned implementation. If you think your app is in compliance, please submit your app for review. You may want to review the Developer Program Policies for additional policy guidance. We recommend reviewing the details listed in this blog post and update your app accordingly to comply with the changes. Thanks for your understanding and continued support. Regards, Mia Google Play Developer Support So I'll interpret that as a, "if you think it's okay, submit it and see, and then we'll let you know." So here we go. Hopefully if it is rejected, the update will only be blocked, and I'll just revert this commit and resubmit. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: always use MaterialAlertDialogBuilderJason A. Donenfeld2023-04-041-3/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: use ErrorMessages consistentlyJason A. Donenfeld2023-04-042-2/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: never throw on link clicksJason A. Donenfeld2023-04-042-4/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: bring back donation buttonJason A. Donenfeld2023-03-241-0/+38
| | | | | | | | | For Google Play Store builds, we'll display an alert box. This was inspired by the discussion around StreetComplete; hopefully we'll have a similar okay outcome. Link: https://github.com/streetcomplete/streetcomplete/issues/3768 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2023-03-215-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: make when statements exhaustive everywhereHarsh Shandilya2022-01-081-0/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: bump copyright yearJason A. Donenfeld2021-10-295-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: remove kernel module downloaderJason A. Donenfeld2021-10-292-78/+8
| | | | | | | | 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>
* ui: update datastore and rework apiJason A. Donenfeld2021-05-061-18/+21
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: replace deprecated string operationsHarsh Shandilya2021-05-051-3/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* DownloadsFileSaver: initialize callback in constructor, not on the flyJason A. Donenfeld2020-10-021-1/+3
| | | | 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-1/+3
| | | | | | | | | | | | 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: move to Jetpack DataStore instead of SharedPrefsJason A. Donenfeld2020-09-183-12/+142
| | | | | | | Hopefully PreferencesPreferenceDataStore gets to go away sometime down the line. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* DownloadsFileSaver: encapsulate permission checksJason A. Donenfeld2020-09-171-14/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ZipExporterPreference: don't ask for storage permissions on newer androidJason A. Donenfeld2020-09-161-4/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: lint codebase with recent changesJason A. Donenfeld2020-09-161-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: don't use low-level logger APIHarsh Shandilya2020-09-161-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* coroutines: lifecycleScope is by default on Main.immediateJason A. Donenfeld2020-09-165-7/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* coroutines: use lifecycleScope where appropriateJason A. Donenfeld2020-09-155-26/+23
| | | | | | | 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-155-81/+86
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* coroutines: convert low-hanging fruitsJason A. Donenfeld2020-09-143-44/+63
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AdminKnobs: allow enterprise admins to disable private key exportJason A. Donenfeld2020-07-231-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* KernelModuleDisablerPreference: do not make synchronous calls to getBackendJason A. Donenfeld2020-04-071-8/+17
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: cleanup code styleJason A. Donenfeld2020-03-301-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* BiometricAuthenticator: rework logic and bugsJason A. Donenfeld2020-03-301-1/+2
| | | | | | | 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-5/+20
| | | | | | | | 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>
* databinding: simplify and address warningsJason A. Donenfeld2020-03-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: Replace ErrorMessages getter with indexing operatorHarsh Shandilya2020-03-272-2/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ObservableTunnel: port to kotlinJason A. Donenfeld2020-03-261-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: root: rewrite in kotlinJason A. Donenfeld2020-03-261-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Introduce realtime log viewerHarsh Shandilya2020-03-261-101/+0
| | | | | | | | | This contains a share button and a save button, the former using a custom content provider. Co-authored-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* LogExporterPreference: Don't ask for storage permissions on Android 10 and aboveHarsh Shandilya2020-03-251-6/+12
| | | | | | We use the proper MediaStore implementation on Android 10 which makes it unnecessary. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Replace PermissionRequestCallback with direct methodsHarsh Shandilya2020-03-202-23/+12
| | | | | | These are much cleaner in Kotlin code. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Convert activity package to KotlinHarsh Shandilya2020-03-202-12/+22
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* preferences: rewrite in kotlinJason A. Donenfeld2020-03-1912-600/+452
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* preference: restart application immediatelyJason A. Donenfeld2020-03-172-19/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ModuleDownloaderPreference: remove disable_kernel_module after downloadingJason A. Donenfeld2020-03-102-5/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: Codestyle cleanupsHarsh Shandilya2020-03-102-6/+6
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* KernelModuleDisablerPreference: turn off tunnels before switching backendJason A. Donenfeld2020-03-091-10/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>