Luno v7.28.0版本的 MD5 值为:08d81b3b88ef7df48c89cb5d56dc11a2
以下内容为反编译后的 r66.java 源代码,内容仅作参考
package mdi.sdk;
import android.content.Context;
import android.content.SharedPreferences;
import com.facebook.internal.ServerProtocol;
import com.sardine.ai.mdisdk.Options;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import mdi.sdk.da6;
import org.json.JSONException;
import org.json.JSONObject;
public class r66 {
public class a implements Callable<g76> {
public final Context a;
public final String b;
public final String c;
public a(Context context, String str, String str2) {
this.a = context;
this.b = str;
this.c = str2;
}
@Override
public g76 call() throws Exception {
SharedPreferences sharedPreferences = this.a.getSharedPreferences("mdisdk", 0);
int i = sharedPreferences.getInt("configLastUpdatedSdkVersion", 0);
long j = sharedPreferences.getLong("configLastUpdated", 0L);
String string = sharedPreferences.getString("config", "");
long currentTimeMillis = System.currentTimeMillis() - j;
if (23 == i && currentTimeMillis < 86400000) {
try {
p96.a("use cached config");
return r66.this.b(string);
} catch (Exception unused) {
return r66.c(r66.this, this.a, this.b, this.c);
}
}
return r66.c(r66.this, this.a, this.b, this.c);
}
}
public static g76 c(r66 r66Var, Context context, String str, String str2) {
g76 a2;
r66Var.getClass();
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("platform", "android");
jSONObject.put(ServerProtocol.FALLBACK_DIALOG_PARAM_VERSION, "1.1.0");
jSONObject.put("clientID", str);
try {
StringBuilder sb = new StringBuilder();
sb.append(Options.ENV_PRODUCTION.equals(str2) ? "https://api.sardine.ai" : "https://api.dev.sardine.ai");
sb.append("/v1/config");
da6.a a3 = da6.a(sb.toString(), jSONObject.toString());
if (a3.a == 200) {
context.getSharedPreferences("mdisdk", 0).edit().putString("config", a3.b).putLong("configLastUpdated", System.currentTimeMillis()).putInt("configLastUpdatedSdkVersion", 23).apply();
p96.a("successfully fetched remote config");
a2 = r66Var.b(a3.b);
} else {
p96.c("error while fetching config: " + a3.a);
a2 = g76.a();
}
return a2;
} catch (Exception e) {
p96.b("error while fetching config", e);
return g76.a();
}
} catch (JSONException e2) {
p96.b("unexpected json error", e2);
return g76.a();
}
}
public Future<g76> a(Context context, String str, String str2) {
FutureTask futureTask = new FutureTask(new a(context, str, str2));
Executors.newSingleThreadExecutor().execute(futureTask);
return futureTask;
}
public final g76 b(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
return new g76(jSONObject.getString("errorReportingUrl"), jSONObject.getBoolean("useNetstat"));
} catch (JSONException e) {
p96.b("unexpected json error", e);
return g76.a();
}
}
}