beb40ad09c
These changes can happen at the wrong time, so we need to be able to walk them back. Fixes: Exception java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at androidx.fragment.app.FragmentManager.checkStateLoss (FragmentManager.java:1610) at androidx.fragment.app.FragmentManager.enqueueAction (FragmentManager.java:1650) at androidx.fragment.app.BackStackRecord.commitInternal (BackStackRecord.java:341) at androidx.fragment.app.BackStackRecord.commit (BackStackRecord.java:306) at androidx.fragment.app.FragmentManagerKt.commit$default (FragmentManager.kt:35) at com.wireguard.android.activity.MainActivity.onSelectedTunnelChanged (MainActivity.kt:113) at com.wireguard.android.activity.BaseActivity.setSelectedTunnel (BaseActivity.kt:25) at com.wireguard.android.activity.BaseActivity$onCreate$1.invokeSuspend (BaseActivity.kt:44) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith (DispatchedContinuation.java:256) at kotlinx.coroutines.DispatchedTaskKt.resume (DispatchedTask.kt:177) at kotlinx.coroutines.CancellableContinuationImpl.parentCancelled$kotlinx_coroutines_core (CancellableContinuationImpl.kt:190) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined (DispatchedTask.kt:190) at kotlinx.coroutines.DispatchedTaskKt.dispatch (DispatchedTask.kt:161) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume (CancellableContinuationImpl.kt:397) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl (CancellableContinuationImpl.kt:431) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default (CancellableContinuationImpl.kt:420) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith (CancellableContinuationImpl.kt:328) at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke (JobSupport.kt:1413) at kotlinx.coroutines.JobSupport.notifyHandlers (JobSupport.kt:368) at kotlinx.coroutines.JobSupport.notifyCompletion (JobSupport.kt:362) at kotlinx.coroutines.JobSupport.completeStateFinalization (JobSupport.kt:323) at kotlinx.coroutines.JobSupport.finalizeFinishingState (JobSupport.kt:240) at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath (JobSupport.kt:906) at kotlinx.coroutines.JobSupport.tryMakeCompleting (JobSupport.kt:863) at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core (JobSupport.kt:806) at kotlinx.coroutines.CompletableDeferredImpl.complete (CompletableDeferredImpl.java:92) at com.wireguard.android.model.TunnelManager$onTunnelsLoaded$1.invokeSuspend (TunnelManager.kt:120) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:237) at android.app.ActivityThread.main (ActivityThread.java:8163) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967) Exception java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at androidx.fragment.app.FragmentManager.checkStateLoss (FragmentManager.java:1610) at androidx.fragment.app.FragmentManager.enqueueAction (FragmentManager.java:1650) at androidx.fragment.app.BackStackRecord.commitInternal (BackStackRecord.java:341) at androidx.fragment.app.BackStackRecord.commit (BackStackRecord.java:306) at androidx.fragment.app.FragmentManagerKt.commit$default (FragmentManager.kt:35) at com.wireguard.android.activity.MainActivity.onSelectedTunnelChanged (MainActivity.kt:113) at com.wireguard.android.activity.BaseActivity.setSelectedTunnel (BaseActivity.kt:25) at com.wireguard.android.activity.BaseActivity$onCreate$1.invokeSuspend (BaseActivity.kt:44) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith (DispatchedContinuation.java:256) at kotlinx.coroutines.DispatchedTaskKt.resume (DispatchedTask.kt:177) at kotlinx.coroutines.CancellableContinuationImpl.parentCancelled$kotlinx_coroutines_core (CancellableContinuationImpl.kt:190) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined (DispatchedTask.kt:190) at kotlinx.coroutines.DispatchedTaskKt.dispatch (DispatchedTask.kt:161) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume (CancellableContinuationImpl.kt:397) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl (CancellableContinuationImpl.kt:431) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default (CancellableContinuationImpl.kt:420) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith (CancellableContinuationImpl.kt:328) at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke (JobSupport.kt:1413) at kotlinx.coroutines.JobSupport.notifyHandlers (JobSupport.kt:368) at kotlinx.coroutines.JobSupport.notifyCompletion (JobSupport.kt:362) at kotlinx.coroutines.JobSupport.completeStateFinalization (JobSupport.kt:323) at kotlinx.coroutines.JobSupport.finalizeFinishingState (JobSupport.kt:240) at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath (JobSupport.kt:906) at kotlinx.coroutines.JobSupport.tryMakeCompleting (JobSupport.kt:863) at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core (JobSupport.kt:806) at kotlinx.coroutines.CompletableDeferredImpl.complete (CompletableDeferredImpl.java:92) at com.wireguard.android.model.TunnelManager$onTunnelsLoaded$1.invokeSuspend (TunnelManager.kt:120) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:210) at android.os.Looper.loop (Looper.java:299) at android.app.ActivityThread.main (ActivityThread.java:8302) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1037) Exception java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at androidx.fragment.app.FragmentManager.checkStateLoss (FragmentManager.java:1610) at androidx.fragment.app.FragmentManager.ensureExecReady (FragmentManager.java:1711) at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:1754) at androidx.fragment.app.FragmentManager.popBackStackImmediate (FragmentManager.java:854) at androidx.fragment.app.FragmentManager.popBackStackImmediate (FragmentManager.java:778) at com.wireguard.android.activity.MainActivity.onSelectedTunnelChanged (MainActivity.kt:110) at com.wireguard.android.activity.BaseActivity.setSelectedTunnel (BaseActivity.kt:25) at com.wireguard.android.activity.BaseActivity$onCreate$1.invokeSuspend (BaseActivity.kt:44) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106) at kotlinx.coroutines.EventLoop.processUnconfinedEvent (EventLoop.common.kt:69) at kotlinx.coroutines.DispatchedTaskKt.runUnconfinedEventLoop (DispatchedTask.kt:204) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith (DispatchedContinuation.kt:282) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable (Cancellable.kt:30) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default (Cancellable.kt:25) at kotlinx.coroutines.CoroutineStart.invoke (CoroutineStart.java:110) at kotlinx.coroutines.AbstractCoroutine.start (AbstractCoroutine.kt:126) at kotlinx.coroutines.BuildersKt.launch$default (Builders.kt) at com.wireguard.android.model.TunnelManager.onTunnelsLoaded (TunnelManager.java:114) at com.wireguard.android.model.TunnelManager.access$onTunnelsLoaded (TunnelManager.java:40) at com.wireguard.android.model.TunnelManager$onCreate$1.invokeSuspend (TunnelManager.kt:104) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106) at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:226) at android.os.Looper.loop (Looper.java:313) at android.app.ActivityThread.main (ActivityThread.java:8757) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> |
||
---|---|---|
.idea | ||
gradle/wrapper | ||
tunnel | ||
ui | ||
.gitignore | ||
.gitmodules | ||
build.gradle | ||
COPYING | ||
gradle.properties | ||
gradlew | ||
README.md | ||
settings.gradle | ||
sync-crowdin.sh | ||
version.gradle |
Android GUI for WireGuard
This is an Android GUI for WireGuard. It opportunistically uses the kernel implementation, and falls back to using the non-root userspace implementation.
Building
$ git clone --recurse-submodules https://git.zx2c4.com/wireguard-android
$ cd wireguard-android
$ ./gradlew assembleRelease
macOS users may need flock(1).
Embedding
The tunnel library is on Maven Central, alongside extensive class library documentation.
implementation 'com.wireguard.android:tunnel:$wireguardTunnelVersion'
The library makes use of Java 8 features, so be sure to support those in your gradle configuration with desugaring:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled = true
}
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
}
Translating
Please help us translate the app into several languages on our translation platform.