九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e
以下内容为反编译后的 h.java 源代码,内容仅作参考
package cn.ninegame.library.f;
import android.text.TextUtils;
import cn.ninegame.genericframework.basic.m;
import cn.ninegame.genericframework.basic.r;
import cn.ninegame.library.util.cc;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONArray;
public final class h implements m {
private static final String[] f2040a = {"uc.cn", "9game.cn"};
private static final String[] b = new String[0];
private static Pattern c = null;
private static Pattern d = null;
private static h e;
public static h a() {
if (e == null) {
e = new h();
}
return e;
}
private h() {
e();
f();
cn.ninegame.genericframework.basic.g.a().b().a("base_biz_flex_param_changes", this);
}
private static void e() {
String[] strArr = null;
String a2 = cn.ninegame.library.dynamicconfig.b.a().a("native_white_url_list");
JSONArray f = !TextUtils.isEmpty(a2) ? cc.f(a2) : null;
int length = f != null ? f.length() : 0;
if (length > 0) {
strArr = new String[length];
for (int i = 0; i < length; i++) {
strArr[i] = f.optString(i);
}
}
if (strArr == null || strArr.length == 0) {
strArr = f2040a;
}
StringBuilder a3 = a(strArr);
a3.append("|(\\bfile:///data/data/cn.ninegame.gamemanager/files/html/.+)|(\\bnative://.+)");
try {
c = Pattern.compile(a3.toString(), 2);
} catch (Exception e2) {
cn.ninegame.library.stat.b.b.d("updateWhiteRegexStr failed:" + e2, new Object[0]);
}
}
private static void f() {
String[] strArr = null;
String a2 = cn.ninegame.library.dynamicconfig.b.a().a("native_black_url_list");
JSONArray f = !TextUtils.isEmpty(a2) ? cc.f(a2) : null;
int length = f != null ? f.length() : 0;
if (length > 0) {
strArr = new String[length];
for (int i = 0; i < length; i++) {
strArr[i] = f.optString(i);
}
}
if (strArr == null || strArr.length == 0) {
strArr = b;
}
try {
d = Pattern.compile(a(strArr).toString(), 2);
} catch (Exception e2) {
cn.ninegame.library.stat.b.b.d("updateBlackRegexStr failed:" + e2, new Object[0]);
}
}
public static String b() {
if (c != null) {
return c.toString();
}
return null;
}
public static String c() {
if (d != null) {
return d.toString();
}
return null;
}
public static int a(String str) {
Matcher matcher;
Matcher matcher2;
boolean z = true;
if (str == null || str.length() == 0) {
return 4;
}
if ((str == null || c == null || (matcher2 = c.matcher(str)) == null || !matcher2.find() || matcher2.start() != 0) ? false : true) {
return 1;
}
if (str == null || d == null || (matcher = d.matcher(str)) == null || !matcher.find() || matcher.start() != 0) {
z = false;
}
if (z) {
return 3;
}
return 2;
}
public static boolean b(String str) {
return a(str) <= d();
}
public static int d() {
return cn.ninegame.library.dynamicconfig.b.a().c("sns_url_secure_level");
}
private static StringBuilder a(String[] strArr) {
StringBuilder sb = new StringBuilder();
sb.append("(\\b((http|https|Http|Https|rtsp|Rtsp|alipays):\\/{2})?([0-9a-z_-]+\\.)*(");
for (String str : strArr) {
sb.append('(').append(str.replace(".", "\\.")).append(')').append('|');
}
sb.deleteCharAt(sb.length() - 1);
sb.append(")(:\\d+)?(/.*)*)");
return sb;
}
@Override
public final void onNotify(r rVar) {
if ("base_biz_flex_param_changes".equals(rVar.f1701a)) {
HashMap hashMap = (HashMap) rVar.b.getSerializable("jsonObject");
if (hashMap != null && hashMap.containsKey("native_white_url_list")) {
e();
}
if (hashMap != null && hashMap.containsKey("native_black_url_list")) {
f();
}
}
}
}