Spermatid v6.1.8版本的 MD5 值为:a375ce51a42d528ba6e2583c10478296
以下内容为反编译后的 IPUtils.java 源代码,内容仅作参考
package com.wj.richmob.util;
import android.content.Context;
import com.czhj.sdk.common.network.JsonRequest;
import com.wj.richmob.helper.LogTag;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class IPUtils {
public static IPBean ipBean = new IPBean();
public static String ipLine = "";
public static class IPBean {
private String ip;
public String getIp() {
return this.ip;
}
public void setIp(String str) {
this.ip = str;
}
}
public static String getNetIp() {
new Thread(new Runnable() {
@Override
public void run() {
InputStream inputStream;
?? r12;
InputStream inputStream2 = null;
try {
try {
?? r13 = (HttpURLConnection) new URL("http://pv.sohu.com/cityjson?ie=utf-8").openConnection();
try {
if (r13.getResponseCode() == 200) {
inputStream2 = r13.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream2, JsonRequest.PROTOCOL_CHARSET));
StringBuilder sb2 = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb2.append(readLine + "\n");
}
Matcher matcher = Pattern.compile("((?:(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d))))").matcher(sb2.toString());
if (matcher.find()) {
IPUtils.ipLine = matcher.group();
}
}
inputStream2.close();
r12 = r13;
} catch (Throwable unused) {
inputStream = inputStream2;
inputStream2 = r13;
inputStream.close();
r12 = inputStream2;
r12.disconnect();
}
} catch (Throwable unused2) {
return;
}
} catch (Throwable unused3) {
inputStream = null;
}
r12.disconnect();
}
}).start();
return ipLine;
}
public static String getNetIpM(final Context context) {
new Thread(new Runnable() {
@Override
public void run() {
InputStream inputStream;
?? r22;
URLConnection openConnection;
?? r23;
InputStream inputStream2 = null;
try {
try {
openConnection = new URL("http://www.3322.org/dyndns/getip").openConnection();
r23 = (HttpURLConnection) openConnection;
} catch (Throwable unused) {
inputStream = null;
}
try {
openConnection.setUseCaches(false);
openConnection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.7 Safari/537.36");
if (r23.getResponseCode() == 200) {
inputStream2 = r23.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream2, JsonRequest.PROTOCOL_CHARSET));
StringBuilder sb2 = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb2.append(readLine + "");
}
IPUtils.ipLine = sb2.toString();
SharedPreferencesHelper.getInstance(context).savePreferencesString("net-ipv", IPUtils.ipLine);
LogTag.d("IPUtil-", IPUtils.ipLine + "");
}
inputStream2.close();
r22 = r23;
} catch (Throwable unused2) {
inputStream = inputStream2;
inputStream2 = r23;
inputStream.close();
r22 = inputStream2;
r22.disconnect();
}
r22.disconnect();
} catch (Throwable unused3) {
}
}
}).start();
String preferencesString = SharedPreferencesHelper.getInstance(context).getPreferencesString("net-ipv");
ipLine = preferencesString;
return preferencesString;
}
public static String getOutNetIP() {
new Thread(new Runnable() {
@Override
public void run() {
InputStream inputStream;
?? r12;
?? r13;
InputStream inputStream2 = null;
try {
try {
r13 = (HttpURLConnection) new URL("https://ifconfig.co/json").openConnection();
} catch (Throwable unused) {
inputStream = null;
}
try {
if (r13.getResponseCode() == 200) {
inputStream2 = r13.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream2, JsonRequest.PROTOCOL_CHARSET));
StringBuilder sb2 = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb2.append(readLine + "\n");
}
if (!sb2.toString().isEmpty()) {
LogTag.d("IPUtils-", IPUtils.ipLine + "");
}
}
inputStream2.close();
r12 = r13;
} catch (Throwable unused2) {
inputStream = inputStream2;
inputStream2 = r13;
inputStream.close();
r12 = inputStream2;
r12.disconnect();
}
r12.disconnect();
} catch (Throwable unused3) {
}
}
}).start();
return ipLine;
}
}