android: Load JNI libraries in Application class
This way they are also loaded when we don't use CharonVpnService.
This commit is contained in:
parent
2d1f65feb3
commit
92c1b52487
|
@ -1073,28 +1073,4 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
||||||
{
|
{
|
||||||
return Build.MODEL + " - " + Build.BRAND + "/" + Build.PRODUCT + "/" + Build.MANUFACTURER;
|
return Build.MODEL + " - " + Build.BRAND + "/" + Build.PRODUCT + "/" + Build.MANUFACTURER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* The libraries are extracted to /data/data/org.strongswan.android/...
|
|
||||||
* during installation. On newer releases most are loaded in JNI_OnLoad.
|
|
||||||
*/
|
|
||||||
static
|
|
||||||
{
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
|
|
||||||
{
|
|
||||||
System.loadLibrary("strongswan");
|
|
||||||
|
|
||||||
if (MainActivity.USE_BYOD)
|
|
||||||
{
|
|
||||||
System.loadLibrary("tpmtss");
|
|
||||||
System.loadLibrary("tncif");
|
|
||||||
System.loadLibrary("tnccs");
|
|
||||||
System.loadLibrary("imcv");
|
|
||||||
}
|
|
||||||
|
|
||||||
System.loadLibrary("charon");
|
|
||||||
System.loadLibrary("ipsec");
|
|
||||||
}
|
|
||||||
System.loadLibrary("androidbridge");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,11 @@ package org.strongswan.android.logic;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
|
|
||||||
import org.strongswan.android.security.LocalCertificateKeyStoreProvider;
|
import org.strongswan.android.security.LocalCertificateKeyStoreProvider;
|
||||||
|
import org.strongswan.android.ui.MainActivity;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
public class StrongSwanApplication extends Application
|
public class StrongSwanApplication extends Application
|
||||||
{
|
{
|
||||||
|
@ -45,4 +47,28 @@ public class StrongSwanApplication extends Application
|
||||||
{
|
{
|
||||||
return StrongSwanApplication.mContext;
|
return StrongSwanApplication.mContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The libraries are extracted to /data/data/org.strongswan.android/...
|
||||||
|
* during installation. On newer releases most are loaded in JNI_OnLoad.
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
{
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||||
|
{
|
||||||
|
System.loadLibrary("strongswan");
|
||||||
|
|
||||||
|
if (MainActivity.USE_BYOD)
|
||||||
|
{
|
||||||
|
System.loadLibrary("tpmtss");
|
||||||
|
System.loadLibrary("tncif");
|
||||||
|
System.loadLibrary("tnccs");
|
||||||
|
System.loadLibrary("imcv");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.loadLibrary("charon");
|
||||||
|
System.loadLibrary("ipsec");
|
||||||
|
}
|
||||||
|
System.loadLibrary("androidbridge");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue