summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnService.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-12-27 19:47:35 +0100
committerArne Schwabe <arne@rfc2549.org>2012-12-27 19:47:35 +0100
commit1c8e1f9adb41d69829886538e9b2b25a9aeb7bbb (patch)
tree90a37b04858799a40f16600f81edae0840f4a576 /src/de/blinkt/openvpn/OpenVpnService.java
parent5420d42b057ad6e0d606088fa9e0836824db8b14 (diff)
Make changes needed to provide an external API
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnService.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnService.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java
index 603f86ce..f4550c13 100644
--- a/src/de/blinkt/openvpn/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/OpenVpnService.java
@@ -120,7 +120,7 @@ public class OpenVpnService extends VpnService implements StateListener {
private void jbNotificationExtras(boolean lowpriority,
android.app.Notification.Builder nbuilder) {
try {
- if( lowpriority) {
+ if(lowpriority) {
Method setpriority = nbuilder.getClass().getMethod("setPriority", int.class);
// PRIORITY_MIN == -2
setpriority.invoke(nbuilder, -2 );
@@ -195,8 +195,8 @@ public class OpenVpnService extends VpnService implements StateListener {
String prefix = getPackageName();
String[] argv = intent.getStringArrayExtra(prefix + ".ARGV");
String nativelibdir = intent.getStringExtra(prefix + ".nativelib");
-
String profileUUID = intent.getStringExtra(prefix + ".profileUUID");
+
mProfile = ProfileManager.get(profileUUID);
showNotification("Starting VPN " + mProfile.mName,"Starting VPN " + mProfile.mName, false,0);
@@ -317,12 +317,12 @@ public class OpenVpnService extends VpnService implements StateListener {
String bconfig[] = new String[6];
- bconfig[0]= getString(R.string.last_openvpn_tun_config);
- bconfig[1] = String.format(getString(R.string.local_ip_info,mLocalIP.mIp,mLocalIP.len,mLocalIPv6, mMtu));
- bconfig[2] = String.format(getString(R.string.dns_server_info, joinString(mDnslist)));
- bconfig[3] = String.format(getString(R.string.dns_domain_info, mDomain));
- bconfig[4] = String.format(getString(R.string.routes_info, joinString(mRoutes)));
- bconfig[5] = String.format(getString(R.string.routes_info6, joinString(mRoutesv6)));
+ bconfig[0]= getString(R.string.last_openvpn_tun_config);
+ bconfig[1] = getString(R.string.local_ip_info,mLocalIP.mIp,mLocalIP.len,mLocalIPv6, mMtu);
+ bconfig[2] = getString(R.string.dns_server_info, joinString(mDnslist));
+ bconfig[3] = getString(R.string.dns_domain_info, mDomain);
+ bconfig[4] = getString(R.string.routes_info, joinString(mRoutes));
+ bconfig[5] = getString(R.string.routes_info6, joinString(mRoutesv6));
String session = mProfile.mName;
if(mLocalIP!=null)
@@ -393,11 +393,11 @@ public class OpenVpnService extends VpnService implements StateListener {
public void addRoute(String dest, String mask) {
CIDRIP route = new CIDRIP(dest, mask);
if(route.len == 32 && !mask.equals("255.255.255.255")) {
- OpenVPN.logMessage(0, "", String.format(getString(R.string.route_not_cidr,dest,mask)));
+ OpenVPN.logMessage(0, "", getString(R.string.route_not_cidr,dest,mask));
}
if(route.normalise())
- OpenVPN.logMessage(0, "", String.format(getString(R.string.route_not_netip,dest,route.len,route.mIp)));
+ OpenVPN.logMessage(0, "", getString(R.string.route_not_netip,dest,route.len,route.mIp));
mRoutes.add(route);
}
@@ -420,7 +420,7 @@ public class OpenVpnService extends VpnService implements StateListener {
else
mLocalIP.len=31;
} else {
- OpenVPN.logMessage(0, "", String.format(getString(R.string.ip_not_cidr, local,netmask,mode)));
+ OpenVPN.logMessage(0, "", getString(R.string.ip_not_cidr, local,netmask,mode));
}
}
}