Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484
以下内容为反编译后的 d.java 源代码,内容仅作参考
package com.amazon.aps.ads.util.adview;
import al.e1;
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import com.amazon.aps.ads.util.adview.c;
import com.amazon.device.ads.DTBAdBannerListener;
import com.amazon.device.ads.DTBAdMRAIDBannerController;
import com.amazon.device.ads.DTBAdMRAIDController;
import com.amazon.device.ads.DTBAdView;
import com.amazon.device.ads.DTBExpectedSizeProvider;
import com.amazon.device.ads.DTBMetricsConfiguration;
import com.amazon.device.ads.DtbCommonUtils;
import com.amazon.device.ads.DtbOmSdkSessionManager;
import com.amazon.device.ads.WebResourceOptions;
import com.amazon.device.ads.WebResourceService;
import i.q;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import l8.b;
import ll.t;
import ll.x;
import o8.m;
import ti.l;
public class d extends b implements k, g {
private final Context adViewContext;
private final boolean localOnly;
protected f webBridge;
private j webClient;
public d(Context context) {
super(context);
l.f(context, xa.c.CONTEXT);
this.localOnly = WebResourceOptions.isLocalSourcesOnly();
this.adViewContext = context;
}
public static final void m8evaluateApsJavascript$lambda11$lambda10(d dVar, String str, ValueCallback valueCallback) {
l.f(dVar, "this$0");
super.evaluateJavascript(str, valueCallback);
}
private final long handleClick(MotionEvent motionEvent, long j10) {
if (j10 - this.timeClicked < 1000) {
return this.timePressed;
}
if (j10 - this.timePressed < 500) {
this.timeClicked = j10;
if (getMraidHandler() == null) {
l8.a.b(m8.b.f23766a, m8.c.f23771b, "Null controller instance onAdClick callback", null);
return 0L;
}
DTBAdMRAIDController mraidHandler = getMraidHandler();
l.c(mraidHandler);
mraidHandler.onAdClicked();
return 0L;
}
return 0L;
}
public static final boolean m9initWebView$lambda3(d dVar, View view, MotionEvent motionEvent) {
l.f(dVar, "this$0");
return dVar.detectAdClick(motionEvent);
}
public static final void m10loadUrl$lambda9$lambda8(d dVar, String str) {
l.f(dVar, "this$0");
l.f(str, "$url");
try {
super.loadUrl(str);
} catch (Exception e10) {
l8.a.b(m8.b.f23766a, m8.c.f23770a, l.k(str, "WebView crash noticed during super.loadUrl method. URL:"), e10);
}
}
@Override
public void cleanup() {
try {
super.cleanup();
removeJavascriptInterface("amzn_bridge");
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler != null) {
mraidHandler.cleanup();
}
setMraidHandler(null);
} catch (RuntimeException e10) {
l8.a.b(m8.b.f23766a, m8.c.f23770a, "Error in ApsAdView cleanup", e10);
}
}
public boolean detectAdClick(MotionEvent motionEvent) {
if (isVideo() || motionEvent == null) {
return false;
}
int action = motionEvent.getAction();
long time = new Date().getTime();
if (action != 0) {
time = action != 1 ? this.timePressed : handleClick(motionEvent, time);
}
this.timePressed = time;
return false;
}
public void evaluateApsJavascript(String str, ValueCallback<String> valueCallback) {
if (str == null) {
return;
}
new Handler(Looper.getMainLooper()).post(new v.g(this, 10, str, valueCallback));
}
public void fetchAd(Bundle bundle) {
fetchAd((String) null, bundle);
}
public void fetchAd(String str) {
fetchAd(str, (Bundle) null);
}
public final void fetchAd(String str, Bundle bundle) {
Bundle bundle2;
long currentTimeMillis = System.currentTimeMillis();
k8.b.f22030a.getClass();
if (t.i(str, null, false) || t.i(str, "", false)) {
str = bundle == null ? null : bundle.getString("bid_html_template", null);
}
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler != null) {
c.a aVar = c.f6818a;
aVar.getClass();
String string = (str != null || bundle == null) ? str : bundle.getString("bid_html_template", null);
if (bundle != null && (mraidHandler instanceof DTBAdMRAIDBannerController)) {
DTBAdBannerListener dTBAdBannerListener = ((DTBAdMRAIDBannerController) mraidHandler).bannerListener;
int i10 = bundle.getInt("expected_width", 0);
int i11 = bundle.getInt("expected_height", 0);
if (i11 > 0 && i10 > 0 && (dTBAdBannerListener instanceof DTBExpectedSizeProvider)) {
DTBExpectedSizeProvider dTBExpectedSizeProvider = (DTBExpectedSizeProvider) dTBAdBannerListener;
dTBExpectedSizeProvider.setExpectedWidth(i10);
dTBExpectedSizeProvider.setExpectedHeight(i11);
}
}
if (DTBMetricsConfiguration.getInstance().isFeatureEnabled("webviewAdInfo_feature") && bundle == null) {
bundle2 = new Bundle();
c.a.a(string, bundle2);
String format = String.format("{bidID:'%s',aaxHost:'%s',pricePoint:'%s'}", Arrays.copyOf(new Object[]{bundle2.getString("bid_identifier"), bundle2.getString("hostname_identifier"), bundle2.getString("event_server_parameter")}, 3));
l.e(format, "format(format, *args)");
bundle2.putString("amazon_ad_info", format);
} else {
bundle2 = bundle;
}
if (bundle2 != null) {
setBidId(bundle2.getString("bid_identifier"));
setHostname(bundle2.getString("hostname_identifier"));
setVideo(bundle2.getBoolean("video_flag"));
}
setStartTime(new Date().getTime());
try {
StringBuilder sb2 = new StringBuilder();
sb2.append("<!DOCTYPE html><html><head>");
sb2.append("<script>");
sb2.append(c.a.b(getAdViewContext(), bundle));
sb2.append("</script>");
Context context = getContext();
l.e(context, "webView.context");
aVar.c(context, getLocalOnly(), "aps-mraid", sb2);
Context context2 = getContext();
l.e(context2, "webView.context");
aVar.c(context2, getLocalOnly(), "dtb-m", sb2);
if (DtbOmSdkSessionManager.getFeatureEnableFlag()) {
Context context3 = getContext();
l.e(context3, "webView.context");
aVar.c(context3, getLocalOnly(), "omsdk-v1", sb2);
}
sb2.append("</head>");
sb2.append("<body style='margin:0;padding:0;'>");
sb2.append(str);
sb2.append("</body></html>");
if (DTBMetricsConfiguration.getInstance().isFeatureEnabled("additional_webview_metric")) {
if (mraidHandler instanceof DTBAdMRAIDBannerController) {
b.a aVar2 = l8.b.f23116a;
String bidId = getBidId();
aVar2.getClass();
b.a.c("bannerCreativeRenderingStart", bidId);
} else {
b.a aVar3 = l8.b.f23116a;
String bidId2 = getBidId();
aVar3.getClass();
b.a.c("interstitialCreativeRenderingStart", bidId2);
}
}
loadDataWithBaseURL("https://c.amazon-adsystem.com/", sb2.toString(), "text/html", "UTF-8", null);
} catch (RuntimeException e10) {
l8.a.b(m8.b.f23766a, m8.c.f23770a, "Fail to execute fetchAd method with bundle", e10);
}
}
b.a aVar4 = l8.b.f23116a;
String bidId3 = getBidId();
n8.b bVar = new n8.b();
bVar.d(getBidId());
m mVar = bVar.f24452a;
o8.i iVar = mVar.f25617i;
if (iVar == null) {
iVar = new o8.i(null, 1, null);
}
mVar.f25617i = iVar;
iVar.f25607b = currentTimeMillis;
aVar4.getClass();
b.a.a(bVar, bidId3);
}
public void fetchAd(String str, Map<String, ? extends Object> map) {
l.f(map, "extra");
c.f6818a.getClass();
try {
Bundle initializeEmptyBundle = DtbCommonUtils.initializeEmptyBundle();
for (Map.Entry<String, ? extends Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
if (value instanceof String) {
initializeEmptyBundle.putString(key, (String) value);
} else if (value instanceof Boolean) {
initializeEmptyBundle.putBoolean(key, ((Boolean) value).booleanValue());
} else if (value instanceof Integer) {
initializeEmptyBundle.putInt(key, ((Number) value).intValue());
} else if (value instanceof Long) {
initializeEmptyBundle.putLong(key, ((Number) value).longValue());
}
}
fetchAd(str, initializeEmptyBundle);
} catch (RuntimeException e10) {
l8.a.b(m8.b.f23766a, m8.c.f23770a, "Fail to execute fetchAd method with map bundle", e10);
}
}
public void fetchAd(Map<String, ? extends Object> map) {
if (map == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Map<kotlin.String?, kotlin.Any>");
}
fetchAd((String) null, map);
}
public final void fetchAdWithLocation(String str) {
Context context = getContext();
if (context == null) {
return;
}
c.a aVar = c.f6818a;
boolean localOnly = getLocalOnly();
aVar.getClass();
try {
StringBuilder sb2 = new StringBuilder();
sb2.append("<script>");
sb2.append(c.a.b(context, null));
sb2.append("</script>");
aVar.c(context, localOnly, "aps-mraid", sb2);
sb2.append("<script>");
sb2.append("window.location=\"");
sb2.append(str);
sb2.append("\";");
sb2.append("</script>");
loadDataWithBaseURL("https://c.amazon-adsystem.com/", sb2.toString(), "text/html", "UTF-8", null);
} catch (RuntimeException e10) {
l8.a.b(m8.b.f23766a, m8.c.f23770a, "Fail to execute fetchAdWithLocation method", e10);
}
}
public final void getAdInfo(String str, Bundle bundle) {
l.f(str, "adhtml");
l.f(bundle, "adInfoBundle");
c.f6818a.getClass();
c.a.a(str, bundle);
}
@Override
public Context getAdViewContext() {
return this.adViewContext;
}
@Override
public DTBAdMRAIDController getApsMraidHandler() {
return getMraidHandler();
}
public final boolean getLocalOnly() {
return this.localOnly;
}
public final j getWebClient() {
return this.webClient;
}
@Override
public void initWebView() {
super.initWebView();
j iVar = new i(this);
setWebViewClient(iVar);
setWebClient(iVar);
setAdViewScrollEnabled(false);
f fVar = new f(this);
this.webBridge = fVar;
addJavascriptInterface(fVar, "amzn_bridge");
WebResourceService.init();
initLayoutListeners();
setOnTouchListener(new g8.a(this, 1));
}
@Override
public boolean isTwoPartExpand() {
if (getMraidHandler() != null) {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler != null) {
return mraidHandler.isTwoPartExpand();
}
throw new NullPointerException("null cannot be cast to non-null type com.amazon.device.ads.DTBAdMRAIDController");
}
return false;
}
public final void loadLocalFile(String str, StringBuilder sb2) {
l.f(str, "filename");
l.f(sb2, "sb");
c.a aVar = c.f6818a;
Context context = getContext();
l.e(context, xa.c.CONTEXT);
aVar.c(context, this.localOnly, str, sb2);
}
@Override
public void loadUrl(String str) {
m8.b bVar = m8.b.f23766a;
l.f(str, "url");
try {
j jVar = this.webClient;
if (jVar == null) {
return;
}
if (jVar.f6829a) {
l8.a.b(bVar, m8.c.f23771b, l.k(str, "WebView is corrupted. loadUrl method will not be executed. URL:"), null);
} else {
new Handler(Looper.getMainLooper()).post(new q(26, this, str));
}
} catch (RuntimeException e10) {
l8.a.b(bVar, m8.c.f23770a, "Failed to execute loadUrl method", e10);
}
}
@Override
public void onAdLeftApplication() {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onAdLeftApplication();
}
@Override
public void onAdOpened() {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onAdOpened();
}
public final void onAdRemoved() {
if (getMraidHandler() == null) {
l8.a.b(m8.b.f23766a, m8.c.f23771b, "Null controller instance onAdRemoved", null);
return;
}
DTBAdMRAIDController mraidHandler = getMraidHandler();
l.c(mraidHandler);
mraidHandler.onAdRemoved();
}
@Override
public void onCrash(WebView webView, StringBuilder sb2, String str) {
DtbOmSdkSessionManager omSdkManager;
m8.c cVar = m8.c.f23770a;
m8.b bVar = m8.b.f23766a;
l.f(webView, "webView");
l.f(sb2, "errorInfo");
l.f(str, "errorDetail");
try {
if (webView instanceof DTBAdView) {
String userAgentString = ((DTBAdView) webView).getSettings().getUserAgentString();
if (userAgentString != null) {
String format = String.format("webViewUserAgentInfo = %s;", Arrays.copyOf(new Object[]{userAgentString}, 1));
l.e(format, "format(format, *args)");
sb2.append(format);
}
if (getBidId() != null) {
String format2 = String.format("webViewBidId = %s;", Arrays.copyOf(new Object[]{getBidId()}, 1));
l.e(format2, "format(format, *args)");
sb2.append(format2);
}
onAdRemoved();
if (getMraidHandler() != null && (omSdkManager = getOmSdkManager()) != null) {
omSdkManager.stopOmAdSession();
}
ViewParent parent = ((DTBAdView) webView).getParent();
if (parent != null && (parent instanceof ViewGroup)) {
((ViewGroup) parent).removeView(this);
}
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler != null) {
mraidHandler.onLoadError();
cleanup();
}
}
String substring = str.substring(0, Math.min(100, str.length()));
l.e(substring, "this as java.lang.String…ing(startIndex, endIndex)");
String format3 = String.format("webViewErrorDetail = %s", Arrays.copyOf(new Object[]{substring}, 1));
l.e(format3, "format(format, *args)");
sb2.append(format3);
l8.a.b(bVar, cVar, sb2.toString(), null);
} catch (RuntimeException e10) {
l8.a.b(bVar, cVar, sb2.toString(), e10);
}
}
@Override
public void onExposureChange(int i10, Rect rect) {
l.f(rect, "adViewRect");
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.fireExposureChange(i10, rect);
}
@Override
public void onLoadError() {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onLoadError();
}
@Override
public void onPageFinished(String str, WebView webView) {
DtbOmSdkSessionManager omSdkManager;
l.f(str, "url");
try {
e1.w(this, l.k(str, "Page finished:"));
if (webView instanceof DTBAdView) {
if (x.q(str, "MRAID_ENV", false)) {
onPageLoaded();
} else if (str.equals("https://c.amazon-adsystem.com/")) {
if ((getMraidHandler() instanceof DTBAdMRAIDBannerController) && (omSdkManager = getOmSdkManager()) != null) {
omSdkManager.stopOmAdSession();
if (isVideo()) {
omSdkManager.initJavaScriptOmAdSession(this, str);
} else {
omSdkManager.initHtmlDisplayOmAdSession(this, str);
}
omSdkManager.registerAdView(this);
omSdkManager.startAdSession();
}
onPageLoaded();
}
}
} catch (RuntimeException e10) {
l8.a.b(m8.b.f23767b, m8.c.f23770a, "Fail to execute onPageFinished method", e10);
}
}
public void onPageLoaded() {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onPageLoad();
}
@Override
public void onPositionChanged(Rect rect) {
l.f(rect, "adViewRect");
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onPositionChanged(rect);
}
@Override
public void onViewabilityChanged(boolean z10) {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.onViewabilityChanged(z10);
}
@Override
public void setCurrentPositionProperty() {
DTBAdMRAIDController mraidHandler = getMraidHandler();
if (mraidHandler == null) {
return;
}
mraidHandler.setCurrentPositionProperty();
}
public final void setIgnoreDetachment() {
this.ignoreDetachment = true;
}
public final void setWebClient(j jVar) {
if (jVar == null) {
return;
}
this.webClient = jVar;
setWebViewClient(jVar);
}
}