Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 e.java 源代码,内容仅作参考
package myobfuscated.uj2;
import android.annotation.TargetApi;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebViewRenderProcess;
import android.webkit.WebViewRenderProcessClient;
import com.amazon.device.ads.DtbConstants;
import com.amazon.device.ads.DtbDeviceData;
import com.picsart.studio.common.source.ResourceSourceContainer;
import com.vungle.ads.AnalyticsClient;
import java.util.concurrent.ExecutorService;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.serialization.json.JsonObject;
import myobfuscated.ej2.k;
import myobfuscated.fo2.g;
import myobfuscated.fo2.r;
import myobfuscated.kj2.i;
import myobfuscated.vj2.c;
import org.jetbrains.annotations.NotNull;
public final class e extends WebViewClient implements myobfuscated.vj2.c {
@NotNull
public static final a Companion = new a(null);
@NotNull
private static final String TAG = "VungleWebClient";
@NotNull
private final myobfuscated.kj2.a advertisement;
private boolean collectConsent;
private c.b errorHandler;
private String gdprAccept;
private String gdprBody;
private String gdprDeny;
private String gdprTitle;
private Boolean isViewable;
private WebView loadedWebView;
private c.a mraidDelegate;
@NotNull
private final ExecutorService offloadExecutor;
@NotNull
private final i placement;
private boolean ready;
private myobfuscated.nj2.d webViewObserver;
public static final class a {
private a() {
}
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
public static final class b extends WebViewRenderProcessClient {
private c.b errorHandler;
public b(c.b bVar) {
this.errorHandler = bVar;
}
public final c.b getErrorHandler() {
return this.errorHandler;
}
public void onRenderProcessResponsive(@NotNull WebView webView, WebViewRenderProcess webViewRenderProcess) {
Intrinsics.checkNotNullParameter(webView, "webView");
}
public void onRenderProcessUnresponsive(@NotNull WebView webView, WebViewRenderProcess webViewRenderProcess) {
Intrinsics.checkNotNullParameter(webView, "webView");
StringBuilder sb = new StringBuilder("onRenderProcessUnresponsive(Title = ");
sb.append(webView.getTitle());
sb.append(", URL = ");
sb.append(webView.getOriginalUrl());
sb.append(", (webViewRenderProcess != null) = ");
sb.append(webViewRenderProcess != null);
Log.w(e.TAG, sb.toString());
c.b bVar = this.errorHandler;
if (bVar != null) {
bVar.onRenderProcessUnresponsive(webView, webViewRenderProcess);
}
}
public final void setErrorHandler(c.b bVar) {
this.errorHandler = bVar;
}
}
public e(@NotNull myobfuscated.kj2.a advertisement, @NotNull i placement, @NotNull ExecutorService offloadExecutor) {
Intrinsics.checkNotNullParameter(advertisement, "advertisement");
Intrinsics.checkNotNullParameter(placement, "placement");
Intrinsics.checkNotNullParameter(offloadExecutor, "offloadExecutor");
this.advertisement = advertisement;
this.placement = placement;
this.offloadExecutor = offloadExecutor;
}
public static void getCollectConsent$vungle_ads_release$annotations() {
}
public static void getErrorHandler$vungle_ads_release$annotations() {
}
public static void getGdprAccept$vungle_ads_release$annotations() {
}
public static void getGdprBody$vungle_ads_release$annotations() {
}
public static void getGdprDeny$vungle_ads_release$annotations() {
}
public static void getGdprTitle$vungle_ads_release$annotations() {
}
public static void getLoadedWebView$vungle_ads_release$annotations() {
}
public static void getMraidDelegate$vungle_ads_release$annotations() {
}
public static void getReady$vungle_ads_release$annotations() {
}
public static void getWebViewObserver$vungle_ads_release$annotations() {
}
private final void handleWebViewError(String str, String str2, boolean z) {
String a2 = myobfuscated.xc0.b.a(str2, ' ', str);
c.b bVar = this.errorHandler;
if (bVar != null) {
bVar.onReceivedError(a2, z);
}
}
private final boolean isCriticalAsset(String str) {
if (str.length() > 0) {
return this.advertisement.getDownloadableUrls().containsValue(str);
}
return false;
}
public static void isViewable$vungle_ads_release$annotations() {
}
private final void runJavascriptOnWebView(WebView webView, String str) {
if (webView != null) {
try {
webView.evaluateJavascript(str, null);
} catch (Exception e) {
AnalyticsClient analyticsClient = AnalyticsClient.INSTANCE;
analyticsClient.logError$vungle_ads_release(313, "Evaluate js failed " + e.getLocalizedMessage(), this.placement.getReferenceId(), this.advertisement.getCreativeId(), this.advertisement.eventId());
}
}
}
public static final void m332shouldOverrideUrlLoading$lambda4$lambda3$lambda2(c.a it, String command, JsonObject args, Handler handler, e this$0, WebView webView) {
Intrinsics.checkNotNullParameter(it, "$it");
Intrinsics.checkNotNullParameter(command, "$command");
Intrinsics.checkNotNullParameter(args, "$args");
Intrinsics.checkNotNullParameter(handler, "$handler");
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (it.processCommand(command, args)) {
handler.post(new myobfuscated.oy1.d(10, this$0, webView));
}
}
public static final void m333shouldOverrideUrlLoading$lambda4$lambda3$lambda2$lambda1(e this$0, WebView webView) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.runJavascriptOnWebView(webView, "window.vungle.mraidBridge.notifyCommandComplete()");
}
public final boolean getCollectConsent$vungle_ads_release() {
return this.collectConsent;
}
public final c.b getErrorHandler$vungle_ads_release() {
return this.errorHandler;
}
public final String getGdprAccept$vungle_ads_release() {
return this.gdprAccept;
}
public final String getGdprBody$vungle_ads_release() {
return this.gdprBody;
}
public final String getGdprDeny$vungle_ads_release() {
return this.gdprDeny;
}
public final String getGdprTitle$vungle_ads_release() {
return this.gdprTitle;
}
public final WebView getLoadedWebView$vungle_ads_release() {
return this.loadedWebView;
}
public final c.a getMraidDelegate$vungle_ads_release() {
return this.mraidDelegate;
}
public final boolean getReady$vungle_ads_release() {
return this.ready;
}
public final myobfuscated.nj2.d getWebViewObserver$vungle_ads_release() {
return this.webViewObserver;
}
public final Boolean isViewable$vungle_ads_release() {
return this.isViewable;
}
@Override
public void notifyPropertiesChange(boolean z) {
WebView webView = this.loadedWebView;
if (webView != null) {
r rVar = new r();
r rVar2 = new r();
g.b(rVar2, "width", Integer.valueOf(webView.getWidth()));
g.b(rVar2, "height", Integer.valueOf(webView.getHeight()));
JsonObject a2 = rVar2.a();
r rVar3 = new r();
g.b(rVar3, "x", 0);
g.b(rVar3, "y", 0);
g.b(rVar3, "width", Integer.valueOf(webView.getWidth()));
g.b(rVar3, "height", Integer.valueOf(webView.getHeight()));
JsonObject a3 = rVar3.a();
r rVar4 = new r();
Boolean bool = Boolean.FALSE;
g.a(rVar4, "sms", bool);
g.a(rVar4, "tel", bool);
g.a(rVar4, "calendar", bool);
g.a(rVar4, "storePicture", bool);
g.a(rVar4, "inlineVideo", bool);
JsonObject a4 = rVar4.a();
rVar.b("maxSize", a2);
rVar.b(DtbDeviceData.DEVICE_DATA_SCREEN_SIZE_KEY, a2);
rVar.b("defaultPosition", a3);
rVar.b("currentPosition", a3);
rVar.b("supports", a4);
g.c(rVar, "placementType", this.advertisement.templateType());
Boolean bool2 = this.isViewable;
if (bool2 != null) {
g.a(rVar, "isViewable", Boolean.valueOf(bool2.booleanValue()));
}
g.c(rVar, "os", DtbConstants.NATIVE_OS_NAME);
g.c(rVar, DtbDeviceData.DEVICE_DATA_OS_VERSION_KEY, String.valueOf(Build.VERSION.SDK_INT));
g.a(rVar, "incentivized", this.placement.getIncentivized());
g.b(rVar, "enableBackImmediately", Integer.valueOf(this.advertisement.getShowCloseDelay(this.placement.getIncentivized())));
g.c(rVar, ResourceSourceContainer.KEY_VERSION, "1.0");
if (this.collectConsent) {
g.a(rVar, "consentRequired", Boolean.TRUE);
g.c(rVar, "consentTitleText", this.gdprTitle);
g.c(rVar, "consentBodyText", this.gdprBody);
g.c(rVar, "consentAcceptButtonText", this.gdprAccept);
g.c(rVar, "consentDenyButtonText", this.gdprDeny);
} else {
g.a(rVar, "consentRequired", bool);
}
g.c(rVar, "sdkVersion", k.VERSION_NAME);
JsonObject a5 = rVar.a();
Log.d(TAG, "loadJs->javascript:window.vungle.mraidBridge.notifyPropertiesChange(" + a5 + ',' + z + ')');
StringBuilder sb = new StringBuilder("window.vungle.mraidBridge.notifyPropertiesChange(");
sb.append(a5);
sb.append(',');
runJavascriptOnWebView(webView, defpackage.d.s(sb, z, ')'));
}
}
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
if (webView == null) {
return;
}
this.loadedWebView = webView;
webView.setVisibility(0);
notifyPropertiesChange(true);
if (Build.VERSION.SDK_INT >= 29) {
webView.setWebViewRenderProcessClient(new b(this.errorHandler));
}
myobfuscated.nj2.d dVar = this.webViewObserver;
if (dVar != null) {
dVar.onPageFinished(webView);
}
}
@Override
public void onReceivedError(WebView webView, int i, @NotNull String description, @NotNull String failingUrl) {
Intrinsics.checkNotNullParameter(description, "description");
Intrinsics.checkNotNullParameter(failingUrl, "failingUrl");
super.onReceivedError(webView, i, description, failingUrl);
}
@Override
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
super.onReceivedError(webView, webResourceRequest, webResourceError);
String valueOf = String.valueOf(webResourceError != null ? webResourceError.getDescription() : null);
String valueOf2 = String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null);
boolean z = false;
boolean z2 = webResourceRequest != null && webResourceRequest.isForMainFrame();
Log.e(TAG, "Error desc " + valueOf + ' ' + z2 + " for URL " + valueOf2);
if (isCriticalAsset(valueOf2) && z2) {
z = true;
}
handleWebViewError(valueOf, valueOf2, z);
}
@Override
public void onReceivedHttpError(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) {
super.onReceivedHttpError(webView, webResourceRequest, webResourceResponse);
String valueOf = String.valueOf(webResourceResponse != null ? Integer.valueOf(webResourceResponse.getStatusCode()) : null);
String valueOf2 = String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null);
boolean z = false;
boolean z2 = webResourceRequest != null && webResourceRequest.isForMainFrame();
Log.e(TAG, "Http Error desc " + valueOf + ' ' + z2 + " for URL " + valueOf2);
if (isCriticalAsset(valueOf2) && z2) {
z = true;
}
handleWebViewError(valueOf, valueOf2, z);
}
@Override
@TargetApi(26)
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
StringBuilder sb = new StringBuilder("onRenderProcessGone url: ");
sb.append(webView != null ? webView.getUrl() : null);
sb.append(", did crash: ");
sb.append(renderProcessGoneDetail != null ? Boolean.valueOf(renderProcessGoneDetail.didCrash()) : null);
Log.w(TAG, sb.toString());
this.loadedWebView = null;
c.b bVar = this.errorHandler;
if (bVar != null) {
return bVar.onWebRenderingProcessGone(webView, renderProcessGoneDetail != null ? Boolean.valueOf(renderProcessGoneDetail.didCrash()) : null);
}
return super.onRenderProcessGone(webView, renderProcessGoneDetail);
}
@Override
public void setAdVisibility(boolean z) {
this.isViewable = Boolean.valueOf(z);
notifyPropertiesChange(false);
}
public final void setCollectConsent$vungle_ads_release(boolean z) {
this.collectConsent = z;
}
@Override
public void setConsentStatus(boolean z, String str, String str2, String str3, String str4) {
this.collectConsent = z;
this.gdprTitle = str;
this.gdprBody = str2;
this.gdprAccept = str3;
this.gdprDeny = str4;
}
@Override
public void setErrorHandler(@NotNull c.b errorHandler) {
Intrinsics.checkNotNullParameter(errorHandler, "errorHandler");
this.errorHandler = errorHandler;
}
public final void setErrorHandler$vungle_ads_release(c.b bVar) {
this.errorHandler = bVar;
}
public final void setGdprAccept$vungle_ads_release(String str) {
this.gdprAccept = str;
}
public final void setGdprBody$vungle_ads_release(String str) {
this.gdprBody = str;
}
public final void setGdprDeny$vungle_ads_release(String str) {
this.gdprDeny = str;
}
public final void setGdprTitle$vungle_ads_release(String str) {
this.gdprTitle = str;
}
public final void setLoadedWebView$vungle_ads_release(WebView webView) {
this.loadedWebView = webView;
}
@Override
public void setMraidDelegate(c.a aVar) {
this.mraidDelegate = aVar;
}
public final void setMraidDelegate$vungle_ads_release(c.a aVar) {
this.mraidDelegate = aVar;
}
public final void setReady$vungle_ads_release(boolean z) {
this.ready = z;
}
public final void setViewable$vungle_ads_release(Boolean bool) {
this.isViewable = bool;
}
@Override
public void setWebViewObserver(myobfuscated.nj2.d dVar) {
this.webViewObserver = dVar;
}
public final void setWebViewObserver$vungle_ads_release(myobfuscated.nj2.d dVar) {
this.webViewObserver = dVar;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
Log.d(TAG, "MRAID Command " + str);
if (str == null || str.length() == 0) {
Log.e(TAG, "Invalid URL ");
return false;
}
Uri parse = Uri.parse(str);
if (parse == null || parse.getScheme() == null) {
return false;
}
String scheme = parse.getScheme();
if (Intrinsics.c(scheme, "mraid")) {
String host = parse.getHost();
if (host != null) {
if (!Intrinsics.c("propertiesChangeCompleted", host)) {
c.a aVar = this.mraidDelegate;
if (aVar != null) {
r rVar = new r();
for (String param : parse.getQueryParameterNames()) {
Intrinsics.checkNotNullExpressionValue(param, "param");
g.c(rVar, param, parse.getQueryParameter(param));
}
this.offloadExecutor.submit(new myobfuscated.mm1.b(aVar, host, rVar.a(), new Handler(Looper.getMainLooper()), this, webView));
}
} else if (!this.ready) {
JsonObject createMRAIDArgs = this.advertisement.createMRAIDArgs();
runJavascriptOnWebView(webView, "window.vungle.mraidBridge.notifyReadyEvent(" + createMRAIDArgs + ')');
this.ready = true;
}
return true;
}
} else if (myobfuscated.mn2.k.n("http", scheme, true) || myobfuscated.mn2.k.n("https", scheme, true)) {
Log.d(TAG, "Open URL".concat(str));
c.a aVar2 = this.mraidDelegate;
if (aVar2 != null) {
r rVar2 = new r();
g.c(rVar2, "url", str);
aVar2.processCommand("openNonMraid", rVar2.a());
}
return true;
}
return false;
}
}