调研通 v3.0.3版本的 MD5 值为:fe075d21227d488bdb9f6aa09d3b3f35
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.xiaomi.metoknlp;
import android.content.Context;
import android.content.SharedPreferences;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.json.JSONObject;
public class b {
private static boolean f9641a = false;
private static int f9642b;
private static b f9643c;
private Context f9644d;
private SharedPreferences f9645e;
private List f9646f = new ArrayList();
private b(Context context) {
this.f9644d = context;
this.f9645e = this.f9644d.getSharedPreferences("config", 0);
}
public static b a() {
return f9643c;
}
public static synchronized void a(Context context) {
synchronized (b.class) {
if (f9643c == null) {
f9643c = new b(context);
}
}
}
public static boolean b() {
return false;
}
public void a(g gVar) {
if (gVar != null) {
synchronized (this.f9646f) {
this.f9646f.add(gVar);
}
}
}
public void a(String str) {
SharedPreferences.Editor edit = this.f9645e.edit();
edit.putString("config_update_time", str);
edit.commit();
}
public void c() {
synchronized (this.f9646f) {
Iterator it = this.f9646f.iterator();
while (it.hasNext()) {
((g) it.next()).a();
}
}
}
public void d() {
String a2;
int i;
int i2;
String k = k();
String h = com.xiaomi.metoknlp.a.e.h();
if (k.equals(h)) {
return;
}
String d2 = com.xiaomi.metoknlp.a.e.d();
StringBuilder sb = new StringBuilder();
String str = "t_";
sb.append("t_");
sb.append(d2);
String a3 = c.a("collect", sb.toString());
if (a3 == null || a3.isEmpty()) {
int i3 = 0;
while (true) {
a2 = c.a("collect", str + d2);
if (a2 != null && !a2.isEmpty()) {
i = 5;
break;
}
i3++;
String str2 = str;
i = 5;
if (i3 == 5) {
break;
} else {
str = str2;
}
}
if (i3 == i) {
return;
} else {
a3 = a2;
}
}
try {
JSONObject jSONObject = new JSONObject(new JSONObject(a3).getString("data"));
String string = this.f9645e.getString("s_f", "");
String optString = jSONObject.optString("s_f", "");
boolean a4 = com.xiaomi.metoknlp.a.e.a(jSONObject.optInt("f_d_d", 0));
SharedPreferences.Editor edit = this.f9645e.edit();
edit.putString("s_f", optString);
edit.putBoolean("f_d_d", a4);
edit.putString("m_s_u", jSONObject.optString("m_s_u", "https://metok.sys.miui.com"));
edit.commit();
new Date();
new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmm");
if (string != null && !string.isEmpty() && optString != null && !optString.isEmpty()) {
Date parse = simpleDateFormat.parse(string);
Date parse2 = simpleDateFormat.parse(optString);
if (parse2.before(parse) || parse2.equals(parse)) {
a(h);
c();
return;
}
}
String a5 = c.a("collect", "f_" + d2);
if (a5 == null || a5.isEmpty()) {
int i4 = 0;
while (true) {
a5 = c.a("collect", "f_" + d2);
if (a5 != null && !a5.isEmpty()) {
i2 = 5;
break;
}
i4++;
i2 = 5;
if (i4 == 5) {
break;
}
}
if (i4 == i2) {
return;
}
}
JSONObject jSONObject2 = new JSONObject(new JSONObject(a5).getString("data"));
SharedPreferences.Editor edit2 = this.f9645e.edit();
edit2.putLong("d_m_i", jSONObject2.optLong("d_m_i", Long.MAX_VALUE));
edit2.putBoolean("d_n_s", com.xiaomi.metoknlp.a.e.a(jSONObject2.optInt("d_n_s", f9642b)));
edit2.putLong("d_s_t", jSONObject2.optLong("d_s_t", Long.MAX_VALUE));
edit2.putLong("d_s_c_t", jSONObject2.optLong("d_s_c_t", Long.MAX_VALUE));
edit2.commit();
a(h);
c();
} catch (Exception unused) {
}
}
public String e() {
return this.f9645e.getString("m_s_u", "https://metok.sys.miui.com");
}
public boolean f() {
return this.f9645e.getBoolean("f_d_d", true);
}
public long g() {
return this.f9645e.getLong("d_m_i", Long.MAX_VALUE);
}
public boolean h() {
return this.f9645e.getBoolean("d_n_s", f9641a);
}
public long i() {
return this.f9645e.getLong("d_s_t", Long.MAX_VALUE);
}
public long j() {
return this.f9645e.getLong("d_s_c_t", Long.MAX_VALUE);
}
public String k() {
return this.f9645e.getString("config_update_time", "0");
}
}