summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/GeneralSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/blinkt/openvpn/GeneralSettings.java')
-rw-r--r--src/de/blinkt/openvpn/GeneralSettings.java13
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;
}