- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
242 lines
11 KiB
Java
242 lines
11 KiB
Java
package com.mbridge.msdk.mbbanner.common.communication;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Context;
|
|
import android.content.DialogInterface;
|
|
import android.content.Intent;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.graphics.drawable.ColorDrawable;
|
|
import android.net.Uri;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.WindowManager;
|
|
import android.webkit.ValueCallback;
|
|
import android.webkit.WebView;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import com.google.android.gms.ads.AdError;
|
|
import com.ironsource.nb;
|
|
import com.mbridge.msdk.foundation.controller.c;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.ab;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.ak;
|
|
import com.mbridge.msdk.mbsignalcommon.mraid.b;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
|
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
|
|
import com.mbridge.msdk.widget.MBAdChoice;
|
|
import com.vungle.ads.internal.presenter.MRAIDPresenter;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class BannerExpandDialog extends Dialog {
|
|
private final String a;
|
|
private String b;
|
|
private boolean c;
|
|
private FrameLayout d;
|
|
private WindVaneWebView e;
|
|
private TextView f;
|
|
private String g;
|
|
private List<CampaignEx> h;
|
|
private com.mbridge.msdk.mbbanner.common.b.a i;
|
|
private b j;
|
|
|
|
public void setCampaignList(String str, List<CampaignEx> list) {
|
|
this.g = str;
|
|
this.h = list;
|
|
}
|
|
|
|
public BannerExpandDialog(Context context, Bundle bundle, com.mbridge.msdk.mbbanner.common.b.a aVar) {
|
|
super(context);
|
|
this.a = "BannerExpandDialog";
|
|
this.j = new b() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.5
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final void expand(String str, boolean z) {
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final CampaignEx getMraidCampaign() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final void open(String str) {
|
|
try {
|
|
if (BannerExpandDialog.this.e == null || System.currentTimeMillis() - BannerExpandDialog.this.e.lastTouchTime <= com.mbridge.msdk.click.b.a.c || !com.mbridge.msdk.click.b.a.a((CampaignEx) BannerExpandDialog.this.h.get(0), BannerExpandDialog.this.e.getUrl(), com.mbridge.msdk.click.b.a.a)) {
|
|
af.b("BannerExpandDialog", str);
|
|
if (BannerExpandDialog.this.h.size() > 1) {
|
|
c.m().c().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
|
|
str = null;
|
|
}
|
|
if (BannerExpandDialog.this.i != null) {
|
|
BannerExpandDialog.this.i.a(true, str);
|
|
}
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b("BannerExpandDialog", MRAIDPresenter.OPEN, th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final void close() {
|
|
BannerExpandDialog.this.dismiss();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final void unload() {
|
|
close();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.mraid.b
|
|
public final void useCustomClose(boolean z) {
|
|
try {
|
|
BannerExpandDialog.this.f.setVisibility(z ? 4 : 0);
|
|
} catch (Throwable th) {
|
|
af.b("BannerExpandDialog", "useCustomClose", th);
|
|
}
|
|
}
|
|
};
|
|
if (bundle != null) {
|
|
this.b = bundle.getString("url");
|
|
this.c = bundle.getBoolean("shouldUseCustomClose");
|
|
}
|
|
this.i = aVar;
|
|
}
|
|
|
|
@Override // android.app.Dialog
|
|
public void onCreate(Bundle bundle) {
|
|
CampaignEx campaignEx;
|
|
super.onCreate(bundle);
|
|
requestWindowFeature(1);
|
|
setCanceledOnTouchOutside(false);
|
|
setCancelable(true);
|
|
FrameLayout frameLayout = new FrameLayout(getContext());
|
|
this.d = frameLayout;
|
|
frameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
|
|
WindVaneWebView windVaneWebView = new WindVaneWebView(getContext().getApplicationContext());
|
|
this.e = windVaneWebView;
|
|
windVaneWebView.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
|
|
this.d.addView(this.e);
|
|
TextView textView = new TextView(getContext());
|
|
this.f = textView;
|
|
textView.setBackgroundColor(0);
|
|
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(96, 96);
|
|
layoutParams.gravity = 8388661;
|
|
layoutParams.setMargins(30, 30, 30, 30);
|
|
this.f.setLayoutParams(layoutParams);
|
|
this.f.setVisibility(this.c ? 4 : 0);
|
|
this.f.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.1
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
BannerExpandDialog.this.dismiss();
|
|
}
|
|
});
|
|
BitmapDrawable a = c.m().a(this.g, 296);
|
|
if (a != null) {
|
|
ImageView imageView = new ImageView(c.m().c());
|
|
ak.a(imageView, a, this.d.getResources().getDisplayMetrics());
|
|
this.d.addView(imageView, new ViewGroup.LayoutParams(-1, -1));
|
|
}
|
|
this.d.addView(this.f);
|
|
setContentView(this.d);
|
|
a();
|
|
this.e.setWebViewListener(new com.mbridge.msdk.mbsignalcommon.b.b() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.2
|
|
@Override // com.mbridge.msdk.mbsignalcommon.b.b, com.mbridge.msdk.mbsignalcommon.windvane.d
|
|
public final void a(WebView webView, String str) {
|
|
super.a(webView, str);
|
|
webView.evaluateJavascript("javascript:" + com.mbridge.msdk.c.b.a.a().b(), new ValueCallback<String>() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.2.1
|
|
@Override // android.webkit.ValueCallback
|
|
public final /* bridge */ /* synthetic */ void onReceiveValue(String str2) {
|
|
}
|
|
});
|
|
BannerExpandDialog.a(BannerExpandDialog.this);
|
|
}
|
|
});
|
|
this.e.setObject(this.j);
|
|
this.e.loadUrl(this.b);
|
|
List<CampaignEx> list = this.h;
|
|
if (list != null && list.size() > 0 && (campaignEx = this.h.get(0)) != null && campaignEx.getPrivacyButtonTemplateVisibility() != 0) {
|
|
MBAdChoice mBAdChoice = new MBAdChoice(c.m().c());
|
|
mBAdChoice.setCampaign(campaignEx);
|
|
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(ak.a(c.m().c(), 12.0f), ak.a(c.m().c(), 12.0f));
|
|
layoutParams2.gravity = 85;
|
|
layoutParams2.bottomMargin = layoutParams.topMargin;
|
|
layoutParams2.rightMargin = layoutParams.rightMargin;
|
|
mBAdChoice.setFeedbackDialogEventListener(new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.3
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public final void showed() {
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public final void close() {
|
|
BannerExpandDialog.this.a();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.d.a
|
|
public final void summit(String str) {
|
|
BannerExpandDialog.this.a();
|
|
}
|
|
});
|
|
this.d.addView(mBAdChoice, layoutParams2);
|
|
}
|
|
setOnDismissListener(new DialogInterface.OnDismissListener() { // from class: com.mbridge.msdk.mbbanner.common.communication.BannerExpandDialog.4
|
|
@Override // android.content.DialogInterface.OnDismissListener
|
|
public final void onDismiss(DialogInterface dialogInterface) {
|
|
if (BannerExpandDialog.this.i != null) {
|
|
BannerExpandDialog.this.i.a(false);
|
|
}
|
|
BannerExpandDialog.this.e.loadDataWithBaseURL(null, "", "text/html", nb.N, null);
|
|
BannerExpandDialog.this.d.removeView(BannerExpandDialog.this.e);
|
|
BannerExpandDialog.this.e.release();
|
|
BannerExpandDialog.this.e = null;
|
|
BannerExpandDialog.this.i = null;
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a() {
|
|
if (getWindow() != null) {
|
|
getWindow().setBackgroundDrawable(new ColorDrawable(0));
|
|
getWindow().getDecorView().setPadding(0, 0, 0, 0);
|
|
WindowManager.LayoutParams attributes = getWindow().getAttributes();
|
|
attributes.width = -1;
|
|
attributes.height = -1;
|
|
getWindow().setAttributes(attributes);
|
|
getWindow().getDecorView().setSystemUiVisibility(4615);
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void a(BannerExpandDialog bannerExpandDialog) {
|
|
try {
|
|
int i = c.m().c().getResources().getConfiguration().orientation;
|
|
JSONObject jSONObject = new JSONObject();
|
|
jSONObject.put("orientation", i == 2 ? "landscape" : i == 1 ? "portrait" : AdError.UNDEFINED_DOMAIN);
|
|
jSONObject.put("locked", "true");
|
|
float j = ab.j(c.m().c());
|
|
float h = ab.h(c.m().c());
|
|
HashMap i2 = ab.i(c.m().c());
|
|
int intValue = ((Integer) i2.get("width")).intValue();
|
|
int intValue2 = ((Integer) i2.get("height")).intValue();
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(MRAIDCommunicatorUtil.KEY_PLACEMENTTYPE, "Interstitial");
|
|
hashMap.put("state", MRAIDCommunicatorUtil.STATES_EXPANDED);
|
|
hashMap.put(MRAIDCommunicatorUtil.KEY_VIEWABLE, "true");
|
|
hashMap.put(MRAIDCommunicatorUtil.KEY_CURRENTORIENTATION, jSONObject);
|
|
bannerExpandDialog.e.getLocationInWindow(new int[2]);
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e, r1[0], r1[1], r11.getWidth(), bannerExpandDialog.e.getHeight());
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(bannerExpandDialog.e, r1[0], r1[1], r5.getWidth(), bannerExpandDialog.e.getHeight());
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().b(bannerExpandDialog.e, j, h);
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().c(bannerExpandDialog.e, intValue, intValue2);
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e, hashMap);
|
|
com.mbridge.msdk.mbsignalcommon.mraid.a.a().a(bannerExpandDialog.e);
|
|
} catch (Throwable th) {
|
|
af.b("BannerExpandDialog", "notifyMraid", th);
|
|
}
|
|
}
|
|
}
|