From 6e04147743d770909acf197401b25c875d7c20e5 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 7 Aug 2012 18:45:03 +0200 Subject: [PATCH] Clone the current VPN profile before updating the password Storing the password on the original object would be problematic in case the user mistypes the password (no prompt would be shown the second time). An alternative would be to just return the ID of the selected profile and then fetch it from the database. --- .../android/src/org/strongswan/android/ui/MainActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java b/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java index 7387dab8d3..50b2bfbe51 100644 --- a/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java +++ b/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java @@ -179,6 +179,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen @Override public void onClick(DialogInterface dialog, int whichButton) { + /* let's work on a clone of the profile when updating the password */ + activeProfile = activeProfile.clone(); activeProfile.setPassword(password.getText().toString().trim()); prepareVpnService(); } -- 2.47.2