我要上王者 v1.1版本的 MD5 值为:b7d3566522def961cabeb92cb17f5db9
以下内容为反编译后的 x.java 源代码,内容仅作参考
package com.ss.android.downloadlib.addownload.compliance;
import android.app.Activity;
import android.text.TextUtils;
import android.util.Pair;
import com.baidu.mobads.sdk.internal.am;
import com.qq.e.ads.nativ.NativeUnifiedADAppInfoImpl;
import com.ss.android.download.api.config.nn;
import com.ss.android.download.api.download.DownloadModel;
import com.ss.android.downloadlib.activity.TTDelegateActivity;
import com.ss.android.downloadlib.addownload.sl;
import com.ss.android.downloadlib.w.hz;
import com.ss.android.downloadlib.w.z;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
public class x {
private SoftReference<Activity> f308if;
public static class Cif {
private static x f312if = new x();
}
public static x m449if() {
return Cif.f312if;
}
private x() {
}
public void m452if(long j) {
TTDelegateActivity.m370if(j);
}
public boolean m454if(DownloadModel downloadModel) {
if (downloadModel.isAd() && sl.b().optInt("ad_lp_show_app_dialog") != 0) {
String webUrl = downloadModel.getDeepLink() == null ? null : downloadModel.getDeepLink().getWebUrl();
return (TextUtils.isEmpty(webUrl) || Pattern.compile(sl.b().optString("ad_allow_web_url_regex", ".+(www.chengzijianzhan.com|www.toutiaopage.com/tetris/page|ad.toutiao.com/tetris/page).+")).matcher(webUrl).matches()) ? false : true;
}
return false;
}
public boolean m455if(com.ss.android.downloadlib.addownload.x.tc tcVar) {
long j;
long j2;
if (!TextUtils.isEmpty(tcVar.x.getLogExtra())) {
try {
j = hz.m776if(new JSONObject(tcVar.x.getLogExtra()), "convert_id");
} catch (Exception e) {
e.printStackTrace();
j = 0;
}
if (j <= 0) {
w.m445if(3, tcVar);
}
j2 = j;
} else {
w.m445if(9, tcVar);
com.ss.android.downloadlib.tc.z.m759if().m761if("requestAppInfo getLogExtra null");
j2 = 0;
}
final long j3 = tcVar.f372if;
com.ss.android.downloadlib.addownload.x.x m459if = z.m457if().m459if(j2, j3);
if (m459if != null) {
j.m404if().m406if(m459if.m628if(), j3, m459if.j);
m452if(m459if.m628if());
w.m447if("lp_app_dialog_try_show", tcVar);
return true;
}
StringBuilder sb = new StringBuilder();
if (j2 > 0) {
sb.append("convert_id=");
sb.append(j2);
}
if (!TextUtils.isEmpty(tcVar.x.getPackageName())) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append("package_name=");
sb.append(tcVar.x.getPackageName());
}
if (sb.length() <= 0) {
w.m445if(6, tcVar);
return false;
}
final long j4 = j2;
com.ss.android.downloadlib.w.z.m840if((z.Cif<String, R>) new z.Cif<String, Boolean>() {
@Override
public Boolean mo408if(String str) {
final boolean[] zArr = {false};
sl.j().mo183if(am.c, str, new HashMap(), new nn() {
@Override
public void mo301if(String str2) {
zArr[0] = x.this.m450if(j4, j3, str2);
}
@Override
public void mo302if(Throwable th) {
w.m444if(2, j3);
zArr[0] = false;
}
});
return Boolean.valueOf(zArr[0]);
}
}, "https://apps.oceanengine.com/customer/api/app/pkg_info?" + sb.toString()).m842if(new z.Cif<Boolean, Object>() {
@Override
public Object mo408if(Boolean bool) {
if (bool.booleanValue()) {
x.this.m452if(com.ss.android.downloadlib.addownload.x.x.m627if(j4, j3));
w.x("lp_app_dialog_try_show", j3);
return null;
}
x.this.x(j3);
return null;
}
}).m843if();
return true;
}
public boolean m450if(long j, long j2, String str) {
try {
JSONObject optJSONObject = new JSONObject(str).optJSONObject("package");
if (optJSONObject != null && optJSONObject.length() != 0) {
com.ss.android.downloadlib.addownload.x.x xVar = new com.ss.android.downloadlib.addownload.x.x();
xVar.f374if = j;
xVar.x = j2;
xVar.j = optJSONObject.optString("icon_url");
xVar.tc = optJSONObject.optString("app_name");
xVar.z = optJSONObject.optString("package_name");
xVar.r = optJSONObject.optString(NativeUnifiedADAppInfoImpl.Keys.VERSION_NAME);
xVar.w = optJSONObject.optString("developer_name");
xVar.f6253b = optJSONObject.optString("policy_url");
JSONArray optJSONArray = optJSONObject.optJSONArray("permissions");
if (optJSONArray != null) {
for (int i = 0; i < optJSONArray.length(); i++) {
JSONObject jSONObject = (JSONObject) optJSONArray.get(i);
xVar.k.add(new Pair<>(jSONObject.optString("permission_name"), jSONObject.optString("permission_desc")));
}
}
z.m457if().m460if(xVar);
j.m404if().m406if(xVar.m628if(), j2, xVar.j);
return true;
}
w.m444if(7, j2);
return false;
} catch (Exception e) {
com.ss.android.downloadlib.tc.z.m759if().mo347if(e, "AdLpComplianceManager parseResponse");
w.m444if(7, j2);
return false;
}
}
public void x(long j) {
com.ss.android.downloadlib.addownload.tc m735if = com.ss.android.downloadlib.k.m732if().m735if(com.ss.android.downloadlib.addownload.x.r.m612if().tc(j).x.getDownloadUrl());
if (m735if != null) {
m735if.m587if(true, true);
return;
}
w.m444if(11, j);
com.ss.android.downloadlib.tc.z.m759if().x("startDownload handler null");
}
public void m453if(Activity activity) {
this.f308if = new SoftReference<>(activity);
}
public Activity x() {
Activity activity = this.f308if.get();
this.f308if = null;
return activity;
}
}