整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3
以下内容为反编译后的 zc.java 源代码,内容仅作参考
package com.ss.android.downloadlib.addownload.compliance;
import android.app.Activity;
import android.text.TextUtils;
import android.util.Pair;
import androidx.annotation.NonNull;
import com.qq.e.ads.nativ.NativeUnifiedADAppInfoImpl;
import com.sigmob.sdk.base.h;
import com.ss.android.download.api.config.lf;
import com.ss.android.download.api.download.DownloadModel;
import com.ss.android.downloadlib.activity.TTDelegateActivity;
import com.ss.android.downloadlib.addownload.il;
import com.ss.android.downloadlib.e.i;
import com.ss.android.downloadlib.e.nr;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
public class zc {
private SoftReference<Activity> g;
public static class g {
private static zc g = new zc();
}
public void zc(long j) {
com.ss.android.downloadlib.addownload.r g2 = com.ss.android.downloadlib.t.g().g(com.ss.android.downloadlib.addownload.zc.fy.g().r(j).zc.getDownloadUrl());
if (g2 != null) {
g2.g(true, true);
return;
}
e.g(11, j);
com.ss.android.downloadlib.r.i.g().zc("startDownload handler null");
}
private zc() {
}
public static zc g() {
return g.g;
}
public void g(long j) {
TTDelegateActivity.g(j);
}
public boolean g(DownloadModel downloadModel) {
if (downloadModel.isAd() && il.gj().optInt("ad_lp_show_app_dialog") != 0) {
String webUrl = downloadModel.getDeepLink() == null ? null : downloadModel.getDeepLink().getWebUrl();
return (TextUtils.isEmpty(webUrl) || Pattern.compile(il.gj().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 Activity zc() {
Activity activity = this.g.get();
this.g = null;
return activity;
}
public boolean g(@NonNull com.ss.android.downloadlib.addownload.zc.r rVar) {
long j;
long j2;
if (!TextUtils.isEmpty(rVar.zc.getLogExtra())) {
try {
j = nr.g(new JSONObject(rVar.zc.getLogExtra()), "convert_id");
} catch (Exception e) {
e.printStackTrace();
j = 0;
}
if (j <= 0) {
e.g(3, rVar);
}
j2 = j;
} else {
e.g(9, rVar);
com.ss.android.downloadlib.r.i.g().g("requestAppInfo getLogExtra null");
j2 = 0;
}
final long j3 = rVar.g;
com.ss.android.downloadlib.addownload.zc.zc g2 = i.g().g(j2, j3);
if (g2 != null) {
ql.g().g(g2.g(), j3, g2.ql);
g(g2.g());
e.g("lp_app_dialog_try_show", rVar);
return true;
}
StringBuilder sb = new StringBuilder();
if (j2 > 0) {
sb.append("convert_id=");
sb.append(j2);
}
if (!TextUtils.isEmpty(rVar.zc.getPackageName())) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append("package_name=");
sb.append(rVar.zc.getPackageName());
}
if (sb.length() <= 0) {
e.g(6, rVar);
return false;
}
final long j4 = j2;
com.ss.android.downloadlib.e.i.g((i.g<String, R>) new i.g<String, Boolean>() {
@Override
public Boolean g(String str) {
final boolean[] zArr = {false};
il.ql().g("GET", str, new HashMap(), new lf() {
@Override
public void g(String str2) {
boolean[] zArr2 = zArr;
AnonymousClass2 anonymousClass2 = AnonymousClass2.this;
zArr2[0] = zc.this.g(j4, j3, str2);
}
@Override
public void g(Throwable th) {
e.g(2, j3);
zArr[0] = false;
}
});
return Boolean.valueOf(zArr[0]);
}
}, "https://apps.oceanengine.com/customer/api/app/pkg_info?" + sb.toString()).g(new i.g<Boolean, Object>() {
@Override
public Object g(Boolean bool) {
if (bool.booleanValue()) {
zc.this.g(com.ss.android.downloadlib.addownload.zc.zc.g(j4, j3));
e.zc("lp_app_dialog_try_show", j3);
return null;
}
zc.this.zc(j3);
return null;
}
}).g();
return true;
}
public boolean g(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.zc.zc zcVar = new com.ss.android.downloadlib.addownload.zc.zc();
zcVar.g = j;
zcVar.zc = j2;
zcVar.ql = optJSONObject.optString("icon_url");
zcVar.r = optJSONObject.optString("app_name");
zcVar.i = optJSONObject.optString(h.o);
zcVar.fy = optJSONObject.optString(NativeUnifiedADAppInfoImpl.Keys.VERSION_NAME);
zcVar.e = optJSONObject.optString("developer_name");
zcVar.gj = 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);
zcVar.t.add(new Pair<>(jSONObject.optString("permission_name"), jSONObject.optString("permission_desc")));
}
}
i.g().g(zcVar);
ql.g().g(zcVar.g(), j2, zcVar.ql);
return true;
}
e.g(7, j2);
return false;
} catch (Exception e) {
com.ss.android.downloadlib.r.i.g().g(e, "AdLpComplianceManager parseResponse");
e.g(7, j2);
return false;
}
}
public void g(Activity activity) {
this.g = new SoftReference<>(activity);
}
}