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 --- src/de/blinkt/openvpn/LogWindow.java | 5 ----- src/de/blinkt/openvpn/core/OpenVPN.java | 15 --------------- src/de/blinkt/openvpn/core/OpenVpnService.java | 21 ++++++++------------- 3 files changed, 8 insertions(+), 33 deletions(-) (limited to 'src/de') 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