MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3
以下内容为反编译后的 x.java 源代码,内容仅作参考
package com.bytedance.sdk.openadsdk.core;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Base64;
import android.util.SparseArray;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import com.bytedance.JProtect;
import com.bytedance.sdk.component.utils.x;
import com.bytedance.sdk.component.widget.SSWebView;
import com.bytedance.sdk.openadsdk.activity.TTWebsiteActivity;
import com.bytedance.sdk.openadsdk.b.b;
import com.bytedance.sdk.openadsdk.core.b.c;
import com.bytedance.sdk.openadsdk.core.model.m;
import com.bytedance.sdk.openadsdk.utils.DeviceUtils;
import com.bytedance.sdk.openadsdk.utils.ac;
import com.bytedance.sdk.openadsdk.utils.ad;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.facebook.internal.NativeProtocol;
import com.facebook.share.internal.ShareConstants;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.firebase.messaging.Constants;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.RemoteConfigConstants;
import com.smaato.sdk.core.mvvm.model.imagead.ImageAdResponseParser;
import com.smaato.sdk.video.vast.model.Creative;
import com.smaato.sdk.video.vast.model.Tracking;
import java.lang.ref.WeakReference;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import net.pubnative.lite.sdk.vpaid.enums.EventConstants;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class x implements com.bytedance.sdk.component.adexpress.d.b, x.a, com.bytedance.sdk.openadsdk.g.b {
private static final Map<String, Boolean> f16602h;
private com.bytedance.sdk.openadsdk.i.b A;
private com.bytedance.sdk.openadsdk.i.i B;
private List<com.bytedance.sdk.openadsdk.core.model.q> D;
private HashMap<String, i> E;
private com.bytedance.sdk.openadsdk.b.c.e H;
private com.bytedance.sdk.component.a.r I;
private String J;
private com.bytedance.sdk.openadsdk.core.widget.a.a L;
private com.bytedance.sdk.openadsdk.i.f M;
private boolean N;
private boolean O;
private Context P;
private a Q;
public Map<String, Object> f16603a;
public boolean f16604b;
private WeakReference<SSWebView> f16606d;
private String f16608f;
private com.bytedance.sdk.openadsdk.core.widget.b f16609g;
private com.bytedance.sdk.openadsdk.g.c f16610i;
private String f16611j;
private WeakReference<View> f16612k;
private String f16613l;
private int f16614m;
private String f16615n;
private int f16616o;
private com.bytedance.sdk.openadsdk.core.model.q f16618q;
private com.bytedance.sdk.component.adexpress.b.k f16619r;
private com.bytedance.sdk.openadsdk.core.nativeexpress.l f16620s;
private JSONObject f16621t;
private com.bytedance.sdk.openadsdk.g.d f16622u;
private com.bytedance.sdk.openadsdk.i.a f16623v;
private com.bytedance.sdk.openadsdk.i.e f16624w;
private com.bytedance.sdk.openadsdk.i.d f16625x;
private JSONObject f16626y;
private com.bytedance.sdk.openadsdk.core.b.d f16627z;
private boolean f16617p = true;
private boolean C = true;
private boolean F = false;
private boolean G = false;
public boolean f16605c = false;
private boolean K = false;
private final com.bytedance.sdk.component.utils.x f16607e = new com.bytedance.sdk.component.utils.x(Looper.getMainLooper(), this);
public interface a {
void a();
}
public static class b {
public String f16643a;
public String f16644b;
public String f16645c;
public JSONObject f16646d;
public int f16647e;
}
static {
ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
f16602h = concurrentHashMap;
Boolean bool = Boolean.TRUE;
concurrentHashMap.put("log_event", bool);
concurrentHashMap.put("private", bool);
concurrentHashMap.put("dispatch_message", bool);
concurrentHashMap.put("custom_event", bool);
concurrentHashMap.put("log_event_v3", bool);
}
public x(Context context) {
this.P = context;
}
private void a(final b bVar, final JSONObject jSONObject) {
if (bVar == null) {
return;
}
try {
a(bVar.f16646d, new com.bytedance.sdk.openadsdk.i.c() {
});
} catch (Exception unused) {
}
}
private void a(String str, boolean z7) {
if (this.H == null || TextUtils.isEmpty(str)) {
return;
}
if (z7) {
this.H.a(str);
} else {
this.H.b(str);
}
}
@JProtect
private void a(JSONObject jSONObject, int i10) throws Exception {
JSONArray jSONArray = new JSONArray();
for (String str : q()) {
jSONArray.put(str);
}
jSONObject.put("appName", com.bytedance.sdk.openadsdk.common.a.a());
jSONObject.put("innerAppName", com.bytedance.sdk.openadsdk.common.a.e());
jSONObject.put("aid", com.bytedance.sdk.openadsdk.common.a.b());
jSONObject.put("sdkEdition", com.bytedance.sdk.openadsdk.common.a.c());
jSONObject.put(RemoteConfigConstants.RequestFieldKey.APP_VERSION, com.bytedance.sdk.openadsdk.common.a.d());
jSONObject.put("netType", com.bytedance.sdk.openadsdk.common.a.f());
jSONObject.put("supportList", jSONArray);
jSONObject.put("deviceId", com.bytedance.sdk.openadsdk.common.a.a(o.a()));
if (DeviceUtils.b(o.a())) {
jSONObject.put("device_platform", "Android_Pad");
} else {
jSONObject.put("device_platform", "Android");
}
jSONObject.put("device_type", Build.VERSION.RELEASE);
}
private static void a(JSONObject jSONObject, com.bytedance.sdk.openadsdk.core.model.q qVar) throws Exception {
String Y = qVar.Y();
if (!TextUtils.isEmpty(Y)) {
jSONObject.put("cid", Y);
}
String ac2 = qVar.ac();
if (!TextUtils.isEmpty(ac2)) {
jSONObject.put("log_extra", ac2);
}
String bc2 = qVar.bc();
if (!TextUtils.isEmpty(bc2)) {
jSONObject.put("download_url", bc2);
}
jSONObject.put("dc", TextUtils.isEmpty(o.d().L()) ? o.d().L() : "SG");
jSONObject.put("language", j.a());
jSONObject.put("isRTL", com.bytedance.sdk.openadsdk.core.settings.o.aj().ad());
}
@JProtect
private boolean a(String str, int i10, com.bytedance.sdk.openadsdk.core.model.m mVar) {
HashMap<String, i> hashMap;
i iVar;
if (TextUtils.isEmpty(str) || (hashMap = this.E) == null || (iVar = hashMap.get(str)) == null) {
return false;
}
iVar.a(i10, mVar);
return true;
}
private boolean a(JSONObject jSONObject, JSONObject jSONObject2) {
String str;
String str2;
int i10;
if (jSONObject != null) {
i10 = jSONObject.optInt("landingStyle");
str2 = jSONObject.optString("url");
str = jSONObject.optString("fallback_url");
} else {
str = "";
str2 = str;
i10 = -1;
}
boolean z7 = false;
if (i10 == 1) {
if (!com.bytedance.sdk.component.utils.o.a(str2)) {
try {
jSONObject2.put("invalid_url", 1);
} catch (JSONException e10) {
com.bytedance.sdk.component.utils.l.c("TTAD.AndroidObject", "handleUrl, EX1->: ", e10);
}
return z7;
}
} else if (i10 == 2) {
try {
if (TextUtils.isEmpty(str2) && TextUtils.isEmpty(str)) {
jSONObject2.put("empty_url", 1);
} else if (!com.bytedance.sdk.component.utils.o.a(str)) {
jSONObject2.put("invalid_url", 1);
}
} catch (JSONException e11) {
com.bytedance.sdk.component.utils.l.c("TTAD.AndroidObject", "handleUrl, EX2->: ", e11);
}
return z7;
}
z7 = true;
return z7;
}
public static JSONArray b(List<com.bytedance.sdk.openadsdk.core.model.q> list) {
JSONArray jSONArray = new JSONArray();
if (list == null) {
return jSONArray;
}
int size = list.size();
for (int i10 = 0; i10 < size; i10++) {
jSONArray.put(list.get(i10).ao());
}
return jSONArray;
}
private void b(String str, JSONObject jSONObject) {
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("__msg_type", "callback");
jSONObject2.put("__callback_id", str);
if (jSONObject != null) {
jSONObject2.put("__params", jSONObject);
}
q(jSONObject2);
} catch (Exception unused) {
}
}
private void c(String str, JSONObject jSONObject) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("__msg_type", Tracking.EVENT);
jSONObject2.put("__event_id", str);
if (jSONObject != null) {
jSONObject2.put("__params", jSONObject);
}
q(jSONObject2);
} catch (Exception unused) {
}
}
private void e(JSONObject jSONObject) throws Exception {
if (this.N) {
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
if ((qVar instanceof com.bytedance.sdk.openadsdk.core.model.r) && ((com.bytedance.sdk.openadsdk.core.model.r) qVar).by()) {
JSONArray jSONArray = new JSONArray();
jSONObject.put("adInfos", jSONArray);
for (com.bytedance.sdk.openadsdk.core.model.q qVar2 : ((com.bytedance.sdk.openadsdk.core.model.r) this.f16618q).bA()) {
JSONObject jSONObject2 = new JSONObject();
a(jSONObject2, qVar2);
jSONArray.put(jSONObject2);
}
return;
}
}
a(jSONObject, this.f16618q);
}
private void f(JSONObject jSONObject) throws Exception {
if (TextUtils.isEmpty(com.bytedance.sdk.openadsdk.core.model.t.d(this.f16618q))) {
return;
}
jSONObject.put("playable_style", com.bytedance.sdk.openadsdk.core.model.t.d(this.f16618q));
}
private void g(JSONObject jSONObject) {
com.bytedance.sdk.openadsdk.b.c.e eVar;
if (jSONObject == null || (eVar = this.H) == null) {
return;
}
eVar.b(jSONObject);
}
private void h(String str) {
try {
String str2 = new String(Base64.decode(str, 2));
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", str2);
JSONArray jSONArray = new JSONArray(str2);
int length = jSONArray.length();
for (int i10 = 0; i10 < length; i10++) {
b bVar = new b();
try {
JSONObject optJSONObject = jSONArray.optJSONObject(i10);
if (optJSONObject != null) {
bVar.f16643a = optJSONObject.optString("__msg_type", null);
bVar.f16644b = optJSONObject.optString("__callback_id", null);
bVar.f16645c = optJSONObject.optString("func");
bVar.f16646d = optJSONObject.optJSONObject(NativeProtocol.WEB_DIALOG_PARAMS);
bVar.f16647e = optJSONObject.optInt("JSSDK");
}
} catch (Throwable unused) {
}
if (!TextUtils.isEmpty(bVar.f16643a) && !TextUtils.isEmpty(bVar.f16645c)) {
Message obtainMessage = this.f16607e.obtainMessage(11);
obtainMessage.obj = bVar;
this.f16607e.sendMessage(obtainMessage);
}
}
} catch (Exception unused2) {
if (!com.bytedance.sdk.component.utils.l.a()) {
com.bytedance.sdk.component.utils.l.d("TTAD.AndroidObject", "failed to parse jsbridge msg queue");
return;
}
com.bytedance.sdk.component.utils.l.d("TTAD.AndroidObject", "failed to parse jsbridge msg queue " + str);
}
}
private void h(JSONObject jSONObject) {
com.bytedance.sdk.openadsdk.i.b bVar = this.A;
if (bVar == null || jSONObject == null) {
return;
}
bVar.a(jSONObject.optBoolean("isRenderSuc", false), jSONObject.optInt("code", -1), jSONObject.optString(SDKConstants.PARAM_DEBUG_MESSAGE, ""));
}
public void i(JSONObject jSONObject) {
if (this.f16620s != null && jSONObject != null) {
try {
this.f16620s.a(jSONObject.optBoolean(EventConstants.MUTE, false));
} catch (Exception unused) {
}
}
}
public boolean i(String str) {
if (!TextUtils.isEmpty(str) && "click_other".equals(str)) {
return j();
}
return true;
}
public String j(String str) {
return this.A != null ? ac.a(this.f16614m) : this.f16619r == null ? ac.b(this.f16614m) : str;
}
public void j(JSONObject jSONObject) {
if (this.f16620s != null && jSONObject != null) {
try {
this.f16620s.a(jSONObject.optInt("stateType", -1));
} catch (Exception unused) {
}
}
}
private void k(String str) {
if (str != null && str.startsWith("bytedance://")) {
try {
if (str.equals("bytedance://dispatch_message/")) {
WebView o10 = o();
if (o10 != null) {
com.bytedance.sdk.component.utils.k.a(o10, "javascript:ToutiaoJSBridge._fetchQueue()");
}
} else if (str.startsWith("bytedance://private/setresult/")) {
int indexOf = str.indexOf(38, 30);
if (indexOf <= 0) {
return;
}
String substring = str.substring(30, indexOf);
String substring2 = str.substring(indexOf + 1);
if (substring.equals("SCENE_FETCHQUEUE") && substring2.length() > 0) {
h(substring2);
}
}
} catch (Exception unused) {
}
}
}
private boolean k(JSONObject jSONObject) {
com.bytedance.sdk.openadsdk.core.nativeexpress.l lVar = this.f16620s;
if (lVar != null && jSONObject != null) {
double c10 = lVar.c();
int d10 = this.f16620s.d();
try {
jSONObject.put("currentTime", c10 / 1000.0d);
jSONObject.put("state", d10);
return true;
} catch (Exception unused) {
}
}
return false;
}
@JProtect
private void l(JSONObject jSONObject) {
int i10;
double d10;
boolean z7;
double d11;
com.bytedance.sdk.openadsdk.i.f fVar;
x xVar = this;
if (xVar.f16619r == null || jSONObject == null) {
return;
}
com.bytedance.sdk.component.adexpress.b.n nVar = new com.bytedance.sdk.component.adexpress.b.n();
nVar.a(1);
try {
boolean optBoolean = jSONObject.optBoolean("isRenderSuc");
JSONObject optJSONObject = jSONObject.optJSONObject("AdSize");
double d12 = FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE;
if (optJSONObject != null) {
d12 = optJSONObject.optDouble("width");
d10 = optJSONObject.optDouble("height");
} else {
d10 = 0.0d;
}
JSONObject optJSONObject2 = jSONObject.optJSONObject("videoInfo");
if (optJSONObject2 != null) {
try {
double optDouble = optJSONObject2.optDouble("x");
double optDouble2 = optJSONObject2.optDouble("y");
z7 = optBoolean;
double optDouble3 = optJSONObject2.optDouble("width");
double optDouble4 = optJSONObject2.optDouble("height");
if (xVar.m(optJSONObject2)) {
d11 = d10;
nVar.a((float) optJSONObject2.optDouble("borderRadiusTopLeft"));
nVar.b((float) optJSONObject2.optDouble("borderRadiusTopRight"));
nVar.c((float) optJSONObject2.optDouble("borderRadiusBottomLeft"));
nVar.d((float) optJSONObject2.optDouble("borderRadiusBottomRight"));
} else {
d11 = d10;
}
nVar.c(optDouble);
nVar.d(optDouble2);
nVar.e(optDouble3);
nVar.f(optDouble4);
} catch (Exception unused) {
i10 = 101;
xVar = this;
nVar.b(i10);
nVar.a(g.a(i10));
xVar.f16619r.a(nVar);
}
} else {
z7 = optBoolean;
d11 = d10;
}
try {
String optString = jSONObject.optString("message", g.a(101));
int optInt = jSONObject.optInt("code", 101);
nVar.a(z7);
nVar.a(d12);
nVar.b(d11);
nVar.a(optString);
nVar.b(optInt);
xVar = this;
xVar.f16619r.a(nVar);
if (optJSONObject2 == null || (fVar = xVar.M) == null) {
return;
}
fVar.a(nVar);
} catch (Exception unused2) {
xVar = this;
i10 = 101;
nVar.b(i10);
nVar.a(g.a(i10));
xVar.f16619r.a(nVar);
}
} catch (Exception unused3) {
}
}
private boolean m(JSONObject jSONObject) {
return jSONObject.has("borderRadiusTopLeft") && jSONObject.has("borderRadiusBottomLeft") && jSONObject.has("borderRadiusTopRight") && jSONObject.has("borderRadiusBottomRight");
}
private void n(JSONObject jSONObject) {
if (jSONObject == null) {
return;
}
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "TTAndroidObject handlerDynamicTrack");
try {
Uri parse = Uri.parse(jSONObject.optString("trackData"));
if ("bytedance".equals(parse.getScheme().toLowerCase())) {
com.bytedance.sdk.openadsdk.utils.l.a(parse, this);
}
} catch (Exception unused) {
}
}
private WebView o() {
SSWebView sSWebView;
WeakReference<SSWebView> weakReference = this.f16606d;
if (weakReference == null || (sSWebView = weakReference.get()) == null) {
return null;
}
return sSWebView.getWebView();
}
private void o(JSONObject jSONObject) {
if (jSONObject == null || this.f16622u == null) {
return;
}
try {
JSONArray optJSONArray = jSONObject.optJSONArray("temaiProductIds");
if (optJSONArray == null || optJSONArray.length() <= 0) {
this.f16622u.a(false, null);
} else {
this.f16622u.a(true, optJSONArray);
}
} catch (Exception unused) {
this.f16622u.a(false, null);
}
}
@JProtect
private JSONObject p() {
try {
View view = this.f16612k.get();
SSWebView sSWebView = this.f16606d.get();
if (view != null && sSWebView != null) {
int[] b10 = ad.b(view);
int[] b11 = ad.b((View) sSWebView);
if (b10 != null && b11 != null) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("x", ad.c(o.a(), b10[0] - b11[0]));
jSONObject.put("y", ad.c(o.a(), b10[1] - b11[1]));
jSONObject.put(ImageAdResponseParser.ResponseFields.IMG_WIDTH_KEY, ad.c(o.a(), view.getWidth()));
jSONObject.put(ImageAdResponseParser.ResponseFields.IMG_HEIGHT_KEY, ad.c(o.a(), view.getHeight()));
jSONObject.put("isExist", true);
return jSONObject;
}
com.bytedance.sdk.component.utils.l.e("TTAD.AndroidObject", "setCloseButtonInfo error position or webViewPosition is null");
return null;
}
com.bytedance.sdk.component.utils.l.e("TTAD.AndroidObject", "setCloseButtonInfo error closeButton is null");
return null;
} catch (Throwable th2) {
com.bytedance.sdk.component.utils.l.a("TTAD.AndroidObject", "setCloseButtonInfo error", th2);
return null;
}
}
private boolean p(JSONObject jSONObject) {
try {
jSONObject.put("creatives", b(this.D));
} catch (Exception unused) {
}
return true;
}
private List<String> q() {
return Arrays.asList("appInfo", "adInfo", "getTemplateInfo", "getTeMaiAds");
}
private void q(JSONObject jSONObject) {
WebView o10;
if (jSONObject == null || (o10 = o()) == null) {
return;
}
String str = "javascript:ToutiaoJSBridge._handleMessageFromToutiao(" + jSONObject + ")";
com.bytedance.sdk.component.utils.k.a(o10, str);
if (com.bytedance.sdk.component.utils.l.a()) {
com.bytedance.sdk.component.utils.l.a("TTAD.AndroidObject", "js_msg " + str);
}
}
private Context r() {
WeakReference<SSWebView> weakReference = this.f16606d;
Activity a10 = (weakReference == null || weakReference.get() == null) ? null : com.bytedance.sdk.component.utils.b.a(this.f16606d.get());
return a10 == null ? this.P : a10;
}
public JSONObject r(JSONObject jSONObject) {
if (this.f16603a != null) {
if (jSONObject == null) {
jSONObject = new JSONObject();
}
try {
JSONObject jSONObject2 = new JSONObject();
String optString = jSONObject.optString("ad_extra_data", null);
if (optString != null) {
jSONObject2 = new JSONObject(optString);
}
for (Map.Entry<String, Object> entry : this.f16603a.entrySet()) {
jSONObject2.put(entry.getKey(), entry.getValue());
}
jSONObject.put("ad_extra_data", jSONObject2.toString());
} catch (Exception e10) {
com.bytedance.sdk.component.utils.l.d(e10.toString());
}
}
return jSONObject;
}
private void s() {
com.bytedance.sdk.openadsdk.i.i iVar = this.B;
if (iVar == null) {
return;
}
iVar.a();
}
private void t() {
com.bytedance.sdk.openadsdk.i.i iVar = this.B;
if (iVar == null) {
return;
}
iVar.b();
}
public void u() {
com.bytedance.sdk.openadsdk.core.nativeexpress.l lVar = this.f16620s;
if (lVar != null) {
lVar.a();
}
}
private void v() {
if (this.P == null || TextUtils.isEmpty(o.d().I())) {
return;
}
TTWebsiteActivity.a(this.P, this.f16618q, this.J);
}
@JProtect
private JSONObject w() {
int ba2;
int aT;
int j10;
int q10;
boolean f10;
boolean z7;
boolean z9;
boolean p10;
com.bytedance.sdk.openadsdk.core.model.q qVar;
JSONObject jSONObject = new JSONObject();
if (o.d() == null) {
return jSONObject;
}
try {
com.bytedance.sdk.openadsdk.core.model.q qVar2 = this.f16618q;
ba2 = qVar2 != null ? qVar2.ba() : 0;
com.bytedance.sdk.openadsdk.core.model.q qVar3 = this.f16618q;
aT = qVar3 != null ? qVar3.aT() : 0;
j10 = o.d().j(String.valueOf(ba2));
q10 = o.d().q(String.valueOf(ba2));
f10 = o.d().f(String.valueOf(ba2));
z7 = true;
z9 = !com.bytedance.sdk.openadsdk.core.model.q.e(this.f16618q) && o.d().l(String.valueOf(ba2)) == 1;
} catch (Exception unused) {
}
if (aT != 7 && aT != 8) {
p10 = o.d().c(String.valueOf(ba2));
jSONObject.put("voice_control", p10);
jSONObject.put("rv_skip_time", j10);
jSONObject.put("fv_skip_show", f10);
jSONObject.put("iv_skip_time", q10);
qVar = this.f16618q;
if (qVar != null || !qVar.an()) {
z7 = false;
}
jSONObject.put("show_dislike", z7);
com.bytedance.sdk.openadsdk.core.model.q qVar4 = this.f16618q;
jSONObject.put("video_adaptation", qVar4 != null ? qVar4.A() : 0);
jSONObject.put("skip_change_to_close", z9);
return jSONObject;
}
p10 = o.d().p(String.valueOf(ba2));
jSONObject.put("voice_control", p10);
jSONObject.put("rv_skip_time", j10);
jSONObject.put("fv_skip_show", f10);
jSONObject.put("iv_skip_time", q10);
qVar = this.f16618q;
if (qVar != null) {
}
z7 = false;
jSONObject.put("show_dislike", z7);
com.bytedance.sdk.openadsdk.core.model.q qVar42 = this.f16618q;
jSONObject.put("video_adaptation", qVar42 != null ? qVar42.A() : 0);
jSONObject.put("skip_change_to_close", z9);
return jSONObject;
}
private boolean x() {
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
if (qVar == null || qVar.aj() == null || com.bytedance.sdk.openadsdk.core.model.t.b(this.f16618q) || this.F || this.f16618q.aj().optInt("parent_type") != 2) {
return false;
}
int aT = this.f16618q.aT();
if (aT == 8 || aT == 7) {
this.F = true;
return true;
}
return false;
}
private void y() {
if (this.f16610i == null) {
this.f16610i = com.bytedance.sdk.openadsdk.g.a.a(this, this.f16618q);
}
}
public com.bytedance.sdk.component.a.r a() {
return this.I;
}
public x a(int i10) {
this.f16616o = i10;
return this;
}
public x a(View view) {
this.f16612k = new WeakReference<>(view);
return this;
}
public x a(com.bytedance.sdk.component.adexpress.b.k kVar) {
this.f16619r = kVar;
return this;
}
public x a(SSWebView sSWebView) {
WebView webView = sSWebView.getWebView();
if (webView == null) {
return this;
}
try {
com.bytedance.sdk.component.a.r b10 = com.bytedance.sdk.component.a.r.a(webView).a(new com.bytedance.sdk.openadsdk.h.a()).a("ToutiaoJSBridge").a(new com.bytedance.sdk.component.a.l() {
@Override
public <T> T a(String str, Type type) {
return null;
}
@Override
public <T> String a(T t10) {
return null;
}
}).a(h.b().q()).b(true).a().b();
this.I = b10;
com.bytedance.sdk.openadsdk.h.a.e.a(b10, this);
com.bytedance.sdk.openadsdk.h.a.a.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.b.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.c.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.d.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.f.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.h.a(this.I, this);
com.bytedance.sdk.openadsdk.h.a.g.a(this.I, sSWebView);
} catch (Exception unused) {
}
return this;
}
public x a(com.bytedance.sdk.openadsdk.b.c.e eVar) {
this.H = eVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.core.b.d dVar) {
this.f16627z = dVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.core.model.q qVar) {
this.f16618q = qVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.core.nativeexpress.l lVar) {
this.f16620s = lVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.core.widget.a.a aVar) {
this.L = aVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.core.widget.b bVar) {
this.f16609g = bVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.g.d dVar) {
this.f16622u = dVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.a aVar) {
this.f16623v = aVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.b bVar) {
this.A = bVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.d dVar) {
this.f16625x = dVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.e eVar) {
this.f16624w = eVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.f fVar) {
this.M = fVar;
return this;
}
public x a(com.bytedance.sdk.openadsdk.i.i iVar) {
this.B = iVar;
return this;
}
public x a(List<com.bytedance.sdk.openadsdk.core.model.q> list) {
this.D = list;
return this;
}
public x a(Map<String, Object> map) {
this.f16603a = map;
return this;
}
public x a(JSONObject jSONObject) {
this.f16621t = jSONObject;
return this;
}
public x a(boolean z7) {
this.f16604b = z7;
return this;
}
@JProtect
public JSONObject a(b bVar, int i10) throws Exception {
char c10;
JSONObject jSONObject;
Context context;
JSONObject jSONObject2;
if ("call".equals(bVar.f16643a)) {
if (h.b().q()) {
StringBuilder sb2 = new StringBuilder();
sb2.append("[JSB-REQ] version:");
sb2.append(i10);
sb2.append(" method:");
sb2.append(bVar.f16645c);
}
JSONObject jSONObject3 = new JSONObject();
String str = bVar.f16645c;
str.hashCode();
int i11 = -1;
switch (str.hashCode()) {
case -2036781162:
if (str.equals("subscribe_app_ad")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case -1423303823:
if (str.equals("adInfo")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case -1330994877:
if (str.equals("pauseWebView")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case -1169135450:
if (str.equals("changeVideoState")) {
c10 = 3;
break;
}
c10 = 65535;
break;
case -1023873614:
if (str.equals("openAdLandPageLinks")) {
c10 = 4;
break;
}
c10 = 65535;
break;
case -844321441:
if (str.equals("webview_time_track")) {
c10 = 5;
break;
}
c10 = 65535;
break;
case -800853518:
if (str.equals("clickEvent")) {
c10 = 6;
break;
}
c10 = 65535;
break;
case -794273169:
if (str.equals("appInfo")) {
c10 = 7;
break;
}
c10 = 65535;
break;
case -715147645:
if (str.equals("getScreenSize")) {
c10 = '\b';
break;
}
c10 = 65535;
break;
case -511324706:
if (str.equals("openPrivacy")) {
c10 = '\t';
break;
}
c10 = 65535;
break;
case -489318846:
if (str.equals("getMaterialMeta")) {
c10 = '\n';
break;
}
c10 = 65535;
break;
case -278382602:
if (str.equals("send_temai_product_ids")) {
c10 = 11;
break;
}
c10 = 65535;
break;
case -173752734:
if (str.equals("getTeMaiAds")) {
c10 = '\f';
break;
}
c10 = 65535;
break;
case 27837080:
if (str.equals("download_app_ad")) {
c10 = '\r';
break;
}
c10 = 65535;
break;
case 94756344:
if (str.equals("close")) {
c10 = 14;
break;
}
c10 = 65535;
break;
case 105049135:
if (str.equals("unsubscribe_app_ad")) {
c10 = 15;
break;
}
c10 = 65535;
break;
case 399543522:
if (str.equals("getCloseButtonInfo")) {
c10 = 16;
break;
}
c10 = 65535;
break;
case 402955465:
if (str.equals("isViewable")) {
c10 = 17;
break;
}
c10 = 65535;
break;
case 425443791:
if (str.equals("getNativeSiteCustomData")) {
c10 = 18;
break;
}
c10 = 65535;
break;
case 442647767:
if (str.equals("sendReward")) {
c10 = 19;
break;
}
c10 = 65535;
break;
case 571273292:
if (str.equals("dynamicTrack")) {
c10 = 20;
break;
}
c10 = 65535;
break;
case 650209982:
if (str.equals("getTemplateInfo")) {
c10 = 21;
break;
}
c10 = 65535;
break;
case 672928467:
if (str.equals("cancel_download_app_ad")) {
c10 = 22;
break;
}
c10 = 65535;
break;
case 711635577:
if (str.equals("getCurrentVideoState")) {
c10 = 23;
break;
}
c10 = 65535;
break;
case 885131792:
if (str.equals("getVolume")) {
c10 = 24;
break;
}
c10 = 65535;
break;
case 1107374321:
if (str.equals("pauseWebViewTimers")) {
c10 = 25;
break;
}
c10 = 65535;
break;
case 1151744482:
if (str.equals("muteVideo")) {
c10 = 26;
break;
}
c10 = 65535;
break;
case 1237100796:
if (str.equals("renderDidFinish")) {
c10 = 27;
break;
}
c10 = 65535;
break;
case 1532142616:
if (str.equals("removeLoading")) {
c10 = 28;
break;
}
c10 = 65535;
break;
case 1634511418:
if (str.equals("endcard_load")) {
c10 = 29;
break;
}
c10 = 65535;
break;
case 1713585602:
if (str.equals("getNetworkData")) {
c10 = 30;
break;
}
c10 = 65535;
break;
case 1731806400:
if (str.equals("playable_style")) {
c10 = 31;
break;
}
c10 = 65535;
break;
case 1979895452:
if (str.equals("sendLog")) {
c10 = ' ';
break;
}
c10 = 65535;
break;
case 2086000188:
if (str.equals("skipVideo")) {
c10 = '!';
break;
}
c10 = 65535;
break;
case 2105008900:
if (str.equals("landscape_click")) {
c10 = '\"';
break;
}
c10 = 65535;
break;
default:
c10 = 65535;
break;
}
switch (c10) {
case 0:
y();
com.bytedance.sdk.openadsdk.b.c.b(this.f16618q, this.J, 0, (JSONObject) null);
Context context2 = this.P;
if (context2 == null) {
com.bytedance.sdk.openadsdk.b.c.b(this.f16618q, this.J, -1, (JSONObject) null);
break;
} else {
this.f16610i.a(context2, bVar.f16646d, this.f16613l, this.f16614m, this.f16617p);
break;
}
case 1:
e(jSONObject3);
break;
case 2:
s();
break;
case 3:
j(bVar.f16646d);
break;
case 4:
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "METHOD_OPEN_OPEN_AD_LANDPAGE_LINKS");
JSONObject jSONObject4 = bVar.f16646d;
if (a(jSONObject4, jSONObject3)) {
b(jSONObject4);
break;
}
break;
case 5:
g(bVar.f16646d);
break;
case 6:
c(bVar.f16646d);
break;
case 7:
a(jSONObject3, bVar.f16647e);
break;
case '\b':
com.bytedance.sdk.openadsdk.i.a aVar = this.f16623v;
if (aVar != null) {
int b10 = aVar.b();
int a10 = this.f16623v.a();
jSONObject3.put("width", b10);
jSONObject3.put("height", a10);
break;
}
break;
case '\t':
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "openPrivacy");
v();
break;
case '\n':
p(jSONObject3);
break;
case 11:
o(bVar.f16646d);
break;
case '\f':
jSONObject = this.f16626y;
break;
case '\r':
this.K = true;
com.bytedance.sdk.openadsdk.b.c.b(this.f16618q, this.J, 1, (JSONObject) null);
com.bytedance.sdk.openadsdk.core.b.d dVar = this.f16627z;
if (dVar == null) {
com.bytedance.sdk.openadsdk.g.c cVar = this.f16610i;
if (cVar != null && (context = this.P) != null) {
cVar.a(context, bVar.f16646d, this.J);
break;
} else {
com.bytedance.sdk.openadsdk.b.c.b(this.f16618q, this.J, -2, (JSONObject) null);
break;
}
} else {
dVar.b(this.C);
break;
}
break;
case 14:
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "METHOD_CLOSE");
f();
break;
case 15:
com.bytedance.sdk.openadsdk.g.c cVar2 = this.f16610i;
if (cVar2 != null) {
cVar2.a(bVar.f16646d);
break;
}
break;
case 16:
jSONObject = p();
break;
case 17:
jSONObject3.put("viewStatus", this.G ? 1 : 0);
break;
case 18:
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "METHOD_GET_NATIVE_SITE_CUSTOM_DATA");
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
if (qVar != null && !TextUtils.isEmpty(qVar.F())) {
jSONObject3.put("data", this.f16618q.F());
break;
}
break;
case 19:
this.f16605c = true;
com.bytedance.sdk.openadsdk.i.e eVar = this.f16624w;
if (eVar != null) {
eVar.a();
break;
}
break;
case 20:
n(bVar.f16646d);
break;
case 21:
JSONObject jSONObject5 = this.f16621t;
if (jSONObject5 != null) {
jSONObject5.put("setting", w());
com.bytedance.sdk.openadsdk.core.model.q qVar2 = this.f16618q;
if (qVar2 != null) {
this.f16621t.put(ShareConstants.MEDIA_EXTENSION, qVar2.az());
}
}
jSONObject3 = this.f16621t;
break;
case 22:
com.bytedance.sdk.openadsdk.g.c cVar3 = this.f16610i;
if (cVar3 != null) {
cVar3.b(bVar.f16646d);
break;
}
break;
case 23:
k(jSONObject3);
break;
case 24:
AudioManager audioManager = (AudioManager) o.a().getSystemService(MimeTypes.BASE_TYPE_AUDIO);
if (audioManager != null) {
i11 = audioManager.getStreamVolume(3);
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "Music volume >>>> AudioManager-->currentVolume=" + i11);
}
jSONObject3.put("endcard_mute", i11 <= 0);
break;
case 25:
t();
break;
case 26:
i(bVar.f16646d);
break;
case 27:
l(bVar.f16646d);
break;
case 28:
com.bytedance.sdk.openadsdk.i.d dVar2 = this.f16625x;
if (dVar2 != null) {
dVar2.a();
break;
}
break;
case 29:
h(bVar.f16646d);
break;
case 30:
a(bVar, jSONObject3);
break;
case 31:
f(jSONObject3);
break;
case ' ':
JSONObject jSONObject6 = bVar.f16646d;
if (jSONObject6 != null && (jSONObject2 = jSONObject6.getJSONObject("extJson")) != null && jSONObject2.has("category") && jSONObject2.has("tag") && jSONObject2.has(Constants.ScionAnalytics.PARAM_LABEL)) {
String string = jSONObject2.getString("category");
String string2 = jSONObject2.getString("tag");
String string3 = jSONObject2.getString(Constants.ScionAnalytics.PARAM_LABEL);
long j10 = jSONObject6.getLong("value");
long j11 = jSONObject6.getLong("extValue");
try {
jSONObject2.putOpt("ua_policy", Integer.valueOf(this.f16616o));
} catch (Exception unused) {
}
if ("click".equals(string3)) {
jSONObject2 = r(jSONObject2);
}
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, string, j(string2), string3, j10, j11, jSONObject2);
break;
}
break;
case '!':
u();
break;
case '\"':
Context context3 = this.P;
if (context3 instanceof com.bytedance.sdk.openadsdk.core.video.c.b) {
((com.bytedance.sdk.openadsdk.core.video.c.b) context3).s();
break;
}
break;
}
if (i10 == 1 && !TextUtils.isEmpty(bVar.f16644b)) {
b(bVar.f16644b, jSONObject3);
if (h.b().q()) {
StringBuilder sb3 = new StringBuilder();
sb3.append("[JSB-RSP] version:");
sb3.append(i10);
sb3.append(" data=");
sb3.append(jSONObject3);
}
}
return jSONObject3;
}
return null;
}
@Override
public void a(Message message) {
if (message != null && message.what == 11) {
Object obj = message.obj;
if (obj instanceof b) {
try {
a((b) obj, 1);
} catch (Exception unused) {
}
}
}
}
public void a(a aVar) {
this.Q = aVar;
}
@Override
public void a(String str) {
}
@Override
public void a(String str, JSONObject jSONObject) {
c(str, jSONObject);
}
@JProtect
public void a(JSONObject jSONObject, com.bytedance.sdk.openadsdk.i.c cVar) {
}
public boolean a(Uri uri) {
if (uri == null) {
return false;
}
if ("bytedance".equals(uri.getScheme())) {
return f16602h.containsKey(uri.getHost());
}
return false;
}
@Override
@JavascriptInterface
public String adInfo() {
JSONObject jSONObject = new JSONObject();
try {
e(jSONObject);
} catch (Exception unused) {
}
return jSONObject.toString();
}
@Override
@JavascriptInterface
public String appInfo() {
JSONObject jSONObject = new JSONObject();
try {
a(jSONObject, 0);
} catch (Exception unused) {
}
return jSONObject.toString();
}
public x b(int i10) {
this.f16614m = i10;
return this;
}
public x b(SSWebView sSWebView) {
this.f16606d = new WeakReference<>(sSWebView);
return this;
}
public x b(boolean z7) {
this.G = z7;
return this;
}
public void b() {
com.bytedance.sdk.component.a.r rVar = this.I;
if (rVar == null) {
return;
}
rVar.a();
this.I = null;
}
public void b(final Uri uri) {
try {
String host = uri.getHost();
if (!"log_event".equals(host) && !"custom_event".equals(host) && !"log_event_v3".equals(host)) {
if (!"private".equals(host) && !"dispatch_message".equals(host)) {
com.bytedance.sdk.component.utils.l.d("TTAD.AndroidObject", "handlrUir: not match schema host");
}
k(uri.toString());
}
com.bytedance.sdk.openadsdk.b.c.a(new com.bytedance.sdk.component.g.h("log_event_handleUri") {
@Override
public void run() {
long j10;
String str;
JSONObject jSONObject;
String queryParameter = uri.getQueryParameter("category");
String queryParameter2 = uri.getQueryParameter("tag");
x.this.J = queryParameter2;
String queryParameter3 = uri.getQueryParameter(Constants.ScionAnalytics.PARAM_LABEL);
if (x.this.i(queryParameter3)) {
long j11 = 0;
try {
j10 = Long.parseLong(uri.getQueryParameter("value"));
} catch (Exception unused) {
j10 = 0;
}
try {
j11 = Long.parseLong(uri.getQueryParameter("ext_value"));
} catch (Exception unused2) {
}
long j12 = j11;
JSONObject jSONObject2 = null;
String queryParameter4 = uri.getQueryParameter("extra");
if (!TextUtils.isEmpty(queryParameter4)) {
try {
JSONObject jSONObject3 = new JSONObject(queryParameter4);
try {
jSONObject3.putOpt("ua_policy", Integer.valueOf(x.this.f16616o));
} catch (Exception unused3) {
}
jSONObject2 = jSONObject3;
} catch (Exception unused4) {
}
}
if ("click".equals(queryParameter3)) {
jSONObject2 = x.this.r(jSONObject2);
}
if ("landing_perf_error".equals(queryParameter3) || "landing_perf_stats".equals(queryParameter3)) {
try {
JSONObject jSONObject4 = new JSONObject();
for (String str2 : uri.getQueryParameterNames()) {
try {
if ("extra".equals(str2)) {
jSONObject4.put("ad_extra_data", new JSONObject(uri.getQueryParameter(str2)).optString("ad_extra_data"));
} else {
jSONObject4.put(str2, uri.getQueryParameter(str2));
}
} catch (Exception unused5) {
}
}
str = x.this.f16608f;
jSONObject = jSONObject4;
} catch (Exception unused6) {
return;
}
} else {
str = x.this.j(queryParameter2);
jSONObject = jSONObject2;
}
com.bytedance.sdk.openadsdk.b.c.a(x.this.f16618q, queryParameter, str, queryParameter3, j10, j12, jSONObject);
}
}
});
} catch (Exception e10) {
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "handleUri exception: ", e10);
}
}
@Override
public void b(String str) {
}
public void b(JSONObject jSONObject) {
int optInt = jSONObject.optInt("landingStyle");
String optString = jSONObject.optString("url");
String optString2 = jSONObject.optString("fallback_url");
try {
jSONObject.put("is_activity", this.P instanceof Activity);
} catch (JSONException unused) {
}
boolean z7 = true;
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, 1, jSONObject);
if (TextUtils.isEmpty(optString)) {
return;
}
if (optInt == 0) {
WebView o10 = o();
if (o10 != null) {
o10.loadUrl(optString);
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, 2, (JSONObject) null);
} else {
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, -1, (JSONObject) null);
}
} else if (optInt == 1 || optInt == 8) {
com.bytedance.sdk.openadsdk.j.a.a aVar = new com.bytedance.sdk.openadsdk.j.a.a();
aVar.a(b.a.f13809b);
aVar.a(this.f16618q);
aVar.b(this.J);
aVar.a(-1);
aVar.a(false);
aVar.b(this.f16618q.M());
com.bytedance.sdk.openadsdk.b.c.a(aVar);
com.bytedance.sdk.openadsdk.utils.p.a(r(), optString, this.f16618q, b.a.f13809b);
} else if (optInt == 2) {
Context r10 = r();
if (!com.bytedance.sdk.openadsdk.utils.p.b(r10, optString, this.f16618q, this.J)) {
com.bytedance.sdk.openadsdk.j.a.a aVar2 = new com.bytedance.sdk.openadsdk.j.a.a();
aVar2.a(b.a.f13809b);
aVar2.a(this.f16618q);
aVar2.b(this.J);
aVar2.a(-1);
aVar2.a(false);
aVar2.b(this.f16618q.M());
com.bytedance.sdk.openadsdk.b.c.a(aVar2);
HashMap hashMap = new HashMap();
hashMap.put("deeplink_url", optString);
hashMap.put("fallback_url", optString2);
hashMap.put("jsb_deeplink", 1);
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, "open_fallback_url", hashMap);
com.bytedance.sdk.openadsdk.utils.p.a(r10, optString2, this.f16618q, b.a.f13809b);
}
} else if (optInt != 3) {
z7 = false;
} else if (z.b(r(), optString, this.f16618q, this.f16614m, this.J, false)) {
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, 3, (JSONObject) null);
} else {
com.bytedance.sdk.openadsdk.b.c.a(this.f16618q, this.J, -2, (JSONObject) null);
}
com.bytedance.sdk.openadsdk.core.widget.b bVar = this.f16609g;
if (bVar == null || !z7) {
return;
}
bVar.a();
}
public com.bytedance.sdk.openadsdk.core.model.q c() {
return this.f16618q;
}
public x c(String str) {
this.f16608f = str;
return this;
}
public void c(int i10) {
com.bytedance.sdk.openadsdk.core.nativeexpress.l lVar = this.f16620s;
if (lVar != null) {
lVar.b(i10);
}
}
public void c(JSONObject jSONObject) {
String str;
double d10;
double d11;
double d12;
double d13;
double d14;
double d15;
double d16;
double d17;
double d18;
JSONObject jSONObject2;
if (jSONObject == null) {
return;
}
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "TTAndroidObject handleClickEvent");
try {
String optString = jSONObject.optString(Creative.AD_ID);
int optInt = jSONObject.optInt("areaType", 1);
String optString2 = jSONObject.optString("clickAreaType");
JSONObject optJSONObject = jSONObject.optJSONObject("clickInfo");
double d19 = FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE;
if (optJSONObject != null) {
double optDouble = optJSONObject.optDouble("down_x", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
d12 = optJSONObject.optDouble("down_y", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble2 = optJSONObject.optDouble("up_x", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble3 = optJSONObject.optDouble("up_y", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble4 = optJSONObject.optDouble("down_time", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble5 = optJSONObject.optDouble("up_time", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble6 = optJSONObject.optDouble("button_x", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble7 = optJSONObject.optDouble("button_y", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble8 = optJSONObject.optDouble("button_width", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
double optDouble9 = optJSONObject.optDouble("button_height", FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE);
jSONObject2 = optJSONObject.optJSONObject("rectInfo");
d18 = optDouble9;
d19 = optDouble;
d11 = optDouble2;
d13 = optDouble4;
d14 = optDouble5;
d15 = optDouble6;
d16 = optDouble7;
d17 = optDouble8;
str = optString;
d10 = optDouble3;
} else {
str = optString;
d10 = 0.0d;
d11 = 0.0d;
d12 = 0.0d;
d13 = 0.0d;
d14 = 0.0d;
d15 = 0.0d;
d16 = 0.0d;
d17 = 0.0d;
d18 = 0.0d;
jSONObject2 = null;
}
com.bytedance.sdk.openadsdk.core.model.m a10 = new m.a().d((float) d19).c((float) d12).b((float) d11).a((float) d10).b((long) d13).a((long) d14).c((int) d15).d((int) d16).e((int) d17).f((int) d18).a(optString2).a((SparseArray<c.a>) null).a(true).b(optInt).a(jSONObject2).a(jSONObject.optInt("clickAreaCategory", -1)).a();
com.bytedance.sdk.component.adexpress.b.k kVar = this.f16619r;
if (kVar != null) {
kVar.a(null, optInt, a10);
}
a(str, optInt, a10);
} catch (Exception unused) {
com.bytedance.sdk.component.adexpress.b.k kVar2 = this.f16619r;
if (kVar2 != null) {
kVar2.a(null, -1, null);
}
}
}
public void c(boolean z7) {
this.f16605c = z7;
}
@Override
@JavascriptInterface
public void changeVideoState(String str) {
try {
final JSONObject jSONObject = new JSONObject(str);
com.bytedance.sdk.openadsdk.utils.aa.a(new Runnable() {
@Override
public void run() {
x.this.j(jSONObject);
}
});
} catch (Exception unused) {
}
}
@Override
@JavascriptInterface
public void chooseAdResult(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt("video_choose");
long optLong = jSONObject.optLong("video_choose_duration");
com.bytedance.sdk.openadsdk.i.f fVar = this.M;
if (fVar != null) {
fVar.a(optInt, optLong);
}
} catch (Exception unused) {
}
}
@Override
@JavascriptInterface
public void clickEvent(String str) {
try {
final JSONObject jSONObject = new JSONObject(str);
com.bytedance.sdk.openadsdk.utils.aa.a(new Runnable() {
@Override
public void run() {
x.this.c(jSONObject);
}
});
} catch (Exception unused) {
}
}
public x d(String str) {
this.f16611j = str;
return this;
}
public void d(JSONObject jSONObject) {
com.bytedance.sdk.openadsdk.core.model.q a10 = com.bytedance.sdk.openadsdk.core.b.a(jSONObject);
if (a10 != null) {
com.bytedance.sdk.openadsdk.core.b.a aVar = new com.bytedance.sdk.openadsdk.core.b.a(o.a(), a10, this.J, this.f16614m);
aVar.a(com.com.bytedance.overseas.sdk.a.d.a(o.a(), a10, this.J));
aVar.onClick(null);
}
}
public void d(boolean z7) {
this.N = z7;
}
public boolean d() {
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
return qVar != null && qVar.v();
}
@Override
@JavascriptInterface
public void dynamicTrack(String str) {
try {
n(new JSONObject(str));
} catch (Exception unused) {
}
}
public x e(String str) {
this.f16613l = str;
return this;
}
public void e(boolean z7) {
this.O = z7;
}
public boolean e() {
return this.f16605c;
}
public x f(String str) {
this.f16615n = str;
return this;
}
public void f() {
com.bytedance.sdk.openadsdk.i.b bVar;
if (this.O && (bVar = this.A) != null) {
bVar.a();
return;
}
Context context = this.P;
if ((context instanceof Activity) && com.bytedance.sdk.openadsdk.utils.p.a((Activity) context)) {
((Activity) this.P).finish();
}
}
public void g() {
com.bytedance.sdk.openadsdk.core.nativeexpress.l lVar = this.f16620s;
if (lVar != null) {
lVar.b();
}
}
public void g(String str) {
this.J = str;
}
@Override
@JavascriptInterface
public String getCurrentVideoState() {
JSONObject jSONObject = new JSONObject();
k(jSONObject);
return jSONObject.toString();
}
@Override
@JavascriptInterface
public String getTemplateInfo() {
a("getTemplateInfo", true);
try {
JSONObject jSONObject = this.f16621t;
if (jSONObject != null) {
jSONObject.put("setting", w());
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
if (qVar != null) {
this.f16621t.put(ShareConstants.MEDIA_EXTENSION, qVar.az());
}
}
a("getTemplateInfo", false);
return this.f16621t.toString();
} catch (Exception unused) {
return "";
}
}
@JProtect
public void h() {
a((JSONObject) null, new com.bytedance.sdk.openadsdk.i.c() {
});
}
public boolean i() {
return this.K;
}
@Override
@JavascriptInterface
public void initRenderFinish() {
com.bytedance.sdk.component.utils.l.b("TTAD.AndroidObject", "initRenderFinish");
com.bytedance.sdk.openadsdk.utils.aa.a(new Runnable() {
@Override
public void run() {
if (x.this.L != null) {
x.this.L.a();
}
}
});
}
public boolean j() {
com.bytedance.sdk.openadsdk.core.model.q qVar = this.f16618q;
return qVar != null && qVar.J() == 1;
}
public void k() {
com.bytedance.sdk.openadsdk.g.c cVar = this.f16610i;
if (cVar != null) {
cVar.a();
}
if (x()) {
h();
}
}
public void l() {
com.bytedance.sdk.openadsdk.g.c cVar = this.f16610i;
if (cVar != null) {
cVar.b();
}
}
public void m() {
com.bytedance.sdk.openadsdk.g.c cVar = this.f16610i;
if (cVar != null) {
cVar.c();
}
this.P = null;
}
@Override
@JavascriptInterface
public void muteVideo(String str) {
try {
final JSONObject jSONObject = new JSONObject(str);
com.bytedance.sdk.openadsdk.utils.aa.a(new Runnable() {
@Override
public void run() {
x.this.i(jSONObject);
}
});
} catch (Exception unused) {
com.bytedance.sdk.component.utils.l.e("TTAD.AndroidObject", "");
}
}
public void n() {
a aVar = this.Q;
if (aVar != null) {
aVar.a();
}
}
@Override
@JavascriptInterface
public void renderDidFinish(String str) {
try {
l(new JSONObject(str));
} catch (Exception unused) {
}
}
@Override
@JavascriptInterface
public void skipVideo() {
com.bytedance.sdk.openadsdk.utils.aa.a(new Runnable() {
@Override
public void run() {
x.this.u();
}
});
}
}