云游合成大猫咪 v1.0.0.9版本的 MD5 值为:2c57f1e5967950f3f726f306bf82eb8e
以下内容为反编译后的 a.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.an;
import com.qq.e.ads.nativ.NativeUnifiedADAppInfoImpl;
import com.ss.android.download.api.config.td;
import com.ss.android.download.api.download.DownloadModel;
import com.ss.android.downloadlib.activity.TTDelegateActivity;
import com.ss.android.downloadlib.addownload.r;
import com.ss.android.downloadlib.h.bl;
import com.ss.android.downloadlib.h.j;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
public class a {
private SoftReference<Activity> ok;
public static class ok {
private static a ok = new a();
}
public static a ok() {
return ok.ok;
}
private a() {
}
public void ok(long j) {
TTDelegateActivity.ok(j);
}
public boolean ok(DownloadModel downloadModel) {
if (!downloadModel.isAd() || r.q().optInt("ad_lp_show_app_dialog") == 0) {
return false;
}
String webUrl = downloadModel.getDeepLink() == null ? null : downloadModel.getDeepLink().getWebUrl();
return (TextUtils.isEmpty(webUrl) || Pattern.compile(r.q().optString("ad_allow_web_url_regex", ".+(www.chengzijianzhan.com|www.toutiaopage.com/tetris/page|ad.toutiao.com/tetris/page).+")).matcher(webUrl).matches()) ? false : true;
}
public boolean ok(com.ss.android.downloadlib.addownload.a.n nVar) {
long j;
long j2;
if (!TextUtils.isEmpty(nVar.a.getLogExtra())) {
try {
j = j.ok(new JSONObject(nVar.a.getLogExtra()), "convert_id");
} catch (Exception e) {
e.printStackTrace();
j = 0;
}
if (j <= 0) {
h.ok(3, nVar);
}
j2 = j;
} else {
h.ok(9, nVar);
com.ss.android.downloadlib.n.bl.ok().ok("requestAppInfo getLogExtra null");
j2 = 0;
}
final long j3 = nVar.ok;
com.ss.android.downloadlib.addownload.a.a ok2 = bl.ok().ok(j2, j3);
if (ok2 != null) {
s.ok().ok(ok2.ok(), j3, ok2.s);
ok(ok2.ok());
h.ok("lp_app_dialog_try_show", nVar);
return true;
}
StringBuilder sb = new StringBuilder();
if (j2 > 0) {
sb.append("convert_id=");
sb.append(j2);
}
if (!TextUtils.isEmpty(nVar.a.getPackageName())) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append("package_name=");
sb.append(nVar.a.getPackageName());
}
if (sb.length() <= 0) {
h.ok(6, nVar);
return false;
}
final long j4 = j2;
com.ss.android.downloadlib.h.bl.ok((bl.ok<String, R>) new bl.ok<String, Boolean>() {
@Override
public Boolean ok(String str) {
final boolean[] zArr = {false};
r.s().ok(an.c, str, new HashMap(), new td() {
@Override
public void ok(String str2) {
zArr[0] = a.this.ok(j4, j3, str2);
}
@Override
public void ok(Throwable th) {
h.ok(2, j3);
zArr[0] = false;
}
});
return Boolean.valueOf(zArr[0]);
}
}, "https://apps.oceanengine.com/customer/api/app/pkg_info?" + sb.toString()).ok(new bl.ok<Boolean, Object>() {
@Override
public Object ok(Boolean bool) {
if (bool.booleanValue()) {
a.this.ok(com.ss.android.downloadlib.addownload.a.a.ok(j4, j3));
h.a("lp_app_dialog_try_show", j3);
return null;
}
a.this.a(j3);
return null;
}
}).ok();
return true;
}
public boolean ok(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.a.a aVar = new com.ss.android.downloadlib.addownload.a.a();
aVar.ok = j;
aVar.a = j2;
aVar.s = optJSONObject.optString("icon_url");
aVar.n = optJSONObject.optString("app_name");
aVar.bl = optJSONObject.optString("package_name");
aVar.kf = optJSONObject.optString(NativeUnifiedADAppInfoImpl.Keys.VERSION_NAME);
aVar.h = optJSONObject.optString("developer_name");
aVar.q = 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);
aVar.p.add(new Pair<>(jSONObject.optString("permission_name"), jSONObject.optString("permission_desc")));
}
}
bl.ok().ok(aVar);
s.ok().ok(aVar.ok(), j2, aVar.s);
return true;
}
h.ok(7, j2);
return false;
} catch (Exception e) {
com.ss.android.downloadlib.n.bl.ok().ok(e, "AdLpComplianceManager parseResponse");
h.ok(7, j2);
return false;
}
}
public void a(long j) {
com.ss.android.downloadlib.addownload.n ok2 = com.ss.android.downloadlib.h.ok().ok(com.ss.android.downloadlib.addownload.a.kf.ok().n(j).a.getDownloadUrl());
if (ok2 != null) {
ok2.ok(true, true);
} else {
h.ok(11, j);
com.ss.android.downloadlib.n.bl.ok().a("startDownload handler null");
}
}
public void ok(Activity activity) {
this.ok = new SoftReference<>(activity);
}
public Activity a() {
Activity activity = this.ok.get();
this.ok = null;
return activity;
}
}