Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package com.iab.omid.library.applovin;
import android.content.Context;
/* loaded from: classes2.dex */
public final class Omid {
private static b INSTANCE = new b();
private Omid() {
}
public static void activate(Context context) {
INSTANCE.a(context.getApplicationContext());
}
public static String getVersion() {
return INSTANCE.a();
}
public static boolean isActive() {
return INSTANCE.b();
}
public static void updateLastActivity() {
INSTANCE.c();
}
}

View File

@@ -0,0 +1,11 @@
package com.iab.omid.library.applovin;
/* loaded from: classes2.dex */
public final class ScriptInjector {
private ScriptInjector() {
}
public static String injectScriptContentIntoHtml(String str, String str2) {
return c.b(str, str2);
}
}

View File

@@ -0,0 +1,6 @@
package com.iab.omid.library.applovin;
/* loaded from: classes2.dex */
public final class a {
public static final Boolean a = Boolean.FALSE;
}

View File

@@ -0,0 +1,51 @@
package com.iab.omid.library.applovin.adsession;
import androidx.annotation.NonNull;
import com.iab.omid.library.applovin.adsession.media.VastProperties;
import com.iab.omid.library.applovin.utils.g;
/* loaded from: classes2.dex */
public final class AdEvents {
private final a adSession;
private AdEvents(a aVar) {
this.adSession = aVar;
}
public static AdEvents createAdEvents(AdSession adSession) {
a aVar = (a) adSession;
g.a(adSession, "AdSession is null");
g.g(aVar);
g.b(aVar);
AdEvents adEvents = new AdEvents(aVar);
aVar.getAdSessionStatePublisher().a(adEvents);
return adEvents;
}
public void impressionOccurred() {
g.b(this.adSession);
g.e(this.adSession);
if (!this.adSession.f()) {
try {
this.adSession.start();
} catch (Exception unused) {
}
}
if (this.adSession.f()) {
this.adSession.k();
}
}
public void loaded() {
g.a(this.adSession);
g.e(this.adSession);
this.adSession.l();
}
public void loaded(@NonNull VastProperties vastProperties) {
g.a(vastProperties, "VastProperties is null");
g.a(this.adSession);
g.e(this.adSession);
this.adSession.a(vastProperties.a());
}
}

View File

@@ -0,0 +1,36 @@
package com.iab.omid.library.applovin.adsession;
import android.view.View;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.publisher.AdSessionStatePublisher;
import com.iab.omid.library.applovin.utils.g;
/* loaded from: classes2.dex */
public abstract class AdSession {
public static AdSession createAdSession(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext) {
g.a();
g.a(adSessionConfiguration, "AdSessionConfiguration is null");
g.a(adSessionContext, "AdSessionContext is null");
return new a(adSessionConfiguration, adSessionContext);
}
public abstract void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str);
public abstract void error(ErrorType errorType, String str);
public abstract void finish();
public abstract String getAdSessionId();
public abstract AdSessionStatePublisher getAdSessionStatePublisher();
public abstract void registerAdView(View view);
public abstract void removeAllFriendlyObstructions();
public abstract void removeFriendlyObstruction(View view);
public abstract void setPossibleObstructionListener(PossibleObstructionListener possibleObstructionListener);
public abstract void start();
}

View File

@@ -0,0 +1,52 @@
package com.iab.omid.library.applovin.adsession;
import com.iab.omid.library.applovin.utils.c;
import com.iab.omid.library.applovin.utils.g;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class AdSessionConfiguration {
private final CreativeType creativeType;
private final Owner impressionOwner;
private final ImpressionType impressionType;
private final boolean isolateVerificationScripts;
private final Owner mediaEventsOwner;
private AdSessionConfiguration(CreativeType creativeType, ImpressionType impressionType, Owner owner, Owner owner2, boolean z) {
this.creativeType = creativeType;
this.impressionType = impressionType;
this.impressionOwner = owner;
if (owner2 == null) {
this.mediaEventsOwner = Owner.NONE;
} else {
this.mediaEventsOwner = owner2;
}
this.isolateVerificationScripts = z;
}
public static AdSessionConfiguration createAdSessionConfiguration(CreativeType creativeType, ImpressionType impressionType, Owner owner, Owner owner2, boolean z) {
g.a(creativeType, "CreativeType is null");
g.a(impressionType, "ImpressionType is null");
g.a(owner, "Impression owner is null");
g.a(owner, creativeType, impressionType);
return new AdSessionConfiguration(creativeType, impressionType, owner, owner2, z);
}
public boolean isNativeImpressionOwner() {
return Owner.NATIVE == this.impressionOwner;
}
public boolean isNativeMediaEventsOwner() {
return Owner.NATIVE == this.mediaEventsOwner;
}
public JSONObject toJsonObject() {
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "impressionOwner", this.impressionOwner);
c.a(jSONObject, "mediaEventsOwner", this.mediaEventsOwner);
c.a(jSONObject, "creativeType", this.creativeType);
c.a(jSONObject, "impressionType", this.impressionType);
c.a(jSONObject, "isolateVerificationScripts", Boolean.valueOf(this.isolateVerificationScripts));
return jSONObject;
}
}

View File

@@ -0,0 +1,107 @@
package com.iab.omid.library.applovin.adsession;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.utils.g;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/* loaded from: classes2.dex */
public final class AdSessionContext {
private final AdSessionContextType adSessionContextType;
@Nullable
private final String contentUrl;
@Nullable
private final String customReferenceData;
private final Map<String, VerificationScriptResource> injectedResourcesMap;
private final String omidJsScriptContent;
private final Partner partner;
private final List<VerificationScriptResource> verificationScriptResources;
private final WebView webView;
private AdSessionContext(Partner partner, WebView webView, String str, List<VerificationScriptResource> list, @Nullable String str2, @Nullable String str3, AdSessionContextType adSessionContextType) {
ArrayList arrayList = new ArrayList();
this.verificationScriptResources = arrayList;
this.injectedResourcesMap = new HashMap();
this.partner = partner;
this.webView = webView;
this.omidJsScriptContent = str;
this.adSessionContextType = adSessionContextType;
if (list != null) {
arrayList.addAll(list);
for (VerificationScriptResource verificationScriptResource : list) {
this.injectedResourcesMap.put(UUID.randomUUID().toString(), verificationScriptResource);
}
}
this.contentUrl = str2;
this.customReferenceData = str3;
}
public static AdSessionContext createHtmlAdSessionContext(Partner partner, WebView webView, @Nullable String str, @Nullable String str2) {
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
if (str2 != null) {
g.a(str2, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, webView, null, null, str, str2, AdSessionContextType.HTML);
}
public static AdSessionContext createJavascriptAdSessionContext(Partner partner, WebView webView, @Nullable String str, @Nullable String str2) {
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
if (str2 != null) {
g.a(str2, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, webView, null, null, str, str2, AdSessionContextType.JAVASCRIPT);
}
public static AdSessionContext createNativeAdSessionContext(Partner partner, String str, List<VerificationScriptResource> list, @Nullable String str2, @Nullable String str3) {
g.a(partner, "Partner is null");
g.a((Object) str, "OM SDK JS script content is null");
g.a(list, "VerificationScriptResources is null");
if (str3 != null) {
g.a(str3, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, null, str, list, str2, str3, AdSessionContextType.NATIVE);
}
public AdSessionContextType getAdSessionContextType() {
return this.adSessionContextType;
}
@Nullable
public String getContentUrl() {
return this.contentUrl;
}
@Nullable
public String getCustomReferenceData() {
return this.customReferenceData;
}
public Map<String, VerificationScriptResource> getInjectedResourcesMap() {
return Collections.unmodifiableMap(this.injectedResourcesMap);
}
public String getOmidJsScriptContent() {
return this.omidJsScriptContent;
}
public Partner getPartner() {
return this.partner;
}
public List<VerificationScriptResource> getVerificationScriptResources() {
return Collections.unmodifiableList(this.verificationScriptResources);
}
public WebView getWebView() {
return this.webView;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.applovin.adsession;
import com.tapjoy.TJAdUnitConstants;
/* loaded from: classes2.dex */
public enum AdSessionContextType {
HTML(TJAdUnitConstants.String.HTML),
NATIVE("native"),
JAVASCRIPT("javascript");
private final String typeString;
AdSessionContextType(String str) {
this.typeString = str;
}
@Override // java.lang.Enum
public String toString() {
return this.typeString;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.applovin.adsession;
/* loaded from: classes2.dex */
public enum CreativeType {
DEFINED_BY_JAVASCRIPT("definedByJavaScript"),
HTML_DISPLAY("htmlDisplay"),
NATIVE_DISPLAY("nativeDisplay"),
VIDEO("video"),
AUDIO("audio");
private final String creativeType;
CreativeType(String str) {
this.creativeType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.creativeType;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.applovin.adsession;
import com.tapjoy.TJDeviceNetworkKt;
/* loaded from: classes2.dex */
public enum DeviceCategory {
CTV("ctv"),
MOBILE(TJDeviceNetworkKt.TJC_CONNECTION_TYPE_MOBILE),
OTHER("other");
private final String deviceCategory;
DeviceCategory(String str) {
this.deviceCategory = str;
}
@Override // java.lang.Enum
public String toString() {
return this.deviceCategory;
}
}

View File

@@ -0,0 +1,18 @@
package com.iab.omid.library.applovin.adsession;
/* loaded from: classes2.dex */
public enum ErrorType {
GENERIC("generic"),
VIDEO("video");
private final String errorType;
ErrorType(String str) {
this.errorType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.errorType;
}
}

View File

@@ -0,0 +1,9 @@
package com.iab.omid.library.applovin.adsession;
/* loaded from: classes2.dex */
public enum FriendlyObstructionPurpose {
VIDEO_CONTROLS,
CLOSE_AD,
NOT_VISIBLE,
OTHER
}

View File

@@ -0,0 +1,27 @@
package com.iab.omid.library.applovin.adsession;
import com.ironsource.v8;
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
/* loaded from: classes2.dex */
public enum ImpressionType {
DEFINED_BY_JAVASCRIPT("definedByJavaScript"),
UNSPECIFIED("unspecified"),
LOADED(v8.h.r),
BEGIN_TO_RENDER("beginToRender"),
ONE_PIXEL("onePixel"),
VIEWABLE(MRAIDCommunicatorUtil.KEY_VIEWABLE),
AUDIBLE("audible"),
OTHER("other");
private final String impressionType;
ImpressionType(String str) {
this.impressionType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.impressionType;
}
}

View File

@@ -0,0 +1,184 @@
package com.iab.omid.library.applovin.adsession;
import android.net.Uri;
import android.view.View;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import androidx.webkit.JavaScriptReplyProxy;
import androidx.webkit.ProxyConfig;
import androidx.webkit.WebMessageCompat;
import androidx.webkit.WebViewCompat;
import androidx.webkit.WebViewFeature;
import com.iab.omid.library.applovin.internal.e;
import com.iab.omid.library.applovin.internal.f;
import com.iab.omid.library.applovin.utils.d;
import com.iab.omid.library.applovin.utils.g;
import com.iab.omid.library.applovin.utils.i;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class JavaScriptSessionService {
private static String JS_MESSAGE_DATA_AD_SESSION_ID = "adSessionId";
private static String JS_MESSAGE_KEY_DATA = "data";
private static String JS_MESSAGE_KEY_METHOD = "method";
private static String JS_MESSAGE_LISTENER_JS_SESSION_SERVICE = "omidJsSessionService";
private static String JS_MESSAGE_METHOD_FINISH_SESSION = "finishSession";
private static String JS_MESSAGE_METHOD_START_SESSION = "startSession";
private static i webViewUtil = new i();
private final HashMap<String, AdSession> adSessions = new HashMap<>();
private final f friendlyObstructions = new f();
private final boolean isHtmlAdView;
private final Partner partner;
private com.iab.omid.library.applovin.weakreference.a weakAdView;
private final WebView webView;
public interface TearDownHandler {
void onTearDown(boolean z);
}
private JavaScriptSessionService(Partner partner, WebView webView, boolean z) {
g.a();
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
this.partner = partner;
this.webView = webView;
this.isHtmlAdView = z;
addWebViewListener();
}
private void addWebViewListener() {
if (!WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)) {
throw new UnsupportedOperationException("The JavaScriptSessionService cannot be supported in this WebView version.");
}
removeWebViewListener();
webViewUtil.a(this.webView, JS_MESSAGE_LISTENER_JS_SESSION_SERVICE, new HashSet(Arrays.asList(ProxyConfig.MATCH_ALL_SCHEMES)), new WebViewCompat.WebMessageListener() { // from class: com.iab.omid.library.applovin.adsession.JavaScriptSessionService.2
@Override // androidx.webkit.WebViewCompat.WebMessageListener
public void onPostMessage(WebView webView, WebMessageCompat webMessageCompat, Uri uri, boolean z, JavaScriptReplyProxy javaScriptReplyProxy) {
try {
JSONObject jSONObject = new JSONObject(webMessageCompat.getData());
String string = jSONObject.getString(JavaScriptSessionService.JS_MESSAGE_KEY_METHOD);
String string2 = jSONObject.getJSONObject(JavaScriptSessionService.JS_MESSAGE_KEY_DATA).getString(JavaScriptSessionService.JS_MESSAGE_DATA_AD_SESSION_ID);
if (string.equals(JavaScriptSessionService.JS_MESSAGE_METHOD_START_SESSION)) {
JavaScriptSessionService.this.startSession(string2);
} else if (string.equals(JavaScriptSessionService.JS_MESSAGE_METHOD_FINISH_SESSION)) {
JavaScriptSessionService.this.finishSession(string2);
} else {
d.b("Unexpected method in JavaScriptSessionService: " + string);
}
} catch (JSONException e) {
d.a("Error parsing JS message in JavaScriptSessionService.", e);
}
}
});
}
public static JavaScriptSessionService create(Partner partner, WebView webView, boolean z) {
return new JavaScriptSessionService(partner, webView, z);
}
private AdSessionConfiguration createAdSessionConfiguration() {
CreativeType creativeType = CreativeType.DEFINED_BY_JAVASCRIPT;
ImpressionType impressionType = ImpressionType.DEFINED_BY_JAVASCRIPT;
Owner owner = Owner.JAVASCRIPT;
return AdSessionConfiguration.createAdSessionConfiguration(creativeType, impressionType, owner, owner, false);
}
private AdSessionContext createAdSessionContext() {
return this.isHtmlAdView ? AdSessionContext.createHtmlAdSessionContext(this.partner, this.webView, null, null) : AdSessionContext.createJavascriptAdSessionContext(this.partner, this.webView, null, null);
}
/* JADX INFO: Access modifiers changed from: private */
public void finishSession(String str) {
AdSession adSession = this.adSessions.get(str);
if (adSession != null) {
adSession.finish();
this.adSessions.remove(str);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void removeWebViewListener() {
webViewUtil.a(this.webView, JS_MESSAGE_LISTENER_JS_SESSION_SERVICE);
}
/* JADX INFO: Access modifiers changed from: private */
public void startSession(String str) {
a aVar = new a(createAdSessionConfiguration(), createAdSessionContext(), str);
this.adSessions.put(str, aVar);
aVar.registerAdView(this.isHtmlAdView ? this.webView : getAdView());
for (e eVar : this.friendlyObstructions.a()) {
aVar.addFriendlyObstruction(eVar.c().get(), eVar.b(), eVar.a());
}
aVar.start();
}
public void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().addFriendlyObstruction(view, friendlyObstructionPurpose, str);
}
this.friendlyObstructions.a(view, friendlyObstructionPurpose, str);
}
@Nullable
public View getAdView() {
com.iab.omid.library.applovin.weakreference.a aVar = this.weakAdView;
if (aVar == null) {
return null;
}
return aVar.get();
}
public void removeAllFriendlyObstructions() {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().removeAllFriendlyObstructions();
}
this.friendlyObstructions.b();
}
public void removeFriendlyObstruction(View view) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().removeFriendlyObstruction(view);
}
this.friendlyObstructions.c(view);
}
public void setAdView(View view) {
if (this.isHtmlAdView) {
if (view != this.webView) {
throw new UnsupportedOperationException("For HTML-rendered ads, the ad view is automatically set to the web view and cannot be changed.");
}
} else {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().registerAdView(view);
}
this.weakAdView = new com.iab.omid.library.applovin.weakreference.a(view);
}
}
public void tearDown(final TearDownHandler tearDownHandler) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().finish();
}
final Timer timer = new Timer();
timer.schedule(new TimerTask() { // from class: com.iab.omid.library.applovin.adsession.JavaScriptSessionService.1
@Override // java.util.TimerTask, java.lang.Runnable
public void run() {
JavaScriptSessionService.this.removeWebViewListener();
tearDownHandler.onTearDown(true);
timer.cancel();
}
}, 1000L);
}
}

View File

@@ -0,0 +1,7 @@
package com.iab.omid.library.applovin.adsession;
/* loaded from: classes2.dex */
public enum OutputDeviceStatus {
NOT_DETECTED,
UNKNOWN
}

View File

@@ -0,0 +1,19 @@
package com.iab.omid.library.applovin.adsession;
/* loaded from: classes2.dex */
public enum Owner {
NATIVE("native"),
JAVASCRIPT("javascript"),
NONE("none");
private final String owner;
Owner(String str) {
this.owner = str;
}
@Override // java.lang.Enum
public String toString() {
return this.owner;
}
}

View File

@@ -0,0 +1,28 @@
package com.iab.omid.library.applovin.adsession;
import com.iab.omid.library.applovin.utils.g;
/* loaded from: classes2.dex */
public class Partner {
private final String name;
private final String version;
private Partner(String str, String str2) {
this.name = str;
this.version = str2;
}
public static Partner createPartner(String str, String str2) {
g.a(str, "Name is null or empty");
g.a(str2, "Version is null or empty");
return new Partner(str, str2);
}
public String getName() {
return this.name;
}
public String getVersion() {
return this.version;
}
}

View File

@@ -0,0 +1,9 @@
package com.iab.omid.library.applovin.adsession;
import android.view.View;
import java.util.List;
/* loaded from: classes2.dex */
public interface PossibleObstructionListener {
void onPossibleObstructionsDetected(String str, List<View> list);
}

View File

@@ -0,0 +1,51 @@
package com.iab.omid.library.applovin.adsession;
import com.iab.omid.library.applovin.utils.c;
import com.iab.omid.library.applovin.utils.g;
import java.net.URL;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class VerificationScriptResource {
private final URL resourceUrl;
private final String vendorKey;
private final String verificationParameters;
private VerificationScriptResource(String str, URL url, String str2) {
this.vendorKey = str;
this.resourceUrl = url;
this.verificationParameters = str2;
}
public static VerificationScriptResource createVerificationScriptResourceWithParameters(String str, URL url, String str2) {
g.a(str, "VendorKey is null or empty");
g.a(url, "ResourceURL is null");
g.a(str2, "VerificationParameters is null or empty");
return new VerificationScriptResource(str, url, str2);
}
public static VerificationScriptResource createVerificationScriptResourceWithoutParameters(URL url) {
g.a(url, "ResourceURL is null");
return new VerificationScriptResource(null, url, null);
}
public URL getResourceUrl() {
return this.resourceUrl;
}
public String getVendorKey() {
return this.vendorKey;
}
public String getVerificationParameters() {
return this.verificationParameters;
}
public JSONObject toJsonObject() {
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "vendorKey", this.vendorKey);
c.a(jSONObject, "resourceUrl", this.resourceUrl.toString());
c.a(jSONObject, "verificationParameters", this.verificationParameters);
return jSONObject;
}
}

View File

@@ -0,0 +1,233 @@
package com.iab.omid.library.applovin.adsession;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.internal.c;
import com.iab.omid.library.applovin.internal.e;
import com.iab.omid.library.applovin.internal.f;
import com.iab.omid.library.applovin.internal.i;
import com.iab.omid.library.applovin.publisher.AdSessionStatePublisher;
import com.iab.omid.library.applovin.publisher.b;
import com.iab.omid.library.applovin.utils.g;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class a extends AdSession {
private final AdSessionContext a;
private final AdSessionConfiguration b;
private final f c;
private com.iab.omid.library.applovin.weakreference.a d;
private AdSessionStatePublisher e;
private boolean f;
private boolean g;
private final String h;
private boolean i;
private boolean j;
private PossibleObstructionListener k;
public a(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext) {
this(adSessionConfiguration, adSessionContext, UUID.randomUUID().toString());
}
private void a() {
if (this.i) {
throw new IllegalStateException("Impression event can only be sent once");
}
}
private void b() {
if (this.j) {
throw new IllegalStateException("Loaded event can only be sent once");
}
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
if (this.g) {
return;
}
this.c.a(view, friendlyObstructionPurpose, str);
}
public View c() {
return this.d.get();
}
public List<e> d() {
return this.c.a();
}
public boolean e() {
return this.k != null;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void error(ErrorType errorType, String str) {
if (this.g) {
throw new IllegalStateException("AdSession is finished");
}
g.a(errorType, "Error type is null");
g.a(str, "Message is null");
getAdSessionStatePublisher().a(errorType, str);
}
public boolean f() {
return this.f && !this.g;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void finish() {
if (this.g) {
return;
}
this.d.clear();
removeAllFriendlyObstructions();
this.g = true;
getAdSessionStatePublisher().f();
c.c().b(this);
getAdSessionStatePublisher().b();
this.e = null;
this.k = null;
}
public boolean g() {
return this.g;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public String getAdSessionId() {
return this.h;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public AdSessionStatePublisher getAdSessionStatePublisher() {
return this.e;
}
public boolean h() {
return this.b.isNativeImpressionOwner();
}
public boolean i() {
return this.b.isNativeMediaEventsOwner();
}
public boolean j() {
return this.f;
}
public void k() {
a();
getAdSessionStatePublisher().g();
this.i = true;
}
public void l() {
b();
getAdSessionStatePublisher().h();
this.j = true;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void registerAdView(View view) {
if (this.g) {
return;
}
g.a(view, "AdView is null");
if (c() == view) {
return;
}
b(view);
getAdSessionStatePublisher().a();
a(view);
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void removeAllFriendlyObstructions() {
if (this.g) {
return;
}
this.c.b();
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void removeFriendlyObstruction(View view) {
if (this.g) {
return;
}
this.c.c(view);
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void setPossibleObstructionListener(PossibleObstructionListener possibleObstructionListener) {
this.k = possibleObstructionListener;
}
@Override // com.iab.omid.library.applovin.adsession.AdSession
public void start() {
if (this.f) {
return;
}
this.f = true;
c.c().c(this);
this.e.a(i.c().b());
this.e.a(com.iab.omid.library.applovin.internal.a.a().b());
this.e.a(this, this.a);
}
public a(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext, String str) {
this.c = new f();
this.f = false;
this.g = false;
this.b = adSessionConfiguration;
this.a = adSessionContext;
this.h = str;
b(null);
this.e = (adSessionContext.getAdSessionContextType() == AdSessionContextType.HTML || adSessionContext.getAdSessionContextType() == AdSessionContextType.JAVASCRIPT) ? new com.iab.omid.library.applovin.publisher.a(str, adSessionContext.getWebView()) : new b(str, adSessionContext.getInjectedResourcesMap(), adSessionContext.getOmidJsScriptContent());
this.e.i();
c.c().a(this);
this.e.a(adSessionConfiguration);
}
private void a(View view) {
Collection<a> b = c.c().b();
if (b == null || b.isEmpty()) {
return;
}
for (a aVar : b) {
if (aVar != this && aVar.c() == view) {
aVar.d.clear();
}
}
}
private void b(View view) {
this.d = new com.iab.omid.library.applovin.weakreference.a(view);
}
public void a(List<com.iab.omid.library.applovin.weakreference.a> list) {
if (e()) {
ArrayList arrayList = new ArrayList();
Iterator<com.iab.omid.library.applovin.weakreference.a> it = list.iterator();
while (it.hasNext()) {
View view = it.next().get();
if (view != null) {
arrayList.add(view);
}
}
this.k.onPossibleObstructionsDetected(this.h, arrayList);
}
}
public void a(@NonNull JSONObject jSONObject) {
b();
getAdSessionStatePublisher().a(jSONObject);
this.j = true;
}
}

View File

@@ -0,0 +1,18 @@
package com.iab.omid.library.applovin.adsession.media;
/* loaded from: classes2.dex */
public enum InteractionType {
CLICK("click"),
INVITATION_ACCEPTED("invitationAccept");
String interactionType;
InteractionType(String str) {
this.interactionType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.interactionType;
}
}

View File

@@ -0,0 +1,127 @@
package com.iab.omid.library.applovin.adsession.media;
import com.facebook.login.LoginLogger;
import com.iab.omid.library.applovin.adsession.AdSession;
import com.iab.omid.library.applovin.adsession.a;
import com.iab.omid.library.applovin.internal.i;
import com.iab.omid.library.applovin.utils.c;
import com.iab.omid.library.applovin.utils.g;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.v8;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.tapjoy.TJAdUnitConstants;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class MediaEvents {
private final a adSession;
private MediaEvents(a aVar) {
this.adSession = aVar;
}
private void confirmValidDuration(float f) {
if (f <= 0.0f) {
throw new IllegalArgumentException("Invalid Media duration");
}
}
private void confirmValidVolume(float f) {
if (f < 0.0f || f > 1.0f) {
throw new IllegalArgumentException("Invalid Media volume");
}
}
public static MediaEvents createMediaEvents(AdSession adSession) {
a aVar = (a) adSession;
g.a(adSession, "AdSession is null");
g.f(aVar);
g.c(aVar);
g.b(aVar);
g.h(aVar);
MediaEvents mediaEvents = new MediaEvents(aVar);
aVar.getAdSessionStatePublisher().a(mediaEvents);
return mediaEvents;
}
public void adUserInteraction(InteractionType interactionType) {
g.a(interactionType, "InteractionType is null");
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "interactionType", interactionType);
this.adSession.getAdSessionStatePublisher().a(TJAdUnitConstants.String.AD_USER_INTERACTION, jSONObject);
}
public void bufferFinish() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("bufferFinish");
}
public void bufferStart() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("bufferStart");
}
public void complete() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_COMPLETE);
}
public void firstQuartile() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("firstQuartile");
}
public void midpoint() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_MIDPOINT);
}
public void pause() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_PAUSE);
}
public void playerStateChange(PlayerState playerState) {
g.a(playerState, "PlayerState is null");
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "state", playerState);
this.adSession.getAdSessionStatePublisher().a("playerStateChange", jSONObject);
}
public void resume() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_RESUME);
}
public void skipped() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(LoginLogger.EVENT_PARAM_METHOD_RESULT_SKIPPED);
}
public void start(float f, float f2) {
confirmValidDuration(f);
confirmValidVolume(f2);
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, IronSourceConstants.EVENTS_DURATION, Float.valueOf(f));
c.a(jSONObject, "mediaPlayerVolume", Float.valueOf(f2));
c.a(jSONObject, v8.i.P, Float.valueOf(i.c().b()));
this.adSession.getAdSessionStatePublisher().a("start", jSONObject);
}
public void thirdQuartile() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("thirdQuartile");
}
public void volumeChange(float f) {
confirmValidVolume(f);
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "mediaPlayerVolume", Float.valueOf(f));
c.a(jSONObject, v8.i.P, Float.valueOf(i.c().b()));
this.adSession.getAdSessionStatePublisher().a("volumeChange", jSONObject);
}
}

View File

@@ -0,0 +1,24 @@
package com.iab.omid.library.applovin.adsession.media;
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
import com.vungle.ads.internal.Constants;
/* loaded from: classes2.dex */
public enum PlayerState {
MINIMIZED("minimized"),
COLLAPSED("collapsed"),
NORMAL("normal"),
EXPANDED(MRAIDCommunicatorUtil.STATES_EXPANDED),
FULLSCREEN(Constants.TEMPLATE_TYPE_FULLSCREEN);
private final String playerState;
PlayerState(String str) {
this.playerState = str;
}
@Override // java.lang.Enum
public String toString() {
return this.playerState;
}
}

View File

@@ -0,0 +1,20 @@
package com.iab.omid.library.applovin.adsession.media;
/* loaded from: classes2.dex */
public enum Position {
PREROLL("preroll"),
MIDROLL("midroll"),
POSTROLL("postroll"),
STANDALONE("standalone");
private final String position;
Position(String str) {
this.position = str;
}
@Override // java.lang.Enum
public String toString() {
return this.position;
}
}

View File

@@ -0,0 +1,63 @@
package com.iab.omid.library.applovin.adsession.media;
import com.iab.omid.library.applovin.utils.d;
import com.iab.omid.library.applovin.utils.g;
import com.ironsource.v8;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class VastProperties {
private final boolean a;
private final Float b;
private final boolean c;
private final Position d;
private VastProperties(boolean z, Float f, boolean z2, Position position) {
this.a = z;
this.b = f;
this.c = z2;
this.d = position;
}
public static VastProperties createVastPropertiesForNonSkippableMedia(boolean z, Position position) {
g.a(position, "Position is null");
return new VastProperties(false, null, z, position);
}
public static VastProperties createVastPropertiesForSkippableMedia(float f, boolean z, Position position) {
g.a(position, "Position is null");
return new VastProperties(true, Float.valueOf(f), z, position);
}
public JSONObject a() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("skippable", this.a);
if (this.a) {
jSONObject.put("skipOffset", this.b);
}
jSONObject.put("autoPlay", this.c);
jSONObject.put(v8.h.L, this.d);
} catch (JSONException e) {
d.a("VastProperties: JSON error", e);
}
return jSONObject;
}
public Position getPosition() {
return this.d;
}
public Float getSkipOffset() {
return this.b;
}
public boolean isAutoPlay() {
return this.c;
}
public boolean isSkippable() {
return this.a;
}
}

View File

@@ -0,0 +1,47 @@
package com.iab.omid.library.applovin;
import android.content.Context;
import com.iab.omid.library.applovin.internal.i;
import com.iab.omid.library.applovin.utils.e;
import com.iab.omid.library.applovin.utils.g;
/* loaded from: classes2.dex */
public class b {
private boolean a;
private void b(Context context) {
g.a(context, "Application Context cannot be null");
}
public String a() {
return "1.4.12-Applovin";
}
public void a(boolean z) {
this.a = z;
}
public boolean b() {
return this.a;
}
public void c() {
g.a();
com.iab.omid.library.applovin.internal.a.a().d();
}
public void a(Context context) {
b(context);
if (b()) {
return;
}
a(true);
i.c().a(context);
com.iab.omid.library.applovin.internal.b.g().a(context);
com.iab.omid.library.applovin.utils.a.a(context);
com.iab.omid.library.applovin.utils.c.a(context);
e.a(context);
com.iab.omid.library.applovin.internal.g.b().a(context);
com.iab.omid.library.applovin.internal.a.a().a(context);
}
}

View File

@@ -0,0 +1,101 @@
package com.iab.omid.library.applovin;
import com.iab.omid.library.applovin.utils.g;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
class c {
private static final Pattern a = Pattern.compile("<(head)( [^>]*)?>", 2);
private static final Pattern b = Pattern.compile("<(head)( [^>]*)?/>", 2);
private static final Pattern c = Pattern.compile("<(body)( [^>]*?)?>", 2);
private static final Pattern d = Pattern.compile("<(body)( [^>]*?)?/>", 2);
private static final Pattern e = Pattern.compile("<(html)( [^>]*?)?>", 2);
private static final Pattern f = Pattern.compile("<(html)( [^>]*?)?/>", 2);
private static final Pattern g = Pattern.compile("<!DOCTYPE [^>]*>", 2);
public static String a(String str, String str2) {
g.a(str, "HTML is null or empty");
int[][] a2 = a(str);
StringBuilder sb = new StringBuilder(str.length() + str2.length() + 16);
if (!b(str, sb, b, str2, a2) && !a(str, sb, a, str2, a2) && !b(str, sb, d, str2, a2) && !a(str, sb, c, str2, a2) && !b(str, sb, f, str2, a2) && !a(str, sb, e, str2, a2) && !a(str, sb, g, str2, a2)) {
return str2 + str;
}
return sb.toString();
}
public static String b(String str, String str2) {
return a(str2, "<script type=\"text/javascript\">" + str + "</script>");
}
private static boolean a(int i, int[][] iArr) {
if (iArr != null) {
for (int[] iArr2 : iArr) {
if (i >= iArr2[0] && i <= iArr2[1]) {
return true;
}
}
}
return false;
}
private static boolean b(String str, StringBuilder sb, Pattern pattern, String str2, int[][] iArr) {
Matcher matcher = pattern.matcher(str);
int i = 0;
while (matcher.find(i)) {
int start = matcher.start();
int end = matcher.end();
if (!a(start, iArr)) {
sb.append(str.substring(0, matcher.end() - 2));
sb.append(">");
sb.append(str2);
sb.append("</");
sb.append(matcher.group(1));
sb.append(">");
sb.append(str.substring(matcher.end()));
return true;
}
i = end;
}
return false;
}
private static boolean a(String str, StringBuilder sb, Pattern pattern, String str2, int[][] iArr) {
Matcher matcher = pattern.matcher(str);
int i = 0;
while (matcher.find(i)) {
int start = matcher.start();
int end = matcher.end();
if (!a(start, iArr)) {
sb.append(str.substring(0, matcher.end()));
sb.append(str2);
sb.append(str.substring(matcher.end()));
return true;
}
i = end;
}
return false;
}
private static int[][] a(String str) {
ArrayList arrayList = new ArrayList();
int length = str.length();
int i = 0;
while (i < length) {
int indexOf = str.indexOf("<!--", i);
if (indexOf >= 0) {
int indexOf2 = str.indexOf("-->", indexOf);
if (indexOf2 >= 0) {
arrayList.add(new int[]{indexOf, indexOf2});
i = indexOf2 + 3;
} else {
arrayList.add(new int[]{indexOf, length});
}
}
i = length;
}
return (int[][]) arrayList.toArray((int[][]) Array.newInstance((Class<?>) Integer.TYPE, 0, 2));
}
}

View File

@@ -0,0 +1,15 @@
package com.iab.omid.library.applovin.devicevolume;
/* loaded from: classes2.dex */
public class a {
public float a(int i, int i2) {
if (i2 <= 0 || i <= 0) {
return 0.0f;
}
float f = i / i2;
if (f > 1.0f) {
return 1.0f;
}
return f;
}
}

View File

@@ -0,0 +1,8 @@
package com.iab.omid.library.applovin.devicevolume;
/* loaded from: classes2.dex */
public class b {
public a a() {
return new a();
}
}

View File

@@ -0,0 +1,6 @@
package com.iab.omid.library.applovin.devicevolume;
/* loaded from: classes2.dex */
public interface c {
void a(float f);
}

View File

@@ -0,0 +1,56 @@
package com.iab.omid.library.applovin.devicevolume;
import android.content.Context;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.os.Handler;
import android.provider.Settings;
/* loaded from: classes2.dex */
public final class d extends ContentObserver {
private final Context a;
private final AudioManager b;
private final a c;
private final c d;
private float e;
public d(Handler handler, Context context, a aVar, c cVar) {
super(handler);
this.a = context;
this.b = (AudioManager) context.getSystemService("audio");
this.c = aVar;
this.d = cVar;
}
private float a() {
return this.c.a(this.b.getStreamVolume(3), this.b.getStreamMaxVolume(3));
}
private boolean a(float f) {
return f != this.e;
}
private void b() {
this.d.a(this.e);
}
public void c() {
this.e = a();
b();
this.a.getContentResolver().registerContentObserver(Settings.System.CONTENT_URI, true, this);
}
public void d() {
this.a.getContentResolver().unregisterContentObserver(this);
}
@Override // android.database.ContentObserver
public void onChange(boolean z) {
super.onChange(z);
float a = a();
if (a(a)) {
this.e = a;
b();
}
}
}

View File

@@ -0,0 +1,11 @@
package com.iab.omid.library.applovin.devicevolume;
import android.content.Context;
import android.os.Handler;
/* loaded from: classes2.dex */
public class e {
public d a(Handler handler, Context context, a aVar, c cVar) {
return new d(handler, context, aVar, cVar);
}
}

View File

@@ -0,0 +1,71 @@
package com.iab.omid.library.applovin.internal;
import android.content.Context;
import androidx.annotation.NonNull;
import com.iab.omid.library.applovin.internal.d;
import java.util.Date;
import java.util.Iterator;
/* loaded from: classes2.dex */
public class a implements d.a {
private static a f = new a(new d());
protected com.iab.omid.library.applovin.utils.f a = new com.iab.omid.library.applovin.utils.f();
private Date b;
private boolean c;
private d d;
private boolean e;
private a(d dVar) {
this.d = dVar;
}
public static a a() {
return f;
}
private void c() {
if (!this.c || this.b == null) {
return;
}
Iterator<com.iab.omid.library.applovin.adsession.a> it = c.c().a().iterator();
while (it.hasNext()) {
it.next().getAdSessionStatePublisher().a(b());
}
}
public Date b() {
Date date = this.b;
if (date != null) {
return (Date) date.clone();
}
return null;
}
public void d() {
Date a = this.a.a();
Date date = this.b;
if (date == null || a.after(date)) {
this.b = a;
c();
}
}
public void a(@NonNull Context context) {
if (this.c) {
return;
}
this.d.a(context);
this.d.a(this);
this.d.e();
this.e = this.d.c();
this.c = true;
}
@Override // com.iab.omid.library.applovin.internal.d.a
public void a(boolean z) {
if (!this.e && z) {
d();
}
this.e = z;
}
}

View File

@@ -0,0 +1,39 @@
package com.iab.omid.library.applovin.internal;
import android.annotation.SuppressLint;
import android.view.View;
import java.util.Iterator;
/* loaded from: classes2.dex */
public class b extends d {
@SuppressLint({"StaticFieldLeak"})
private static b d = new b();
private b() {
}
public static b g() {
return d;
}
@Override // com.iab.omid.library.applovin.internal.d
public void b(boolean z) {
Iterator<com.iab.omid.library.applovin.adsession.a> it = c.c().b().iterator();
while (it.hasNext()) {
it.next().getAdSessionStatePublisher().a(z);
}
}
@Override // com.iab.omid.library.applovin.internal.d
public boolean d() {
Iterator<com.iab.omid.library.applovin.adsession.a> it = c.c().a().iterator();
while (it.hasNext()) {
View c = it.next().c();
if (c != null && c.hasWindowFocus()) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,54 @@
package com.iab.omid.library.applovin.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/* loaded from: classes2.dex */
public class c {
private static c c = new c();
private final ArrayList<com.iab.omid.library.applovin.adsession.a> a = new ArrayList<>();
private final ArrayList<com.iab.omid.library.applovin.adsession.a> b = new ArrayList<>();
private c() {
}
public static c c() {
return c;
}
public Collection<com.iab.omid.library.applovin.adsession.a> a() {
return Collections.unmodifiableCollection(this.b);
}
public Collection<com.iab.omid.library.applovin.adsession.a> b() {
return Collections.unmodifiableCollection(this.a);
}
public boolean d() {
return this.b.size() > 0;
}
public void a(com.iab.omid.library.applovin.adsession.a aVar) {
this.a.add(aVar);
}
public void b(com.iab.omid.library.applovin.adsession.a aVar) {
boolean d = d();
this.a.remove(aVar);
this.b.remove(aVar);
if (!d || d()) {
return;
}
i.c().e();
}
public void c(com.iab.omid.library.applovin.adsession.a aVar) {
boolean d = d();
this.b.add(aVar);
if (d) {
return;
}
i.c().d();
}
}

View File

@@ -0,0 +1,107 @@
package com.iab.omid.library.applovin.internal;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
/* loaded from: classes2.dex */
public class d implements Application.ActivityLifecycleCallbacks {
private boolean a;
protected boolean b;
private a c;
public interface a {
void a(boolean z);
}
public void a(@NonNull Context context) {
if (context instanceof Application) {
((Application) context).registerActivityLifecycleCallbacks(this);
}
}
public void a(a aVar) {
this.c = aVar;
}
@VisibleForTesting
public ActivityManager.RunningAppProcessInfo b() {
ActivityManager.RunningAppProcessInfo runningAppProcessInfo = new ActivityManager.RunningAppProcessInfo();
ActivityManager.getMyMemoryState(runningAppProcessInfo);
return runningAppProcessInfo;
}
public void b(boolean z) {
}
public boolean c() {
return this.b;
}
public boolean d() {
return false;
}
public void e() {
this.a = true;
boolean a2 = a();
this.b = a2;
b(a2);
}
public void f() {
this.a = false;
this.c = null;
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
a(true);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
a(a());
}
private void a(boolean z) {
if (this.b != z) {
this.b = z;
if (this.a) {
b(z);
a aVar = this.c;
if (aVar != null) {
aVar.a(z);
}
}
}
}
private boolean a() {
return b().importance == 100 || d();
}
}

View File

@@ -0,0 +1,36 @@
package com.iab.omid.library.applovin.internal;
import android.view.View;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
/* loaded from: classes2.dex */
public class e {
private final com.iab.omid.library.applovin.weakreference.a a;
private final String b;
private final FriendlyObstructionPurpose c;
private final String d;
public e(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
this.a = new com.iab.omid.library.applovin.weakreference.a(view);
this.b = view.getClass().getCanonicalName();
this.c = friendlyObstructionPurpose;
this.d = str;
}
public String a() {
return this.d;
}
public FriendlyObstructionPurpose b() {
return this.c;
}
public com.iab.omid.library.applovin.weakreference.a c() {
return this.a;
}
public String d() {
return this.b;
}
}

View File

@@ -0,0 +1,64 @@
package com.iab.omid.library.applovin.internal;
import android.view.View;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public class f {
private static final Pattern b = Pattern.compile("^[a-zA-Z0-9 ]+$");
private final List<e> a = new ArrayList();
private e b(View view) {
for (e eVar : this.a) {
if (eVar.c().get() == view) {
return eVar;
}
}
return null;
}
public List<e> a() {
return this.a;
}
public void c(View view) {
a(view);
e b2 = b(view);
if (b2 != null) {
this.a.remove(b2);
}
}
private void a(View view) {
if (view == null) {
throw new IllegalArgumentException("FriendlyObstruction is null");
}
}
public void b() {
this.a.clear();
}
public void a(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
a(view);
a(str);
if (b(view) == null) {
this.a.add(new e(view, friendlyObstructionPurpose, str));
}
}
private void a(String str) {
if (str != null) {
if (str.length() > 50) {
throw new IllegalArgumentException("FriendlyObstruction has detailed reason over 50 characters in length");
}
if (!b.matcher(str).matches()) {
throw new IllegalArgumentException("FriendlyObstruction has detailed reason that contains characters not in [a-z][A-Z][0-9] or space");
}
}
}
}

View File

@@ -0,0 +1,27 @@
package com.iab.omid.library.applovin.internal;
import android.annotation.SuppressLint;
import android.content.Context;
/* loaded from: classes2.dex */
public class g {
@SuppressLint({"StaticFieldLeak"})
private static g b = new g();
private Context a;
private g() {
}
public static g b() {
return b;
}
public Context a() {
return this.a;
}
public void a(Context context) {
this.a = context != null ? context.getApplicationContext() : null;
}
}

View File

@@ -0,0 +1,157 @@
package com.iab.omid.library.applovin.internal;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.iab.omid.library.applovin.adsession.ErrorType;
import com.ironsource.v8;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class h {
private static h a = new h();
public class a implements Runnable {
final /* synthetic */ WebView a;
final /* synthetic */ String b;
public a(WebView webView, String str) {
this.a = webView;
this.b = str;
}
@Override // java.lang.Runnable
public void run() {
h.this.c(this.a, this.b);
}
}
private h() {
}
public static final h a() {
return a;
}
public void b(WebView webView, String str) {
a(webView, "publishImpressionEvent", str);
}
public void c(WebView webView, String str, String str2) {
if (str == null || TextUtils.isEmpty(str2)) {
return;
}
c(webView, "(function() {this.omidVerificationProperties = this.omidVerificationProperties || {};Object.defineProperty(this.omidVerificationProperties, 'injectionId', {get: function() {var currentScript = document && document.currentScript;return currentScript && currentScript.getAttribute('data-injection-id');}, configurable: true});var script = document.createElement('script');script.setAttribute(\"type\",\"text/javascript\");script.setAttribute(\"src\",\"%SCRIPT_SRC%\");script.setAttribute(\"data-injection-id\",\"%INJECTION_ID%\");document.body.appendChild(script);})();".replace("%SCRIPT_SRC%", str).replace("%INJECTION_ID%", str2));
}
public void a(WebView webView, String str) {
a(webView, "finishSession", str);
}
public void b(WebView webView, String str, String str2) {
a(webView, "setState", str2, str);
}
public boolean c(WebView webView, String str) {
if (webView == null || TextUtils.isEmpty(str)) {
return false;
}
try {
webView.evaluateJavascript(str, null);
return true;
} catch (IllegalStateException unused) {
webView.loadUrl("javascript: " + str);
return true;
}
}
public void a(WebView webView, String str, float f) {
a(webView, "setDeviceVolume", Float.valueOf(f), str);
}
public void b(WebView webView, String str, @Nullable JSONObject jSONObject) {
a(webView, "publishLoadedEvent", jSONObject, str);
}
public void a(WebView webView, String str, ErrorType errorType, String str2) {
a(webView, "error", errorType.toString(), str2, str);
}
public void a(WebView webView, String str, String str2) {
a(webView, "setNativeViewHierarchy", str2, str);
}
public void a(WebView webView, String str, String str2, @Nullable JSONObject jSONObject) {
a(webView, "publishMediaEvent", str2, jSONObject, str);
}
public void a(WebView webView, String str, JSONObject jSONObject) {
a(webView, v8.a.e, jSONObject, str);
}
public void a(WebView webView, String str, JSONObject jSONObject, JSONObject jSONObject2, JSONObject jSONObject3) {
a(webView, "startSession", str, jSONObject, jSONObject2, jSONObject3);
}
@VisibleForTesting
public void a(WebView webView, String str, Object... objArr) {
if (webView == null) {
com.iab.omid.library.applovin.utils.d.a("The WebView is null for " + str);
return;
}
StringBuilder sb = new StringBuilder(128);
sb.append("if(window.omidBridge!==undefined){omidBridge.");
sb.append(str);
sb.append("(");
a(sb, objArr);
sb.append(")}");
a(webView, sb);
}
@VisibleForTesting
public void a(WebView webView, StringBuilder sb) {
String sb2 = sb.toString();
Handler handler = webView.getHandler();
if (handler == null || Looper.myLooper() == handler.getLooper()) {
c(webView, sb2);
} else {
handler.post(new a(webView, sb2));
}
}
public void a(WebView webView, @NonNull JSONObject jSONObject) {
a(webView, "setLastActivity", jSONObject);
}
@VisibleForTesting
public void a(StringBuilder sb, Object[] objArr) {
String obj;
if (objArr == null || objArr.length <= 0) {
return;
}
for (Object obj2 : objArr) {
if (obj2 == null) {
obj = "null";
} else {
if (obj2 instanceof String) {
obj = obj2.toString();
if (!obj.startsWith("{")) {
sb.append('\"');
sb.append(obj);
sb.append('\"');
}
} else {
sb.append(obj2);
}
sb.append(",");
}
sb.append(obj);
sb.append(",");
}
sb.setLength(sb.length() - 1);
}
}

View File

@@ -0,0 +1,75 @@
package com.iab.omid.library.applovin.internal;
import android.content.Context;
import android.os.Handler;
import com.iab.omid.library.applovin.internal.d;
import com.iab.omid.library.applovin.walking.TreeWalker;
import java.util.Iterator;
/* loaded from: classes2.dex */
public class i implements d.a, com.iab.omid.library.applovin.devicevolume.c {
private static i f;
private float a = 0.0f;
private final com.iab.omid.library.applovin.devicevolume.e b;
private final com.iab.omid.library.applovin.devicevolume.b c;
private com.iab.omid.library.applovin.devicevolume.d d;
private c e;
public i(com.iab.omid.library.applovin.devicevolume.e eVar, com.iab.omid.library.applovin.devicevolume.b bVar) {
this.b = eVar;
this.c = bVar;
}
private c a() {
if (this.e == null) {
this.e = c.c();
}
return this.e;
}
public static i c() {
if (f == null) {
f = new i(new com.iab.omid.library.applovin.devicevolume.e(), new com.iab.omid.library.applovin.devicevolume.b());
}
return f;
}
public float b() {
return this.a;
}
public void d() {
b.g().a(this);
b.g().e();
TreeWalker.getInstance().h();
this.d.c();
}
public void e() {
TreeWalker.getInstance().j();
b.g().f();
this.d.d();
}
@Override // com.iab.omid.library.applovin.devicevolume.c
public void a(float f2) {
this.a = f2;
Iterator<com.iab.omid.library.applovin.adsession.a> it = a().a().iterator();
while (it.hasNext()) {
it.next().getAdSessionStatePublisher().a(f2);
}
}
public void a(Context context) {
this.d = this.b.a(new Handler(), context, this.c.a(), this);
}
@Override // com.iab.omid.library.applovin.internal.d.a
public void a(boolean z) {
if (z) {
TreeWalker.getInstance().h();
} else {
TreeWalker.getInstance().g();
}
}
}

View File

@@ -0,0 +1,17 @@
package com.iab.omid.library.applovin.processor;
import android.view.View;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public interface a {
/* renamed from: com.iab.omid.library.applovin.processor.a$a, reason: collision with other inner class name */
public interface InterfaceC0129a {
void a(View view, a aVar, JSONObject jSONObject, boolean z);
}
JSONObject a(View view);
void a(View view, JSONObject jSONObject, InterfaceC0129a interfaceC0129a, boolean z, boolean z2);
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.applovin.processor;
/* loaded from: classes2.dex */
public class b {
private final d a;
private final c b;
public b() {
d dVar = new d();
this.a = dVar;
this.b = new c(dVar);
}
public a a() {
return this.b;
}
public a b() {
return this.a;
}
}

View File

@@ -0,0 +1,61 @@
package com.iab.omid.library.applovin.processor;
import android.view.View;
import androidx.annotation.NonNull;
import com.iab.omid.library.applovin.processor.a;
import com.iab.omid.library.applovin.utils.e;
import com.iab.omid.library.applovin.utils.h;
import java.util.ArrayList;
import java.util.Collection;
import java.util.IdentityHashMap;
import java.util.Iterator;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class c implements a {
private final a a;
public c(a aVar) {
this.a = aVar;
}
@NonNull
public ArrayList<View> a() {
View rootView;
ArrayList<View> arrayList = new ArrayList<>();
com.iab.omid.library.applovin.internal.c c = com.iab.omid.library.applovin.internal.c.c();
if (c != null) {
Collection<com.iab.omid.library.applovin.adsession.a> a = c.a();
IdentityHashMap identityHashMap = new IdentityHashMap((a.size() * 2) + 3);
Iterator<com.iab.omid.library.applovin.adsession.a> it = a.iterator();
while (it.hasNext()) {
View c2 = it.next().c();
if (c2 != null && h.e(c2) && (rootView = c2.getRootView()) != null && !identityHashMap.containsKey(rootView)) {
identityHashMap.put(rootView, rootView);
float c3 = h.c(rootView);
int size = arrayList.size();
while (size > 0 && h.c(arrayList.get(size - 1)) > c3) {
size--;
}
arrayList.add(size, rootView);
}
}
}
return arrayList;
}
@Override // com.iab.omid.library.applovin.processor.a
public JSONObject a(View view) {
JSONObject a = com.iab.omid.library.applovin.utils.c.a(0, 0, 0, 0);
com.iab.omid.library.applovin.utils.c.a(a, e.a());
return a;
}
@Override // com.iab.omid.library.applovin.processor.a
public void a(View view, JSONObject jSONObject, a.InterfaceC0129a interfaceC0129a, boolean z, boolean z2) {
Iterator<View> it = a().iterator();
while (it.hasNext()) {
interfaceC0129a.a(it.next(), this.a, jSONObject, z2);
}
}
}

View File

@@ -0,0 +1,69 @@
package com.iab.omid.library.applovin.processor;
import android.annotation.TargetApi;
import android.view.View;
import android.view.ViewGroup;
import com.iab.omid.library.applovin.processor.a;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class d implements a {
private final int[] a = new int[2];
@TargetApi(21)
private void b(ViewGroup viewGroup, JSONObject jSONObject, a.InterfaceC0129a interfaceC0129a, boolean z) {
HashMap hashMap = new HashMap();
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View childAt = viewGroup.getChildAt(i);
ArrayList arrayList = (ArrayList) hashMap.get(Float.valueOf(childAt.getZ()));
if (arrayList == null) {
arrayList = new ArrayList();
hashMap.put(Float.valueOf(childAt.getZ()), arrayList);
}
arrayList.add(childAt);
}
ArrayList arrayList2 = new ArrayList(hashMap.keySet());
Collections.sort(arrayList2);
Iterator it = arrayList2.iterator();
while (it.hasNext()) {
Iterator it2 = ((ArrayList) hashMap.get((Float) it.next())).iterator();
while (it2.hasNext()) {
interfaceC0129a.a((View) it2.next(), this, jSONObject, z);
}
}
}
@Override // com.iab.omid.library.applovin.processor.a
public JSONObject a(View view) {
if (view == null) {
return com.iab.omid.library.applovin.utils.c.a(0, 0, 0, 0);
}
int width = view.getWidth();
int height = view.getHeight();
view.getLocationOnScreen(this.a);
int[] iArr = this.a;
return com.iab.omid.library.applovin.utils.c.a(iArr[0], iArr[1], width, height);
}
@Override // com.iab.omid.library.applovin.processor.a
public void a(View view, JSONObject jSONObject, a.InterfaceC0129a interfaceC0129a, boolean z, boolean z2) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
if (z) {
b(viewGroup, jSONObject, interfaceC0129a, z2);
} else {
a(viewGroup, jSONObject, interfaceC0129a, z2);
}
}
}
private void a(ViewGroup viewGroup, JSONObject jSONObject, a.InterfaceC0129a interfaceC0129a, boolean z) {
for (int i = 0; i < viewGroup.getChildCount(); i++) {
interfaceC0129a.a(viewGroup.getChildAt(i), this, jSONObject, z);
}
}
}

View File

@@ -0,0 +1,187 @@
package com.iab.omid.library.applovin.publisher;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.adsession.AdEvents;
import com.iab.omid.library.applovin.adsession.AdSessionConfiguration;
import com.iab.omid.library.applovin.adsession.AdSessionContext;
import com.iab.omid.library.applovin.adsession.ErrorType;
import com.iab.omid.library.applovin.adsession.VerificationScriptResource;
import com.iab.omid.library.applovin.adsession.media.MediaEvents;
import com.iab.omid.library.applovin.internal.g;
import com.iab.omid.library.applovin.internal.h;
import com.iab.omid.library.applovin.utils.c;
import com.iab.omid.library.applovin.utils.f;
import com.mbridge.msdk.MBridgeConstans;
import com.unity3d.ads.core.domain.HandleInvocationsFromAdViewer;
import java.util.Date;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public abstract class AdSessionStatePublisher {
private String a;
private com.iab.omid.library.applovin.weakreference.b b;
private AdEvents c;
private MediaEvents d;
private a e;
private long f;
public enum a {
AD_STATE_IDLE,
AD_STATE_VISIBLE,
AD_STATE_NOTVISIBLE
}
public AdSessionStatePublisher(String str) {
a();
this.a = str;
this.b = new com.iab.omid.library.applovin.weakreference.b(null);
}
public void a() {
this.f = f.b();
this.e = a.AD_STATE_IDLE;
}
public void a(AdEvents adEvents) {
this.c = adEvents;
}
public void a(MediaEvents mediaEvents) {
this.d = mediaEvents;
}
public void b() {
this.b.clear();
}
public AdEvents c() {
return this.c;
}
public MediaEvents d() {
return this.d;
}
public boolean e() {
return this.b.get() != null;
}
public void f() {
h.a().a(getWebView(), this.a);
}
public void g() {
h.a().b(getWebView(), this.a);
}
public WebView getWebView() {
return this.b.get();
}
public void h() {
a((JSONObject) null);
}
public void i() {
}
public void a(float f) {
h.a().a(getWebView(), this.a, f);
}
public void b(String str, long j) {
if (j >= this.f) {
this.e = a.AD_STATE_VISIBLE;
h.a().a(getWebView(), this.a, str);
}
}
public void a(WebView webView) {
this.b = new com.iab.omid.library.applovin.weakreference.b(webView);
}
public void a(AdSessionConfiguration adSessionConfiguration) {
h.a().a(getWebView(), this.a, adSessionConfiguration.toJsonObject());
}
public void a(ErrorType errorType, String str) {
h.a().a(getWebView(), this.a, errorType, str);
}
public void a(com.iab.omid.library.applovin.adsession.a aVar, AdSessionContext adSessionContext) {
a(aVar, adSessionContext, null);
}
public void a(com.iab.omid.library.applovin.adsession.a aVar, AdSessionContext adSessionContext, JSONObject jSONObject) {
String adSessionId = aVar.getAdSessionId();
JSONObject jSONObject2 = new JSONObject();
c.a(jSONObject2, "environment", MBridgeConstans.DYNAMIC_VIEW_WX_APP);
c.a(jSONObject2, "adSessionType", adSessionContext.getAdSessionContextType());
c.a(jSONObject2, "deviceInfo", com.iab.omid.library.applovin.utils.b.d());
c.a(jSONObject2, "deviceCategory", com.iab.omid.library.applovin.utils.a.a().toString());
JSONArray jSONArray = new JSONArray();
jSONArray.put("clid");
jSONArray.put("vlid");
c.a(jSONObject2, "supports", jSONArray);
JSONObject jSONObject3 = new JSONObject();
c.a(jSONObject3, HandleInvocationsFromAdViewer.KEY_OM_PARTNER, adSessionContext.getPartner().getName());
c.a(jSONObject3, HandleInvocationsFromAdViewer.KEY_OM_PARTNER_VERSION, adSessionContext.getPartner().getVersion());
c.a(jSONObject2, "omidNativeInfo", jSONObject3);
JSONObject jSONObject4 = new JSONObject();
c.a(jSONObject4, "libraryVersion", "1.4.12-Applovin");
c.a(jSONObject4, "appId", g.b().a().getApplicationContext().getPackageName());
c.a(jSONObject2, MBridgeConstans.DYNAMIC_VIEW_WX_APP, jSONObject4);
if (adSessionContext.getContentUrl() != null) {
c.a(jSONObject2, "contentUrl", adSessionContext.getContentUrl());
}
if (adSessionContext.getCustomReferenceData() != null) {
c.a(jSONObject2, "customReferenceData", adSessionContext.getCustomReferenceData());
}
JSONObject jSONObject5 = new JSONObject();
for (VerificationScriptResource verificationScriptResource : adSessionContext.getVerificationScriptResources()) {
c.a(jSONObject5, verificationScriptResource.getVendorKey(), verificationScriptResource.getVerificationParameters());
}
h.a().a(getWebView(), adSessionId, jSONObject2, jSONObject5, jSONObject);
}
public void a(String str) {
a(str, (JSONObject) null);
}
public void a(String str, long j) {
if (j >= this.f) {
a aVar = this.e;
a aVar2 = a.AD_STATE_NOTVISIBLE;
if (aVar != aVar2) {
this.e = aVar2;
h.a().a(getWebView(), this.a, str);
}
}
}
public void a(String str, @Nullable JSONObject jSONObject) {
h.a().a(getWebView(), this.a, str, jSONObject);
}
public void a(@NonNull Date date) {
if (date == null) {
return;
}
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "timestamp", Long.valueOf(date.getTime()));
h.a().a(getWebView(), jSONObject);
}
public void a(@Nullable JSONObject jSONObject) {
h.a().b(getWebView(), this.a, jSONObject);
}
public void a(boolean z) {
if (e()) {
h.a().b(getWebView(), this.a, z ? "foregrounded" : "backgrounded");
}
}
}

View File

@@ -0,0 +1,16 @@
package com.iab.omid.library.applovin.publisher;
import android.annotation.SuppressLint;
import android.webkit.WebView;
/* loaded from: classes2.dex */
public class a extends AdSessionStatePublisher {
@SuppressLint({"SetJavaScriptEnabled"})
public a(String str, WebView webView) {
super(str);
if (webView != null && !webView.getSettings().getJavaScriptEnabled()) {
webView.getSettings().setJavaScriptEnabled(true);
}
a(webView);
}
}

View File

@@ -0,0 +1,101 @@
package com.iab.omid.library.applovin.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.applovin.adsession.AdSessionContext;
import com.iab.omid.library.applovin.adsession.VerificationScriptResource;
import com.iab.omid.library.applovin.internal.g;
import com.iab.omid.library.applovin.internal.h;
import com.iab.omid.library.applovin.utils.c;
import com.iab.omid.library.applovin.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.applovin.publisher.b$b, reason: collision with other inner class name */
public class RunnableC0130b implements Runnable {
private final WebView a;
public RunnableC0130b() {
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.applovin.publisher.AdSessionStatePublisher
public void b() {
super.b();
new Handler().postDelayed(new RunnableC0130b(), 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.applovin.publisher.AdSessionStatePublisher
public void i() {
super.i();
j();
}
@SuppressLint({"SetJavaScriptEnabled"})
public void j() {
WebView webView = new WebView(g.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);
h.a().c(this.g, this.j);
for (String str : this.i.keySet()) {
h.a().c(this.g, this.i.get(str).getResourceUrl().toExternalForm(), str);
}
this.h = Long.valueOf(f.b());
}
@Override // com.iab.omid.library.applovin.publisher.AdSessionStatePublisher
public void a(com.iab.omid.library.applovin.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);
}
}

View File

@@ -0,0 +1,25 @@
package com.iab.omid.library.applovin.utils;
import android.app.UiModeManager;
import android.content.Context;
import com.iab.omid.library.applovin.adsession.DeviceCategory;
/* loaded from: classes2.dex */
public final class a {
private static UiModeManager a;
public static DeviceCategory a() {
UiModeManager uiModeManager = a;
if (uiModeManager == null) {
return DeviceCategory.OTHER;
}
int currentModeType = uiModeManager.getCurrentModeType();
return currentModeType != 1 ? currentModeType != 4 ? DeviceCategory.OTHER : DeviceCategory.CTV : DeviceCategory.MOBILE;
}
public static void a(Context context) {
if (context != null) {
a = (UiModeManager) context.getSystemService("uimode");
}
}
}

View File

@@ -0,0 +1,30 @@
package com.iab.omid.library.applovin.utils;
import android.os.Build;
import com.glu.plugins.gluanalytics.AnalyticsData;
import com.ironsource.ad;
import com.ironsource.v8;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class b {
public static String a() {
return Build.MANUFACTURER + "; " + Build.MODEL;
}
public static String b() {
return v8.d;
}
public static String c() {
return Integer.toString(Build.VERSION.SDK_INT);
}
public static JSONObject d() {
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "deviceType", a());
c.a(jSONObject, AnalyticsData.S_OS_VERSION, c());
c.a(jSONObject, ad.y, b());
return jSONObject;
}
}

View File

@@ -0,0 +1,240 @@
package com.iab.omid.library.applovin.utils;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Point;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.iab.omid.library.applovin.adsession.OutputDeviceStatus;
import com.iab.omid.library.applovin.walking.a;
import com.ironsource.v8;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class c {
private static WindowManager a;
private static String[] b = {"x", "y", "width", "height"};
static float c = Resources.getSystem().getDisplayMetrics().density;
public static /* synthetic */ class a {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[OutputDeviceStatus.values().length];
a = iArr;
try {
iArr[OutputDeviceStatus.NOT_DETECTED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
}
}
public static class b {
final float a;
final float b;
public b(float f, float f2) {
this.a = f;
this.b = f2;
}
}
public static float a(int i) {
return i / c;
}
public static void b(JSONObject jSONObject) {
b a2 = a(jSONObject);
try {
jSONObject.put("width", a2.a);
jSONObject.put("height", a2.b);
} catch (JSONException e) {
e.printStackTrace();
}
}
private static boolean c(JSONObject jSONObject, JSONObject jSONObject2) {
JSONArray optJSONArray = jSONObject.optJSONArray("isFriendlyObstructionFor");
JSONArray optJSONArray2 = jSONObject2.optJSONArray("isFriendlyObstructionFor");
if (optJSONArray == null && optJSONArray2 == null) {
return true;
}
if (!a(optJSONArray, optJSONArray2)) {
return false;
}
for (int i = 0; i < optJSONArray.length(); i++) {
if (!optJSONArray.optString(i, "").equals(optJSONArray2.optString(i, ""))) {
return false;
}
}
return true;
}
private static boolean d(JSONObject jSONObject, JSONObject jSONObject2) {
return Boolean.valueOf(jSONObject.optBoolean("hasWindowFocus")).equals(Boolean.valueOf(jSONObject2.optBoolean("hasWindowFocus")));
}
private static boolean e(JSONObject jSONObject, JSONObject jSONObject2) {
return Boolean.valueOf(jSONObject.optBoolean("noOutputDevice")).equals(Boolean.valueOf(jSONObject2.optBoolean("noOutputDevice")));
}
private static boolean f(JSONObject jSONObject, JSONObject jSONObject2) {
for (String str : b) {
if (jSONObject.optDouble(str) != jSONObject2.optDouble(str)) {
return false;
}
}
return true;
}
private static boolean g(JSONObject jSONObject, JSONObject jSONObject2) {
return jSONObject.optString("adSessionId", "").equals(jSONObject2.optString("adSessionId", ""));
}
public static boolean h(@NonNull JSONObject jSONObject, @Nullable JSONObject jSONObject2) {
if (jSONObject == null && jSONObject2 == null) {
return true;
}
if (jSONObject == null || jSONObject2 == null) {
return false;
}
return f(jSONObject, jSONObject2) && g(jSONObject, jSONObject2) && e(jSONObject, jSONObject2) && d(jSONObject, jSONObject2) && c(jSONObject, jSONObject2) && b(jSONObject, jSONObject2);
}
private static b a(JSONObject jSONObject) {
float f;
float f2;
if (a != null) {
Point point = new Point(0, 0);
a.getDefaultDisplay().getRealSize(point);
f = a(point.x);
f2 = a(point.y);
} else {
f = 0.0f;
f2 = 0.0f;
}
return new b(f, f2);
}
public static void b(JSONObject jSONObject, String str) {
try {
jSONObject.put("notVisibleReason", str);
} catch (JSONException e) {
d.a("Error with setting not visible reason", e);
}
}
public static JSONObject a(int i, int i2, int i3, int i4) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("x", a(i));
jSONObject.put("y", a(i2));
jSONObject.put("width", a(i3));
jSONObject.put("height", a(i4));
} catch (JSONException e) {
d.a("Error with creating viewStateObject", e);
}
return jSONObject;
}
private static boolean b(JSONObject jSONObject, JSONObject jSONObject2) {
JSONArray optJSONArray = jSONObject.optJSONArray("childViews");
JSONArray optJSONArray2 = jSONObject2.optJSONArray("childViews");
if (optJSONArray == null && optJSONArray2 == null) {
return true;
}
if (!a(optJSONArray, optJSONArray2)) {
return false;
}
for (int i = 0; i < optJSONArray.length(); i++) {
if (!h(optJSONArray.optJSONObject(i), optJSONArray2.optJSONObject(i))) {
return false;
}
}
return true;
}
public static void a(Context context) {
if (context != null) {
c = context.getResources().getDisplayMetrics().density;
a = (WindowManager) context.getSystemService("window");
}
}
public static void a(JSONObject jSONObject, OutputDeviceStatus outputDeviceStatus) {
try {
jSONObject.put("noOutputDevice", a(outputDeviceStatus));
} catch (JSONException e) {
d.a("Error with setting output device status", e);
}
}
public static void a(JSONObject jSONObject, a.C0131a c0131a) {
com.iab.omid.library.applovin.internal.e a2 = c0131a.a();
JSONArray jSONArray = new JSONArray();
Iterator<String> it = c0131a.b().iterator();
while (it.hasNext()) {
jSONArray.put(it.next());
}
try {
jSONObject.put("isFriendlyObstructionFor", jSONArray);
jSONObject.put("friendlyObstructionClass", a2.d());
jSONObject.put("friendlyObstructionPurpose", a2.b());
jSONObject.put("friendlyObstructionReason", a2.a());
} catch (JSONException e) {
d.a("Error with setting friendly obstruction", e);
}
}
public static void a(JSONObject jSONObject, Boolean bool) {
try {
jSONObject.put("hasWindowFocus", bool);
} catch (JSONException e) {
d.a("Error with setting has window focus", e);
}
}
public static void a(JSONObject jSONObject, String str) {
try {
jSONObject.put("adSessionId", str);
} catch (JSONException e) {
d.a("Error with setting ad session id", e);
}
}
public static void a(JSONObject jSONObject, String str, Object obj) {
try {
jSONObject.put(str, obj);
} catch (NullPointerException | JSONException e) {
d.a("JSONException during JSONObject.put for name [" + str + v8.i.e, e);
}
}
public static void a(JSONObject jSONObject, JSONObject jSONObject2) {
try {
JSONArray optJSONArray = jSONObject.optJSONArray("childViews");
if (optJSONArray == null) {
optJSONArray = new JSONArray();
jSONObject.put("childViews", optJSONArray);
}
optJSONArray.put(jSONObject2);
} catch (JSONException e) {
e.printStackTrace();
}
}
private static boolean a(OutputDeviceStatus outputDeviceStatus) {
return a.a[outputDeviceStatus.ordinal()] == 1;
}
private static boolean a(JSONArray jSONArray, JSONArray jSONArray2) {
if (jSONArray == null && jSONArray2 == null) {
return true;
}
return (jSONArray == null || jSONArray2 == null || jSONArray.length() != jSONArray2.length()) ? false : true;
}
}

View File

@@ -0,0 +1,27 @@
package com.iab.omid.library.applovin.utils;
import android.text.TextUtils;
import android.util.Log;
/* loaded from: classes2.dex */
public final class d {
public static void a(String str) {
if (com.iab.omid.library.applovin.a.a.booleanValue()) {
TextUtils.isEmpty(str);
}
}
public static void b(String str) {
if (!com.iab.omid.library.applovin.a.a.booleanValue() || TextUtils.isEmpty(str)) {
return;
}
Log.w("OMIDLIB", str);
}
public static void a(String str, Exception exc) {
if ((!com.iab.omid.library.applovin.a.a.booleanValue() || TextUtils.isEmpty(str)) && exc == null) {
return;
}
Log.e("OMIDLIB", str, exc);
}
}

View File

@@ -0,0 +1,40 @@
package com.iab.omid.library.applovin.utils;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import androidx.annotation.NonNull;
import com.iab.omid.library.applovin.adsession.DeviceCategory;
import com.iab.omid.library.applovin.adsession.OutputDeviceStatus;
/* loaded from: classes2.dex */
public class e {
private static OutputDeviceStatus a = OutputDeviceStatus.UNKNOWN;
public class a extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
OutputDeviceStatus outputDeviceStatus;
if (intent.getAction() == "android.media.action.HDMI_AUDIO_PLUG") {
int intExtra = intent.getIntExtra("android.media.extra.AUDIO_PLUG_STATE", -1);
if (intExtra == 0) {
outputDeviceStatus = OutputDeviceStatus.NOT_DETECTED;
} else if (intExtra != 1) {
return;
} else {
outputDeviceStatus = OutputDeviceStatus.UNKNOWN;
}
OutputDeviceStatus unused = e.a = outputDeviceStatus;
}
}
}
public static OutputDeviceStatus a() {
return com.iab.omid.library.applovin.utils.a.a() != DeviceCategory.CTV ? OutputDeviceStatus.UNKNOWN : a;
}
public static void a(@NonNull Context context) {
context.registerReceiver(new a(), new IntentFilter("android.media.action.HDMI_AUDIO_PLUG"));
}
}

View File

@@ -0,0 +1,14 @@
package com.iab.omid.library.applovin.utils;
import java.util.Date;
/* loaded from: classes2.dex */
public class f {
public static long b() {
return System.nanoTime();
}
public Date a() {
return new Date();
}
}

View File

@@ -0,0 +1,93 @@
package com.iab.omid.library.applovin.utils;
import android.text.TextUtils;
import com.iab.omid.library.applovin.Omid;
import com.iab.omid.library.applovin.adsession.CreativeType;
import com.iab.omid.library.applovin.adsession.ImpressionType;
import com.iab.omid.library.applovin.adsession.Owner;
/* loaded from: classes2.dex */
public class g {
public static void a() {
if (!Omid.isActive()) {
throw new IllegalStateException("Method called before OM SDK activation");
}
}
public static void b(com.iab.omid.library.applovin.adsession.a aVar) {
if (aVar.g()) {
throw new IllegalStateException("AdSession is finished");
}
}
public static void c(com.iab.omid.library.applovin.adsession.a aVar) {
if (aVar.j()) {
throw new IllegalStateException("AdSession is started");
}
}
private static void d(com.iab.omid.library.applovin.adsession.a aVar) {
if (!aVar.j()) {
throw new IllegalStateException("AdSession is not started");
}
}
public static void e(com.iab.omid.library.applovin.adsession.a aVar) {
if (!aVar.h()) {
throw new IllegalStateException("Impression event is not expected from the Native AdSession");
}
}
public static void f(com.iab.omid.library.applovin.adsession.a aVar) {
if (!aVar.i()) {
throw new IllegalStateException("Cannot create MediaEvents for JavaScript AdSession");
}
}
public static void g(com.iab.omid.library.applovin.adsession.a aVar) {
if (aVar.getAdSessionStatePublisher().c() != null) {
throw new IllegalStateException("AdEvents already exists for AdSession");
}
}
public static void h(com.iab.omid.library.applovin.adsession.a aVar) {
if (aVar.getAdSessionStatePublisher().d() != null) {
throw new IllegalStateException("MediaEvents already exists for AdSession");
}
}
public static void a(Owner owner, CreativeType creativeType, ImpressionType impressionType) {
if (owner == Owner.NONE) {
throw new IllegalArgumentException("Impression owner is none");
}
if (creativeType == CreativeType.DEFINED_BY_JAVASCRIPT && owner == Owner.NATIVE) {
throw new IllegalArgumentException("ImpressionType/CreativeType can only be defined as DEFINED_BY_JAVASCRIPT if Impression Owner is JavaScript");
}
if (impressionType == ImpressionType.DEFINED_BY_JAVASCRIPT && owner == Owner.NATIVE) {
throw new IllegalArgumentException("ImpressionType/CreativeType can only be defined as DEFINED_BY_JAVASCRIPT if Impression Owner is JavaScript");
}
}
public static void a(com.iab.omid.library.applovin.adsession.a aVar) {
d(aVar);
b(aVar);
}
public static void a(Object obj, String str) {
if (obj == null) {
throw new IllegalArgumentException(str);
}
}
public static void a(String str, int i, String str2) {
if (str.length() > i) {
throw new IllegalArgumentException(str2);
}
}
public static void a(String str, String str2) {
if (TextUtils.isEmpty(str)) {
throw new IllegalArgumentException(str2);
}
}
}

View File

@@ -0,0 +1,55 @@
package com.iab.omid.library.applovin.utils;
import android.view.View;
/* loaded from: classes2.dex */
public final class h {
public static String a(View view) {
if (!view.isAttachedToWindow()) {
return "notAttached";
}
int visibility = view.getVisibility();
if (visibility == 8) {
return "viewGone";
}
if (visibility == 4) {
return "viewInvisible";
}
if (visibility != 0) {
return "viewNotVisible";
}
if (view.getAlpha() == 0.0f) {
return "viewAlphaZero";
}
return null;
}
public static View b(View view) {
Object parent = view.getParent();
if (parent instanceof View) {
return (View) parent;
}
return null;
}
public static float c(View view) {
return view.getZ();
}
public static boolean d(View view) {
return a(view) == null;
}
public static boolean e(View view) {
if (!view.isAttachedToWindow() || !view.isShown()) {
return false;
}
while (view != null) {
if (view.getAlpha() == 0.0f) {
return false;
}
view = b(view);
}
return true;
}
}

View File

@@ -0,0 +1,17 @@
package com.iab.omid.library.applovin.utils;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.webkit.WebViewCompat;
import java.util.Set;
/* loaded from: classes2.dex */
public class i {
public void a(@NonNull WebView webView, @NonNull String str) {
WebViewCompat.removeWebMessageListener(webView, str);
}
public void a(@NonNull WebView webView, @NonNull String str, @NonNull Set<String> set, @NonNull WebViewCompat.WebMessageListener webMessageListener) {
WebViewCompat.addWebMessageListener(webView, str, set, webMessageListener);
}
}

View File

@@ -0,0 +1,240 @@
package com.iab.omid.library.applovin.walking;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import androidx.annotation.VisibleForTesting;
import com.iab.omid.library.applovin.processor.a;
import com.iab.omid.library.applovin.utils.f;
import com.iab.omid.library.applovin.utils.h;
import com.iab.omid.library.applovin.walking.a;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class TreeWalker implements a.InterfaceC0129a {
private static TreeWalker i = new TreeWalker();
private static Handler j = new Handler(Looper.getMainLooper());
private static Handler k = null;
private static final Runnable l = new b();
private static final Runnable m = new c();
private int b;
private long h;
private List<TreeWalkerTimeLogger> a = new ArrayList();
private boolean c = false;
private final List<com.iab.omid.library.applovin.weakreference.a> d = new ArrayList();
private com.iab.omid.library.applovin.walking.a f = new com.iab.omid.library.applovin.walking.a();
private com.iab.omid.library.applovin.processor.b e = new com.iab.omid.library.applovin.processor.b();
private com.iab.omid.library.applovin.walking.b g = new com.iab.omid.library.applovin.walking.b(new com.iab.omid.library.applovin.walking.async.c());
public interface TreeWalkerNanoTimeLogger extends TreeWalkerTimeLogger {
void onTreeProcessedNano(int i, long j);
}
public interface TreeWalkerTimeLogger {
void onTreeProcessed(int i, long j);
}
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public void run() {
TreeWalker.this.g.b();
}
}
public class b implements Runnable {
@Override // java.lang.Runnable
public void run() {
TreeWalker.getInstance().l();
}
}
public class c implements Runnable {
@Override // java.lang.Runnable
public void run() {
if (TreeWalker.k != null) {
TreeWalker.k.post(TreeWalker.l);
TreeWalker.k.postDelayed(TreeWalker.m, 200L);
}
}
}
private void d() {
a(f.b() - this.h);
}
private void e() {
this.b = 0;
this.d.clear();
this.c = false;
Iterator<com.iab.omid.library.applovin.adsession.a> it = com.iab.omid.library.applovin.internal.c.c().a().iterator();
while (true) {
if (!it.hasNext()) {
break;
} else if (it.next().e()) {
this.c = true;
break;
}
}
this.h = f.b();
}
public static TreeWalker getInstance() {
return i;
}
private void i() {
if (k == null) {
Handler handler = new Handler(Looper.getMainLooper());
k = handler;
handler.post(l);
k.postDelayed(m, 200L);
}
}
private void k() {
Handler handler = k;
if (handler != null) {
handler.removeCallbacks(m);
k = null;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void l() {
e();
f();
d();
}
public void addTimeLogger(TreeWalkerTimeLogger treeWalkerTimeLogger) {
if (this.a.contains(treeWalkerTimeLogger)) {
return;
}
this.a.add(treeWalkerTimeLogger);
}
@VisibleForTesting
public void f() {
this.f.e();
long b2 = f.b();
com.iab.omid.library.applovin.processor.a a2 = this.e.a();
if (this.f.b().size() > 0) {
Iterator<String> it = this.f.b().iterator();
while (it.hasNext()) {
String next = it.next();
JSONObject a3 = a2.a(null);
a(next, this.f.a(next), a3);
com.iab.omid.library.applovin.utils.c.b(a3);
HashSet<String> hashSet = new HashSet<>();
hashSet.add(next);
this.g.a(a3, hashSet, b2);
}
}
if (this.f.c().size() > 0) {
JSONObject a4 = a2.a(null);
a(null, a2, a4, com.iab.omid.library.applovin.walking.c.PARENT_VIEW, false);
com.iab.omid.library.applovin.utils.c.b(a4);
this.g.b(a4, this.f.c(), b2);
if (this.c) {
Iterator<com.iab.omid.library.applovin.adsession.a> it2 = com.iab.omid.library.applovin.internal.c.c().a().iterator();
while (it2.hasNext()) {
it2.next().a(this.d);
}
}
} else {
this.g.b();
}
this.f.a();
}
public void g() {
k();
}
public void h() {
i();
}
public void j() {
g();
this.a.clear();
j.post(new a());
}
public void removeTimeLogger(TreeWalkerTimeLogger treeWalkerTimeLogger) {
if (this.a.contains(treeWalkerTimeLogger)) {
this.a.remove(treeWalkerTimeLogger);
}
}
private void a(long j2) {
if (this.a.size() > 0) {
for (TreeWalkerTimeLogger treeWalkerTimeLogger : this.a) {
treeWalkerTimeLogger.onTreeProcessed(this.b, TimeUnit.NANOSECONDS.toMillis(j2));
if (treeWalkerTimeLogger instanceof TreeWalkerNanoTimeLogger) {
((TreeWalkerNanoTimeLogger) treeWalkerTimeLogger).onTreeProcessedNano(this.b, j2);
}
}
}
}
private boolean b(View view, JSONObject jSONObject) {
String d = this.f.d(view);
if (d == null) {
return false;
}
com.iab.omid.library.applovin.utils.c.a(jSONObject, d);
com.iab.omid.library.applovin.utils.c.a(jSONObject, Boolean.valueOf(this.f.f(view)));
this.f.d();
return true;
}
private void a(View view, com.iab.omid.library.applovin.processor.a aVar, JSONObject jSONObject, com.iab.omid.library.applovin.walking.c cVar, boolean z) {
aVar.a(view, jSONObject, this, cVar == com.iab.omid.library.applovin.walking.c.PARENT_VIEW, z);
}
@Override // com.iab.omid.library.applovin.processor.a.InterfaceC0129a
public void a(View view, com.iab.omid.library.applovin.processor.a aVar, JSONObject jSONObject, boolean z) {
com.iab.omid.library.applovin.walking.c e;
if (h.d(view) && (e = this.f.e(view)) != com.iab.omid.library.applovin.walking.c.UNDERLYING_VIEW) {
JSONObject a2 = aVar.a(view);
com.iab.omid.library.applovin.utils.c.a(jSONObject, a2);
if (!b(view, a2)) {
boolean z2 = z || a(view, a2);
if (this.c && e == com.iab.omid.library.applovin.walking.c.OBSTRUCTION_VIEW && !z2) {
this.d.add(new com.iab.omid.library.applovin.weakreference.a(view));
}
a(view, aVar, a2, e, z2);
}
this.b++;
}
}
private void a(String str, View view, JSONObject jSONObject) {
com.iab.omid.library.applovin.processor.a b2 = this.e.b();
String b3 = this.f.b(str);
if (b3 != null) {
JSONObject a2 = b2.a(view);
com.iab.omid.library.applovin.utils.c.a(a2, str);
com.iab.omid.library.applovin.utils.c.b(a2, b3);
com.iab.omid.library.applovin.utils.c.a(jSONObject, a2);
}
}
private boolean a(View view, JSONObject jSONObject) {
a.C0131a c2 = this.f.c(view);
if (c2 == null) {
return false;
}
com.iab.omid.library.applovin.utils.c.a(jSONObject, c2);
return true;
}
}

View File

@@ -0,0 +1,191 @@
package com.iab.omid.library.applovin.walking;
import android.view.View;
import com.iab.omid.library.applovin.internal.e;
import com.iab.omid.library.applovin.utils.h;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
/* loaded from: classes2.dex */
public class a {
private final HashMap<View, String> a = new HashMap<>();
private final HashMap<View, C0131a> b = new HashMap<>();
private final HashMap<String, View> c = new HashMap<>();
private final HashSet<View> d = new HashSet<>();
private final HashSet<String> e = new HashSet<>();
private final HashSet<String> f = new HashSet<>();
private final HashMap<String, String> g = new HashMap<>();
private final Map<View, Boolean> h = new WeakHashMap();
private boolean i;
/* renamed from: com.iab.omid.library.applovin.walking.a$a, reason: collision with other inner class name */
public static class C0131a {
private final e a;
private final ArrayList<String> b = new ArrayList<>();
public C0131a(e eVar, String str) {
this.a = eVar;
a(str);
}
public e a() {
return this.a;
}
public ArrayList<String> b() {
return this.b;
}
public void a(String str) {
this.b.add(str);
}
}
private Boolean b(View view) {
if (view.hasWindowFocus()) {
this.h.remove(view);
return Boolean.FALSE;
}
if (this.h.containsKey(view)) {
return this.h.get(view);
}
Map<View, Boolean> map = this.h;
Boolean bool = Boolean.FALSE;
map.put(view, bool);
return bool;
}
public View a(String str) {
return this.c.get(str);
}
public HashSet<String> b() {
return this.f;
}
public C0131a c(View view) {
C0131a c0131a = this.b.get(view);
if (c0131a != null) {
this.b.remove(view);
}
return c0131a;
}
public HashSet<String> c() {
return this.e;
}
public String d(View view) {
if (this.a.size() == 0) {
return null;
}
String str = this.a.get(view);
if (str != null) {
this.a.remove(view);
}
return str;
}
public void d() {
this.i = true;
}
public c e(View view) {
return this.d.contains(view) ? c.PARENT_VIEW : this.i ? c.OBSTRUCTION_VIEW : c.UNDERLYING_VIEW;
}
public boolean f(View view) {
if (!this.h.containsKey(view)) {
return true;
}
this.h.put(view, Boolean.TRUE);
return false;
}
private String a(View view) {
if (!view.isAttachedToWindow()) {
return "notAttached";
}
if (b(view).booleanValue()) {
return "noWindowFocus";
}
HashSet hashSet = new HashSet();
while (view != null) {
String a = h.a(view);
if (a != null) {
return a;
}
hashSet.add(view);
Object parent = view.getParent();
view = parent instanceof View ? (View) parent : null;
}
this.d.addAll(hashSet);
return null;
}
public String b(String str) {
return this.g.get(str);
}
public void e() {
com.iab.omid.library.applovin.internal.c c = com.iab.omid.library.applovin.internal.c.c();
if (c != null) {
for (com.iab.omid.library.applovin.adsession.a aVar : c.a()) {
View c2 = aVar.c();
if (aVar.f()) {
String adSessionId = aVar.getAdSessionId();
if (c2 != null) {
String a = a(c2);
if (a == null) {
this.e.add(adSessionId);
this.a.put(c2, adSessionId);
a(aVar);
} else if (a != "noWindowFocus") {
this.f.add(adSessionId);
this.c.put(adSessionId, c2);
this.g.put(adSessionId, a);
}
} else {
this.f.add(adSessionId);
this.g.put(adSessionId, "noAdView");
}
}
}
}
}
public void a() {
this.a.clear();
this.b.clear();
this.c.clear();
this.d.clear();
this.e.clear();
this.f.clear();
this.g.clear();
this.i = false;
}
private void a(com.iab.omid.library.applovin.adsession.a aVar) {
Iterator<e> it = aVar.d().iterator();
while (it.hasNext()) {
a(it.next(), aVar);
}
}
private void a(e eVar, com.iab.omid.library.applovin.adsession.a aVar) {
View view = eVar.c().get();
if (view == null) {
return;
}
C0131a c0131a = this.b.get(view);
if (c0131a != null) {
c0131a.a(aVar.getAdSessionId());
} else {
this.b.put(view, new C0131a(eVar, aVar.getAdSessionId()));
}
}
}

View File

@@ -0,0 +1,19 @@
package com.iab.omid.library.applovin.walking.async;
import com.iab.omid.library.applovin.walking.async.b;
import java.util.HashSet;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public abstract class a extends b {
protected final HashSet<String> c;
protected final JSONObject d;
protected final long e;
public a(b.InterfaceC0132b interfaceC0132b, HashSet<String> hashSet, JSONObject jSONObject, long j) {
super(interfaceC0132b);
this.c = new HashSet<>(hashSet);
this.d = jSONObject;
this.e = j;
}
}

View File

@@ -0,0 +1,43 @@
package com.iab.omid.library.applovin.walking.async;
import android.os.AsyncTask;
import java.util.concurrent.ThreadPoolExecutor;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public abstract class b extends AsyncTask<Object, Void, String> {
private a a;
protected final InterfaceC0132b b;
public interface a {
void a(b bVar);
}
/* renamed from: com.iab.omid.library.applovin.walking.async.b$b, reason: collision with other inner class name */
public interface InterfaceC0132b {
JSONObject a();
void a(JSONObject jSONObject);
}
public b(InterfaceC0132b interfaceC0132b) {
this.b = interfaceC0132b;
}
public void a(a aVar) {
this.a = aVar;
}
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void onPostExecute(String str) {
a aVar = this.a;
if (aVar != null) {
aVar.a(this);
}
}
public void a(ThreadPoolExecutor threadPoolExecutor) {
executeOnExecutor(threadPoolExecutor, new Object[0]);
}
}

View File

@@ -0,0 +1,44 @@
package com.iab.omid.library.applovin.walking.async;
import com.iab.omid.library.applovin.walking.async.b;
import java.util.ArrayDeque;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* loaded from: classes2.dex */
public class c implements b.a {
private final BlockingQueue<Runnable> a;
private final ThreadPoolExecutor b;
private final ArrayDeque<b> c = new ArrayDeque<>();
private b d = null;
public c() {
LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue();
this.a = linkedBlockingQueue;
this.b = new ThreadPoolExecutor(1, 1, 1L, TimeUnit.SECONDS, linkedBlockingQueue);
}
private void a() {
b poll = this.c.poll();
this.d = poll;
if (poll != null) {
poll.a(this.b);
}
}
public void b(b bVar) {
bVar.a(this);
this.c.add(bVar);
if (this.d == null) {
a();
}
}
@Override // com.iab.omid.library.applovin.walking.async.b.a
public void a(b bVar) {
this.d = null;
a();
}
}

View File

@@ -0,0 +1,17 @@
package com.iab.omid.library.applovin.walking.async;
import com.iab.omid.library.applovin.walking.async.b;
/* loaded from: classes2.dex */
public class d extends b {
public d(b.InterfaceC0132b interfaceC0132b) {
super(interfaceC0132b);
}
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public String doInBackground(Object... objArr) {
this.b.a(null);
return null;
}
}

View File

@@ -0,0 +1,36 @@
package com.iab.omid.library.applovin.walking.async;
import com.iab.omid.library.applovin.walking.async.b;
import java.util.HashSet;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class e extends a {
public e(b.InterfaceC0132b interfaceC0132b, HashSet<String> hashSet, JSONObject jSONObject, long j) {
super(interfaceC0132b, hashSet, jSONObject, j);
}
private void b(String str) {
com.iab.omid.library.applovin.internal.c c = com.iab.omid.library.applovin.internal.c.c();
if (c != null) {
for (com.iab.omid.library.applovin.adsession.a aVar : c.b()) {
if (this.c.contains(aVar.getAdSessionId())) {
aVar.getAdSessionStatePublisher().a(str, this.e);
}
}
}
}
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public String doInBackground(Object... objArr) {
return this.d.toString();
}
@Override // com.iab.omid.library.applovin.walking.async.b, android.os.AsyncTask
/* renamed from: a */
public void onPostExecute(String str) {
b(str);
super.onPostExecute(str);
}
}

View File

@@ -0,0 +1,43 @@
package com.iab.omid.library.applovin.walking.async;
import android.text.TextUtils;
import com.iab.omid.library.applovin.walking.async.b;
import java.util.HashSet;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class f extends a {
public f(b.InterfaceC0132b interfaceC0132b, HashSet<String> hashSet, JSONObject jSONObject, long j) {
super(interfaceC0132b, hashSet, jSONObject, j);
}
private void b(String str) {
com.iab.omid.library.applovin.internal.c c = com.iab.omid.library.applovin.internal.c.c();
if (c != null) {
for (com.iab.omid.library.applovin.adsession.a aVar : c.b()) {
if (this.c.contains(aVar.getAdSessionId())) {
aVar.getAdSessionStatePublisher().b(str, this.e);
}
}
}
}
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public String doInBackground(Object... objArr) {
if (com.iab.omid.library.applovin.utils.c.h(this.d, this.b.a())) {
return null;
}
this.b.a(this.d);
return this.d.toString();
}
@Override // com.iab.omid.library.applovin.walking.async.b, android.os.AsyncTask
/* renamed from: a */
public void onPostExecute(String str) {
if (!TextUtils.isEmpty(str)) {
b(str);
}
super.onPostExecute(str);
}
}

View File

@@ -0,0 +1,43 @@
package com.iab.omid.library.applovin.walking;
import androidx.annotation.VisibleForTesting;
import com.iab.omid.library.applovin.walking.async.b;
import com.iab.omid.library.applovin.walking.async.d;
import com.iab.omid.library.applovin.walking.async.e;
import com.iab.omid.library.applovin.walking.async.f;
import java.util.HashSet;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class b implements b.InterfaceC0132b {
private JSONObject a;
private final com.iab.omid.library.applovin.walking.async.c b;
public b(com.iab.omid.library.applovin.walking.async.c cVar) {
this.b = cVar;
}
@Override // com.iab.omid.library.applovin.walking.async.b.InterfaceC0132b
@VisibleForTesting
public JSONObject a() {
return this.a;
}
@Override // com.iab.omid.library.applovin.walking.async.b.InterfaceC0132b
@VisibleForTesting
public void a(JSONObject jSONObject) {
this.a = jSONObject;
}
public void b() {
this.b.b(new d(this));
}
public void b(JSONObject jSONObject, HashSet<String> hashSet, long j) {
this.b.b(new f(this, hashSet, jSONObject, j));
}
public void a(JSONObject jSONObject, HashSet<String> hashSet, long j) {
this.b.b(new e(this, hashSet, jSONObject, j));
}
}

View File

@@ -0,0 +1,8 @@
package com.iab.omid.library.applovin.walking;
/* loaded from: classes2.dex */
public enum c {
PARENT_VIEW,
OBSTRUCTION_VIEW,
UNDERLYING_VIEW
}

View File

@@ -0,0 +1,11 @@
package com.iab.omid.library.applovin.weakreference;
import android.view.View;
import java.lang.ref.WeakReference;
/* loaded from: classes2.dex */
public class a extends WeakReference<View> {
public a(View view) {
super(view);
}
}

View File

@@ -0,0 +1,11 @@
package com.iab.omid.library.applovin.weakreference;
import android.webkit.WebView;
import java.lang.ref.WeakReference;
/* loaded from: classes2.dex */
public class b extends WeakReference<WebView> {
public b(WebView webView) {
super(webView);
}
}

View File

@@ -0,0 +1,28 @@
package com.iab.omid.library.fyber;
import android.content.Context;
/* loaded from: classes2.dex */
public final class Omid {
public static final /* synthetic */ int $r8$clinit = 0;
private static b INSTANCE = new b();
private Omid() {
}
public static void activate(Context context) {
INSTANCE.a(context.getApplicationContext());
}
public static String getVersion() {
return INSTANCE.a();
}
public static boolean isActive() {
return INSTANCE.b();
}
public static void updateLastActivity() {
INSTANCE.c();
}
}

View File

@@ -0,0 +1,243 @@
package com.iab.omid.library.fyber;
/* loaded from: classes2.dex */
public final class R {
public static final class attr {
public static int alpha = 0x7f040055;
public static int font = 0x7f0400d8;
public static int fontProviderAuthority = 0x7f0400da;
public static int fontProviderCerts = 0x7f0400db;
public static int fontProviderFetchStrategy = 0x7f0400dd;
public static int fontProviderFetchTimeout = 0x7f0400de;
public static int fontProviderPackage = 0x7f0400df;
public static int fontProviderQuery = 0x7f0400e0;
public static int fontStyle = 0x7f0400e2;
public static int fontVariationSettings = 0x7f0400e3;
public static int fontWeight = 0x7f0400e4;
public static int ttcIndex = 0x7f04019c;
private attr() {
}
}
public static final class color {
public static int notification_action_color_filter = 0x7f0600e7;
public static int notification_icon_bg_color = 0x7f0600e8;
public static int ripple_material_light = 0x7f0600f3;
public static int secondary_text_default_material_light = 0x7f0600f5;
private color() {
}
}
public static final class dimen {
public static int compat_button_inset_horizontal_material = 0x7f070095;
public static int compat_button_inset_vertical_material = 0x7f070096;
public static int compat_button_padding_horizontal_material = 0x7f070097;
public static int compat_button_padding_vertical_material = 0x7f070098;
public static int compat_control_corner_material = 0x7f070099;
public static int compat_notification_large_icon_max_height = 0x7f07009a;
public static int compat_notification_large_icon_max_width = 0x7f07009b;
public static int notification_action_icon_size = 0x7f070105;
public static int notification_action_text_size = 0x7f070106;
public static int notification_big_circle_margin = 0x7f070107;
public static int notification_content_margin_start = 0x7f070108;
public static int notification_large_icon_height = 0x7f070109;
public static int notification_large_icon_width = 0x7f07010a;
public static int notification_main_column_padding_top = 0x7f07010b;
public static int notification_media_narrow_margin = 0x7f07010c;
public static int notification_right_icon_size = 0x7f07010d;
public static int notification_right_side_padding_top = 0x7f07010e;
public static int notification_small_icon_background_padding = 0x7f07010f;
public static int notification_small_icon_size_as_large = 0x7f070110;
public static int notification_subtext_size = 0x7f070111;
public static int notification_top_pad = 0x7f070112;
public static int notification_top_pad_large_text = 0x7f070113;
private dimen() {
}
}
public static final class drawable {
public static int notification_action_background = 0x7f080241;
public static int notification_bg = 0x7f080242;
public static int notification_bg_low = 0x7f080243;
public static int notification_bg_low_normal = 0x7f080244;
public static int notification_bg_low_pressed = 0x7f080245;
public static int notification_bg_normal = 0x7f080246;
public static int notification_bg_normal_pressed = 0x7f080247;
public static int notification_icon_background = 0x7f080248;
public static int notification_template_icon_bg = 0x7f08024a;
public static int notification_template_icon_low_bg = 0x7f08024b;
public static int notification_tile_bg = 0x7f08024c;
public static int notify_panel_notification_icon_bg = 0x7f08024d;
private drawable() {
}
}
public static final class id {
public static int accessibility_action_clickable_span = 0x7f0a0009;
public static int accessibility_custom_action_0 = 0x7f0a000a;
public static int accessibility_custom_action_1 = 0x7f0a000b;
public static int accessibility_custom_action_10 = 0x7f0a000c;
public static int accessibility_custom_action_11 = 0x7f0a000d;
public static int accessibility_custom_action_12 = 0x7f0a000e;
public static int accessibility_custom_action_13 = 0x7f0a000f;
public static int accessibility_custom_action_14 = 0x7f0a0010;
public static int accessibility_custom_action_15 = 0x7f0a0011;
public static int accessibility_custom_action_16 = 0x7f0a0012;
public static int accessibility_custom_action_17 = 0x7f0a0013;
public static int accessibility_custom_action_18 = 0x7f0a0014;
public static int accessibility_custom_action_19 = 0x7f0a0015;
public static int accessibility_custom_action_2 = 0x7f0a0016;
public static int accessibility_custom_action_20 = 0x7f0a0017;
public static int accessibility_custom_action_21 = 0x7f0a0018;
public static int accessibility_custom_action_22 = 0x7f0a0019;
public static int accessibility_custom_action_23 = 0x7f0a001a;
public static int accessibility_custom_action_24 = 0x7f0a001b;
public static int accessibility_custom_action_25 = 0x7f0a001c;
public static int accessibility_custom_action_26 = 0x7f0a001d;
public static int accessibility_custom_action_27 = 0x7f0a001e;
public static int accessibility_custom_action_28 = 0x7f0a001f;
public static int accessibility_custom_action_29 = 0x7f0a0020;
public static int accessibility_custom_action_3 = 0x7f0a0021;
public static int accessibility_custom_action_30 = 0x7f0a0022;
public static int accessibility_custom_action_31 = 0x7f0a0023;
public static int accessibility_custom_action_4 = 0x7f0a0024;
public static int accessibility_custom_action_5 = 0x7f0a0025;
public static int accessibility_custom_action_6 = 0x7f0a0026;
public static int accessibility_custom_action_7 = 0x7f0a0027;
public static int accessibility_custom_action_8 = 0x7f0a0028;
public static int accessibility_custom_action_9 = 0x7f0a0029;
public static int action_container = 0x7f0a0032;
public static int action_divider = 0x7f0a0034;
public static int action_image = 0x7f0a0035;
public static int action_text = 0x7f0a003c;
public static int actions = 0x7f0a003d;
public static int async = 0x7f0a0088;
public static int blocking = 0x7f0a0091;
public static int chronometer = 0x7f0a00a6;
public static int dialog_button = 0x7f0a00c1;
public static int forever = 0x7f0a0107;
public static int icon = 0x7f0a014a;
public static int icon_group = 0x7f0a014b;
public static int info = 0x7f0a0151;
public static int italic = 0x7f0a0156;
public static int line1 = 0x7f0a015d;
public static int line3 = 0x7f0a015e;
public static int normal = 0x7f0a022f;
public static int notification_background = 0x7f0a0230;
public static int notification_main_column = 0x7f0a0231;
public static int notification_main_column_container = 0x7f0a0232;
public static int right_icon = 0x7f0a0248;
public static int right_side = 0x7f0a0249;
public static int tag_accessibility_actions = 0x7f0a0270;
public static int tag_accessibility_clickable_spans = 0x7f0a0271;
public static int tag_accessibility_heading = 0x7f0a0272;
public static int tag_accessibility_pane_title = 0x7f0a0273;
public static int tag_screen_reader_focusable = 0x7f0a0277;
public static int tag_transition_group = 0x7f0a0279;
public static int tag_unhandled_key_event_manager = 0x7f0a027a;
public static int tag_unhandled_key_listeners = 0x7f0a027b;
public static int text = 0x7f0a027d;
public static int text2 = 0x7f0a027e;
public static int time = 0x7f0a0283;
public static int title = 0x7f0a0284;
private id() {
}
}
public static final class integer {
public static int status_bar_notification_info_maxnum = 0x7f0b0014;
private integer() {
}
}
public static final class layout {
public static int custom_dialog = 0x7f0d0033;
public static int notification_action = 0x7f0d009f;
public static int notification_action_tombstone = 0x7f0d00a0;
public static int notification_template_custom_big = 0x7f0d00a7;
public static int notification_template_icon_group = 0x7f0d00a8;
public static int notification_template_part_chronometer = 0x7f0d00ac;
public static int notification_template_part_time = 0x7f0d00ad;
private layout() {
}
}
public static final class string {
public static int status_bar_notification_info_overflow = 0x7f120187;
private string() {
}
}
public static final class style {
public static int TextAppearance_Compat_Notification = 0x7f130147;
public static int TextAppearance_Compat_Notification_Info = 0x7f130148;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f13014a;
public static int TextAppearance_Compat_Notification_Time = 0x7f13014d;
public static int TextAppearance_Compat_Notification_Title = 0x7f13014f;
public static int Widget_Compat_NotificationActionContainer = 0x7f1301c1;
public static int Widget_Compat_NotificationActionText = 0x7f1301c2;
private style() {
}
}
public static final class styleable {
public static int ColorStateListItem_alpha = 0x00000003;
public static int ColorStateListItem_android_alpha = 0x00000001;
public static int ColorStateListItem_android_color = 0x00000000;
public static int ColorStateListItem_android_lStar = 0x00000002;
public static int ColorStateListItem_lStar = 0x00000004;
public static int FontFamilyFont_android_font = 0x00000000;
public static int FontFamilyFont_android_fontStyle = 0x00000002;
public static int FontFamilyFont_android_fontVariationSettings = 0x00000004;
public static int FontFamilyFont_android_fontWeight = 0x00000001;
public static int FontFamilyFont_android_ttcIndex = 0x00000003;
public static int FontFamilyFont_font = 0x00000005;
public static int FontFamilyFont_fontStyle = 0x00000006;
public static int FontFamilyFont_fontVariationSettings = 0x00000007;
public static int FontFamilyFont_fontWeight = 0x00000008;
public static int FontFamilyFont_ttcIndex = 0x00000009;
public static int FontFamily_fontProviderAuthority = 0x00000000;
public static int FontFamily_fontProviderCerts = 0x00000001;
public static int FontFamily_fontProviderFallbackQuery = 0x00000002;
public static int FontFamily_fontProviderFetchStrategy = 0x00000003;
public static int FontFamily_fontProviderFetchTimeout = 0x00000004;
public static int FontFamily_fontProviderPackage = 0x00000005;
public static int FontFamily_fontProviderQuery = 0x00000006;
public static int FontFamily_fontProviderSystemFontFamily = 0x00000007;
public static int GradientColorItem_android_color = 0x00000000;
public static int GradientColorItem_android_offset = 0x00000001;
public static int GradientColor_android_centerColor = 0x00000007;
public static int GradientColor_android_centerX = 0x00000003;
public static int GradientColor_android_centerY = 0x00000004;
public static int GradientColor_android_endColor = 0x00000001;
public static int GradientColor_android_endX = 0x0000000a;
public static int GradientColor_android_endY = 0x0000000b;
public static int GradientColor_android_gradientRadius = 0x00000005;
public static int GradientColor_android_startColor = 0x00000000;
public static int GradientColor_android_startX = 0x00000008;
public static int GradientColor_android_startY = 0x00000009;
public static int GradientColor_android_tileMode = 0x00000006;
public static int GradientColor_android_type = 0x00000002;
public static int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, android.R.attr.lStar, com.ea.games.r3_row.R.attr.alpha, com.ea.games.r3_row.R.attr.lStar};
public static int[] FontFamily = {com.ea.games.r3_row.R.attr.fontProviderAuthority, com.ea.games.r3_row.R.attr.fontProviderCerts, com.ea.games.r3_row.R.attr.fontProviderFallbackQuery, com.ea.games.r3_row.R.attr.fontProviderFetchStrategy, com.ea.games.r3_row.R.attr.fontProviderFetchTimeout, com.ea.games.r3_row.R.attr.fontProviderPackage, com.ea.games.r3_row.R.attr.fontProviderQuery, com.ea.games.r3_row.R.attr.fontProviderSystemFontFamily};
public static int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, com.ea.games.r3_row.R.attr.font, com.ea.games.r3_row.R.attr.fontStyle, com.ea.games.r3_row.R.attr.fontVariationSettings, com.ea.games.r3_row.R.attr.fontWeight, com.ea.games.r3_row.R.attr.ttcIndex};
public static int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
public static int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
private styleable() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,11 @@
package com.iab.omid.library.fyber;
/* loaded from: classes2.dex */
public final class ScriptInjector {
private ScriptInjector() {
}
public static String injectScriptContentIntoHtml(String str, String str2) {
return c.b(str, str2);
}
}

View File

@@ -0,0 +1,6 @@
package com.iab.omid.library.fyber;
/* loaded from: classes2.dex */
public final class a {
public static final Boolean a = Boolean.FALSE;
}

View File

@@ -0,0 +1,51 @@
package com.iab.omid.library.fyber.adsession;
import androidx.annotation.NonNull;
import com.iab.omid.library.fyber.adsession.media.VastProperties;
import com.iab.omid.library.fyber.utils.g;
/* loaded from: classes2.dex */
public final class AdEvents {
private final a adSession;
private AdEvents(a aVar) {
this.adSession = aVar;
}
public static AdEvents createAdEvents(AdSession adSession) {
a aVar = (a) adSession;
g.a(adSession, "AdSession is null");
g.g(aVar);
g.b(aVar);
AdEvents adEvents = new AdEvents(aVar);
aVar.getAdSessionStatePublisher().a(adEvents);
return adEvents;
}
public void impressionOccurred() {
g.b(this.adSession);
g.e(this.adSession);
if (!this.adSession.f()) {
try {
this.adSession.start();
} catch (Exception unused) {
}
}
if (this.adSession.f()) {
this.adSession.k();
}
}
public void loaded() {
g.a(this.adSession);
g.e(this.adSession);
this.adSession.l();
}
public void loaded(@NonNull VastProperties vastProperties) {
g.a(vastProperties, "VastProperties is null");
g.a(this.adSession);
g.e(this.adSession);
this.adSession.a(vastProperties.a());
}
}

View File

@@ -0,0 +1,36 @@
package com.iab.omid.library.fyber.adsession;
import android.view.View;
import androidx.annotation.Nullable;
import com.iab.omid.library.fyber.publisher.AdSessionStatePublisher;
import com.iab.omid.library.fyber.utils.g;
/* loaded from: classes2.dex */
public abstract class AdSession {
public static AdSession createAdSession(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext) {
g.a();
g.a(adSessionConfiguration, "AdSessionConfiguration is null");
g.a(adSessionContext, "AdSessionContext is null");
return new a(adSessionConfiguration, adSessionContext);
}
public abstract void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str);
public abstract void error(ErrorType errorType, String str);
public abstract void finish();
public abstract String getAdSessionId();
public abstract AdSessionStatePublisher getAdSessionStatePublisher();
public abstract void registerAdView(@Nullable View view);
public abstract void removeAllFriendlyObstructions();
public abstract void removeFriendlyObstruction(View view);
public abstract void setPossibleObstructionListener(PossibleObstructionListener possibleObstructionListener);
public abstract void start();
}

View File

@@ -0,0 +1,52 @@
package com.iab.omid.library.fyber.adsession;
import com.iab.omid.library.fyber.utils.c;
import com.iab.omid.library.fyber.utils.g;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class AdSessionConfiguration {
private final CreativeType creativeType;
private final Owner impressionOwner;
private final ImpressionType impressionType;
private final boolean isolateVerificationScripts;
private final Owner mediaEventsOwner;
private AdSessionConfiguration(CreativeType creativeType, ImpressionType impressionType, Owner owner, Owner owner2, boolean z) {
this.creativeType = creativeType;
this.impressionType = impressionType;
this.impressionOwner = owner;
if (owner2 == null) {
this.mediaEventsOwner = Owner.NONE;
} else {
this.mediaEventsOwner = owner2;
}
this.isolateVerificationScripts = z;
}
public static AdSessionConfiguration createAdSessionConfiguration(CreativeType creativeType, ImpressionType impressionType, Owner owner, Owner owner2, boolean z) {
g.a(creativeType, "CreativeType is null");
g.a(impressionType, "ImpressionType is null");
g.a(owner, "Impression owner is null");
g.a(owner, creativeType, impressionType);
return new AdSessionConfiguration(creativeType, impressionType, owner, owner2, z);
}
public boolean isNativeImpressionOwner() {
return Owner.NATIVE == this.impressionOwner;
}
public boolean isNativeMediaEventsOwner() {
return Owner.NATIVE == this.mediaEventsOwner;
}
public JSONObject toJsonObject() {
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "impressionOwner", this.impressionOwner);
c.a(jSONObject, "mediaEventsOwner", this.mediaEventsOwner);
c.a(jSONObject, "creativeType", this.creativeType);
c.a(jSONObject, "impressionType", this.impressionType);
c.a(jSONObject, "isolateVerificationScripts", Boolean.valueOf(this.isolateVerificationScripts));
return jSONObject;
}
}

View File

@@ -0,0 +1,107 @@
package com.iab.omid.library.fyber.adsession;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import com.iab.omid.library.fyber.utils.g;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/* loaded from: classes2.dex */
public final class AdSessionContext {
private final AdSessionContextType adSessionContextType;
@Nullable
private final String contentUrl;
@Nullable
private final String customReferenceData;
private final Map<String, VerificationScriptResource> injectedResourcesMap;
private final String omidJsScriptContent;
private final Partner partner;
private final List<VerificationScriptResource> verificationScriptResources;
private final WebView webView;
private AdSessionContext(Partner partner, WebView webView, String str, List<VerificationScriptResource> list, @Nullable String str2, @Nullable String str3, AdSessionContextType adSessionContextType) {
ArrayList arrayList = new ArrayList();
this.verificationScriptResources = arrayList;
this.injectedResourcesMap = new HashMap();
this.partner = partner;
this.webView = webView;
this.omidJsScriptContent = str;
this.adSessionContextType = adSessionContextType;
if (list != null) {
arrayList.addAll(list);
for (VerificationScriptResource verificationScriptResource : list) {
this.injectedResourcesMap.put(UUID.randomUUID().toString(), verificationScriptResource);
}
}
this.contentUrl = str2;
this.customReferenceData = str3;
}
public static AdSessionContext createHtmlAdSessionContext(Partner partner, WebView webView, @Nullable String str, @Nullable String str2) {
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
if (str2 != null) {
g.a(str2, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, webView, null, null, str, str2, AdSessionContextType.HTML);
}
public static AdSessionContext createJavascriptAdSessionContext(Partner partner, WebView webView, @Nullable String str, @Nullable String str2) {
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
if (str2 != null) {
g.a(str2, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, webView, null, null, str, str2, AdSessionContextType.JAVASCRIPT);
}
public static AdSessionContext createNativeAdSessionContext(Partner partner, String str, List<VerificationScriptResource> list, @Nullable String str2, @Nullable String str3) {
g.a(partner, "Partner is null");
g.a((Object) str, "OM SDK JS script content is null");
g.a(list, "VerificationScriptResources is null");
if (str3 != null) {
g.a(str3, 256, "CustomReferenceData is greater than 256 characters");
}
return new AdSessionContext(partner, null, str, list, str2, str3, AdSessionContextType.NATIVE);
}
public AdSessionContextType getAdSessionContextType() {
return this.adSessionContextType;
}
@Nullable
public String getContentUrl() {
return this.contentUrl;
}
@Nullable
public String getCustomReferenceData() {
return this.customReferenceData;
}
public Map<String, VerificationScriptResource> getInjectedResourcesMap() {
return Collections.unmodifiableMap(this.injectedResourcesMap);
}
public String getOmidJsScriptContent() {
return this.omidJsScriptContent;
}
public Partner getPartner() {
return this.partner;
}
public List<VerificationScriptResource> getVerificationScriptResources() {
return Collections.unmodifiableList(this.verificationScriptResources);
}
public WebView getWebView() {
return this.webView;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.fyber.adsession;
import com.tapjoy.TJAdUnitConstants;
/* loaded from: classes2.dex */
public enum AdSessionContextType {
HTML(TJAdUnitConstants.String.HTML),
NATIVE("native"),
JAVASCRIPT("javascript");
private final String typeString;
AdSessionContextType(String str) {
this.typeString = str;
}
@Override // java.lang.Enum
public String toString() {
return this.typeString;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.fyber.adsession;
/* loaded from: classes2.dex */
public enum CreativeType {
DEFINED_BY_JAVASCRIPT("definedByJavaScript"),
HTML_DISPLAY("htmlDisplay"),
NATIVE_DISPLAY("nativeDisplay"),
VIDEO("video"),
AUDIO("audio");
private final String creativeType;
CreativeType(String str) {
this.creativeType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.creativeType;
}
}

View File

@@ -0,0 +1,21 @@
package com.iab.omid.library.fyber.adsession;
import com.tapjoy.TJDeviceNetworkKt;
/* loaded from: classes2.dex */
public enum DeviceCategory {
CTV("ctv"),
MOBILE(TJDeviceNetworkKt.TJC_CONNECTION_TYPE_MOBILE),
OTHER("other");
private final String deviceCategory;
DeviceCategory(String str) {
this.deviceCategory = str;
}
@Override // java.lang.Enum
public String toString() {
return this.deviceCategory;
}
}

View File

@@ -0,0 +1,18 @@
package com.iab.omid.library.fyber.adsession;
/* loaded from: classes2.dex */
public enum ErrorType {
GENERIC("generic"),
VIDEO("video");
private final String errorType;
ErrorType(String str) {
this.errorType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.errorType;
}
}

View File

@@ -0,0 +1,9 @@
package com.iab.omid.library.fyber.adsession;
/* loaded from: classes2.dex */
public enum FriendlyObstructionPurpose {
VIDEO_CONTROLS,
CLOSE_AD,
NOT_VISIBLE,
OTHER
}

View File

@@ -0,0 +1,27 @@
package com.iab.omid.library.fyber.adsession;
import com.ironsource.v8;
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
/* loaded from: classes2.dex */
public enum ImpressionType {
DEFINED_BY_JAVASCRIPT("definedByJavaScript"),
UNSPECIFIED("unspecified"),
LOADED(v8.h.r),
BEGIN_TO_RENDER("beginToRender"),
ONE_PIXEL("onePixel"),
VIEWABLE(MRAIDCommunicatorUtil.KEY_VIEWABLE),
AUDIBLE("audible"),
OTHER("other");
private final String impressionType;
ImpressionType(String str) {
this.impressionType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.impressionType;
}
}

View File

@@ -0,0 +1,184 @@
package com.iab.omid.library.fyber.adsession;
import android.net.Uri;
import android.view.View;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import androidx.webkit.JavaScriptReplyProxy;
import androidx.webkit.ProxyConfig;
import androidx.webkit.WebMessageCompat;
import androidx.webkit.WebViewCompat;
import androidx.webkit.WebViewFeature;
import com.iab.omid.library.fyber.internal.e;
import com.iab.omid.library.fyber.internal.f;
import com.iab.omid.library.fyber.utils.d;
import com.iab.omid.library.fyber.utils.g;
import com.iab.omid.library.fyber.utils.i;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class JavaScriptSessionService {
private static String JS_MESSAGE_DATA_AD_SESSION_ID = "adSessionId";
private static String JS_MESSAGE_KEY_DATA = "data";
private static String JS_MESSAGE_KEY_METHOD = "method";
private static String JS_MESSAGE_LISTENER_JS_SESSION_SERVICE = "omidJsSessionService";
private static String JS_MESSAGE_METHOD_FINISH_SESSION = "finishSession";
private static String JS_MESSAGE_METHOD_START_SESSION = "startSession";
private static i webViewUtil = new i();
private final HashMap<String, AdSession> adSessions = new HashMap<>();
private final f friendlyObstructions = new f();
private final boolean isHtmlAdView;
private final Partner partner;
private com.iab.omid.library.fyber.weakreference.a weakAdView;
private final WebView webView;
public interface TearDownHandler {
void onTearDown(boolean z);
}
private JavaScriptSessionService(Partner partner, WebView webView, boolean z) {
g.a();
g.a(partner, "Partner is null");
g.a(webView, "WebView is null");
this.partner = partner;
this.webView = webView;
this.isHtmlAdView = z;
if (z) {
setAdView(webView);
}
addWebViewListener();
}
private void addWebViewListener() {
if (!WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)) {
throw new UnsupportedOperationException("The JavaScriptSessionService cannot be supported in this WebView version.");
}
removeWebViewListener();
webViewUtil.a(this.webView, JS_MESSAGE_LISTENER_JS_SESSION_SERVICE, new HashSet(Arrays.asList(ProxyConfig.MATCH_ALL_SCHEMES)), new WebViewCompat.WebMessageListener() { // from class: com.iab.omid.library.fyber.adsession.JavaScriptSessionService.2
@Override // androidx.webkit.WebViewCompat.WebMessageListener
public void onPostMessage(WebView webView, WebMessageCompat webMessageCompat, Uri uri, boolean z, JavaScriptReplyProxy javaScriptReplyProxy) {
try {
JSONObject jSONObject = new JSONObject(webMessageCompat.getData());
String string = jSONObject.getString(JavaScriptSessionService.JS_MESSAGE_KEY_METHOD);
String string2 = jSONObject.getJSONObject(JavaScriptSessionService.JS_MESSAGE_KEY_DATA).getString(JavaScriptSessionService.JS_MESSAGE_DATA_AD_SESSION_ID);
if (string.equals(JavaScriptSessionService.JS_MESSAGE_METHOD_START_SESSION)) {
JavaScriptSessionService.this.startSession(string2);
} else if (string.equals(JavaScriptSessionService.JS_MESSAGE_METHOD_FINISH_SESSION)) {
JavaScriptSessionService.this.finishSession(string2);
} else {
d.b("Unexpected method in JavaScriptSessionService: " + string);
}
} catch (JSONException e) {
d.a("Error parsing JS message in JavaScriptSessionService.", e);
}
}
});
}
public static JavaScriptSessionService create(Partner partner, WebView webView, boolean z) {
return new JavaScriptSessionService(partner, webView, z);
}
private AdSessionConfiguration createAdSessionConfiguration() {
CreativeType creativeType = CreativeType.DEFINED_BY_JAVASCRIPT;
ImpressionType impressionType = ImpressionType.DEFINED_BY_JAVASCRIPT;
Owner owner = Owner.JAVASCRIPT;
return AdSessionConfiguration.createAdSessionConfiguration(creativeType, impressionType, owner, owner, false);
}
private AdSessionContext createAdSessionContext() {
return this.isHtmlAdView ? AdSessionContext.createHtmlAdSessionContext(this.partner, this.webView, null, null) : AdSessionContext.createJavascriptAdSessionContext(this.partner, this.webView, null, null);
}
/* JADX INFO: Access modifiers changed from: private */
public void finishSession(String str) {
AdSession adSession = this.adSessions.get(str);
if (adSession != null) {
adSession.finish();
this.adSessions.remove(str);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void removeWebViewListener() {
webViewUtil.a(this.webView, JS_MESSAGE_LISTENER_JS_SESSION_SERVICE);
}
/* JADX INFO: Access modifiers changed from: private */
public void startSession(String str) {
a aVar = new a(createAdSessionConfiguration(), createAdSessionContext(), str);
this.adSessions.put(str, aVar);
aVar.registerAdView(getAdView());
for (e eVar : this.friendlyObstructions.a()) {
aVar.addFriendlyObstruction(eVar.c().get(), eVar.b(), eVar.a());
}
aVar.start();
}
public void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().addFriendlyObstruction(view, friendlyObstructionPurpose, str);
}
this.friendlyObstructions.a(view, friendlyObstructionPurpose, str);
}
@Nullable
public View getAdView() {
com.iab.omid.library.fyber.weakreference.a aVar = this.weakAdView;
if (aVar == null) {
return null;
}
return aVar.get();
}
public void removeAllFriendlyObstructions() {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().removeAllFriendlyObstructions();
}
this.friendlyObstructions.b();
}
public void removeFriendlyObstruction(View view) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().removeFriendlyObstruction(view);
}
this.friendlyObstructions.c(view);
}
public void setAdView(@Nullable View view) {
if (getAdView() == view) {
return;
}
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().registerAdView(view);
}
this.weakAdView = new com.iab.omid.library.fyber.weakreference.a(view);
}
public void tearDown(final TearDownHandler tearDownHandler) {
Iterator<AdSession> it = this.adSessions.values().iterator();
while (it.hasNext()) {
it.next().finish();
}
final Timer timer = new Timer();
timer.schedule(new TimerTask() { // from class: com.iab.omid.library.fyber.adsession.JavaScriptSessionService.1
@Override // java.util.TimerTask, java.lang.Runnable
public void run() {
JavaScriptSessionService.this.removeWebViewListener();
tearDownHandler.onTearDown(true);
timer.cancel();
}
}, 1000L);
}
}

View File

@@ -0,0 +1,7 @@
package com.iab.omid.library.fyber.adsession;
/* loaded from: classes2.dex */
public enum OutputDeviceStatus {
NOT_DETECTED,
UNKNOWN
}

View File

@@ -0,0 +1,19 @@
package com.iab.omid.library.fyber.adsession;
/* loaded from: classes2.dex */
public enum Owner {
NATIVE("native"),
JAVASCRIPT("javascript"),
NONE("none");
private final String owner;
Owner(String str) {
this.owner = str;
}
@Override // java.lang.Enum
public String toString() {
return this.owner;
}
}

View File

@@ -0,0 +1,28 @@
package com.iab.omid.library.fyber.adsession;
import com.iab.omid.library.fyber.utils.g;
/* loaded from: classes2.dex */
public class Partner {
private final String name;
private final String version;
private Partner(String str, String str2) {
this.name = str;
this.version = str2;
}
public static Partner createPartner(String str, String str2) {
g.a(str, "Name is null or empty");
g.a(str2, "Version is null or empty");
return new Partner(str, str2);
}
public String getName() {
return this.name;
}
public String getVersion() {
return this.version;
}
}

View File

@@ -0,0 +1,9 @@
package com.iab.omid.library.fyber.adsession;
import android.view.View;
import java.util.List;
/* loaded from: classes2.dex */
public interface PossibleObstructionListener {
void onPossibleObstructionsDetected(String str, List<View> list);
}

View File

@@ -0,0 +1,51 @@
package com.iab.omid.library.fyber.adsession;
import com.iab.omid.library.fyber.utils.c;
import com.iab.omid.library.fyber.utils.g;
import java.net.URL;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class VerificationScriptResource {
private final URL resourceUrl;
private final String vendorKey;
private final String verificationParameters;
private VerificationScriptResource(String str, URL url, String str2) {
this.vendorKey = str;
this.resourceUrl = url;
this.verificationParameters = str2;
}
public static VerificationScriptResource createVerificationScriptResourceWithParameters(String str, URL url, String str2) {
g.a(str, "VendorKey is null or empty");
g.a(url, "ResourceURL is null");
g.a(str2, "VerificationParameters is null or empty");
return new VerificationScriptResource(str, url, str2);
}
public static VerificationScriptResource createVerificationScriptResourceWithoutParameters(URL url) {
g.a(url, "ResourceURL is null");
return new VerificationScriptResource(null, url, null);
}
public URL getResourceUrl() {
return this.resourceUrl;
}
public String getVendorKey() {
return this.vendorKey;
}
public String getVerificationParameters() {
return this.verificationParameters;
}
public JSONObject toJsonObject() {
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "vendorKey", this.vendorKey);
c.a(jSONObject, "resourceUrl", this.resourceUrl.toString());
c.a(jSONObject, "verificationParameters", this.verificationParameters);
return jSONObject;
}
}

View File

@@ -0,0 +1,229 @@
package com.iab.omid.library.fyber.adsession;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.iab.omid.library.fyber.internal.c;
import com.iab.omid.library.fyber.internal.e;
import com.iab.omid.library.fyber.internal.f;
import com.iab.omid.library.fyber.internal.i;
import com.iab.omid.library.fyber.publisher.AdSessionStatePublisher;
import com.iab.omid.library.fyber.publisher.b;
import com.iab.omid.library.fyber.utils.g;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class a extends AdSession {
private final AdSessionContext a;
private final AdSessionConfiguration b;
private final f c;
private com.iab.omid.library.fyber.weakreference.a d;
private AdSessionStatePublisher e;
private boolean f;
private boolean g;
private final String h;
private boolean i;
private boolean j;
private PossibleObstructionListener k;
public a(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext) {
this(adSessionConfiguration, adSessionContext, UUID.randomUUID().toString());
}
public a(AdSessionConfiguration adSessionConfiguration, AdSessionContext adSessionContext, String str) {
this.c = new f();
this.f = false;
this.g = false;
this.b = adSessionConfiguration;
this.a = adSessionContext;
this.h = str;
b(null);
this.e = (adSessionContext.getAdSessionContextType() == AdSessionContextType.HTML || adSessionContext.getAdSessionContextType() == AdSessionContextType.JAVASCRIPT) ? new com.iab.omid.library.fyber.publisher.a(str, adSessionContext.getWebView()) : new b(str, adSessionContext.getInjectedResourcesMap(), adSessionContext.getOmidJsScriptContent());
this.e.i();
c.c().a(this);
this.e.a(adSessionConfiguration);
}
private void a() {
if (this.i) {
throw new IllegalStateException("Impression event can only be sent once");
}
}
private void a(@Nullable View view) {
Collection<a> b = c.c().b();
if (b == null || b.isEmpty()) {
return;
}
for (a aVar : b) {
if (aVar != this && aVar.c() == view) {
aVar.d.clear();
}
}
}
private void b() {
if (this.j) {
throw new IllegalStateException("Loaded event can only be sent once");
}
}
private void b(@Nullable View view) {
this.d = new com.iab.omid.library.fyber.weakreference.a(view);
}
public void a(List<com.iab.omid.library.fyber.weakreference.a> list) {
if (e()) {
ArrayList arrayList = new ArrayList();
Iterator<com.iab.omid.library.fyber.weakreference.a> it = list.iterator();
while (it.hasNext()) {
View view = it.next().get();
if (view != null) {
arrayList.add(view);
}
}
this.k.onPossibleObstructionsDetected(this.h, arrayList);
}
}
public void a(@NonNull JSONObject jSONObject) {
b();
getAdSessionStatePublisher().a(jSONObject);
this.j = true;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void addFriendlyObstruction(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) {
if (this.g) {
return;
}
this.c.a(view, friendlyObstructionPurpose, str);
}
public View c() {
return this.d.get();
}
public List<e> d() {
return this.c.a();
}
public boolean e() {
return this.k != null;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void error(ErrorType errorType, String str) {
if (this.g) {
throw new IllegalStateException("AdSession is finished");
}
g.a(errorType, "Error type is null");
g.a(str, "Message is null");
getAdSessionStatePublisher().a(errorType, str);
}
public boolean f() {
return this.f && !this.g;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void finish() {
if (this.g) {
return;
}
this.d.clear();
removeAllFriendlyObstructions();
this.g = true;
getAdSessionStatePublisher().f();
c.c().b(this);
getAdSessionStatePublisher().b();
this.e = null;
this.k = null;
}
public boolean g() {
return this.g;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public String getAdSessionId() {
return this.h;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public AdSessionStatePublisher getAdSessionStatePublisher() {
return this.e;
}
public boolean h() {
return this.b.isNativeImpressionOwner();
}
public boolean i() {
return this.b.isNativeMediaEventsOwner();
}
public boolean j() {
return this.f;
}
public void k() {
a();
getAdSessionStatePublisher().g();
this.i = true;
}
public void l() {
b();
getAdSessionStatePublisher().h();
this.j = true;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void registerAdView(@Nullable View view) {
if (this.g || c() == view) {
return;
}
b(view);
getAdSessionStatePublisher().a();
a(view);
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void removeAllFriendlyObstructions() {
if (this.g) {
return;
}
this.c.b();
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void removeFriendlyObstruction(View view) {
if (this.g) {
return;
}
this.c.c(view);
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void setPossibleObstructionListener(PossibleObstructionListener possibleObstructionListener) {
this.k = possibleObstructionListener;
}
@Override // com.iab.omid.library.fyber.adsession.AdSession
public void start() {
if (this.f) {
return;
}
this.f = true;
c.c().c(this);
this.e.a(i.c().b());
this.e.a(com.iab.omid.library.fyber.internal.a.a().b());
this.e.a(this, this.a);
}
}

View File

@@ -0,0 +1,18 @@
package com.iab.omid.library.fyber.adsession.media;
/* loaded from: classes2.dex */
public enum InteractionType {
CLICK("click"),
INVITATION_ACCEPTED("invitationAccept");
String interactionType;
InteractionType(String str) {
this.interactionType = str;
}
@Override // java.lang.Enum
public String toString() {
return this.interactionType;
}
}

View File

@@ -0,0 +1,127 @@
package com.iab.omid.library.fyber.adsession.media;
import com.facebook.login.LoginLogger;
import com.iab.omid.library.fyber.adsession.AdSession;
import com.iab.omid.library.fyber.adsession.a;
import com.iab.omid.library.fyber.internal.i;
import com.iab.omid.library.fyber.utils.c;
import com.iab.omid.library.fyber.utils.g;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.ironsource.v8;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.tapjoy.TJAdUnitConstants;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class MediaEvents {
private final a adSession;
private MediaEvents(a aVar) {
this.adSession = aVar;
}
private void confirmValidDuration(float f) {
if (f <= 0.0f) {
throw new IllegalArgumentException("Invalid Media duration");
}
}
private void confirmValidVolume(float f) {
if (f < 0.0f || f > 1.0f) {
throw new IllegalArgumentException("Invalid Media volume");
}
}
public static MediaEvents createMediaEvents(AdSession adSession) {
a aVar = (a) adSession;
g.a(adSession, "AdSession is null");
g.f(aVar);
g.c(aVar);
g.b(aVar);
g.h(aVar);
MediaEvents mediaEvents = new MediaEvents(aVar);
aVar.getAdSessionStatePublisher().a(mediaEvents);
return mediaEvents;
}
public void adUserInteraction(InteractionType interactionType) {
g.a(interactionType, "InteractionType is null");
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "interactionType", interactionType);
this.adSession.getAdSessionStatePublisher().a(TJAdUnitConstants.String.AD_USER_INTERACTION, jSONObject);
}
public void bufferFinish() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("bufferFinish");
}
public void bufferStart() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("bufferStart");
}
public void complete() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_COMPLETE);
}
public void firstQuartile() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("firstQuartile");
}
public void midpoint() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_MIDPOINT);
}
public void pause() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_PAUSE);
}
public void playerStateChange(PlayerState playerState) {
g.a(playerState, "PlayerState is null");
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "state", playerState);
this.adSession.getAdSessionStatePublisher().a("playerStateChange", jSONObject);
}
public void resume() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(CampaignEx.JSON_NATIVE_VIDEO_RESUME);
}
public void skipped() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a(LoginLogger.EVENT_PARAM_METHOD_RESULT_SKIPPED);
}
public void start(float f, float f2) {
confirmValidDuration(f);
confirmValidVolume(f2);
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, IronSourceConstants.EVENTS_DURATION, Float.valueOf(f));
c.a(jSONObject, "mediaPlayerVolume", Float.valueOf(f2));
c.a(jSONObject, v8.i.P, Float.valueOf(i.c().b()));
this.adSession.getAdSessionStatePublisher().a("start", jSONObject);
}
public void thirdQuartile() {
g.a(this.adSession);
this.adSession.getAdSessionStatePublisher().a("thirdQuartile");
}
public void volumeChange(float f) {
confirmValidVolume(f);
g.a(this.adSession);
JSONObject jSONObject = new JSONObject();
c.a(jSONObject, "mediaPlayerVolume", Float.valueOf(f));
c.a(jSONObject, v8.i.P, Float.valueOf(i.c().b()));
this.adSession.getAdSessionStatePublisher().a("volumeChange", jSONObject);
}
}

View File

@@ -0,0 +1,24 @@
package com.iab.omid.library.fyber.adsession.media;
import com.mbridge.msdk.newreward.player.view.hybrid.util.MRAIDCommunicatorUtil;
import com.vungle.ads.internal.Constants;
/* loaded from: classes2.dex */
public enum PlayerState {
MINIMIZED("minimized"),
COLLAPSED("collapsed"),
NORMAL("normal"),
EXPANDED(MRAIDCommunicatorUtil.STATES_EXPANDED),
FULLSCREEN(Constants.TEMPLATE_TYPE_FULLSCREEN);
private final String playerState;
PlayerState(String str) {
this.playerState = str;
}
@Override // java.lang.Enum
public String toString() {
return this.playerState;
}
}

View File

@@ -0,0 +1,20 @@
package com.iab.omid.library.fyber.adsession.media;
/* loaded from: classes2.dex */
public enum Position {
PREROLL("preroll"),
MIDROLL("midroll"),
POSTROLL("postroll"),
STANDALONE("standalone");
private final String position;
Position(String str) {
this.position = str;
}
@Override // java.lang.Enum
public String toString() {
return this.position;
}
}

View File

@@ -0,0 +1,63 @@
package com.iab.omid.library.fyber.adsession.media;
import com.iab.omid.library.fyber.utils.d;
import com.iab.omid.library.fyber.utils.g;
import com.ironsource.v8;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class VastProperties {
private final boolean a;
private final Float b;
private final boolean c;
private final Position d;
private VastProperties(boolean z, Float f, boolean z2, Position position) {
this.a = z;
this.b = f;
this.c = z2;
this.d = position;
}
public static VastProperties createVastPropertiesForNonSkippableMedia(boolean z, Position position) {
g.a(position, "Position is null");
return new VastProperties(false, null, z, position);
}
public static VastProperties createVastPropertiesForSkippableMedia(float f, boolean z, Position position) {
g.a(position, "Position is null");
return new VastProperties(true, Float.valueOf(f), z, position);
}
public JSONObject a() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("skippable", this.a);
if (this.a) {
jSONObject.put("skipOffset", this.b);
}
jSONObject.put("autoPlay", this.c);
jSONObject.put(v8.h.L, this.d);
} catch (JSONException e) {
d.a("VastProperties: JSON error", e);
}
return jSONObject;
}
public Position getPosition() {
return this.d;
}
public Float getSkipOffset() {
return this.b;
}
public boolean isAutoPlay() {
return this.c;
}
public boolean isSkippable() {
return this.a;
}
}

View File

@@ -0,0 +1,49 @@
package com.iab.omid.library.fyber;
import android.content.Context;
import com.iab.omid.library.fyber.internal.i;
import com.iab.omid.library.fyber.internal.j;
import com.iab.omid.library.fyber.utils.e;
import com.iab.omid.library.fyber.utils.g;
/* loaded from: classes2.dex */
public class b {
private boolean a;
private void b(Context context) {
g.a(context, "Application Context cannot be null");
}
public String a() {
return "1.5.0-Fyber";
}
public void a(Context context) {
b(context);
if (b()) {
return;
}
a(true);
i.c().a(context);
com.iab.omid.library.fyber.internal.b.g().a(context);
com.iab.omid.library.fyber.utils.a.a(context);
com.iab.omid.library.fyber.utils.c.a(context);
e.a(context);
com.iab.omid.library.fyber.internal.g.b().a(context);
com.iab.omid.library.fyber.internal.a.a().a(context);
j.b().a(context);
}
public void a(boolean z) {
this.a = z;
}
public boolean b() {
return this.a;
}
public void c() {
g.a();
com.iab.omid.library.fyber.internal.a.a().d();
}
}

View File

@@ -0,0 +1,101 @@
package com.iab.omid.library.fyber;
import com.iab.omid.library.fyber.utils.g;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
class c {
private static final Pattern a = Pattern.compile("<(head)( [^>]*)?>", 2);
private static final Pattern b = Pattern.compile("<(head)( [^>]*)?/>", 2);
private static final Pattern c = Pattern.compile("<(body)( [^>]*?)?>", 2);
private static final Pattern d = Pattern.compile("<(body)( [^>]*?)?/>", 2);
private static final Pattern e = Pattern.compile("<(html)( [^>]*?)?>", 2);
private static final Pattern f = Pattern.compile("<(html)( [^>]*?)?/>", 2);
private static final Pattern g = Pattern.compile("<!DOCTYPE [^>]*>", 2);
public static String a(String str, String str2) {
g.a(str, "HTML is null or empty");
int[][] a2 = a(str);
StringBuilder sb = new StringBuilder(str.length() + str2.length() + 16);
if (!b(str, sb, b, str2, a2) && !a(str, sb, a, str2, a2) && !b(str, sb, d, str2, a2) && !a(str, sb, c, str2, a2) && !b(str, sb, f, str2, a2) && !a(str, sb, e, str2, a2) && !a(str, sb, g, str2, a2)) {
return str2 + str;
}
return sb.toString();
}
private static boolean a(int i, int[][] iArr) {
if (iArr != null) {
for (int[] iArr2 : iArr) {
if (i >= iArr2[0] && i <= iArr2[1]) {
return true;
}
}
}
return false;
}
private static boolean a(String str, StringBuilder sb, Pattern pattern, String str2, int[][] iArr) {
Matcher matcher = pattern.matcher(str);
int i = 0;
while (matcher.find(i)) {
int start = matcher.start();
int end = matcher.end();
if (!a(start, iArr)) {
sb.append(str.substring(0, matcher.end()));
sb.append(str2);
sb.append(str.substring(matcher.end()));
return true;
}
i = end;
}
return false;
}
private static int[][] a(String str) {
ArrayList arrayList = new ArrayList();
int length = str.length();
int i = 0;
while (i < length) {
int indexOf = str.indexOf("<!--", i);
if (indexOf >= 0) {
int indexOf2 = str.indexOf("-->", indexOf);
if (indexOf2 >= 0) {
arrayList.add(new int[]{indexOf, indexOf2});
i = indexOf2 + 3;
} else {
arrayList.add(new int[]{indexOf, length});
}
}
i = length;
}
return (int[][]) arrayList.toArray((int[][]) Array.newInstance((Class<?>) Integer.TYPE, 0, 2));
}
public static String b(String str, String str2) {
return a(str2, "<script type=\"text/javascript\">" + str + "</script>");
}
private static boolean b(String str, StringBuilder sb, Pattern pattern, String str2, int[][] iArr) {
Matcher matcher = pattern.matcher(str);
int i = 0;
while (matcher.find(i)) {
int start = matcher.start();
int end = matcher.end();
if (!a(start, iArr)) {
sb.append(str.substring(0, matcher.end() - 2));
sb.append(">");
sb.append(str2);
sb.append("</");
sb.append(matcher.group(1));
sb.append(">");
sb.append(str.substring(matcher.end()));
return true;
}
i = end;
}
return false;
}
}

View File

@@ -0,0 +1,15 @@
package com.iab.omid.library.fyber.devicevolume;
/* loaded from: classes2.dex */
public class a {
public float a(int i, int i2) {
if (i2 <= 0 || i <= 0) {
return 0.0f;
}
float f = i / i2;
if (f > 1.0f) {
return 1.0f;
}
return f;
}
}

View File

@@ -0,0 +1,8 @@
package com.iab.omid.library.fyber.devicevolume;
/* loaded from: classes2.dex */
public class b {
public a a() {
return new a();
}
}

View File

@@ -0,0 +1,6 @@
package com.iab.omid.library.fyber.devicevolume;
/* loaded from: classes2.dex */
public interface c {
void a(float f);
}

Some files were not shown because too many files have changed in this diff Show More