- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
103 lines
3.7 KiB
Java
103 lines
3.7 KiB
Java
package com.mbridge.msdk.mbsignalcommon.mraid;
|
|
|
|
import android.net.Uri;
|
|
import android.text.TextUtils;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.tools.z;
|
|
import com.mbridge.msdk.mbsignalcommon.mraid.a;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
|
import java.lang.reflect.Method;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.Set;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class c {
|
|
private static volatile ConcurrentHashMap<String, String> a = new ConcurrentHashMap<>();
|
|
private static ArrayList<String> b = new ArrayList<>();
|
|
|
|
public static com.mbridge.msdk.mbsignalcommon.windvane.a a(WindVaneWebView windVaneWebView, String str) {
|
|
Set<String> unmodifiableSet;
|
|
Uri parse = Uri.parse(str);
|
|
String scheme = parse.getScheme();
|
|
if (TextUtils.isEmpty(scheme) || !scheme.contains(CampaignEx.JSON_KEY_MRAID)) {
|
|
return null;
|
|
}
|
|
com.mbridge.msdk.mbsignalcommon.windvane.a aVar = new com.mbridge.msdk.mbsignalcommon.windvane.a();
|
|
aVar.d = z.a("n+ztLkxpVTzBLkxgHN==");
|
|
aVar.e = parse.getHost();
|
|
int i = 0;
|
|
if (b.size() == 0) {
|
|
for (Method method : b.class.getDeclaredMethods()) {
|
|
b.add(method.getName());
|
|
}
|
|
}
|
|
if (!b.contains(aVar.e) && windVaneWebView != null) {
|
|
String campaignId = windVaneWebView.getCampaignId();
|
|
String str2 = aVar.e;
|
|
if (!TextUtils.isEmpty(campaignId)) {
|
|
if (a.containsKey(campaignId)) {
|
|
String str3 = a.get(campaignId);
|
|
if (!TextUtils.isEmpty(str2) && !str3.contains(str2)) {
|
|
if (str3.length() > 0) {
|
|
str3 = str3.concat(",");
|
|
}
|
|
a.put(campaignId, str3.concat(str2));
|
|
}
|
|
} else {
|
|
a.put(campaignId, str2);
|
|
}
|
|
}
|
|
a.C0211a.a.a(windVaneWebView, aVar.e);
|
|
a.C0211a.a.a(windVaneWebView, aVar.e, "Specified command is not implemented");
|
|
return null;
|
|
}
|
|
String encodedQuery = parse.getEncodedQuery();
|
|
if (encodedQuery == null) {
|
|
unmodifiableSet = Collections.emptySet();
|
|
} else {
|
|
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
|
do {
|
|
int indexOf = encodedQuery.indexOf(38, i);
|
|
if (indexOf == -1) {
|
|
indexOf = encodedQuery.length();
|
|
}
|
|
int indexOf2 = encodedQuery.indexOf(61, i);
|
|
if (indexOf2 > indexOf || indexOf2 == -1) {
|
|
indexOf2 = indexOf;
|
|
}
|
|
linkedHashSet.add(Uri.decode(encodedQuery.substring(i, indexOf2)));
|
|
i = indexOf + 1;
|
|
} while (i < encodedQuery.length());
|
|
unmodifiableSet = Collections.unmodifiableSet(linkedHashSet);
|
|
}
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
for (String str4 : unmodifiableSet) {
|
|
jSONObject.put(str4, parse.getQueryParameter(str4));
|
|
}
|
|
aVar.f = jSONObject.toString();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return aVar;
|
|
}
|
|
|
|
public static String a(String str) {
|
|
if (a.containsKey(str)) {
|
|
return a.get(str);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static void b(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
a.remove(str);
|
|
}
|
|
}
|