mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
always use import for UrlEncodingHelper
This commit is contained in:
parent
2226ae6a8e
commit
010d8c9f7e
@ -33,6 +33,7 @@ import com.fsck.k9.Preferences;
|
|||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
import com.fsck.k9.activity.K9Activity;
|
import com.fsck.k9.activity.K9Activity;
|
||||||
import com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection;
|
import com.fsck.k9.activity.setup.AccountSetupCheckSettings.CheckDirection;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.AuthType;
|
import com.fsck.k9.mail.AuthType;
|
||||||
import com.fsck.k9.mail.ConnectionSecurity;
|
import com.fsck.k9.mail.ConnectionSecurity;
|
||||||
@ -279,8 +280,8 @@ public class AccountSetupBasics extends K9Activity
|
|||||||
URI incomingUri = null;
|
URI incomingUri = null;
|
||||||
URI outgoingUri = null;
|
URI outgoingUri = null;
|
||||||
try {
|
try {
|
||||||
String userEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(user);
|
String userEnc = UrlEncodingHelper.encodeUtf8(user);
|
||||||
String passwordEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(password);
|
String passwordEnc = UrlEncodingHelper.encodeUtf8(password);
|
||||||
|
|
||||||
String incomingUsername = mProvider.incomingUsernameTemplate;
|
String incomingUsername = mProvider.incomingUsernameTemplate;
|
||||||
incomingUsername = incomingUsername.replaceAll("\\$email", email);
|
incomingUsername = incomingUsername.replaceAll("\\$email", email);
|
||||||
|
@ -62,6 +62,7 @@ import com.fsck.k9.K9;
|
|||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
import com.fsck.k9.controller.MessageRetrievalListener;
|
import com.fsck.k9.controller.MessageRetrievalListener;
|
||||||
import com.fsck.k9.helper.StringUtils;
|
import com.fsck.k9.helper.StringUtils;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.helper.power.TracingPowerManager;
|
import com.fsck.k9.helper.power.TracingPowerManager;
|
||||||
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
|
import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
|
||||||
@ -202,19 +203,19 @@ public class ImapStore extends Store {
|
|||||||
if (userinfo.endsWith(":")) {
|
if (userinfo.endsWith(":")) {
|
||||||
// Password is empty. This can only happen after an account was imported.
|
// Password is empty. This can only happen after an account was imported.
|
||||||
authenticationType = AuthType.valueOf(userInfoParts[0]);
|
authenticationType = AuthType.valueOf(userInfoParts[0]);
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
} else if (userInfoParts.length == 2) {
|
} else if (userInfoParts.length == 2) {
|
||||||
authenticationType = AuthType.PLAIN;
|
authenticationType = AuthType.PLAIN;
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
} else if (userInfoParts.length == 3) {
|
} else if (userInfoParts.length == 3) {
|
||||||
authenticationType = AuthType.valueOf(userInfoParts[0]);
|
authenticationType = AuthType.valueOf(userInfoParts[0]);
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
|
|
||||||
if (AuthType.EXTERNAL == authenticationType) {
|
if (AuthType.EXTERNAL == authenticationType) {
|
||||||
clientCertificateAlias = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[2]);
|
clientCertificateAlias = UrlEncodingHelper.decodeUtf8(userInfoParts[2]);
|
||||||
} else {
|
} else {
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[2]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -253,11 +254,11 @@ public class ImapStore extends Store {
|
|||||||
* @see ImapStore#decodeUri(String)
|
* @see ImapStore#decodeUri(String)
|
||||||
*/
|
*/
|
||||||
public static String createUri(ServerSettings server) {
|
public static String createUri(ServerSettings server) {
|
||||||
String userEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.username);
|
String userEnc = UrlEncodingHelper.encodeUtf8(server.username);
|
||||||
String passwordEnc = (server.password != null) ?
|
String passwordEnc = (server.password != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.password) : "";
|
UrlEncodingHelper.encodeUtf8(server.password) : "";
|
||||||
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
||||||
|
|
||||||
String scheme;
|
String scheme;
|
||||||
switch (server.connectionSecurity) {
|
switch (server.connectionSecurity) {
|
||||||
|
@ -7,6 +7,7 @@ import com.fsck.k9.Account;
|
|||||||
import com.fsck.k9.K9;
|
import com.fsck.k9.K9;
|
||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
import com.fsck.k9.controller.MessageRetrievalListener;
|
import com.fsck.k9.controller.MessageRetrievalListener;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.*;
|
import com.fsck.k9.mail.*;
|
||||||
import com.fsck.k9.mail.filter.Base64;
|
import com.fsck.k9.mail.filter.Base64;
|
||||||
@ -125,12 +126,12 @@ public class Pop3Store extends Store {
|
|||||||
passwordIndex++;
|
passwordIndex++;
|
||||||
authType = AuthType.valueOf(userInfoParts[0]);
|
authType = AuthType.valueOf(userInfoParts[0]);
|
||||||
}
|
}
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[userIndex]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[userIndex]);
|
||||||
if (userInfoParts.length > passwordIndex) {
|
if (userInfoParts.length > passwordIndex) {
|
||||||
if (authType == AuthType.EXTERNAL) {
|
if (authType == AuthType.EXTERNAL) {
|
||||||
clientCertificateAlias = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[passwordIndex]);
|
clientCertificateAlias = UrlEncodingHelper.decodeUtf8(userInfoParts[passwordIndex]);
|
||||||
} else {
|
} else {
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[passwordIndex]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[passwordIndex]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,11 +152,11 @@ public class Pop3Store extends Store {
|
|||||||
* @see Pop3Store#decodeUri(String)
|
* @see Pop3Store#decodeUri(String)
|
||||||
*/
|
*/
|
||||||
public static String createUri(ServerSettings server) {
|
public static String createUri(ServerSettings server) {
|
||||||
String userEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.username);
|
String userEnc = UrlEncodingHelper.encodeUtf8(server.username);
|
||||||
String passwordEnc = (server.password != null) ?
|
String passwordEnc = (server.password != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.password) : "";
|
UrlEncodingHelper.encodeUtf8(server.password) : "";
|
||||||
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
||||||
|
|
||||||
String scheme;
|
String scheme;
|
||||||
switch (server.connectionSecurity) {
|
switch (server.connectionSecurity) {
|
||||||
|
@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.K9;
|
import com.fsck.k9.K9;
|
||||||
import com.fsck.k9.controller.MessageRetrievalListener;
|
import com.fsck.k9.controller.MessageRetrievalListener;
|
||||||
|
|
||||||
import com.fsck.k9.helper.UrlEncodingHelper;
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.*;
|
import com.fsck.k9.mail.*;
|
||||||
@ -41,8 +42,6 @@ import javax.xml.parsers.SAXParserFactory;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -141,7 +140,7 @@ public class WebDavStore extends Store {
|
|||||||
String userInfo = webDavUri.getUserInfo();
|
String userInfo = webDavUri.getUserInfo();
|
||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
String[] userInfoParts = userInfo.split(":");
|
String[] userInfoParts = userInfo.split(":");
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
||||||
String userParts[] = username.split("\\\\", 2);
|
String userParts[] = username.split("\\\\", 2);
|
||||||
|
|
||||||
if (userParts.length > 1) {
|
if (userParts.length > 1) {
|
||||||
@ -150,7 +149,7 @@ public class WebDavStore extends Store {
|
|||||||
alias = username;
|
alias = username;
|
||||||
}
|
}
|
||||||
if (userInfoParts.length > 1) {
|
if (userInfoParts.length > 1) {
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,9 +189,9 @@ public class WebDavStore extends Store {
|
|||||||
* @see WebDavStore#decodeUri(String)
|
* @see WebDavStore#decodeUri(String)
|
||||||
*/
|
*/
|
||||||
public static String createUri(ServerSettings server) {
|
public static String createUri(ServerSettings server) {
|
||||||
String userEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.username);
|
String userEnc = UrlEncodingHelper.encodeUtf8(server.username);
|
||||||
String passwordEnc = (server.password != null) ?
|
String passwordEnc = (server.password != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.password) : "";
|
UrlEncodingHelper.encodeUtf8(server.password) : "";
|
||||||
|
|
||||||
String scheme;
|
String scheme;
|
||||||
switch (server.connectionSecurity) {
|
switch (server.connectionSecurity) {
|
||||||
@ -1241,9 +1240,9 @@ public class WebDavStore extends Store {
|
|||||||
String url = "";
|
String url = "";
|
||||||
for (int i = 0, count = urlParts.length; i < count; i++) {
|
for (int i = 0, count = urlParts.length; i < count; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
url = url + "/" + com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(urlParts[i]);
|
url = url + "/" + UrlEncodingHelper.encodeUtf8(urlParts[i]);
|
||||||
} else {
|
} else {
|
||||||
url = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(urlParts[i]);
|
url = UrlEncodingHelper.encodeUtf8(urlParts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
encodedName = url;
|
encodedName = url;
|
||||||
@ -1884,7 +1883,7 @@ public class WebDavStore extends Store {
|
|||||||
if (!messageURL.endsWith("/")) {
|
if (!messageURL.endsWith("/")) {
|
||||||
messageURL += "/";
|
messageURL += "/";
|
||||||
}
|
}
|
||||||
messageURL += com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(message.getUid() + ":" + System.currentTimeMillis() + ".eml");
|
messageURL += UrlEncodingHelper.encodeUtf8(message.getUid() + ":" + System.currentTimeMillis() + ".eml");
|
||||||
|
|
||||||
Log.i(K9.LOG_TAG, "Uploading message as " + messageURL);
|
Log.i(K9.LOG_TAG, "Uploading message as " + messageURL);
|
||||||
|
|
||||||
@ -1972,7 +1971,7 @@ public class WebDavStore extends Store {
|
|||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
end = UrlEncodingHelper.decodeUtf8(end);
|
end = UrlEncodingHelper.decodeUtf8(end);
|
||||||
end = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(end);
|
end = UrlEncodingHelper.encodeUtf8(end);
|
||||||
end = end.replaceAll("\\+", "%20");
|
end = end.replaceAll("\\+", "%20");
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
Log.e(K9.LOG_TAG, "IllegalArgumentException caught in setUrl: " + iae + "\nTrace: "
|
Log.e(K9.LOG_TAG, "IllegalArgumentException caught in setUrl: " + iae + "\nTrace: "
|
||||||
@ -2377,7 +2376,7 @@ public class WebDavStore extends Store {
|
|||||||
try {
|
try {
|
||||||
if (length > 3) {
|
if (length > 3) {
|
||||||
end = UrlEncodingHelper.decodeUtf8(end);
|
end = UrlEncodingHelper.decodeUtf8(end);
|
||||||
end = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(end);
|
end = UrlEncodingHelper.encodeUtf8(end);
|
||||||
end = end.replaceAll("\\+", "%20");
|
end = end.replaceAll("\\+", "%20");
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
|
@ -26,6 +26,7 @@ import com.fsck.k9.K9;
|
|||||||
import com.fsck.k9.Preferences;
|
import com.fsck.k9.Preferences;
|
||||||
import com.fsck.k9.controller.MessageRetrievalListener;
|
import com.fsck.k9.controller.MessageRetrievalListener;
|
||||||
import com.fsck.k9.helper.StringUtils;
|
import com.fsck.k9.helper.StringUtils;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.Flag;
|
import com.fsck.k9.mail.Flag;
|
||||||
import com.fsck.k9.mail.Folder;
|
import com.fsck.k9.mail.Folder;
|
||||||
@ -467,7 +468,7 @@ public class LocalStore extends Store implements Serializable {
|
|||||||
|
|
||||||
public void addPendingCommand(PendingCommand command) throws UnavailableStorageException {
|
public void addPendingCommand(PendingCommand command) throws UnavailableStorageException {
|
||||||
for (int i = 0; i < command.arguments.length; i++) {
|
for (int i = 0; i < command.arguments.length; i++) {
|
||||||
command.arguments[i] = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(command.arguments[i]);
|
command.arguments[i] = UrlEncodingHelper.encodeUtf8(command.arguments[i]);
|
||||||
}
|
}
|
||||||
final ContentValues cv = new ContentValues();
|
final ContentValues cv = new ContentValues();
|
||||||
cv.put("command", command.command);
|
cv.put("command", command.command);
|
||||||
|
@ -6,6 +6,7 @@ import android.util.Log;
|
|||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.K9;
|
import com.fsck.k9.K9;
|
||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.*;
|
import com.fsck.k9.mail.*;
|
||||||
import com.fsck.k9.mail.Message.RecipientType;
|
import com.fsck.k9.mail.Message.RecipientType;
|
||||||
@ -94,19 +95,19 @@ public class SmtpTransport extends Transport {
|
|||||||
String[] userInfoParts = smtpUri.getUserInfo().split(":");
|
String[] userInfoParts = smtpUri.getUserInfo().split(":");
|
||||||
if (userInfoParts.length == 1) {
|
if (userInfoParts.length == 1) {
|
||||||
authType = AuthType.PLAIN;
|
authType = AuthType.PLAIN;
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
||||||
} else if (userInfoParts.length == 2) {
|
} else if (userInfoParts.length == 2) {
|
||||||
authType = AuthType.PLAIN;
|
authType = AuthType.PLAIN;
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
} else if (userInfoParts.length == 3) {
|
} else if (userInfoParts.length == 3) {
|
||||||
// NOTE: In SmptTransport URIs, the authType comes last!
|
// NOTE: In SmptTransport URIs, the authType comes last!
|
||||||
authType = AuthType.valueOf(userInfoParts[2]);
|
authType = AuthType.valueOf(userInfoParts[2]);
|
||||||
username = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
username = UrlEncodingHelper.decodeUtf8(userInfoParts[0]);
|
||||||
if (authType == AuthType.EXTERNAL) {
|
if (authType == AuthType.EXTERNAL) {
|
||||||
clientCertificateAlias = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
clientCertificateAlias = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
} else {
|
} else {
|
||||||
password = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
password = UrlEncodingHelper.decodeUtf8(userInfoParts[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,11 +129,11 @@ public class SmtpTransport extends Transport {
|
|||||||
*/
|
*/
|
||||||
public static String createUri(ServerSettings server) {
|
public static String createUri(ServerSettings server) {
|
||||||
String userEnc = (server.username != null) ?
|
String userEnc = (server.username != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.username) : "";
|
UrlEncodingHelper.encodeUtf8(server.username) : "";
|
||||||
String passwordEnc = (server.password != null) ?
|
String passwordEnc = (server.password != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.password) : "";
|
UrlEncodingHelper.encodeUtf8(server.password) : "";
|
||||||
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ?
|
||||||
com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
UrlEncodingHelper.encodeUtf8(server.clientCertificateAlias) : "";
|
||||||
|
|
||||||
String scheme;
|
String scheme;
|
||||||
switch (server.connectionSecurity) {
|
switch (server.connectionSecurity) {
|
||||||
|
@ -9,6 +9,7 @@ import android.database.sqlite.SQLiteStatement;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.fsck.k9.K9;
|
import com.fsck.k9.K9;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
@ -59,11 +60,11 @@ public class Storage implements SharedPreferences {
|
|||||||
if (transportUriStr != null) {
|
if (transportUriStr != null) {
|
||||||
String[] userInfoParts = uri.getUserInfo().split(":");
|
String[] userInfoParts = uri.getUserInfo().split(":");
|
||||||
|
|
||||||
String usernameEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
String usernameEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
||||||
String passwordEnc = "";
|
String passwordEnc = "";
|
||||||
String authType = "";
|
String authType = "";
|
||||||
if (userInfoParts.length > 1) {
|
if (userInfoParts.length > 1) {
|
||||||
passwordEnc = ":" + com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
passwordEnc = ":" + UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
||||||
}
|
}
|
||||||
if (userInfoParts.length > 2) {
|
if (userInfoParts.length > 2) {
|
||||||
authType = ":" + userInfoParts[2];
|
authType = ":" + userInfoParts[2];
|
||||||
@ -83,34 +84,34 @@ public class Storage implements SharedPreferences {
|
|||||||
if (storeUriStr.startsWith("imap")) {
|
if (storeUriStr.startsWith("imap")) {
|
||||||
String[] userInfoParts = uri.getUserInfo().split(":");
|
String[] userInfoParts = uri.getUserInfo().split(":");
|
||||||
if (userInfoParts.length == 2) {
|
if (userInfoParts.length == 2) {
|
||||||
String usernameEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
String usernameEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
||||||
String passwordEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
String passwordEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
||||||
|
|
||||||
newUserInfo = usernameEnc + ":" + passwordEnc;
|
newUserInfo = usernameEnc + ":" + passwordEnc;
|
||||||
} else {
|
} else {
|
||||||
String authType = userInfoParts[0];
|
String authType = userInfoParts[0];
|
||||||
String usernameEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
String usernameEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
||||||
String passwordEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[2]);
|
String passwordEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[2]);
|
||||||
|
|
||||||
newUserInfo = authType + ":" + usernameEnc + ":" + passwordEnc;
|
newUserInfo = authType + ":" + usernameEnc + ":" + passwordEnc;
|
||||||
}
|
}
|
||||||
} else if (storeUriStr.startsWith("pop3")) {
|
} else if (storeUriStr.startsWith("pop3")) {
|
||||||
String[] userInfoParts = uri.getUserInfo().split(":", 2);
|
String[] userInfoParts = uri.getUserInfo().split(":", 2);
|
||||||
String usernameEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
String usernameEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
||||||
|
|
||||||
String passwordEnc = "";
|
String passwordEnc = "";
|
||||||
if (userInfoParts.length > 1) {
|
if (userInfoParts.length > 1) {
|
||||||
passwordEnc = ":" + com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
passwordEnc = ":" + UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
newUserInfo = usernameEnc + passwordEnc;
|
newUserInfo = usernameEnc + passwordEnc;
|
||||||
} else if (storeUriStr.startsWith("webdav")) {
|
} else if (storeUriStr.startsWith("webdav")) {
|
||||||
String[] userInfoParts = uri.getUserInfo().split(":", 2);
|
String[] userInfoParts = uri.getUserInfo().split(":", 2);
|
||||||
String usernameEnc = com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
String usernameEnc = UrlEncodingHelper.encodeUtf8(userInfoParts[0]);
|
||||||
|
|
||||||
String passwordEnc = "";
|
String passwordEnc = "";
|
||||||
if (userInfoParts.length > 1) {
|
if (userInfoParts.length > 1) {
|
||||||
passwordEnc = ":" + com.fsck.k9.helper.UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
passwordEnc = ":" + UrlEncodingHelper.encodeUtf8(userInfoParts[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
newUserInfo = usernameEnc + passwordEnc;
|
newUserInfo = usernameEnc + passwordEnc;
|
||||||
|
@ -47,6 +47,7 @@ import com.fsck.k9.fragment.MessageViewFragment;
|
|||||||
import com.fsck.k9.helper.ClipboardManager;
|
import com.fsck.k9.helper.ClipboardManager;
|
||||||
import com.fsck.k9.helper.Contacts;
|
import com.fsck.k9.helper.Contacts;
|
||||||
import com.fsck.k9.helper.HtmlConverter;
|
import com.fsck.k9.helper.HtmlConverter;
|
||||||
|
import com.fsck.k9.helper.UrlEncodingHelper;
|
||||||
import com.fsck.k9.helper.Utility;
|
import com.fsck.k9.helper.Utility;
|
||||||
import com.fsck.k9.mail.Address;
|
import com.fsck.k9.mail.Address;
|
||||||
import com.fsck.k9.mail.Flag;
|
import com.fsck.k9.mail.Flag;
|
||||||
@ -790,7 +791,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
|||||||
// Try to get the filename from the URL
|
// Try to get the filename from the URL
|
||||||
int start = path.lastIndexOf("/");
|
int start = path.lastIndexOf("/");
|
||||||
if (start != -1 && start + 1 < path.length()) {
|
if (start != -1 && start + 1 < path.length()) {
|
||||||
filename = com.fsck.k9.helper.UrlEncodingHelper.decodeUtf8(path.substring(start + 1));
|
filename = UrlEncodingHelper.decodeUtf8(path.substring(start + 1));
|
||||||
} else {
|
} else {
|
||||||
// Use a dummy filename if necessary
|
// Use a dummy filename if necessary
|
||||||
filename = "saved_image";
|
filename = "saved_image";
|
||||||
|
Loading…
Reference in New Issue
Block a user