diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-17 20:17:19 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-17 20:17:19 +0200 |
commit | aadf9c06d74fbb41af7be39661055fd367b4c643 (patch) | |
tree | 3d4625d3721b42f7fdfcede0c0ce069d09f1c0d5 /src/de/blinkt/openvpn/GeneralSettings.java | |
parent | 7fe13897bf2ba07ac553b3a47cb5cf66c766f67d (diff) |
Implementier modprobe tun for more braindead images
Diffstat (limited to 'src/de/blinkt/openvpn/GeneralSettings.java')
-rw-r--r-- | src/de/blinkt/openvpn/GeneralSettings.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/GeneralSettings.java b/src/de/blinkt/openvpn/GeneralSettings.java index 24bf2616..b9c412c0 100644 --- a/src/de/blinkt/openvpn/GeneralSettings.java +++ b/src/de/blinkt/openvpn/GeneralSettings.java @@ -1,5 +1,8 @@ package de.blinkt.openvpn; +import java.io.File; + import android.os.Bundle; +import android.preference.Preference; import android.preference.PreferenceFragment; public class GeneralSettings extends PreferenceFragment { @@ -11,6 +14,16 @@ public class GeneralSettings extends PreferenceFragment { // Load the preferences from an XML resource addPreferencesFromResource(R.xml.general_settings); + Preference loadtun = findPreference("loadTunModule"); + if(!isTunModuleAvailable()) + loadtun.setEnabled(false); + } + + private boolean isTunModuleAvailable() { + // Check if the tun module exists on the file system + if(new File("/system/lib/modules/tun.ko").length() > 10) + return true; + return false; } |