When other projects copy and paste all of WireGuard and then tweak it,
some idiots leave the updater code in, resulting in useless requests
going to my server. In some cases this has even resulted in a DoS
because of further confusions.
To cut down on this, hardcode the usual package name prefix, and abort
with a really silly exception if it doesn't match. This will lead copy
and pasters to this comment, which hopefully they read.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
If something goes wrong, maybe it's best not to DoS the update server.
Instead back off gradually and then go into the usual sleep loop.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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>
The newly added zipReleasePublication task will generate a ZIP file at tunnel/build/distributions/tunnel-$VERSION-maven.zip
that can be uploaded to https://central.sonatype.com/publishing.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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>
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>
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>
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>