]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Show profile ID at bottom of advanced settings
authorTobias Brunner <tobias@strongswan.org>
Wed, 6 Jun 2018 14:38:26 +0000 (16:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 3 Jul 2018 09:31:32 +0000 (11:31 +0200)
Can be selected and copied to the clipboard to use in automation
software that doesn't support the shortcut.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java
src/frontends/android/app/src/main/res/layout/profile_detail_view.xml
src/frontends/android/app/src/main/res/values-de/strings.xml
src/frontends/android/app/src/main/res/values-pl/strings.xml
src/frontends/android/app/src/main/res/values-ru/strings.xml
src/frontends/android/app/src/main/res/values-ua/strings.xml
src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
src/frontends/android/app/src/main/res/values/strings.xml

index 37c5b3357f09c68b42ec26fea15c48f922e57344..a811244e276614768090197d2d622cafe2b99bd0 100644 (file)
@@ -132,6 +132,8 @@ public class VpnProfileDetailActivity extends AppCompatActivity
        private EditText mIkeProposal;
        private TextInputLayoutHelper mEspProposalWrap;
        private EditText mEspProposal;
+       private TextView mProfileIdLabel;
+       private TextView mProfileId;
 
        @Override
        public void onCreate(Bundle savedInstanceState)
@@ -194,6 +196,9 @@ public class VpnProfileDetailActivity extends AppCompatActivity
                /* make the link clickable */
                ((TextView)findViewById(R.id.proposal_intro)).setMovementMethod(LinkMovementMethod.getInstance());
 
+               mProfileIdLabel = (TextView)findViewById(R.id.profile_id_label);
+               mProfileId = (TextView)findViewById(R.id.profile_id);
+
                final SpaceTokenizer spaceTokenizer = new SpaceTokenizer();
                mName.setTokenizer(spaceTokenizer);
                mRemoteId.setTokenizer(spaceTokenizer);
@@ -564,6 +569,12 @@ public class VpnProfileDetailActivity extends AppCompatActivity
                }
                mShowAdvanced.setVisibility(!show ? View.VISIBLE : View.GONE);
                mAdvancedSettings.setVisibility(show ? View.VISIBLE : View.GONE);
+
+               if (show && mProfile == null)
+               {
+                       mProfileIdLabel.setVisibility(View.GONE);
+                       mProfileId.setVisibility(View.GONE);
+               }
        }
 
        /**
@@ -749,6 +760,7 @@ public class VpnProfileDetailActivity extends AppCompatActivity
                                mSelectedApps = mProfile.getSelectedAppsSet();
                                mIkeProposal.setText(mProfile.getIkeProposal());
                                mEspProposal.setText(mProfile.getEspProposal());
+                               mProfileId.setText(mProfile.getUUID().toString());
                                flags = mProfile.getFlags();
                                useralias = mProfile.getUserCertificateAlias();
                                local_id = mProfile.getLocalId();
index d4d88314d013ca0b4d6b2691e4996ab08c9a8291..cf7609c44575ef7f125aab2e9e28539f646db729 100644 (file)
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
+            <TextView
+                android:id="@+id/profile_id_label"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:layout_marginBottom="10dp"
+                android:layout_marginLeft="4dp"
+                android:layout_marginStart="4dp"
+                android:textSize="16sp"
+                android:text="@string/profile_profile_id" />
+
+            <TextView
+                android:id="@+id/profile_id"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:layout_marginBottom="10dp"
+                android:layout_marginLeft="4dp"
+                android:textSize="12sp"
+                android:textIsSelectable="true" />
+
         </LinearLayout>
 
     </LinearLayout>
index ec4c80fe861eaa6d1b880980bbc818667cbf7a47..896e53608ff4f70504a1d36607a7b7b8cfd52e26 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-    Copyright (C) 2012-2017 Tobias Brunner
+    Copyright (C) 2012-2018 Tobias Brunner
     Copyright (C) 2012 Giuliano Grassi
     Copyright (C) 2012 Ralf Sager
     HSR Hochschule fuer Technik Rapperswil
     <string name="profile_import_exists">Dieses VPN Profil existiert bereits, die bestehenden Einstellungen werden ersetzt.</string>
     <string name="profile_cert_import">Zertifikat aus VPN Profil importieren</string>
     <string name="profile_cert_alias">Zertifikat für \"%1$s\"</string>
+    <string name="profile_profile_id">Profil-ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">Ein Wert wird benötigt, um die Verbindung aufbauen zu können</string>
     <string name="alert_text_no_input_username">Bitte geben Sie Ihren Benutzernamen ein</string>
index 3bf24a4191f7383fc2cdb7313d4a481692b44297..ce1dc6741b199b8e0f08d09467ee188841cbdf16 100644 (file)
     <string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
     <string name="profile_cert_import">Import certificate from VPN profile</string>
     <string name="profile_cert_alias">Certificate for \"%1$s\"</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
     <string name="alert_text_no_input_username">Wprowadź swoją nazwę użytkownika</string>
index f4e59675855cddd9d5a7b261d5c8b265dfe3940b..756473b5649d94feee402c7f0f6667ab9d0e86b3 100644 (file)
     <string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
     <string name="profile_cert_import">Import certificate from VPN profile</string>
     <string name="profile_cert_alias">Certificate for \"%1$s\"</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
     <string name="alert_text_no_input_username">Пожалуйста введите имя пользователя</string>
index 931c09a6fbf40aa771973c55be65b6cb0d14cde6..8c165734a383ce86fe8cc5ccdfe8b7a1ce8acb42 100644 (file)
     <string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
     <string name="profile_cert_import">Import certificate from VPN profile</string>
     <string name="profile_cert_alias">Certificate for \"%1$s\"</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
     <string name="alert_text_no_input_username">Введіть ім\'я користувача </string>
index 7291ccb6c62093f49de7ac4466c650e5e4e353c7..2d195f638402555f781370f3f684c6dd565c0979 100644 (file)
     <string name="profile_import_exists">此VPN配置已经存在,当前设定将被覆盖。</string>
     <string name="profile_cert_import">从VPN配置导入证书</string>
     <string name="profile_cert_alias">\"%1$s\" 所对应的证书</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">必填信息以初始化连接</string>
     <string name="alert_text_no_input_username">请输入您的用户名</string>
index 5283d368a015001a03f42955068915855242c181..650cd6940d01467a54586ea86a26eaeb2cba079b 100644 (file)
     <string name="profile_import_exists">這個VPN設定檔已經存在,當前設定檔會被覆蓋。</string>
     <string name="profile_cert_import">從VPN設定檔匯入憑證</string>
     <string name="profile_cert_alias">\"%1$s\" 對應的憑證</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">請填寫必要訊息才能初始化連線</string>
     <string name="alert_text_no_input_username">請輸入您的用戶名稱</string>
index 5c88e43ea0297b43a1d64127f0558f94bbe89714..e6cb9dc4cdfb42dcdd93386e4053bed3d0922e91 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-    Copyright (C) 2012-2017 Tobias Brunner
+    Copyright (C) 2012-2018 Tobias Brunner
     Copyright (C) 2012 Giuliano Grassi
     Copyright (C) 2012 Ralf Sager
     HSR Hochschule fuer Technik Rapperswil
     <string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
     <string name="profile_cert_import">Import certificate from VPN profile</string>
     <string name="profile_cert_alias">Certificate for \"%1$s\"</string>
+    <string name="profile_profile_id">Profile ID</string>
     <!-- Warnings/Notifications in the details view -->
     <string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
     <string name="alert_text_no_input_username">Please enter your username </string>