- 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
101 lines
3.7 KiB
Java
101 lines
3.7 KiB
Java
package com.iab.omid.library.unity3d.publisher;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.os.Handler;
|
|
import android.util.Log;
|
|
import android.webkit.RenderProcessGoneDetail;
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebViewClient;
|
|
import com.iab.omid.library.unity3d.adsession.AdSessionContext;
|
|
import com.iab.omid.library.unity3d.adsession.VerificationScriptResource;
|
|
import com.iab.omid.library.unity3d.internal.g;
|
|
import com.iab.omid.library.unity3d.utils.c;
|
|
import com.iab.omid.library.unity3d.utils.f;
|
|
import java.util.Map;
|
|
import java.util.concurrent.TimeUnit;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class b extends AdSessionStatePublisher {
|
|
private WebView g;
|
|
private Long h;
|
|
private final Map<String, VerificationScriptResource> i;
|
|
private final String j;
|
|
|
|
public class a extends WebViewClient {
|
|
public a() {
|
|
}
|
|
|
|
@Override // android.webkit.WebViewClient
|
|
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
|
|
Log.w("NativeBridge", "WebView renderer gone: " + renderProcessGoneDetail.toString() + "for WebView: " + webView);
|
|
if (b.this.getWebView() == webView) {
|
|
Log.w("NativeBridge", "Deallocating the Native bridge as it is unusable. No further events will be generated for this session.");
|
|
b.this.a((WebView) null);
|
|
}
|
|
webView.destroy();
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* renamed from: com.iab.omid.library.unity3d.publisher.b$b, reason: collision with other inner class name */
|
|
public class RunnableC0145b implements Runnable {
|
|
private final WebView a;
|
|
|
|
public RunnableC0145b() {
|
|
this.a = b.this.g;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
this.a.destroy();
|
|
}
|
|
}
|
|
|
|
public b(String str, Map<String, VerificationScriptResource> map, String str2) {
|
|
super(str);
|
|
this.h = null;
|
|
this.i = map;
|
|
this.j = str2;
|
|
}
|
|
|
|
@Override // com.iab.omid.library.unity3d.publisher.AdSessionStatePublisher
|
|
public void a(com.iab.omid.library.unity3d.adsession.a aVar, AdSessionContext adSessionContext) {
|
|
JSONObject jSONObject = new JSONObject();
|
|
Map<String, VerificationScriptResource> injectedResourcesMap = adSessionContext.getInjectedResourcesMap();
|
|
for (String str : injectedResourcesMap.keySet()) {
|
|
c.a(jSONObject, str, injectedResourcesMap.get(str).toJsonObject());
|
|
}
|
|
a(aVar, adSessionContext, jSONObject);
|
|
}
|
|
|
|
@Override // com.iab.omid.library.unity3d.publisher.AdSessionStatePublisher
|
|
public void b() {
|
|
super.b();
|
|
new Handler().postDelayed(new RunnableC0145b(), Math.max(4000 - (this.h == null ? 4000L : TimeUnit.MILLISECONDS.convert(f.b() - this.h.longValue(), TimeUnit.NANOSECONDS)), 2000L));
|
|
this.g = null;
|
|
}
|
|
|
|
@Override // com.iab.omid.library.unity3d.publisher.AdSessionStatePublisher
|
|
public void i() {
|
|
super.i();
|
|
j();
|
|
}
|
|
|
|
@SuppressLint({"SetJavaScriptEnabled"})
|
|
public void j() {
|
|
WebView webView = new WebView(com.iab.omid.library.unity3d.internal.f.b().a());
|
|
this.g = webView;
|
|
webView.getSettings().setJavaScriptEnabled(true);
|
|
this.g.getSettings().setAllowContentAccess(false);
|
|
this.g.getSettings().setAllowFileAccess(false);
|
|
this.g.setWebViewClient(new a());
|
|
a(this.g);
|
|
g.a().c(this.g, this.j);
|
|
for (String str : this.i.keySet()) {
|
|
g.a().c(this.g, this.i.get(str).getResourceUrl().toExternalForm(), str);
|
|
}
|
|
this.h = Long.valueOf(f.b());
|
|
}
|
|
}
|