diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/de/blinkt/openvpn/ConfigConverter.java | 5 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/ConfigParser.java | 8 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/LaunchVPN.java | 4 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/NetworkSateReceiver.java | 13 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/ProfileManager.java | 2 |
5 files changed, 24 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java index c08b176d..40aa24e0 100644 --- a/src/de/blinkt/openvpn/ConfigConverter.java +++ b/src/de/blinkt/openvpn/ConfigConverter.java @@ -6,6 +6,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.util.List; import java.util.Vector; @@ -407,7 +408,9 @@ public class ConfigConverter extends ListActivity { private void doImport(InputStream is) { ConfigParser cp = new ConfigParser(); try { - cp.parseConfig(is); + InputStreamReader isr = new InputStreamReader(is); + + cp.parseConfig(isr); VpnProfile vp = cp.convertProfile(); mResult = vp; embedFiles(); diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java index f2814f7e..cdec964e 100644 --- a/src/de/blinkt/openvpn/ConfigParser.java +++ b/src/de/blinkt/openvpn/ConfigParser.java @@ -4,6 +4,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.Reader; import java.util.HashMap; import java.util.Locale; import java.util.Vector; @@ -18,11 +19,10 @@ public class ConfigParser { private HashMap<String, Vector<Vector<String>>> options = new HashMap<String, Vector<Vector<String>>>(); - public void parseConfig(InputStream inputStream) throws IOException, ConfigParseError { + public void parseConfig(Reader reader) throws IOException, ConfigParseError { - InputStreamReader fr = new InputStreamReader(inputStream); - BufferedReader br =new BufferedReader(fr); + BufferedReader br =new BufferedReader(reader); @SuppressWarnings("unused") int lineno=0; @@ -230,9 +230,9 @@ public class ConfigParser { "route-gateway", "route-metric", "route-method", + "status", "script-security", "show-net-up", - "status", "suppress-timestamps", "tmp-dir", "tun-ipv6", diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index c89704fa..bc0a4cf2 100644 --- a/src/de/blinkt/openvpn/LaunchVPN.java +++ b/src/de/blinkt/openvpn/LaunchVPN.java @@ -73,8 +73,8 @@ import android.widget.TextView; */ public class LaunchVPN extends ListActivity implements OnItemClickListener { - static final String EXTRA_KEY = "de.blinkt.openvpn.shortcutProfileUUID"; - static final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName"; + public static final String EXTRA_KEY = "de.blinkt.openvpn.shortcutProfileUUID"; + public static final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName"; public static final String EXTRA_HIDELOG = "de.blinkt.openvpn.showNoLogWindow";; private static final int START_VPN_PROFILE= 70; diff --git a/src/de/blinkt/openvpn/NetworkSateReceiver.java b/src/de/blinkt/openvpn/NetworkSateReceiver.java index a649bd65..e20c8e52 100644 --- a/src/de/blinkt/openvpn/NetworkSateReceiver.java +++ b/src/de/blinkt/openvpn/NetworkSateReceiver.java @@ -37,10 +37,23 @@ public class NetworkSateReceiver extends BroadcastReceiver { if(extrainfo==null)
extrainfo="";
+ /*
+ if(networkInfo.getType()==android.net.ConnectivityManager.TYPE_WIFI) {
+ WifiManager wifiMgr = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
+ WifiInfo wifiinfo = wifiMgr.getConnectionInfo();
+ extrainfo+=wifiinfo.getBSSID();
+
+ subtype += wifiinfo.getNetworkId();
+ }*/
+
+
+
netstatestring = String.format("%2$s %4$s to %1$s %3$s",networkInfo.getTypeName(),
networkInfo.getDetailedState(),extrainfo,subtype );
}
+
+
if(networkInfo!=null && networkInfo.getState() == State.CONNECTED) {
int newnet = networkInfo.getType();
diff --git a/src/de/blinkt/openvpn/ProfileManager.java b/src/de/blinkt/openvpn/ProfileManager.java index d2e08a97..9457b53f 100644 --- a/src/de/blinkt/openvpn/ProfileManager.java +++ b/src/de/blinkt/openvpn/ProfileManager.java @@ -51,7 +51,7 @@ public class ProfileManager { } } - public static ProfileManager getInstance(Context context) { + synchronized public static ProfileManager getInstance(Context context) { checkInstance(context); return instance; } |