summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/basic_settings.xml2
-rw-r--r--res/values/attrs.xml1
-rw-r--r--src/de/blinkt/openvpn/FileSelectLayout.java11
-rw-r--r--src/de/blinkt/openvpn/VPNPreferences.java4
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java6
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" />
<LinearLayout
@@ -168,6 +169,7 @@
android:id="@+id/pkcs12select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ blinkt:certificate="false"
blinkt:title="@string/client_pkcs12_title" />
<TextView
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index cb503b86..ef3681b1 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -3,6 +3,7 @@
<resources>
<declare-styleable name="FileSelectLayout">
<attr name="title" format="string|reference" />
+ <attr name="certificate" format="boolean" />
<!-- <attr name="taskid" format="integer" /> -->
</declare-styleable>
</resources> \ 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<Header> 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 += "<ca>\n" + ks[0] + "</ca>\n";
+ cfg += "<ca>\n" + ks[0] + "\n</ca>\n";
if (ks[1] != null)
- cfg += "<extra-certs>\n" + ks[1] + "<extra-certs>\n";
- cfg += "<cert>\n" + ks[2] + "</cert>\n";
+ cfg += "<extra-certs>\n" + ks[1] + "\n<extra-certs>\n";
+ cfg += "<cert>\n" + ks[2] + "\n</cert>\n";
cfg += "management-external-key\n";
} else {
cfg += context.getString(R.string.keychain_access) + "\n";