From e481245959d63c9aa23c562cae6dbc5aea5eb307 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 10 Apr 2013 10:58:43 +0200 Subject: Always log tun information I tired of bug reports without this information. Also this removes one of the unclear buttons in the Logwindow --- res/menu/logmenu.xml | 8 +------- res/values/strings.xml | 8 ++------ src/de/blinkt/openvpn/LogWindow.java | 5 ----- src/de/blinkt/openvpn/core/OpenVPN.java | 15 --------------- src/de/blinkt/openvpn/core/OpenVpnService.java | 21 ++++++++------------- 5 files changed, 11 insertions(+), 46 deletions(-) diff --git a/res/menu/logmenu.xml b/res/menu/logmenu.xml index 12b54c67..4c4f132b 100644 --- a/res/menu/logmenu.xml +++ b/res/menu/logmenu.xml @@ -11,14 +11,8 @@ android:id="@+id/cancel" android:icon="@android:drawable/ic_menu_close_clear_cancel" android:showAsAction="ifRoom|withText" - android:title="@string/disconnect" + android:title="@string/cancel_connection" android:titleCondensed="@string/cancel"/> - Source code and issue tracker available at http://code.google.com/p/ics-openvpn/ This program uses the following components; see the source code for full details on the licenses About - About OpenVPN for Android - List of all configured VPNs Profiles Type PKCS12 Password @@ -57,7 +55,6 @@ Specify custom options. Use with care! Route rejected by Android Disconnect - Disconnect clear log Cancel Confirmation Disconnect the connected VPN/cancel the connection attempt? @@ -99,10 +96,9 @@ Clear info Show connection details - Last interface configuration from OpenVPN: + Opening tun interface: Local IPv4: %1$s/%2$d IPv6: %3$s MTU: %4$d - DNS Server: %s - DNS Domain: %s + DNS Server: %1$s, Domain: %2$s Routes: %s Routes IPv6: %s Got interface information %1$s and %2$s, assuming second address is peer address of remote. Using /32 netmask for local IP. Mode given by OpenVPN is \"%3$s\". diff --git a/src/de/blinkt/openvpn/LogWindow.java b/src/de/blinkt/openvpn/LogWindow.java index 5077da4b..5c78f2f6 100644 --- a/src/de/blinkt/openvpn/LogWindow.java +++ b/src/de/blinkt/openvpn/LogWindow.java @@ -46,7 +46,6 @@ import de.blinkt.openvpn.core.ProfileManager; public class LogWindow extends ListActivity implements StateListener { private static final String LOGTIMEFORMAT = "logtimeformat"; private static final int START_VPN_CONFIG = 0; - private String[] mBconfig=null; protected OpenVpnService mService; private ServiceConnection mConnection = new ServiceConnection() { @@ -283,10 +282,6 @@ public class LogWindow extends ListActivity implements StateListener { builder.show(); return true; - } else if(item.getItemId()==R.id.info) { - if(mBconfig==null) - OpenVPN.triggerLogBuilderConfig(); - } else if(item.getItemId()==R.id.send) { ladapter.shareLog(); } else if(item.getItemId()==R.id.edit_vpn) { diff --git a/src/de/blinkt/openvpn/core/OpenVPN.java b/src/de/blinkt/openvpn/core/OpenVPN.java index aba3ef0c..2bc4cf6b 100644 --- a/src/de/blinkt/openvpn/core/OpenVPN.java +++ b/src/de/blinkt/openvpn/core/OpenVPN.java @@ -31,8 +31,6 @@ public class OpenVPN { private static Vector stateListener; private static Vector byteCountListener; - private static String[] mBconfig; - private static String mLaststatemsg=""; private static String mLaststate = "NOPROCESS"; @@ -346,19 +344,6 @@ public class OpenVPN { // brought to you by eclipse auto complete return (LogItem[]) logbuffer.toArray(new LogItem[logbuffer.size()]); - } - public static void logBuilderConfig(String[] bconfig) { - mBconfig = bconfig; - } - public static void triggerLogBuilderConfig() { - if(mBconfig==null) { - logMessage(0, "", "No active interface"); - } else { - for (String item : mBconfig) { - logMessage(0, "", item); - } - } - } public static void updateStateString (String state, String msg) { diff --git a/src/de/blinkt/openvpn/core/OpenVpnService.java b/src/de/blinkt/openvpn/core/OpenVpnService.java index 1b25c28a..4dba80f1 100644 --- a/src/de/blinkt/openvpn/core/OpenVpnService.java +++ b/src/de/blinkt/openvpn/core/OpenVpnService.java @@ -104,7 +104,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac private void endVpnService() { mProcessThread=null; - OpenVPN.logBuilderConfig(null); OpenVPN.removeByteCountListener(this); unregisterNetworkStateReceiver(); ProfileManager.setConntectedVpnProfileDisconnected(this); @@ -268,7 +267,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac mProfile = ProfileManager.get(profileUUID); - showNotification("Starting VPN " + mProfile.mName,"Starting VPN " + mProfile.mName, + String startTitle = getString(R.string.start_vpn_title, mProfile.mName); + String startTicker = getString(R.string.start_vpn_ticker, mProfile.mName); + showNotification(startTitle, startTicker, false,0,ConnectionStatus.LEVEL_CONNECTING_NO_SERVER_REPLY_YET); // Set a flag that we are starting a new VPN @@ -407,14 +408,11 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac if(mDomain!=null) builder.addSearchDomain(mDomain); - String bconfig[] = new String[6]; - - 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)); + OpenVPN.logInfo(R.string.last_openvpn_tun_config); + OpenVPN.logInfo(R.string.local_ip_info,mLocalIP.mIp,mLocalIP.len,mLocalIPv6, mMtu); + OpenVPN.logInfo(R.string.dns_server_info, joinString(mDnslist), mDomain); + OpenVPN.logInfo(R.string.routes_info, joinString(mRoutes)); + OpenVPN.logInfo(R.string.routes_info6, joinString(mRoutesv6)); String session = mProfile.mName; if(mLocalIP!=null && mLocalIPv6!=null) @@ -424,9 +422,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac builder.setSession(session); - - OpenVPN.logBuilderConfig(bconfig); - // No DNS Server, log a warning if(mDnslist.size()==0) OpenVPN.logInfo(R.string.warn_no_dns); -- cgit v1.2.3