mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-20 13:39:36 -04:00
Lint fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user