4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1
以下内容为反编译后的 e.java 源代码,内容仅作参考
package cn.m4399.diag.a;
import cn.m4399.diag.api.Report;
import com.xiaomi.mipush.sdk.Constants;
import org.xbill.DNS.Lookup;
import org.xbill.DNS.Name;
import org.xbill.DNS.Record;
import org.xbill.DNS.SimpleResolver;
import org.xbill.DNS.Type;
public class e implements cn.m4399.diag.api.a {
public static void a(String[] strArr, Report report) throws Exception {
int i = 2;
int i2 = 1;
if (strArr.length <= 2 || !strArr[0].equals("-t")) {
i = 0;
} else {
i2 = Type.value(strArr[1]);
if (i2 < 0) {
report.withOutput("invalid type");
return;
}
}
while (i < strArr.length) {
Lookup lookup = new Lookup(strArr[i], i2);
SimpleResolver simpleResolver = new SimpleResolver("114.114.114.114");
simpleResolver.setTimeout(5);
lookup.setResolver(simpleResolver);
lookup.run();
a(strArr[i], lookup, report);
i++;
}
}
@Override
public Report make(String... strArr) {
Report report = new Report(name());
try {
a(strArr, report);
} catch (Exception e) {
e.printStackTrace();
report.withOutput(e.getMessage());
}
return report;
}
@Override
public String name() {
return "Dns Lookup";
}
public static void a(String str, Lookup lookup, Report report) {
report.withLineExtra(str + Constants.COLON_SEPARATOR);
if (lookup.getResult() != 0) {
report.withLineExtra(" " + lookup.getErrorString() + " ");
return;
}
Name[] aliases = lookup.getAliases();
if (aliases.length > 0) {
report.withLineExtra("# aliases: ");
for (int i = 0; i < aliases.length; i++) {
report.withLineExtra(aliases[i].toString());
if (i < aliases.length - 1) {
report.withLineExtra(" ");
}
}
report.withOutput("\n");
}
if (lookup.getResult() == 0) {
for (Record record : lookup.getAnswers()) {
report.withOutput(record.toString());
}
report.withResult(true);
}
}
}