Cyber Surfer v5.2.5版本的 MD5 值为:db13c5fce988de393e52d2679f934b22
以下内容为反编译后的 DTBAdMRAIDController.java 源代码,内容仅作参考
package com.amazon.device.ads;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.ValueCallback;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.appcompat.content.res.AppCompatResources;
import com.amazon.device.ads.SDKUtilities;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.iab.omid.library.amazon.adsession.FriendlyObstructionPurpose;
import com.safedk.android.analytics.brandsafety.BrandSafetyUtils;
import com.safedk.android.utils.Logger;
import com.unity3d.services.ads.adunit.AdUnitActivity;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Date;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public abstract class DTBAdMRAIDController implements DTBActivityListener {
static final String LOG_TAG = "DTBAdMRAIDController";
static final String MRAID_CLOSE = "window.mraid.close();";
private static final String MRAID_READY = "window.mraidBridge.event.ready();";
DTBAdView adView;
LinearLayout closeIndicatorRegion;
DTBMRAIDCloseButtonListener customButtonListener;
private Rect lastRect;
private MraidExposure lastReportedExposure;
private Boolean lastViewabilityState;
private boolean loadReportSubmitted;
boolean pageLoaded = false;
protected boolean useCustomClose = false;
private int lastReportedSizeChangeWidth = -1;
private int lastReportedSizeChangeHeight = -1;
protected MraidStateType state = MraidStateType.LOADING;
private boolean jsReady = false;
private boolean isTwoPartExpand = false;
private DtbOmSdkSessionManager dtbOmSdkSessionManager = DtbOmSdkSessionManager.getNewInstance();
public static class AnonymousClass2 {
static final int[] $SwitchMap$com$amazon$device$ads$MraidStateType;
static {
int[] iArr = new int[MraidStateType.values().length];
$SwitchMap$com$amazon$device$ads$MraidStateType = iArr;
try {
iArr[MraidStateType.LOADING.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$amazon$device$ads$MraidStateType[MraidStateType.DEFAULT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$amazon$device$ads$MraidStateType[MraidStateType.RESIZED.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$amazon$device$ads$MraidStateType[MraidStateType.EXPANDED.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$amazon$device$ads$MraidStateType[MraidStateType.HIDDEN.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
public class MraidExposure {
int percent;
Rect rect;
MraidExposure(int i, Rect rect) {
this.percent = i;
this.rect = new Rect(rect);
}
}
static {
MraidCommand.registerCommand(MraidOpenCommand.getMraidName(), MraidOpenCommand.class);
MraidCommand.registerCommand(MraidCloseCommand.getMraidName(), MraidCloseCommand.class);
MraidCommand.registerCommand(MraidUnloadCommand.getMraidName(), MraidUnloadCommand.class);
MraidCommand.registerCommand(MraidResizeCommand.getMraidName(), MraidResizeCommand.class);
MraidCommand.registerCommand(MraidExpandCommand.getMraidName(), MraidExpandCommand.class);
MraidCommand.registerCommand(MraidUseCustomCloseCommand.getMraidName(), MraidUseCustomCloseCommand.class);
MraidCommand.registerCommand(MraidJSReadyCommand.getMraidName(), MraidJSReadyCommand.class);
MraidCommand.registerCommand(MraidFirePixelCommand.getMraidName(), MraidFirePixelCommand.class);
}
public DTBAdMRAIDController(DTBAdView dTBAdView) {
this.adView = dTBAdView;
}
private void evaluateJavascriptMethod(String str, JSONObject jSONObject) {
evaluateJavascript(String.format(str + "(%s);", jSONObject.toString()));
}
private void fireEnforcedExposureChange(int i, Rect rect) {
evaluateJavascript(String.format("window.mraidBridge.event.exposureChange(%d, { x:%d, y:%d, width:%d, height: %d}, null);", Integer.valueOf(i), Integer.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(rect.left)), Integer.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(rect.top)), Integer.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(rect.right - rect.left)), Integer.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(rect.bottom - rect.top))));
}
private void fireMaxSizeEvent() {
SDKUtilities.SimpleSize maxSize = DTBAdUtil.getMaxSize(getAdView());
evaluateJavascript(String.format("window.mraidBridge.property.setMaxSize({'width':%d, 'height':%d});", Integer.valueOf(maxSize.getWidth()), Integer.valueOf(maxSize.getHeight())));
}
private JSONObject formProperties(MraidProperty[] mraidPropertyArr) throws JSONException {
JSONObject jSONObject = new JSONObject();
for (MraidProperty mraidProperty : mraidPropertyArr) {
mraidProperty.formJSON(jSONObject);
}
return jSONObject;
}
private MraidProperty getCurrentStateProperty() {
int i = AnonymousClass2.$SwitchMap$com$amazon$device$ads$MraidStateType[this.state.ordinal()];
return i != 1 ? i != 2 ? i != 3 ? i != 4 ? i != 5 ? MraidProperty.STATE_DEFAULT_PROPERTY : MraidProperty.STATE_HIDDEN_PROPERTY : MraidProperty.STATE_EXPANDED_PROPERTY : MraidProperty.STATE_RESIZED_PROPERTY : MraidProperty.STATE_DEFAULT_PROPERTY : MraidProperty.STATE_LOADING_PROPERTY;
}
public static void safedk_Activity_startActivity_9d898b58165fa4ba0e12c3900a2b8533(Activity activity, Intent intent) {
Logger.d("SafeDK-Special|SafeDK: Call> Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V");
if (intent == null) {
return;
}
BrandSafetyUtils.detectAdClick(intent, "com.amazon.device.ads");
activity.startActivity(intent);
}
public static void safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(Context context, Intent intent) {
Logger.d("SafeDK-Special|SafeDK: Call> Landroid/content/Context;->startActivity(Landroid/content/Intent;)V");
if (intent == null) {
return;
}
BrandSafetyUtils.detectAdClick(intent, "com.amazon.device.ads");
context.startActivity(intent);
}
public void addCloseIndicator(int i, int i2) {
removeCloseIndicator();
addCloseIndicator(i, i2, false);
}
protected void addCloseIndicator(int i, int i2, View.OnTouchListener onTouchListener, boolean z) {
createContentIndicator();
DTBAdUtil.getRootView(getAdView()).addView(this.closeIndicatorRegion, DTBAdUtil.sizeToDevicePixels(50), DTBAdUtil.sizeToDevicePixels(50));
this.closeIndicatorRegion.setX(i - DTBAdUtil.sizeToDevicePixels(50));
this.closeIndicatorRegion.setY(i2);
setCloseIndicatorContent(onTouchListener);
}
public void addCloseIndicator(int i, int i2, boolean z) {
removeCloseIndicator();
addCloseIndicator(i, i2, null, z);
}
public void closeExpandedPartTwo() {
}
public void commandCompleted(String str) {
evaluateJavascript(String.format("window.mraidBridge.service.acknowledgement('%s');", str));
}
public void createContentIndicator() {
LinearLayout linearLayout = new LinearLayout(getAdView().getContext());
this.closeIndicatorRegion = linearLayout;
linearLayout.setVisibility(this.useCustomClose ? 4 : 0);
this.closeIndicatorRegion.setOrientation(1);
}
public void createLoadReport() {
String bidId = this.adView.getBidId();
String hostname = this.adView.getHostname();
if (bidId == null || this.loadReportSubmitted) {
return;
}
DTBMetricsProcessor.getInstance().submitLatencyReportBidId(DTBMetricReport.addBid(bidId, hostname), DTBMetricsProcessor.REPORT_LOAD_LATENCY, (int) (new Date().getTime() - this.adView.getStartTime()));
this.loadReportSubmitted = true;
}
protected void evaluateJavascript(final String str) {
String str2 = LOG_TAG;
DtbLog.debug(str2, "MRAID Evaluate JSScript:" + str);
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
DTBAdMRAIDController.this.m34xbe1b85ea(str);
}
});
}
public abstract void expand(Map<String, Object> map);
void fireEnforcedSizeChange(int i, int i2) {
evaluateJavascript(String.format("window.mraidBridge.event.sizeChange(%d, %d);", Integer.valueOf(i), Integer.valueOf(i2)));
}
void fireEnforcedViewableChange(boolean z) {
Object[] objArr = new Object[1];
objArr[0] = z ? "true" : "false";
evaluateJavascript(String.format("window.mraidBridge.event.viewableChange(%s);", objArr));
}
public void fireErrorEvent(String str, String str2) {
evaluateJavascript(String.format("window.mraidBridge.event.error('%s','%s');", str2, str));
}
public void fireExposureChange(int i, Rect rect) {
int i2 = rect.right;
int i3 = rect.left;
int i4 = rect.bottom;
int i5 = rect.top;
if (this.jsReady) {
fireEnforcedExposureChange(i, rect);
} else {
this.lastReportedExposure = new MraidExposure(i, rect);
}
}
void fireMRAIDReadyEvent() {
evaluateJavascript(MRAID_READY);
}
protected void fireMRAIDSupports() {
evaluateJavascriptMethod("window.mraidBridge.property.setSupports", MraidProperty.SUPPORTS_PROPERTY.getData());
}
protected void firePlacementType() throws JSONException {
JSONObject jSONObject = new JSONObject();
jSONObject.put("type", getPlacementType());
evaluateJavascriptMethod("window.mraidBridge.property.setPlacementType", jSONObject);
}
void fireScreenSizeEvent() {
SDKUtilities.SimpleSize screenSize = DTBAdUtil.getScreenSize(getAdView());
evaluateJavascript(String.format("window.mraidBridge.property.setScreenSize({'width':%d, 'height':%d});", Integer.valueOf(screenSize.getWidth()), Integer.valueOf(screenSize.getHeight())));
}
public void fireSizeChange(int i, int i2) {
if (this.lastReportedSizeChangeWidth == i && this.lastReportedSizeChangeHeight == i2) {
return;
}
this.lastReportedSizeChangeWidth = i;
this.lastReportedSizeChangeHeight = i2;
if (this.jsReady) {
fireEnforcedSizeChange(i, i2);
}
}
void fireStateChangeEvent() {
try {
JSONObject formProperties = formProperties(new MraidProperty[]{getCurrentStateProperty()});
String str = LOG_TAG;
DtbLog.debug(str, "State was changed to " + formProperties.toString() + " for controller " + this);
evaluateJavascript(String.format("window.mraidBridge.event.stateChange(%s);", formProperties.toString()));
} catch (JSONException e) {
e.printStackTrace();
}
}
public void fireViewableChange(boolean z) {
Boolean bool = this.lastViewabilityState;
if (bool == null || bool.booleanValue() != z) {
if (this.jsReady) {
fireEnforcedViewableChange(z);
}
this.lastViewabilityState = Boolean.valueOf(z);
}
}
public DTBAdView getAdView() {
return this.adView;
}
Context getContext() {
return getAdView().getContext();
}
public DtbOmSdkSessionManager getDtbOmSdkSessionManager() {
return this.dtbOmSdkSessionManager;
}
protected MraidStateType getInitialStateType() {
return MraidStateType.DEFAULT;
}
protected String getPlacementType() {
return "";
}
public void impressionFired() {
if (!getAdView().isVideo() && getDtbOmSdkSessionManager() != null) {
getDtbOmSdkSessionManager().impressionOccured();
}
commandCompleted(MraidFirePixelCommand.getMraidName());
}
public boolean isTwoPartExpand() {
return this.isTwoPartExpand;
}
public void jsReady() {
int i;
commandCompleted("jsready");
this.jsReady = true;
Boolean bool = this.lastViewabilityState;
if (bool != null) {
fireEnforcedViewableChange(bool.booleanValue());
}
MraidExposure mraidExposure = this.lastReportedExposure;
if (mraidExposure != null) {
fireEnforcedExposureChange(mraidExposure.percent, this.lastReportedExposure.rect);
}
int i2 = this.lastReportedSizeChangeWidth;
if (i2 <= 0 || (i = this.lastReportedSizeChangeHeight) <= 0) {
return;
}
fireEnforcedSizeChange(i2, i);
}
public void m34xbe1b85ea(final String str) {
if (getAdView() != null) {
getAdView().evaluateJavascript(str, new ValueCallback<String>() {
@Override
public void onReceiveValue(String str2) {
if (str2 == null || "null".equals(str2)) {
return;
}
String str3 = DTBAdMRAIDController.LOG_TAG;
DtbLog.debug(str3, "Value received:" + str2 + " for script " + str);
}
});
}
}
public void m35xd4333b11() {
getAdView().loadUrl("about:blank");
}
public boolean m36x15d656ad(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == 0) {
evaluateJavascript(MRAID_CLOSE);
((ViewGroup) view.getParent()).removeView(view);
this.closeIndicatorRegion = null;
return true;
}
return true;
}
public void m37lambda$setState$1$comamazondeviceadsDTBAdMRAIDController() {
DTBAdView adView = getAdView();
if (adView != null) {
adView.setVisibility(8);
}
}
@Override
public void onActivityDestroyed(Activity activity) {
}
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityResumed(Activity activity) {
}
@Override
public void onActivityStopped(Activity activity) {
}
public void onAdClicked() {
}
public abstract void onAdLeftApplication();
public void onAdOpened(DTBAdView dTBAdView) {
}
public void onAdRemoved() {
}
public void onLoadError() {
String bidId = this.adView.getBidId();
String hostname = this.adView.getHostname();
if (bidId != null) {
DTBMetricsProcessor.getInstance().submitSimpleReportBidId(DTBMetricReport.addBid(bidId, hostname), DTBMetricsProcessor.REPORT_LOAD_FAILURE);
}
passLoadError();
}
public void onLoadError(String str, int i) {
onLoadError();
}
public abstract void onMRAIDClose();
public void onMRAIDUnload() {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
DTBAdMRAIDController.this.m35xd4333b11();
}
});
}
public abstract void onPageLoad();
public void onPositionChanged(Rect rect) {
Rect rect2 = this.lastRect;
if (rect2 == null || !rect2.equals(rect)) {
int i = rect.right - rect.left;
int i2 = rect.bottom - rect.top;
Rect rect3 = this.lastRect;
boolean z = true;
if (rect3 != null) {
int i3 = rect3.right - this.lastRect.left;
int i4 = this.lastRect.bottom - this.lastRect.top;
if (Math.abs(i3 - i) <= 1 && Math.abs(i4 - i2) <= 1) {
z = false;
}
}
setCurrentPositionProperty();
if (z) {
fireSizeChange(DTBAdUtil.pixelsToDeviceIndependenPixels(i), DTBAdUtil.pixelsToDeviceIndependenPixels(i2));
}
this.lastRect = rect;
}
}
public abstract void onResize(Map<String, Object> map);
public void onVideoCompleted() {
}
public void onViewabilityChanged(boolean z) {
DtbLog.debug("SET MRAID Visible " + z);
fireViewableChange(z);
}
public void openUrl(String str) {
PackageManager packageManager = this.adView.getContext().getPackageManager();
try {
Uri parse = Uri.parse(str);
if ("amazonmobile".equals(parse.getScheme()) && parse.getHost().equals("intent")) {
String[] split = str.split("intent=");
if (split.length > 1) {
String str2 = null;
for (int i = 1; i < split.length; i++) {
try {
String str3 = split[i];
if (str3.lastIndexOf("&") == str3.length() - 1) {
str3 = str3.substring(0, str3.length() - 1);
}
str2 = URLDecoder.decode(str3, "UTF-8");
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(getContext(), new Intent("android.intent.action.VIEW", Uri.parse(str2)));
onAdLeftApplication();
break;
} catch (ActivityNotFoundException unused) {
DtbLog.debug("Intent:" + str2 + " not found.");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "requested activity not found");
} catch (UnsupportedEncodingException unused2) {
DtbLog.debug("Unsupported encoding");
}
}
}
} else if ("com.amazon.mobile.shopping".equals(parse.getScheme())) {
try {
if (packageManager.getLaunchIntentForPackage("com.amazon.mShop.android.shopping") != null) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(parse);
safedk_Activity_startActivity_9d898b58165fa4ba0e12c3900a2b8533(AdRegistration.getCurrentActivity(), intent);
} else {
Intent intent2 = new Intent("android.intent.action.VIEW");
intent2.setData(parse);
int indexOf = str.indexOf("products/");
if (indexOf > 0) {
intent2.setData(Uri.parse("https://www.amazon.com/dp/" + str.substring(indexOf + 9)));
safedk_Activity_startActivity_9d898b58165fa4ba0e12c3900a2b8533(AdRegistration.getCurrentActivity(), intent2);
}
}
onAdLeftApplication();
} catch (ActivityNotFoundException unused3) {
DtbLog.debug(LOG_TAG, "Activity not found com.amazon.mobile.shopping");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "mshop activity not found");
} catch (NullPointerException unused4) {
DtbLog.debug(LOG_TAG, "Current activity from AdRegistration not found");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "current activity from AdRegistration not found");
}
} else if ("market".equals(parse.getScheme()) || "amzn".equals(parse.getScheme())) {
try {
try {
Intent intent3 = new Intent("android.intent.action.VIEW");
intent3.setData(parse);
safedk_Activity_startActivity_9d898b58165fa4ba0e12c3900a2b8533(AdRegistration.getCurrentActivity(), intent3);
onAdLeftApplication();
} catch (ActivityNotFoundException unused5) {
DtbLog.debug(LOG_TAG, "App stores and browsers not found");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "app stores and browsers not found");
} catch (NullPointerException unused6) {
DtbLog.debug(LOG_TAG, "Current activity from AdRegistration not found");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "current activity from AdRegistration not found");
}
} catch (ActivityNotFoundException unused7) {
DTBAdUtil.directAppStoreLinkToBrowser(this, parse);
} catch (NullPointerException unused8) {
DtbLog.debug(LOG_TAG, "Current activity from AdRegistration not found");
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "current activity from AdRegistration not found");
}
} else {
if (parse.getScheme() == null) {
parse = Uri.parse("https:" + str);
}
Intent intent4 = new Intent("android.intent.action.VIEW", parse);
try {
intent4.addFlags(268435456);
safedk_Context_startActivity_97cb3195734cf5c9cc3418feeafa6dd6(getContext(), intent4);
onAdLeftApplication();
} catch (Exception e) {
DtbLog.error(LOG_TAG, e.getMessage());
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "invalid url " + str);
}
}
commandCompleted(TtmlNode.TEXT_EMPHASIS_MARK_OPEN);
} catch (Exception unused9) {
fireErrorEvent(TtmlNode.TEXT_EMPHASIS_MARK_OPEN, "invalid url " + str);
commandCompleted(TtmlNode.TEXT_EMPHASIS_MARK_OPEN);
}
}
void passLoadError() {
}
public void prepareMraid() throws JSONException {
createLoadReport();
this.pageLoaded = true;
fireMaxSizeEvent();
fireScreenSizeEvent();
if (getAdView().isVisible()) {
setCurrentPositionProperty();
}
fireMRAIDSupports();
firePlacementType();
setCurrentAppOrientation();
setState(getInitialStateType());
fireMRAIDReadyEvent();
if (AdRegistration.isTestMode()) {
evaluateJavascript("window.mraidBridge.service.debug('enable');");
}
}
public void removeCloseIndicator() {
ViewGroup viewGroup;
LinearLayout linearLayout = this.closeIndicatorRegion;
if (linearLayout == null || (viewGroup = (ViewGroup) linearLayout.getParent()) == null) {
return;
}
viewGroup.removeView(this.closeIndicatorRegion);
}
public void setCloseIndicatorContent(View.OnTouchListener onTouchListener) {
this.closeIndicatorRegion.setBackgroundColor(0);
this.closeIndicatorRegion.setId(R.id.mraid_close_indicator);
ImageView imageView = new ImageView(getAdView().getContext());
imageView.setId(R.id.mraid_close_indicator);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(DTBAdUtil.sizeToDevicePixels(24), DTBAdUtil.sizeToDevicePixels(24));
layoutParams.setMargins(DTBAdUtil.sizeToDevicePixels(14), DTBAdUtil.sizeToDevicePixels(14), 0, 0);
this.closeIndicatorRegion.addView(imageView, layoutParams);
if (getDtbOmSdkSessionManager() != null) {
getDtbOmSdkSessionManager().addFriendlyObstruction(this.closeIndicatorRegion.findViewById(R.id.mraid_close_indicator), FriendlyObstructionPurpose.CLOSE_AD);
}
imageView.setImageDrawable(AppCompatResources.getDrawable(getAdView().getContext(), R.drawable.mraid_close));
if (onTouchListener != null) {
this.closeIndicatorRegion.setOnTouchListener(onTouchListener);
} else {
this.closeIndicatorRegion.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return DTBAdMRAIDController.this.m36x15d656ad(view, motionEvent);
}
});
}
}
protected void setCurrentAppOrientation() throws JSONException {
int determineSimpleOrientation = DisplayUtils.determineSimpleOrientation();
String str = determineSimpleOrientation != 1 ? determineSimpleOrientation != 2 ? "unspecified" : DtbDeviceDataRetriever.ORIENTATION_LANDSCAPE : DtbDeviceDataRetriever.ORIENTATION_PORTRAIT;
boolean isRotationLocked = DisplayUtils.isRotationLocked();
JSONObject jSONObject = new JSONObject();
jSONObject.put(AdUnitActivity.EXTRA_ORIENTATION, str);
jSONObject.put("locked", isRotationLocked);
evaluateJavascriptMethod("window.mraidBridge.property.setCurrentAppOrientation", jSONObject);
}
public void setCurrentPositionProperty() {
if (this.pageLoaded) {
int[] iArr = new int[2];
getAdView().getLocationOnScreen(iArr);
setCurrentPositionProperty(iArr[0], iArr[1], getAdView().getWidth(), getAdView().getHeight());
}
}
public void setCurrentPositionProperty(float f, float f2) {
if (this.pageLoaded) {
int[] iArr = new int[2];
getAdView().getLocationOnScreen(iArr);
setCurrentPositionProperty(iArr[0], iArr[1], f, f2);
}
}
void setCurrentPositionProperty(int i, int i2, float f, float f2) {
if (this.pageLoaded) {
evaluateJavascript(String.format("window.mraidBridge.property.setCurrentPosition({'xPos':%.1f, 'yPos':%.1f, 'width': %.1f, 'height': %.1f});", Float.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(i)), Float.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels(i2)), Float.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels((int) f)), Float.valueOf(DTBAdUtil.pixelsToDeviceIndependenPixels((int) f2))));
}
}
public void setCustomButtonListener(DTBMRAIDCloseButtonListener dTBMRAIDCloseButtonListener) {
this.customButtonListener = dTBMRAIDCloseButtonListener;
}
public void setState(MraidStateType mraidStateType) {
this.state = mraidStateType;
if (mraidStateType == MraidStateType.HIDDEN) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
DTBAdMRAIDController.this.m37lambda$setState$1$comamazondeviceadsDTBAdMRAIDController();
}
});
}
fireStateChangeEvent();
}
public void setTwoPartExpand(boolean z) {
this.isTwoPartExpand = z;
}
public void setUseCustomClose(boolean z) {
DtbLog.debug("Set useCustomClose to " + z);
this.useCustomClose = z;
commandCompleted("useCustomClose");
DTBMRAIDCloseButtonListener dTBMRAIDCloseButtonListener = this.customButtonListener;
if (dTBMRAIDCloseButtonListener != null) {
dTBMRAIDCloseButtonListener.useCustomButtonUpdated();
}
}
}