正在查看: 万能钥匙 v1.1.23 应用的 bl.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 万能钥匙 v1.1.23 应用的 bl.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package cn.fly.verify;
import android.net.Network;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.SecureRandom;
import java.util.HashMap;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import org.json.JSONObject;
public class bl {
public static class a implements HostnameVerifier {
@Override
public boolean verify(String str, SSLSession sSLSession) {
if (TextUtils.isEmpty(str)) {
return false;
}
return str.equals("opencloud.wostore.cn") || str.contains("10010.com");
}
}
public static class b implements HostnameVerifier {
@Override
public boolean verify(String str, SSLSession sSLSession) {
if (TextUtils.isEmpty(str)) {
return false;
}
return str.equals("opencloud.wostore.cn") || str.contains("10010.com");
}
}
private String a(InputStream inputStream) {
ByteArrayOutputStream byteArrayOutputStream;
Throwable th;
try {
byteArrayOutputStream = new ByteArrayOutputStream();
} catch (Exception unused) {
byteArrayOutputStream = null;
} catch (Throwable th2) {
byteArrayOutputStream = null;
th = th2;
}
try {
byte[] bArr = new byte[1024];
while (true) {
int read = inputStream.read(bArr);
if (read == -1) {
break;
}
byteArrayOutputStream.write(bArr, 0, read);
}
String byteArrayOutputStream2 = byteArrayOutputStream.toString();
try {
byteArrayOutputStream.close();
inputStream.close();
} catch (Exception unused2) {
}
return byteArrayOutputStream2;
} catch (Exception unused3) {
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (Exception unused4) {
return null;
}
}
if (inputStream != null) {
inputStream.close();
}
return null;
} catch (Throwable th3) {
th = th3;
if (byteArrayOutputStream != null) {
try {
byteArrayOutputStream.close();
} catch (Exception unused5) {
throw th;
}
}
if (inputStream != null) {
inputStream.close();
}
throw th;
}
}
private String c(String str, HashMap<String, String> hashMap, Network network) {
String str2;
try {
str2 = new URL(str).getHost();
} catch (MalformedURLException unused) {
str2 = BuildConfig.FLAVOR;
}
String str3 = str2.contains("10010.com") ? str2 + bm.b() : str;
try {
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, null, new SecureRandom());
bp bpVar = new bp(sSLContext.getSocketFactory());
URL url = new URL(str3);
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (network != null ? network.openConnection(url) : url.openConnection());
httpsURLConnection.setDoInput(true);
httpsURLConnection.setDoOutput(false);
httpsURLConnection.setUseCaches(false);
httpsURLConnection.setInstanceFollowRedirects(false);
httpsURLConnection.setReadTimeout(30000);
httpsURLConnection.setConnectTimeout(30000);
httpsURLConnection.setRequestMethod("GET");
httpsURLConnection.setSSLSocketFactory(bpVar);
httpsURLConnection.setHostnameVerifier(new b());
if (hashMap != null) {
for (String str4 : hashMap.keySet()) {
httpsURLConnection.setRequestProperty(str4, hashMap.get(str4));
}
}
httpsURLConnection.addRequestProperty("Connection", str.startsWith("https://opencloud.wostore.cn/openapi/netauth/precheck/wp?") ? "Keep-Alive" : "close");
httpsURLConnection.connect();
if (httpsURLConnection.getResponseCode() == 200) {
String a10 = a(httpsURLConnection.getInputStream());
if (!TextUtils.isEmpty(a10)) {
return a10;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", 10012);
jSONObject.put(NotificationCompat.CATEGORY_MESSAGE, "10012");
jSONObject.put("data", str3);
return jSONObject.toString();
}
if (httpsURLConnection.getResponseCode() == 302) {
String headerField = httpsURLConnection.getHeaderField("Location");
if (!TextUtils.isEmpty(headerField)) {
return headerField.startsWith("https") ? a(headerField, null, network) : b(headerField, null, network);
}
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("code", 10013);
jSONObject2.put(NotificationCompat.CATEGORY_MESSAGE, "无跳转地址");
jSONObject2.put("data", str2);
return jSONObject2.toString();
}
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("code", 10010);
jSONObject3.put(NotificationCompat.CATEGORY_MESSAGE, "https状态码" + httpsURLConnection.getResponseCode());
jSONObject3.put("data", str2);
return jSONObject3.toString();
} catch (Throwable th) {
try {
JSONObject jSONObject4 = new JSONObject();
jSONObject4.put("code", 10011);
jSONObject4.put(NotificationCompat.CATEGORY_MESSAGE, "http异常" + th.getMessage());
jSONObject4.put("data", str2);
return jSONObject4.toString();
} catch (Throwable unused2) {
return null;
}
}
}
public String a(String str, HashMap<String, String> hashMap, Network network) {
String str2;
HttpsURLConnection httpsURLConnection;
try {
str2 = new URL(str).getHost();
} catch (MalformedURLException unused) {
str2 = BuildConfig.FLAVOR;
}
try {
URL url = new URL(str2.contains("10010.com") ? str + bm.b() : str);
httpsURLConnection = (HttpsURLConnection) (network != null ? network.openConnection(url) : url.openConnection());
try {
httpsURLConnection.setDoInput(true);
httpsURLConnection.setDoOutput(false);
httpsURLConnection.setUseCaches(false);
httpsURLConnection.setInstanceFollowRedirects(false);
httpsURLConnection.setReadTimeout(30000);
httpsURLConnection.setConnectTimeout(30000);
httpsURLConnection.setRequestMethod("GET");
httpsURLConnection.setHostnameVerifier(new a());
if (hashMap != null) {
for (String str3 : hashMap.keySet()) {
httpsURLConnection.setRequestProperty(str3, hashMap.get(str3));
}
}
httpsURLConnection.addRequestProperty("Connection", str.startsWith("https://opencloud.wostore.cn/openapi/netauth/precheck/wp?") ? "Keep-Alive" : "close");
httpsURLConnection.connect();
if (httpsURLConnection.getResponseCode() == 200) {
String a10 = a(httpsURLConnection.getInputStream());
if (!TextUtils.isEmpty(a10)) {
httpsURLConnection.disconnect();
return a10;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", 10012);
jSONObject.put(NotificationCompat.CATEGORY_MESSAGE, "10012");
jSONObject.put("data", str2);
String jSONObject2 = jSONObject.toString();
httpsURLConnection.disconnect();
return jSONObject2;
}
if (httpsURLConnection.getResponseCode() != 302) {
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("code", 10010);
jSONObject3.put(NotificationCompat.CATEGORY_MESSAGE, "https状态码" + httpsURLConnection.getResponseCode());
jSONObject3.put("data", str2);
String jSONObject4 = jSONObject3.toString();
httpsURLConnection.disconnect();
return jSONObject4;
}
String headerField = httpsURLConnection.getHeaderField("Location");
if (TextUtils.isEmpty(headerField)) {
JSONObject jSONObject5 = new JSONObject();
jSONObject5.put("code", 10013);
jSONObject5.put(NotificationCompat.CATEGORY_MESSAGE, "无跳转地址");
jSONObject5.put("data", str2);
String jSONObject6 = jSONObject5.toString();
httpsURLConnection.disconnect();
return jSONObject6;
}
if (headerField.startsWith("https")) {
String a11 = a(headerField, null, network);
httpsURLConnection.disconnect();
return a11;
}
String b10 = b(headerField, null, network);
httpsURLConnection.disconnect();
return b10;
} catch (Throwable th) {
th = th;
try {
bw.a(th);
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("code", 10011);
jSONObject7.put(NotificationCompat.CATEGORY_MESSAGE, "https异常" + th.getMessage());
jSONObject7.put("data", str2);
String jSONObject8 = jSONObject7.toString();
if (httpsURLConnection != null) {
httpsURLConnection.disconnect();
}
return jSONObject8;
} catch (Exception unused2) {
if (httpsURLConnection != null) {
httpsURLConnection.disconnect();
}
return null;
} catch (Throwable th2) {
if (httpsURLConnection != null) {
httpsURLConnection.disconnect();
}
throw th2;
}
}
} catch (Throwable th3) {
th = th3;
httpsURLConnection = null;
}
}
public String b(String str, HashMap<String, String> hashMap, Network network) {
HttpURLConnection httpURLConnection;
try {
str = "http://" + new URL(str).getHost();
} catch (MalformedURLException unused) {
}
try {
URL url = new URL(str);
httpURLConnection = (HttpURLConnection) (network != null ? network.openConnection(url) : url.openConnection());
try {
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(false);
httpURLConnection.setUseCaches(false);
httpURLConnection.setInstanceFollowRedirects(false);
httpURLConnection.setReadTimeout(30000);
httpURLConnection.setConnectTimeout(30000);
httpURLConnection.setRequestMethod("GET");
if (hashMap != null) {
for (String str2 : hashMap.keySet()) {
httpURLConnection.setRequestProperty(str2, hashMap.get(str2));
}
}
httpURLConnection.addRequestProperty("Connection", "close");
httpURLConnection.connect();
if (httpURLConnection.getResponseCode() == 200) {
String a10 = a(httpURLConnection.getInputStream());
if (!TextUtils.isEmpty(a10)) {
httpURLConnection.disconnect();
return a10;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("code", 10012);
jSONObject.put(NotificationCompat.CATEGORY_MESSAGE, "10012");
jSONObject.put("data", str);
String jSONObject2 = jSONObject.toString();
httpURLConnection.disconnect();
return jSONObject2;
}
if (httpURLConnection.getResponseCode() != 302) {
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put("code", 10010);
jSONObject3.put(NotificationCompat.CATEGORY_MESSAGE, "http状态码" + httpURLConnection.getResponseCode());
jSONObject3.put("data", str);
String jSONObject4 = jSONObject3.toString();
httpURLConnection.disconnect();
return jSONObject4;
}
String headerField = httpURLConnection.getHeaderField("Location");
if (TextUtils.isEmpty(headerField)) {
JSONObject jSONObject5 = new JSONObject();
jSONObject5.put("code", 10013);
jSONObject5.put(NotificationCompat.CATEGORY_MESSAGE, "无跳转地址");
jSONObject5.put("data", str);
String jSONObject6 = jSONObject5.toString();
httpURLConnection.disconnect();
return jSONObject6;
}
if (headerField.startsWith("https")) {
String a11 = a(headerField, null, network);
httpURLConnection.disconnect();
return a11;
}
String b10 = b(headerField, null, network);
httpURLConnection.disconnect();
return b10;
} catch (Throwable th) {
th = th;
try {
JSONObject jSONObject7 = new JSONObject();
jSONObject7.put("code", 10024);
jSONObject7.put(NotificationCompat.CATEGORY_MESSAGE, "http异常" + th.getMessage());
jSONObject7.put("data", str);
String jSONObject8 = jSONObject7.toString();
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
return jSONObject8;
} catch (Exception unused2) {
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
return null;
} catch (Throwable th2) {
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
throw th2;
}
}
} catch (Throwable th3) {
th = th3;
httpURLConnection = null;
}
}
}