private boolean mHideImport;
private androidx.core.widget.ContentLoadingProgressBar mProgressBar;
private TextView mExistsWarning;
+ private TextView mSharedSecretWarning;
private ViewGroup mBasicDataGroup;
private TextView mName;
private TextView mGateway;
mProgressBar = findViewById(R.id.progress_bar);
mExistsWarning = findViewById(R.id.exists_warning);
+ mSharedSecretWarning = findViewById(R.id.shared_secret_warning);
mBasicDataGroup = findViewById(R.id.basic_data_group);
mName = findViewById(R.id.name);
mGateway = findViewById(R.id.gateway);
mRemoteCert = findViewById(R.id.remote_certificate);
mExistsWarning.setVisibility(View.GONE);
+ mSharedSecretWarning.setVisibility(View.GONE);
mBasicDataGroup.setVisibility(View.GONE);
mUsernamePassword.setVisibility(View.GONE);
mUserCertificate.setVisibility(View.GONE);
if (mProfile.getVpnType().has(VpnTypeFeature.USER_PASS))
{
mUsername.setText(mProfile.getUsername());
- if (mProfile.getUsername() != null && !mProfile.getUsername().isEmpty())
+ if (!TextUtils.isEmpty(mProfile.getUsername()))
{
mUsername.setEnabled(false);
}
+ mPassword.setText(mProfile.getPassword());
+ if (!TextUtils.isEmpty(mProfile.getPassword()))
+ {
+ mPassword.setEnabled(false);
+ mSharedSecretWarning.setVisibility(View.VISIBLE);
+ }
}
mUserCertificate.setVisibility(mProfile.getVpnType().has(VpnTypeFeature.CERTIFICATE) ? View.VISIBLE : View.GONE);
if (type.has(VpnTypeFeature.USER_PASS))
{
profile.setUsername(local.optString("eap_id", null));
+ profile.setPassword(local.optString("shared_secret", null));
}
if (type.has(VpnTypeFeature.CERTIFICATE))
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary" />
+ <TextView
+ android:id="@+id/shared_secret_warning"
+ android:background="@drawable/state_background"
+ android:padding="8dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ app:drawableStartCompat="@android:drawable/ic_dialog_alert"
+ android:drawablePadding="8dp"
+ android:textStyle="bold"
+ android:text="@string/profile_import_shared_secret"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorPrimary" />
+
<LinearLayout
android:id="@+id/basic_data_group"
android:layout_width="match_parent"
<string name="profile_import_failed_tls">TLS-Handshake fehlgeschlagen</string>
<string name="profile_import_failed_value">Ungültiger Wert in \"%1$s\"</string>
<string name="profile_import_exists">Dieses VPN Profil existiert bereits, die bestehenden Einstellungen werden ersetzt.</string>
+ <string name="profile_import_shared_secret">Diese Datei enthält ein Klartext-Passwort. Denken Sie daran, sie nach dem Importieren zu löschen.</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>
<string name="profile_import_failed_tls">TLS handshake failed</string>
<string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</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>
<string name="profile_import_failed_tls">TLS handshake failed</string>
<string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</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>
<string name="profile_import_failed_tls">TLS handshake failed</string>
<string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</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>
<string name="profile_import_failed_tls">TLS握手失败</string>
<string name="profile_import_failed_value">无效的值: \"%1$s\"</string>
<string name="profile_import_exists">此VPN配置已经存在,当前设定将被覆盖。</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</string>
<string name="profile_cert_import">从VPN配置导入证书</string>
<string name="profile_cert_alias">\"%1$s\" 所对应的证书</string>
<string name="profile_profile_id">配置文件ID</string>
<string name="profile_import_failed_tls">TLS連線失敗</string>
<string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">這個VPN設定檔已經存在,當前設定檔會被覆蓋。</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</string>
<string name="profile_cert_import">從VPN設定檔匯入憑證</string>
<string name="profile_cert_alias">\"%1$s\" 對應的憑證</string>
<string name="profile_profile_id">Profile ID</string>
<string name="profile_import_failed_tls">TLS handshake failed</string>
<string name="profile_import_failed_value">Invalid value in \"%1$s\"</string>
<string name="profile_import_exists">This VPN profile already exists, its current settings will be replaced.</string>
+ <string name="profile_import_shared_secret">This file contains a cleartext password. Remember to delete it after importing.</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>