From 7a6a6c894d5318b66efbe7289d12c9d33278c750 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 12 Jul 2013 17:39:33 +0200 Subject: Do not show certificate information on pkcs12 and key dialogs (closes issue #180) --HG-- extra : rebase_source : cf8d0c01621f7e22033a8a3962c4bc47983753fb --- res/layout/basic_settings.xml | 2 ++ res/values/attrs.xml | 1 + src/de/blinkt/openvpn/FileSelectLayout.java | 11 +++++++---- src/de/blinkt/openvpn/VPNPreferences.java | 4 +--- src/de/blinkt/openvpn/VpnProfile.java | 6 +++--- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/res/layout/basic_settings.xml b/res/layout/basic_settings.xml index 76535ce6..3b1c48c2 100644 --- a/res/layout/basic_settings.xml +++ b/res/layout/basic_settings.xml @@ -131,6 +131,7 @@ android:id="@+id/keyselect" android:layout_width="match_parent" android:layout_height="wrap_content" + blinkt:certificate="false" blinkt:title="@string/client_key_title" /> + \ No newline at end of file diff --git a/src/de/blinkt/openvpn/FileSelectLayout.java b/src/de/blinkt/openvpn/FileSelectLayout.java index f5a01e10..ce2f5b20 100644 --- a/src/de/blinkt/openvpn/FileSelectLayout.java +++ b/src/de/blinkt/openvpn/FileSelectLayout.java @@ -15,7 +15,8 @@ import android.widget.TextView; public class FileSelectLayout extends LinearLayout implements OnClickListener { - private TextView mDataView; + private final boolean mIsCertificate; + private TextView mDataView; private String mData; private Fragment mFragment; private int mTaskId; @@ -25,13 +26,14 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener { private boolean mShowClear; private TextView mDataDetails; - public FileSelectLayout( Context context,AttributeSet attrset) { + public FileSelectLayout( Context context, AttributeSet attrset) { super(context,attrset); inflate(getContext(), R.layout.file_select, this); - TypedArray ta = context.obtainStyledAttributes(attrset,R.styleable.FileSelectLayout); + TypedArray ta = context.obtainStyledAttributes(attrset, R.styleable.FileSelectLayout); mTitle = ta.getString(R.styleable.FileSelectLayout_title); + mIsCertificate = ta.getBoolean(R.styleable.FileSelectLayout_certificate,true); TextView tview = (TextView) findViewById(R.id.file_title); tview.setText(mTitle); @@ -76,7 +78,8 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener { mDataView.setText(R.string.inline_file_data); else mDataView.setText(data); - mDataDetails.setText(X509Utils.getCertificateFriendlyName(c,data)); + if(mIsCertificate) + mDataDetails.setText(X509Utils.getCertificateFriendlyName(c,data)); } } diff --git a/src/de/blinkt/openvpn/VPNPreferences.java b/src/de/blinkt/openvpn/VPNPreferences.java index 3f24728a..700734f1 100644 --- a/src/de/blinkt/openvpn/VPNPreferences.java +++ b/src/de/blinkt/openvpn/VPNPreferences.java @@ -20,12 +20,9 @@ public class VPNPreferences extends PreferenceActivity { public VPNPreferences() { super(); - } - - @Override protected void onStop() { super.onStop(); @@ -81,6 +78,7 @@ public class VPNPreferences extends PreferenceActivity { } + @Override public void onBuildHeaders(List
target) { loadHeadersFromResource(R.xml.vpn_headers, target); diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 8f8f3c24..53d33b27 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -247,10 +247,10 @@ public class VpnProfile implements Serializable { String[] ks = getKeyStoreCertificates(context); cfg += "### From Keystore ####\n"; if (ks != null) { - cfg += "\n" + ks[0] + "\n"; + cfg += "\n" + ks[0] + "\n\n"; if (ks[1] != null) - cfg += "\n" + ks[1] + "\n"; - cfg += "\n" + ks[2] + "\n"; + cfg += "\n" + ks[1] + "\n\n"; + cfg += "\n" + ks[2] + "\n\n"; cfg += "management-external-key\n"; } else { cfg += context.getString(R.string.keychain_access) + "\n"; -- cgit v1.2.3