- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
324 lines
12 KiB
Java
324 lines
12 KiB
Java
package com.applovin.impl.sdk;
|
|
|
|
import android.adservices.measurement.MeasurementManager;
|
|
import android.adservices.topics.GetTopicsRequest;
|
|
import android.adservices.topics.GetTopicsResponse;
|
|
import android.adservices.topics.Topic;
|
|
import android.adservices.topics.TopicsManager;
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.os.OutcomeReceiver;
|
|
import android.text.TextUtils;
|
|
import android.view.InputEvent;
|
|
import androidx.privacysandbox.ads.adservices.measurement.MeasurementManager$Api33Ext5Impl$$ExternalSyntheticApiModelOutline23;
|
|
import androidx.privacysandbox.ads.adservices.measurement.MeasurementManager$Api33Ext5Impl$$ExternalSyntheticApiModelOutline24;
|
|
import androidx.privacysandbox.ads.adservices.topics.TopicsManagerApi33Ext4Impl$$ExternalSyntheticApiModelOutline0;
|
|
import androidx.privacysandbox.ads.adservices.topics.TopicsManagerApi33Ext4Impl$$ExternalSyntheticApiModelOutline1;
|
|
import androidx.privacysandbox.ads.adservices.topics.TopicsManagerApi33Ext5Impl$$ExternalSyntheticApiModelOutline3;
|
|
import androidx.privacysandbox.ads.adservices.topics.TopicsManagerImplCommon$$ExternalSyntheticApiModelOutline1;
|
|
import androidx.privacysandbox.ads.adservices.topics.TopicsManagerImplCommon$$ExternalSyntheticApiModelOutline3;
|
|
import com.applovin.impl.jn;
|
|
import com.applovin.impl.sdk.utils.JsonUtils;
|
|
import com.applovin.impl.sj;
|
|
import com.applovin.impl.tm;
|
|
import com.applovin.impl.wh;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.concurrent.Executor;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class q {
|
|
private final j a;
|
|
private final Executor b;
|
|
private final MeasurementManager e;
|
|
private final TopicsManager h;
|
|
private final Set c = new HashSet();
|
|
private final Object d = new Object();
|
|
private final AtomicReference f = new AtomicReference(new JSONArray());
|
|
private final d g = new d(this, null);
|
|
|
|
public class a implements OutcomeReceiver {
|
|
public a() {
|
|
}
|
|
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onError(Exception exc) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Failed to register impression", exc);
|
|
}
|
|
}
|
|
|
|
public void onResult(Object obj) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Successfully registered impression");
|
|
}
|
|
}
|
|
}
|
|
|
|
public class b implements OutcomeReceiver {
|
|
public b() {
|
|
}
|
|
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onError(Exception exc) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Failed to register click", exc);
|
|
}
|
|
}
|
|
|
|
public void onResult(Object obj) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Successfully registered click");
|
|
}
|
|
}
|
|
}
|
|
|
|
public class c implements OutcomeReceiver {
|
|
public c() {
|
|
}
|
|
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onError(Exception exc) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Failed to register conversion", exc);
|
|
}
|
|
}
|
|
|
|
public void onResult(Object obj) {
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().a("PrivacySandboxService", "Successfully registered conversion");
|
|
}
|
|
}
|
|
}
|
|
|
|
public class d implements OutcomeReceiver {
|
|
private d() {
|
|
}
|
|
|
|
public void a(GetTopicsResponse getTopicsResponse) {
|
|
List topics;
|
|
int topicId;
|
|
long modelVersion;
|
|
long taxonomyVersion;
|
|
topics = getTopicsResponse.getTopics();
|
|
int size = topics.size();
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
q.this.a.J().d("PrivacySandboxService", size + " topic(s) received");
|
|
}
|
|
JSONArray jSONArray = new JSONArray();
|
|
Iterator it = topics.iterator();
|
|
while (it.hasNext()) {
|
|
Topic m = TopicsManagerImplCommon$$ExternalSyntheticApiModelOutline3.m(it.next());
|
|
JSONObject jSONObject = new JSONObject();
|
|
topicId = m.getTopicId();
|
|
JsonUtils.putInt(jSONObject, "id", topicId);
|
|
modelVersion = m.getModelVersion();
|
|
JsonUtils.putLong(jSONObject, "model", modelVersion);
|
|
taxonomyVersion = m.getTaxonomyVersion();
|
|
JsonUtils.putLong(jSONObject, "taxonomy", taxonomyVersion);
|
|
jSONArray.put(jSONObject);
|
|
}
|
|
q.this.f.set(jSONArray);
|
|
q.this.b(((Boolean) q.this.a.a(sj.K6)).booleanValue(), ((Long) q.this.a.a(sj.I6)).longValue());
|
|
}
|
|
|
|
public /* bridge */ /* synthetic */ void onResult(Object obj) {
|
|
a(TopicsManagerImplCommon$$ExternalSyntheticApiModelOutline1.m(obj));
|
|
}
|
|
|
|
public /* synthetic */ d(q qVar, a aVar) {
|
|
this();
|
|
}
|
|
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public void onError(Exception exc) {
|
|
String str;
|
|
Long l = (Long) q.this.a.a(sj.J6);
|
|
boolean z = l.longValue() == -1;
|
|
q.this.a.J();
|
|
if (n.a()) {
|
|
n J = q.this.a.J();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("Failed to retrieve topics");
|
|
if (z) {
|
|
str = "";
|
|
} else {
|
|
str = ", retrying in " + l + " ms";
|
|
}
|
|
sb.append(str);
|
|
J.a("PrivacySandboxService", sb.toString(), exc);
|
|
}
|
|
if (z) {
|
|
return;
|
|
}
|
|
q.this.b(((Boolean) q.this.a.a(sj.L6)).booleanValue(), l.longValue());
|
|
}
|
|
}
|
|
|
|
public q(j jVar) {
|
|
this.a = jVar;
|
|
this.b = jVar.j0().a();
|
|
Context l = j.l();
|
|
this.e = MeasurementManager$Api33Ext5Impl$$ExternalSyntheticApiModelOutline24.m(l.getSystemService(MeasurementManager$Api33Ext5Impl$$ExternalSyntheticApiModelOutline23.m()));
|
|
this.h = TopicsManagerApi33Ext4Impl$$ExternalSyntheticApiModelOutline1.m(l.getSystemService(TopicsManagerApi33Ext4Impl$$ExternalSyntheticApiModelOutline0.m()));
|
|
if (((Boolean) jVar.a(sj.H6)).booleanValue()) {
|
|
b(((Boolean) jVar.a(sj.K6)).booleanValue(), 0L);
|
|
}
|
|
}
|
|
|
|
private boolean c(String str) {
|
|
synchronized (this.d) {
|
|
try {
|
|
if (this.c.contains(str)) {
|
|
return false;
|
|
}
|
|
this.c.add(str);
|
|
return true;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void b(final List list) {
|
|
a("register impression", new Runnable() { // from class: com.applovin.impl.sdk.q$$ExternalSyntheticLambda1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q.this.a(list);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(List list) {
|
|
if (list == null || list.isEmpty() || this.e == null || !wh.e(j.w0)) {
|
|
return;
|
|
}
|
|
this.a.J();
|
|
if (n.a()) {
|
|
this.a.J().a("PrivacySandboxService", "Registering impression...");
|
|
}
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
this.e.registerSource(Uri.parse((String) it.next()), null, this.b, new a());
|
|
}
|
|
}
|
|
|
|
public void b(final List list, final InputEvent inputEvent) {
|
|
a("register click", new Runnable() { // from class: com.applovin.impl.sdk.q$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q.this.a(list, inputEvent);
|
|
}
|
|
});
|
|
}
|
|
|
|
public void b(final String str) {
|
|
a("register conversion trigger event", new Runnable() { // from class: com.applovin.impl.sdk.q$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q.this.a(str);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void b(final boolean z, final long j) {
|
|
a("retrieve topics", new Runnable() { // from class: com.applovin.impl.sdk.q$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q.this.a(z, j);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(List list, InputEvent inputEvent) {
|
|
if (list == null || list.isEmpty() || this.e == null || !wh.e(j.w0)) {
|
|
return;
|
|
}
|
|
this.a.J();
|
|
if (n.a()) {
|
|
this.a.J().a("PrivacySandboxService", "Registering click...");
|
|
}
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
this.e.registerSource(Uri.parse((String) it.next()), inputEvent, this.b, new b());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(String str) {
|
|
if (TextUtils.isEmpty(str) || this.e == null || !wh.e(j.w0)) {
|
|
return;
|
|
}
|
|
this.a.J();
|
|
if (n.a()) {
|
|
this.a.J().a("PrivacySandboxService", "Registering conversion: " + str);
|
|
}
|
|
this.e.registerTrigger(Uri.parse(str), this.b, new c());
|
|
}
|
|
|
|
public JSONArray a() {
|
|
return (JSONArray) this.f.get();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(boolean z, long j) {
|
|
GetTopicsRequest.Builder shouldRecordObservation;
|
|
GetTopicsRequest.Builder adsSdkName;
|
|
final GetTopicsRequest build;
|
|
if (this.h == null) {
|
|
return;
|
|
}
|
|
shouldRecordObservation = TopicsManagerApi33Ext5Impl$$ExternalSyntheticApiModelOutline3.m().setShouldRecordObservation(z);
|
|
adsSdkName = shouldRecordObservation.setAdsSdkName("AppLovin");
|
|
build = adsSdkName.build();
|
|
if (j > 0) {
|
|
this.a.j0().a(new jn(this.a, true, "getTopics", new Runnable() { // from class: com.applovin.impl.sdk.q$$ExternalSyntheticLambda4
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
q.this.a(build);
|
|
}
|
|
}), tm.b.OTHER, j);
|
|
} else {
|
|
this.h.getTopics(build, this.b, this.g);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(GetTopicsRequest getTopicsRequest) {
|
|
this.h.getTopics(getTopicsRequest, this.b, this.g);
|
|
}
|
|
|
|
private void a(String str, Runnable runnable) {
|
|
try {
|
|
this.a.J();
|
|
if (n.a()) {
|
|
this.a.J().a("PrivacySandboxService", "Running operation: " + str);
|
|
}
|
|
runnable.run();
|
|
} catch (Throwable th) {
|
|
this.a.J();
|
|
if (n.a()) {
|
|
this.a.J().a("PrivacySandboxService", "Failed to run operation: " + str, th);
|
|
}
|
|
if (c(str)) {
|
|
this.a.E().a("PrivacySandboxService", str, th);
|
|
}
|
|
}
|
|
}
|
|
}
|