|
|
@ -124,6 +124,7 @@ import com.sun.mail.util.MailConnectException;
|
|
|
|
import net.openid.appauth.AuthState;
|
|
|
|
import net.openid.appauth.AuthState;
|
|
|
|
import net.openid.appauth.TokenResponse;
|
|
|
|
import net.openid.appauth.TokenResponse;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
@ -3613,67 +3614,73 @@ public class Log {
|
|
|
|
static SpannableStringBuilder getCiphers() {
|
|
|
|
static SpannableStringBuilder getCiphers() {
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
|
|
|
|
|
|
|
|
|
for (String protocol : new String[]{"SSL", "TLS"})
|
|
|
|
for (Provider provider : new Provider[]{null, new BouncyCastleJsseProvider()})
|
|
|
|
try {
|
|
|
|
for (String protocol : new String[]{"SSL", "TLS"})
|
|
|
|
int begin = ssb.length();
|
|
|
|
try {
|
|
|
|
ssb.append("Protocol: ").append(protocol);
|
|
|
|
int begin = ssb.length();
|
|
|
|
ssb.setSpan(new StyleSpan(Typeface.BOLD), begin, ssb.length(), 0);
|
|
|
|
ssb.append("Protocol: ").append(protocol)
|
|
|
|
ssb.append("\r\n\r\n");
|
|
|
|
.append(" ")
|
|
|
|
|
|
|
|
.append(provider == null ? "Android" : provider.getClass().getSimpleName());
|
|
|
|
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
|
|
|
ssb.setSpan(new StyleSpan(Typeface.BOLD), begin, ssb.length(), 0);
|
|
|
|
tmf.init((KeyStore) null);
|
|
|
|
ssb.append("\r\n\r\n");
|
|
|
|
|
|
|
|
|
|
|
|
ssb.append("Provider: ").append(tmf.getProvider().getName()).append("\r\n");
|
|
|
|
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
|
|
|
ssb.append("Algorithm: ").append(tmf.getAlgorithm()).append("\r\n");
|
|
|
|
tmf.init((KeyStore) null);
|
|
|
|
|
|
|
|
|
|
|
|
TrustManager[] tms = tmf.getTrustManagers();
|
|
|
|
ssb.append("Provider: ").append(tmf.getProvider().getName()).append("\r\n");
|
|
|
|
if (tms != null)
|
|
|
|
ssb.append("Algorithm: ").append(tmf.getAlgorithm()).append("\r\n");
|
|
|
|
for (TrustManager tm : tms)
|
|
|
|
|
|
|
|
ssb.append("Manager: ").append(tm.getClass().getName()).append("\r\n");
|
|
|
|
TrustManager[] tms = tmf.getTrustManagers();
|
|
|
|
|
|
|
|
if (tms != null)
|
|
|
|
SSLContext sslContext = SSLContext.getInstance(protocol);
|
|
|
|
for (TrustManager tm : tms)
|
|
|
|
|
|
|
|
ssb.append("Manager: ").append(tm.getClass().getName()).append("\r\n");
|
|
|
|
ssb.append("Context: ").append(sslContext.getProtocol()).append("\r\n\r\n");
|
|
|
|
|
|
|
|
|
|
|
|
SSLContext sslContext = (provider == null
|
|
|
|
sslContext.init(null, tmf.getTrustManagers(), null);
|
|
|
|
? SSLContext.getInstance(protocol)
|
|
|
|
SSLSocket socket = (SSLSocket) sslContext.getSocketFactory().createSocket();
|
|
|
|
: SSLContext.getInstance(protocol, provider));
|
|
|
|
|
|
|
|
|
|
|
|
List<String> protocols = new ArrayList<>();
|
|
|
|
|
|
|
|
protocols.addAll(Arrays.asList(socket.getEnabledProtocols()));
|
|
|
|
ssb.append("Context: ").append(sslContext.getProtocol()).append("\r\n\r\n");
|
|
|
|
|
|
|
|
|
|
|
|
for (String p : socket.getSupportedProtocols()) {
|
|
|
|
sslContext.init(null, tmf.getTrustManagers(), null);
|
|
|
|
boolean enabled = protocols.contains(p);
|
|
|
|
SSLSocket socket = (SSLSocket) sslContext.getSocketFactory().createSocket();
|
|
|
|
if (!enabled)
|
|
|
|
|
|
|
|
ssb.append('(');
|
|
|
|
List<String> protocols = new ArrayList<>();
|
|
|
|
int start = ssb.length();
|
|
|
|
protocols.addAll(Arrays.asList(socket.getEnabledProtocols()));
|
|
|
|
ssb.append(p);
|
|
|
|
|
|
|
|
if (!enabled) {
|
|
|
|
for (String p : socket.getSupportedProtocols()) {
|
|
|
|
ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0);
|
|
|
|
boolean enabled = protocols.contains(p);
|
|
|
|
ssb.append(')');
|
|
|
|
if (!enabled)
|
|
|
|
|
|
|
|
ssb.append('(');
|
|
|
|
|
|
|
|
int start = ssb.length();
|
|
|
|
|
|
|
|
ssb.append(p);
|
|
|
|
|
|
|
|
if (!enabled) {
|
|
|
|
|
|
|
|
ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0);
|
|
|
|
|
|
|
|
ssb.append(')');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ssb.append("\r\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ssb.append("\r\n");
|
|
|
|
ssb.append("\r\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
ssb.append("\r\n");
|
|
|
|
List<String> ciphers = new ArrayList<>();
|
|
|
|
|
|
|
|
ciphers.addAll(Arrays.asList(socket.getEnabledCipherSuites()));
|
|
|
|
List<String> ciphers = new ArrayList<>();
|
|
|
|
|
|
|
|
ciphers.addAll(Arrays.asList(socket.getEnabledCipherSuites()));
|
|
|
|
for (String c : socket.getSupportedCipherSuites()) {
|
|
|
|
|
|
|
|
boolean enabled = ciphers.contains(c);
|
|
|
|
for (String c : socket.getSupportedCipherSuites()) {
|
|
|
|
if (!enabled)
|
|
|
|
boolean enabled = ciphers.contains(c);
|
|
|
|
ssb.append('(');
|
|
|
|
if (!enabled)
|
|
|
|
int start = ssb.length();
|
|
|
|
ssb.append('(');
|
|
|
|
ssb.append(c);
|
|
|
|
int start = ssb.length();
|
|
|
|
if (!enabled) {
|
|
|
|
ssb.append(c);
|
|
|
|
ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0);
|
|
|
|
if (!enabled) {
|
|
|
|
ssb.append(')');
|
|
|
|
ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0);
|
|
|
|
}
|
|
|
|
ssb.append(')');
|
|
|
|
ssb.append("\r\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ssb.append("\r\n");
|
|
|
|
ssb.append("\r\n");
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
ssb.append(ex.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ssb.append("\r\n");
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
ssb.append(ex.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), 0, ssb.length(), 0);
|
|
|
|
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), 0, ssb.length(), 0);
|
|
|
|
|
|
|
|
|
|
|
|