diff --git a/app/src/main/java/eu/neilalexander/yggdrasil/PacketTunnelProvider.kt b/app/src/main/java/eu/neilalexander/yggdrasil/PacketTunnelProvider.kt index 7259e80..a8e2ca0 100644 --- a/app/src/main/java/eu/neilalexander/yggdrasil/PacketTunnelProvider.kt +++ b/app/src/main/java/eu/neilalexander/yggdrasil/PacketTunnelProvider.kt @@ -152,8 +152,7 @@ open class PacketTunnelProvider: VpnService() { builder.addRoute("2001:4860:4860::8888", 128) } - parcel = builder.establish() - val parcel = parcel + val parcel = builder.establish() if (parcel == null || !parcel.fileDescriptor.valid()) { stop() return @@ -172,6 +171,8 @@ open class PacketTunnelProvider: VpnService() { updater() } + this.parcel = parcel + var intent = Intent(YGG_STATE_INTENT) intent.putExtra("state", STATE_ENABLED) LocalBroadcastManager.getInstance(this).sendBroadcast(intent)