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 | f622fbfbf3a6f8985f681c268c64d07e7dcd3eb7 (patch) | |
tree | ed870475bbbcb01a50330485ea505a63302d6cd5 /src/de/blinkt/openvpn/GeneralSettings.java | |
parent | 2097538559ca82d4c2336da63a5e45e10ca53af0 (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; } |