我要上王者 v1.1版本的 MD5 值为:b7d3566522def961cabeb92cb17f5db9
以下内容为反编译后的 r.java 源代码,内容仅作参考
package com.ss.android.downloadlib.addownload.compliance;
import android.text.TextUtils;
import com.ss.android.download.api.config.nn;
import com.ss.android.downloadlib.addownload.sl;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONObject;
public class r {
private final AtomicInteger f299if;
public static class Cif {
private static r f303if = new r();
}
public static r m412if() {
return Cif.f303if;
}
private r() {
this.f299if = new AtomicInteger(0);
}
public String x() {
StringBuilder sb = new StringBuilder();
sb.append(this.f299if.get() < 3 ? "https://apps.bytesfield.com" : "https://apps.bytesfield-b.com");
sb.append("/customer/api/app/deep_link");
return sb.toString();
}
public void m423if(final com.ss.android.downloadlib.addownload.x.tc tcVar, final k kVar) {
if (sl.j() == null) {
com.ss.android.downloadlib.tc.z.m759if().m761if("getDownloadNetworkFactory == NULL");
m421if(401, tcVar);
return;
}
com.ss.android.downloadlib.j.m705if().m706if(new Runnable() {
@Override
public void run() {
r rVar = r.this;
rVar.x(tcVar, rVar.x(), r.this.m420if(tcVar, true, 4), kVar);
}
});
}
public void m417if(com.ss.android.downloadlib.addownload.x.tc tcVar, String str, byte[] bArr, k kVar) {
if (this.f299if.get() < 6) {
this.f299if.incrementAndGet();
x(tcVar, str, bArr, kVar);
return;
}
m418if("当前网络不佳,请稍后再试");
this.f299if.set(0);
m421if(402, tcVar);
}
public void x(final com.ss.android.downloadlib.addownload.x.tc tcVar, final String str, final byte[] bArr, final k kVar) {
sl.j().mo184if(str, bArr, "application/json; charset=utf-8", 0, new nn() {
@Override
public void mo301if(String str2) {
r.this.m416if(tcVar, str2, kVar);
}
@Override
public void mo302if(Throwable th) {
r.this.m417if(tcVar, str, bArr, kVar);
}
});
}
private void m418if(final String str) {
com.ss.android.downloadlib.k.m732if().x().post(new Runnable() {
@Override
public void run() {
sl.z().mo182if(6, sl.getContext(), null, str, null, 0);
}
});
}
public byte[] m420if(com.ss.android.downloadlib.addownload.x.tc tcVar, boolean z, int i) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("download_url", tcVar.mo356if());
jSONObject.put("package_name", tcVar.tc());
jSONObject.put("call_scene", 50);
if (z) {
jSONObject.put("sender_package_name", sl.getContext().getPackageName());
jSONObject.put("sender_version", sl.vf().tc);
if (i > 0) {
jSONObject.put("store", i);
}
} else {
jSONObject.put("id", String.valueOf(tcVar.x()));
if (tcVar.hw().getDeepLink() != null) {
if (TextUtils.isEmpty(tcVar.hw().getDeepLink().getWebUrl())) {
com.ss.android.downloadlib.tc.z.m759if().m761if("web_url is null");
}
jSONObject.put("web_url", tcVar.hw().getDeepLink().getWebUrl());
} else {
com.ss.android.downloadlib.tc.z.m759if().m761if("deeplink is null");
}
}
} catch (Exception unused) {
com.ss.android.downloadlib.tc.z.m759if().m761if("param build error");
}
return jSONObject.toString().getBytes();
}
public void m416if(com.ss.android.downloadlib.addownload.x.tc tcVar, String str, k kVar) {
try {
if (TextUtils.isEmpty(str)) {
com.ss.android.downloadlib.tc.z.m759if().m761if("response content is null");
m421if(404, tcVar);
kVar.mo410if();
return;
}
this.f299if.set(0);
tc w = tc.w(str);
if (w.m428if() != 0) {
m421if(403, tcVar);
kVar.mo410if();
} else if (TextUtils.isEmpty(w.x())) {
m421if(405, tcVar);
kVar.mo410if();
} else {
kVar.mo411if(w.x());
}
} catch (Exception e) {
com.ss.android.downloadlib.tc.z.m759if().mo347if(e, "DownloadMiuiMarketHelper parseResponse");
}
}
public void m421if(int i, com.ss.android.downloadlib.addownload.x.tc tcVar) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.putOpt("download_miui_market_fail_code", Integer.valueOf(i));
} catch (Exception e) {
e.printStackTrace();
}
com.ss.android.downloadlib.j.Cif.m709if().m726if("get_miui_market_compliance_error", jSONObject, tcVar);
}
public void m422if(int i, com.ss.android.downloadlib.addownload.x.tc tcVar, JSONObject jSONObject) {
try {
jSONObject.putOpt("download_miui_market_success_result", Integer.valueOf(i));
} catch (Exception e) {
e.printStackTrace();
}
com.ss.android.downloadlib.j.Cif.m709if().m726if("get_miui_market_compliance_success", jSONObject, tcVar);
}
}