- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
105 lines
3.9 KiB
Java
105 lines
3.9 KiB
Java
package com.iab.omid.library.unity3d.adsession;
|
|
|
|
import android.webkit.WebView;
|
|
import androidx.annotation.Nullable;
|
|
import com.iab.omid.library.unity3d.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;
|
|
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, 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, 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, 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, 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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|