Commit Graph
436 Commits
Author SHA1 Message Date
Anthony RyanandJason A. Donenfeld 89c0bb6c7a ui: losslessly optimize launcher icons
Using Efficient-Comprression-Tool we can reduce image size  by 37.59KB (27%)
with no visual change.

      compressed      │     uncompressed      │
──────────┬───────────┼───────────┬───────────┤
 size     │ diff      │ size      │ diff      │ path
──────────┼───────────┼───────────┼───────────┼───────────────────────────────────────────────
 75.2 KiB │ +75.2 KiB │       0 B │       0 B │ +
 15.8 KiB │  -6.7 KiB │  15.7 KiB │  -6.7 KiB │ ∆ res/mipmap-xxxhdpi-v4/ic_launcher.png
 20.4 KiB │  -6.3 KiB │  20.3 KiB │  -6.3 KiB │ ∆ res/mipmap-xxxhdpi-v4/ic_launcher_round.png
  8.6 KiB │  -6.2 KiB │   8.4 KiB │  -6.2 KiB │ ∆ res/mipmap-xhdpi-v4/banner.png
 11.6 KiB │  -4.3 KiB │  11.5 KiB │  -4.3 KiB │ ∆ res/mipmap-xxhdpi-v4/ic_launcher.png
 15.2 KiB │    -4 KiB │  15.1 KiB │    -4 KiB │ ∆ res/mipmap-xxhdpi-v4/ic_launcher_round.png
  6.2 KiB │  -2.6 KiB │   6.1 KiB │  -2.6 KiB │ ∆ res/mipmap-xhdpi-v4/ic_launcher.png
  7.9 KiB │  -2.5 KiB │   7.8 KiB │  -2.5 KiB │ ∆ res/mipmap-xhdpi-v4/ic_launcher_round.png
    5 KiB │  -1.7 KiB │   4.9 KiB │  -1.7 KiB │ ∆ res/mipmap-hdpi-v4/ic_launcher.png
    6 KiB │  -1.5 KiB │   5.8 KiB │  -1.5 KiB │ ∆ res/mipmap-hdpi-v4/ic_launcher_round.png
  2.7 KiB │  -1,002 B │   2.5 KiB │    -996 B │ ∆ res/mipmap-mdpi-v4/ic_launcher.png
  3.2 KiB │    -918 B │   3.1 KiB │    -918 B │ ∆ res/mipmap-mdpi-v4/ic_launcher_round.png
──────────┼───────────┼───────────┼───────────┼───────────────────────────────────────────────
  178 KiB │ +37.6 KiB │ 101.1 KiB │ -37.6 KiB │ (total)

[0]: https://github.com/JakeWharton/diffuse/

Signed-off-by: Anthony Ryan <anthonyryan1@gmail.com>
[Harsh: comparing APKs with Diffuse[0] shows modest but non-zero size savings]
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2025-10-20 18:22:36 +02:00
Jason A. Donenfeld cb216c6ec6 QrCodeFromFileScanner: more efficiently downscale images and release memory
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-31 04:22:06 +02:00
Jason A. Donenfeld d45b1ea9a7 QrCodeFromFileScanner: catch OOM errors
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>
2025-05-31 03:47:10 +02:00
Jason A. Donenfeld 6414de156c QuickTileService: wait for tunnels to load
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-28 03:56:51 +02:00
Jason A. Donenfeld fa989fe58e QuickTileService: handle onClick in applicationScope
This helps with the case where the TunnelManager is still loading.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-28 03:49:37 +02:00
Jason A. Donenfeld 90395232b0 TvMainActivity: link to cx file explorer
Google requires us to link to a specific file manager. We can't just
open the app store. They keep rejecting the app otherwise. Annoying.

Also, due to Android TV bugs, we also can't link to a prefilled search
query of "file manager". Instead we must link to an actual file manager.

Unfortunately, none of the open source file manager apps both support
the TV interface and can act as a file chooser. So instead we pick what
looks like the only decent one that doesn't have any in app purchases.
Ugh. I don't like doing this. It's not an endorsement. I don't know much
about who makes these. But what choice do we have?

So doing this for now. Maybe we'll find some better solution or apply to
be a file manager ourselves in the future.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-23 04:16:41 +02:00
Jason A. Donenfeld e12e658408 DonatePreferences: use toUri() extension
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-21 01:48:42 +02:00
Jason A. Donenfeld 2c223fb68c MainActivity: don't reuse id names across layouts
This causes problems on foldables.

Reported-by: Josh Dague <josh3736@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-19 17:57:39 +02:00
Jason A. Donenfeld 0ea6cee192 global: add missing xml copyright and opening tag
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-19 17:40:03 +02:00
Jason A. Donenfeld 0295abd808 global: update copyright notices
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-19 17:31:02 +02:00
Jason A. Donenfeld 0350b801b6 TunnelCreatorActivity: use proper xml for layout
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-19 17:26:38 +02:00
Jason A. Donenfeld 720079bdf9 TunnelToggleActivity: suppress errors from prepare() in lockdown mode
Exception java.lang.IllegalStateException: Unavailable in lockdown mode
  at android.os.Parcel.createExceptionOrNull (Parcel.java:3031)
  at android.os.Parcel.createException (Parcel.java:3007)
  at android.os.Parcel.readException (Parcel.java:2990)
  at android.os.Parcel.readException (Parcel.java:2932)
  at android.net.IVpnManager$Stub$Proxy.prepareVpn (IVpnManager.java:1064)
  at android.net.VpnService.prepare (VpnService.java:290)
  at com.wireguard.android.activity.TunnelToggleActivity$onCreate$1.invokeSuspend (TunnelToggleActivity.kt:44)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:8)
  at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith (DispatchedContinuation.kt:155)
  at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable (Cancellable.kt:12)
  at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default (Cancellable.kt:12)
  at kotlinx.coroutines.CoroutineStart.invoke (CoroutineStart.java:80)
  at kotlinx.coroutines.AbstractCoroutine.start (AbstractCoroutine.kt:80)
  at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch (BuildersKt__Builders_common.kt:52)
  at kotlinx.coroutines.BuildersKt.launch (Builders.kt:52)
  at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default (BuildersKt__Builders_common.kt:52)
  at kotlinx.coroutines.BuildersKt.launch$default (Builders.kt:52)
  at com.wireguard.android.activity.TunnelToggleActivity.onCreate (TunnelToggleActivity.kt:14)
  at android.app.Activity.performCreate (Activity.java:8591)
  at android.app.Activity.performCreate (Activity.java:8570)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1384)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4150)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4325)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:101)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2574)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8762)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-16 18:45:19 +02:00
Jason A. Donenfeld aa68b5152e ui: set fitsSystemWindows=true for EdgeToEdge on API 35+
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-16 18:41:56 +02:00
Jason A. Donenfeld 67db72ac40 TvMainActivity: use OpenDocument instead of GetContent
This should make it possible to open files on Android TV 14.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-16 18:41:56 +02:00
Jason A. Donenfeld 7c743534a5 ui: sync translations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-15 17:20:31 +02:00
Jason A. Donenfeld 6aab7cccf9 LogViewerActivity: cast array to Any type instead of using union inference
Type argument for reified type parameter 'T' was inferred to the
intersection of ['Comparable<*>' & 'Serializable']. Reification of an
intersection type results in the common supertype being used. This may
lead to subtle issues and an explicit type argument is encouraged. This
will become an error in a future release.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-08 04:59:37 +02:00
Jason A. Donenfeld bd0967e36e SettingsActivity: manually apply insets for api 35
The forced EdgeToEdge changes don't work well with
PreferenceFragmentCompat, because it's basically abandoned by androidx,
so apply the insets manually ourselves.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-08 04:59:37 +02:00
Jason A. Donenfeld de2338a470 SettingsActivity: remove unused imports
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-08 04:59:37 +02:00
Jason A. Donenfeld fb115b4079 gradle: use = instead of .set
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-08 04:59:37 +02:00
Jason A. Donenfeld 9c0bafad17 gradle: update kotlin to 2.1.20
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-05 16:09:58 +02:00
Jason A. Donenfeld d7242288bb gradle: target API 36
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-05-05 16:09:58 +02:00
Jason A. Donenfeld 9453b6c0e2 ui: sync with crowdin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-18 14:26:41 +02:00
Jason A. Donenfeld 8390553850 QuickTileService: require SYSTEM_ALERT_WINDOW to start background activity
Due to buggy changes in Android 14, we now need to bother the user about
enabling "draw over other apps" for the quick settings toggle to work
when the app isn't already running.

Link: https://issuetracker.google.com/issues/305035828
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-18 14:26:41 +02:00
Jason A. Donenfeld db7f70736f gradle: bump many deps
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-13 21:32:16 +02:00
SlipkHunterandHarsh Shandilya 0be12b8d07 ui: only show a snackbar for Android 12 and lower
Signed-off-by: SlipkHunter <abrito025@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2023-09-12 12:23:46 +05:30
Jason A. Donenfeld 434534ac59 ui: hide corrupted message if no installer
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-07 05:06:04 +02:00
Jason A. Donenfeld 0f77af85d3 ui: sync with crowdin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-07 04:24:14 +02:00
Jason A. Donenfeld adefd16f7e ui: remove unused elvis operators
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-06 19:05:52 +02:00
Jason A. Donenfeld e4a49a5356 ui: use api 34's startActivityAndCollapse
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-06 19:05:52 +02:00
Jason A. Donenfeld 58ec110360 gradle: remove unused import
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-05 17:59:01 +02:00
Jason A. Donenfeld a7ce5ad42a gradle: bump to api 34
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-05 16:13:19 +02:00
Jason A. Donenfeld fbcbfbd311 strings: sync with crowdin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-26 16:19:52 +02:00
Jason A. Donenfeld 2abd426cdc gradle: bump to agp 8.2.0-alpha05
I wanted to stay on 8.1 in hopes of landing on a stable channel, but
Google won't backport the RB fix, so we have to bump to 8.2 alphas.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-26 16:19:52 +02:00
Jason A. Donenfeld 37a892a2da gradle: sort extracted locales rather than generated XML
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-26 16:19:52 +02:00
Jason A. Donenfeld f2d166a6a4 ui: add basic double update guard
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-26 16:19:52 +02:00
Jason A. Donenfeld d883802178 ui: remove debug keys
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-26 16:19:52 +02:00
Jason A. Donenfeld 8d990be204 ui: add missing article to string
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-14 01:18:12 +02:00
Jason A. Donenfeld 9972d9607e gradle: sort lines in localeConfig
This works around https://issuetracker.google.com/issues/281825213

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-13 01:12:15 +02:00
Jason A. Donenfeld 6a72194106 ui: use modal corruption alert instead of snackbar
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-11 13:50:26 +02:00
Jason A. Donenfeld 254e6164d7 ui: use applicationScope helper when possible
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-11 02:57:38 +02:00
Jason A. Donenfeld 675386241b ui: cleanup quick tile and modernize
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-11 02:52:50 +02:00
Jason A. Donenfeld fb08bb6bd4 strings: sync with crowdin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 20:54:29 +02:00
Jason A. Donenfeld 70f8e5ab3a ui: add shortcut for adding quick settings tile
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 20:48:11 +02:00
Jason A. Donenfeld e53a8d76f9 gradle: hack around 8.1.0-beta02 api 21 outlining bug
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 19:56:08 +02:00
Jason A. Donenfeld e0b4551bca gradle: generate locales for per-app picking
Enable the per-app locale picking menu by adding the right metadata
automatically to the manifest with new AGP automation.

This attempts to follow:
https://developer.android.com/guide/topics/resources/app-languages#use-localeconfig

Using the new AGP feature:
https://developer.android.com/studio/preview/features#automatic-per-app-languages

It appears to work, and it also should squelch the "W AppCompatDelegate:
Checking for metadata for AppLocalesMetadataHolderService : " warnings
on old Android that syphyr pointed out.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 19:56:04 +02:00
Jason A. Donenfeld 4156b83b84 ui: bifurcate only parts of release but nag about wrong context
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 19:10:53 +02:00
Jason A. Donenfeld f829b8abe0 gradle: exclude version meta files in release build
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-10 16:54:12 +02:00
Jason A. Donenfeld 5cafd1ebe4 ui: use debug key in debug builds
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-08 14:00:09 +02:00
Jason A. Donenfeld 51991324a9 ui: only register contracts in constructors
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-08 13:31:33 +02:00
Jason A. Donenfeld 33a8a51962 gradle: restore play runtime detection
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-05-08 13:08:09 +02:00