package com.fyber.inneractive.sdk.activities; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.text.TextUtils; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.FrameLayout; import com.fyber.inneractive.sdk.R; import com.fyber.inneractive.sdk.util.IAlog; import com.fyber.inneractive.sdk.util.d0; import com.fyber.inneractive.sdk.util.t; import com.google.android.gms.drive.DriveFile; import com.ironsource.v8; import java.util.HashMap; import java.util.Map; /* loaded from: classes2.dex */ public class FyberReportAdActivity extends Activity { public static com.fyber.inneractive.sdk.flow.f e; public WebView a; public String b; public String c; public String d; public static Intent createIntent(Context context, String str, String str2, Long l) { Intent intent = new Intent(context, (Class) FyberReportAdActivity.class); if (!(context instanceof Activity)) { intent.addFlags(DriveFile.MODE_READ_ONLY); } Bundle bundle = new Bundle(); bundle.putString("advertiser_domain", str); bundle.putString("dsp_name", str2); bundle.putString("dsp_id", l != null ? Long.toString(l.longValue()) : null); intent.putExtras(bundle); return intent; } public static void disableWebviewZoomControls(WebView webView) { webView.getSettings().setSupportZoom(true); webView.getSettings().setBuiltInZoomControls(true); new d0(webView).run(); } public static com.fyber.inneractive.sdk.flow.f getAdReporter() { return e; } public final FrameLayout a() { WebView webView; FrameLayout frameLayout = new FrameLayout(this); try { webView = new WebView(this); webView.setWebViewClient(new a(this)); webView.setId(R.id.ia_inneractive_webview_report_ad); WebSettings settings = webView.getSettings(); boolean z = true; settings.setJavaScriptEnabled(true); settings.setSupportZoom(true); settings.setBuiltInZoomControls(true); settings.setUseWideViewPort(true); settings.setLoadWithOverviewMode(true); disableWebviewZoomControls(webView); HashMap hashMap = new HashMap(); if (!TextUtils.isEmpty(this.b)) { hashMap.put("advertiser_domain", this.b); } if (!TextUtils.isEmpty(this.c)) { hashMap.put("dsp_name", this.c); } if (!TextUtils.isEmpty(this.d)) { hashMap.put("dsp_id", this.d); } StringBuilder sb = new StringBuilder("https://cdn2.inner-active.mobi/client/fyber-i-icon/index.html"); for (Map.Entry entry : hashMap.entrySet()) { sb.append(z ? "?" : v8.i.c); sb.append((String) entry.getKey()); sb.append(v8.i.b); sb.append(Uri.encode((String) entry.getValue())); z = false; } webView.loadUrl(sb.toString()); } catch (Exception unused) { IAlog.b("failed creating webivew for report ad", new Object[0]); finish(); webView = null; } this.a = webView; frameLayout.addView(webView, -1, -1); return frameLayout; } public String getAdDomain() { return this.b; } public String getAdNetwork() { return this.c; } public String getAdNetworkId() { return this.d; } @Override // android.app.Activity public void onCreate(Bundle bundle) { getWindow().requestFeature(2); getWindow().setFeatureInt(2, -1); super.onCreate(bundle); try { Bundle extras = getIntent().getExtras(); if (extras != null) { this.b = extras.getString("advertiser_domain"); this.c = extras.getString("dsp_name"); this.d = extras.getString("dsp_id"); } setContentView(a()); } catch (Exception e2) { IAlog.a("failed creating fyber report ad activity", e2, new Object[0]); finish(); } } @Override // android.app.Activity, android.view.Window.Callback public void onDetachedFromWindow() { super.onDetachedFromWindow(); setVisible(false); } @Override // android.app.Activity public void onDestroy() { WebView webView = this.a; if (webView != null) { t.a(webView); this.a.destroy(); this.a = null; } e = null; super.onDestroy(); } public static void start(Context context, com.fyber.inneractive.sdk.flow.f fVar, String str, String str2, Long l) { e = fVar; try { context.startActivity(createIntent(context, str, str2, l)); } catch (Exception e2) { IAlog.a("failed starting fyber report ad activity", e2, new Object[0]); } } }