星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e
以下内容为反编译后的 d.java 源代码,内容仅作参考
package org.qiyi.android.pingback.internal.k;
import android.content.Context;
import android.text.TextUtils;
import com.iqiyi.biologicalprobe.bean.BioConstant;
import com.qiyi.c.a.b;
import com.qiyi.c.a.e;
import java.io.File;
import org.json.JSONException;
import org.json.JSONObject;
public class d {
private static boolean a;
private static boolean f16607b;
private org.qiyi.android.pingback.s.c f16608c;
private boolean f16609d = false;
private b f16610e = null;
public class a implements e<String> {
final Context a;
final String f16611b;
final String f16612c;
final boolean f16613d;
a(Context context, String str, String str2, boolean z) {
this.a = context;
this.f16611b = str;
this.f16612c = str2;
this.f16613d = z;
}
private void c(String str) {
if (TextUtils.isEmpty(str)) {
str = BioConstant.kEmptyJson;
}
org.qiyi.android.pingback.a0.b.g(str, d.e(this.a, this.f16611b));
}
private b e(JSONObject jSONObject) {
b d2 = b.d(jSONObject);
if (d2 != null) {
d2.f16604f = "2";
}
return d2;
}
@Override
public void b(Exception exc) {
org.qiyi.android.pingback.internal.g.b.b("SchemaManager", exc);
}
@Override
public void a(String str) {
JSONObject jSONObject;
String optString;
boolean z;
long nanoTime = System.nanoTime();
try {
jSONObject = new JSONObject(str);
} catch (JSONException e2) {
e2.printStackTrace();
jSONObject = null;
}
if (jSONObject == null || (optString = jSONObject.optString("code")) == null) {
return;
}
char c2 = 65535;
switch (optString.hashCode()) {
case 65200581:
if (optString.equals("E0000")) {
c2 = 0;
break;
}
break;
case 65200582:
if (optString.equals("E0001")) {
c2 = 1;
break;
}
break;
case 65477637:
if (optString.equals("E9999")) {
c2 = 2;
break;
}
break;
}
switch (c2) {
case 0:
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Diff data.");
b e3 = e(jSONObject);
if (d.this.f16610e != null) {
d.this.f16610e.e(e3);
} else {
org.qiyi.android.pingback.internal.m.a.a("SchemaManager", new org.qiyi.android.pingback.t.a("Trying to merge DIFF to a Null sSchema."));
}
z = true;
break;
case 1:
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Full data.");
d.this.f16610e = e(jSONObject);
z = true;
break;
case 2:
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Ignored");
d.this.f16610e = null;
c(b.b(optString, this.f16612c, d.f16607b));
z = false;
break;
default:
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Unknown code: ", optString);
z = this.f16613d;
break;
}
if (org.qiyi.android.pingback.internal.g.b.g()) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Data parsing cost " + (((float) (System.nanoTime() - nanoTime)) / 1000000.0f), " ms");
}
if (d.this.f16610e == null || !z) {
return;
}
d.this.f16610e.f16602d = this.f16612c;
d.this.f16610e.f16603e = d.f16607b;
d.this.f16610e.f16604f = "2";
long nanoTime2 = System.nanoTime();
c(d.this.f16610e.a());
if (org.qiyi.android.pingback.internal.g.b.g()) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Dump to file cost " + (((float) (System.nanoTime() - nanoTime2)) / 1000000.0f), " ms");
}
}
}
public d(org.qiyi.android.pingback.s.c cVar) {
this.f16608c = cVar;
}
public static File e(Context context, String str) {
if (context == null) {
return null;
}
return new File(context.getFilesDir(), "pb_schema_" + str);
}
private static boolean h(b bVar, String str) {
if (bVar == null) {
return true;
}
return ((TextUtils.isEmpty(bVar.f16602d) || bVar.f16602d.equals(str)) && "2".equals(bVar.f16604f) && bVar.f16603e == f16607b) ? false : true;
}
private static b i(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
try {
return b.d(new JSONObject(str));
} catch (JSONException e2) {
org.qiyi.android.pingback.internal.g.b.b("SchemaManager", e2);
return null;
}
}
private static String j(Context context) {
String c2 = org.qiyi.android.pingback.a0.b.c(context, "pb_schema.json");
if (!TextUtils.isEmpty(c2)) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "JSON file located!");
return c2;
}
String d2 = org.qiyi.android.pingback.a0.b.d(context, "pb_schema");
if (TextUtils.isEmpty(d2)) {
return null;
}
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "GZIP file located!");
return d2;
}
public static void k(boolean z) {
a = z;
}
public static void l(boolean z) {
f16607b = z;
}
private void m(Context context, String str, String str2, String str3, boolean z) {
if (a) {
if (TextUtils.isEmpty(str)) {
org.qiyi.android.pingback.internal.m.a.a("SchemaManager", new org.qiyi.android.pingback.t.a("Missing p1 parameter!"));
return;
}
StringBuilder sb = new StringBuilder(f16607b ? "http://opportunarch.iqiyi.com/test/openapi/v2/frontend/listEvent" : "http://opportunarch.iqiyi.com/openapi/v2/frontend/listEvent");
sb.append("?p1=");
sb.append(str);
sb.append("&bv=");
sb.append(str2);
if (!TextUtils.isEmpty(str3)) {
sb.append("&pv=");
sb.append(str3);
}
new b.a().u(sb.toString()).m(b.EnumC0284b.GET).e(false).l(String.class).i().h().u(new a(context, str, str2, z));
}
}
public b f() {
if (a) {
return this.f16610e;
}
return null;
}
public void g() {
String str;
b bVar;
boolean z;
if (a && !this.f16609d) {
this.f16609d = true;
Context a2 = this.f16608c.a();
String v = this.f16608c.v();
String l2 = this.f16608c.l();
File e2 = e(a2, l2);
if (e2 == null) {
return;
}
String str2 = null;
if (e2.exists()) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Loading cache from file...");
str = org.qiyi.android.pingback.a0.b.b(e2);
} else {
str = null;
}
if (TextUtils.isEmpty(str)) {
bVar = null;
} else {
bVar = i(str);
if (h(bVar, v)) {
bVar = null;
z = true;
if (TextUtils.isEmpty(str2)) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Loading cache from assets...");
str2 = j(a2);
z = true;
}
if (!TextUtils.isEmpty(str2)) {
org.qiyi.android.pingback.internal.g.b.e("SchemaManager", "Building local cache");
if (bVar == null) {
bVar = i(str2);
}
this.f16610e = bVar;
}
b bVar2 = this.f16610e;
m(a2, l2, v, bVar2 == null ? bVar2.f() : "", z);
}
}
str2 = str;
z = false;
if (TextUtils.isEmpty(str2)) {
}
if (!TextUtils.isEmpty(str2)) {
}
b bVar22 = this.f16610e;
m(a2, l2, v, bVar22 == null ? bVar22.f() : "", z);
}
}
}