diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml index 76335ea7e..a0f32cd1e 100644 --- a/res/values/non_localizable_custom.xml +++ b/res/values/non_localizable_custom.xml @@ -70,7 +70,6 @@ false false true - true false diff --git a/src/org/linphone/AccountPreferencesFragment.java b/src/org/linphone/AccountPreferencesFragment.java index ba0116912..ba01adbca 100644 --- a/src/org/linphone/AccountPreferencesFragment.java +++ b/src/org/linphone/AccountPreferencesFragment.java @@ -82,13 +82,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment { OnPreferenceChangeListener passwordChangedListener = new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - if (getResources().getBoolean(R.bool.store_ha1_passwords) - && mPrefs.getAccountPassword(n) == null) { - String ha1 = LinphoneUtils.md5Hash(mPrefs.getAccountUsername(n), newValue.toString(), mPrefs.getAccountDomain(n)); - mPrefs.setAccountHa1(n, ha1); - } else { - mPrefs.setAccountPassword(n, newValue.toString()); - } + mPrefs.setAccountPassword(n, newValue.toString()); return true; } }; @@ -220,7 +214,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment { userid.setSummary(userid.getText()); EditTextPreference password = (EditTextPreference) account.getPreference(2); - password.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); + password.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); password.setText(mPrefs.getAccountPassword(n)); password.setOnPreferenceChangeListener(passwordChangedListener); diff --git a/src/org/linphone/LinphonePreferences.java b/src/org/linphone/LinphonePreferences.java index a7eef8dff..e43182019 100644 --- a/src/org/linphone/LinphonePreferences.java +++ b/src/org/linphone/LinphonePreferences.java @@ -166,7 +166,6 @@ public class LinphonePreferences { private String tempDisplayName; private String tempUserId; private String tempPassword; - private String tempHa1; private String tempDomain; private String tempProxy; private boolean tempOutboundProxy; @@ -206,11 +205,6 @@ public class LinphonePreferences { return this; } - public AccountBuilder setHa1(String ha1) { - tempHa1 = ha1; - return this; - } - public AccountBuilder setDomain(String domain) { tempDomain = domain; return this; @@ -323,7 +317,7 @@ public class LinphonePreferences { prxCfg.setQualityReportingInterval(tempQualityReportingInterval); prxCfg.setRealm("sip.linphone.org"); - LinphoneAuthInfo authInfo = LinphoneCoreFactory.instance().createAuthInfo(tempUsername, tempUserId, tempPassword, tempHa1, null, tempDomain); + LinphoneAuthInfo authInfo = LinphoneCoreFactory.instance().createAuthInfo(tempUsername, tempUserId, tempPassword, null, null, tempDomain); lc.addProxyConfig(prxCfg); lc.addAuthInfo(authInfo); @@ -474,18 +468,6 @@ public class LinphonePreferences { LinphoneAuthInfo authInfo = getAuthInfo(n); return authInfo == null ? null : authInfo.getPassword(); } - - public void setAccountHa1(int n, String ha1) { - LinphoneAuthInfo info = getClonedAuthInfo(n); - info.setHa1(ha1); - saveAuthInfo(info); - } - - public String getAccountHa1(int n) { - LinphoneAuthInfo authInfo = getAuthInfo(n); - return authInfo == null ? null : authInfo.getHa1(); - } - public void setAccountDomain(int n, String domain) { String identity = "sip:" + getAccountUsername(n) + "@" + domain; diff --git a/src/org/linphone/LinphoneUtils.java b/src/org/linphone/LinphoneUtils.java index 0cdf4794a..108625276 100644 --- a/src/org/linphone/LinphoneUtils.java +++ b/src/org/linphone/LinphoneUtils.java @@ -23,14 +23,13 @@ import static android.view.View.VISIBLE; import java.io.BufferedOutputStream; import java.io.BufferedReader; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -404,32 +403,5 @@ public final class LinphoneUtils { e.printStackTrace(); } } - - public static String md5Hash(String username, String password, String domain) { - String passwordToHash = username + ":" + domain + ":" + password; - - byte messageDigest[] = null; - try { - MessageDigest digest; - digest = java.security.MessageDigest.getInstance("MD5"); - digest.update(passwordToHash.getBytes()); - messageDigest = digest.digest(); - - StringBuffer hexString = new StringBuffer(); - for (int i = 0; i < messageDigest.length; i++) { - String h = Integer.toHexString(0xFF & messageDigest[i]); - while (h.length() < 2) { - h = "0" + h; - } - hexString.append(h); - } - String hash = hexString.toString(); - return hash; - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - - return null; - } } diff --git a/src/org/linphone/setup/SetupActivity.java b/src/org/linphone/setup/SetupActivity.java index 93aa4ab8a..ec18e8ceb 100644 --- a/src/org/linphone/setup/SetupActivity.java +++ b/src/org/linphone/setup/SetupActivity.java @@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ import org.linphone.LinphoneManager; import org.linphone.LinphonePreferences; -import org.linphone.LinphoneUtils; import org.linphone.LinphonePreferences.AccountBuilder; import org.linphone.LinphoneSimpleListener.LinphoneOnRegistrationStateChangedListener; import org.linphone.R; @@ -293,12 +292,8 @@ public class SetupActivity extends FragmentActivity implements OnClickListener { boolean useLinphoneDotOrgCustomPorts = getResources().getBoolean(R.bool.use_linphone_server_ports); AccountBuilder builder = new AccountBuilder(LinphoneManager.getLc()) .setUsername(username) - .setDomain(domain); - if (getResources().getBoolean(R.bool.store_ha1_passwords)) { - builder = builder.setHa1(LinphoneUtils.md5Hash(username, password, domain)); - } else { - builder = builder.setPassword(password); - } + .setDomain(domain) + .setPassword(password); if (isMainAccountLinphoneDotOrg && useLinphoneDotOrgCustomPorts) { if (getResources().getBoolean(R.bool.disable_all_security_features_for_markets)) {