mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
fix(android): Load library before starting tunnel only (#3539)
When AlwaysOnVpn is configured, the tunnel can run without MainActivity, so the library is never loaded. Fixes #3532
This commit is contained in:
@@ -8,17 +8,12 @@ import dev.firezone.android.R
|
||||
|
||||
@AndroidEntryPoint
|
||||
internal class MainActivity : AppCompatActivity(R.layout.activity_main) {
|
||||
// fail fast if the native library is not loaded
|
||||
companion object {
|
||||
init {
|
||||
System.loadLibrary("connlib")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onBackPressed() {}
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ class TunnelService : VpnService() {
|
||||
} else if (config.token != null) {
|
||||
onTunnelStateUpdate(Tunnel.State.Connecting)
|
||||
updateStatusNotification("Status: Connecting...")
|
||||
System.loadLibrary("connlib")
|
||||
|
||||
sessionPtr =
|
||||
TunnelSession.connect(
|
||||
|
||||
Reference in New Issue
Block a user