Lint fixes

This commit is contained in:
Sergey Eremin
2017-04-16 03:22:26 +03:00
parent 5363a4c0e9
commit 4bcddf0493
5 changed files with 15 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ class AppListViewBinder implements SimpleAdapter.ViewBinder {
ImageDownloadTask task = new ImageDownloadTask();
task.setView(view);
task.execute((String) drawableOrUrl);
} else if (null != drawableOrUrl) {
} else {
view.setImageDrawable((Drawable) drawableOrUrl);
}
return true;

View File

@@ -28,7 +28,7 @@ public class BitmapManager {
private Context context;
static {
HttpsURLConnection.setDefaultHostnameVerifier(new NullHostNameVerifier());
HttpsURLConnection.setDefaultHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier());
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new X509TrustManager[]{new NullX509TrustManager()}, new SecureRandom());

View File

@@ -1,12 +0,0 @@
package com.github.yeriomin.yalpstore;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
class NullHostNameVerifier implements HostnameVerifier {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
}

View File

@@ -1,17 +1,27 @@
package com.github.yeriomin.yalpstore;
import java.security.cert.CertificateException;
import javax.net.ssl.X509TrustManager;
class NullX509TrustManager implements X509TrustManager {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws java.security.cert.CertificateException {
// not implemented
try {
x509Certificates[0].checkValidity();
} catch (Exception e) {
throw new CertificateException("Certificate not valid or trusted.");
}
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws java.security.cert.CertificateException {
// not implemented
try {
x509Certificates[0].checkValidity();
} catch (Exception e) {
throw new CertificateException("Certificate not valid or trusted.");
}
}
@Override

View File

@@ -37,7 +37,7 @@ public class PreferenceLanguageFragment extends PreferenceListFragment {
Map<String, String> languages = new HashMap<>();
for (Locale locale: Locale.getAvailableLocales()) {
String displayName = locale.getDisplayName();
displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
displayName = displayName.substring(0, 1).toUpperCase(Locale.getDefault()) + displayName.substring(1);
languages.put(locale.toString(), displayName);
}
languages = Util.sort(languages);