Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 CmpServiceImpl.java 源代码,内容仅作参考
package com.applovin.impl.privacy.cmp;
import android.app.Activity;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.applovin.impl.privacy.a.d;
import com.applovin.impl.privacy.cmp.b;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.t;
import com.applovin.impl.sdk.x;
import com.applovin.sdk.AppLovinCmpError;
import com.applovin.sdk.AppLovinCmpService;
import com.applovin.sdk.AppLovinSdkUtils;
public class CmpServiceImpl implements b.a, AppLovinCmpService {
private final com.applovin.impl.privacy.cmp.a ayh;
private com.applovin.impl.privacy.cmp.b ayi = Aj();
private a ayj;
private b ayk;
private final n sdk;
public interface a {
void c(AppLovinCmpError appLovinCmpError);
}
public interface b {
void d(AppLovinCmpError appLovinCmpError);
}
public CmpServiceImpl(n nVar) {
this.sdk = nVar;
this.ayh = new com.applovin.impl.privacy.cmp.a(nVar.CG().getDebugUserGeography());
}
private com.applovin.impl.privacy.cmp.b Aj() {
if (t.dM("com.google.android.ump.ConsentForm")) {
return new com.applovin.impl.privacy.cmp.b(this.sdk);
}
if (this.sdk.CG().isEnabled() && this.sdk.CG().Ap() == d.a.UNIFIED) {
x.I("AppLovinSdk", "Could not load Google UMP. Please add the Google User Messaging Platform SDK into your application. Instructions can be found here: https://dash.applovin.com/documentation/mediation/android/getting-started/terms-and-privacy-policy-flow#enabling-google-ump");
return null;
}
return null;
}
private void Ak() {
if (hasSupportedCmp()) {
this.ayi.Ak();
}
}
private void Al() {
com.applovin.impl.privacy.cmp.b bVar = this.ayi;
if (bVar == null) {
return;
}
bVar.destroy();
}
private void a(AppLovinCmpError appLovinCmpError) {
a aVar = this.ayj;
if (aVar == null) {
return;
}
aVar.c(appLovinCmpError);
this.ayj = null;
}
private void b(AppLovinCmpError appLovinCmpError) {
b bVar = this.ayk;
if (bVar == null) {
return;
}
bVar.d(appLovinCmpError);
this.ayk = null;
}
@Override
public boolean hasSupportedCmp() {
return this.ayi != null;
}
public void loadCmp(final Activity activity, a aVar) {
if (!hasSupportedCmp()) {
aVar.c(new CmpErrorImpl(AppLovinCmpError.Code.INTEGRATION_ERROR, "A supported CMP is not integrated"));
return;
}
this.ayj = aVar;
Runnable runnable = new Runnable() {
@Override
public void run() {
CmpServiceImpl.this.ayi.a(activity, CmpServiceImpl.this.ayh, CmpServiceImpl.this);
}
};
if (this.ayi.Am()) {
AppLovinSdkUtils.runOnUiThread(runnable);
} else {
runnable.run();
}
}
@Override
public void onFlowHidden(Bundle bundle) {
b((AppLovinCmpError) null);
Al();
}
@Override
public void onFlowLoadFailed(CmpErrorImpl cmpErrorImpl) {
a(cmpErrorImpl);
Al();
}
@Override
public void onFlowLoaded(Bundle bundle) {
a((AppLovinCmpError) null);
}
@Override
public void onFlowShowFailed(CmpErrorImpl cmpErrorImpl) {
b(cmpErrorImpl);
Al();
}
public void showCmp(final Activity activity, b bVar) {
Runnable runnable = new Runnable() {
@Override
public void run() {
CmpServiceImpl.this.ayi.b(activity, CmpServiceImpl.this.ayh, CmpServiceImpl.this);
}
};
this.ayk = bVar;
if (this.ayi.An()) {
AppLovinSdkUtils.runOnUiThread(runnable);
} else {
runnable.run();
}
}
@Override
public void showCmpForExistingUser(@NonNull final Activity activity, @NonNull final AppLovinCmpService.OnCompletedListener onCompletedListener) {
this.sdk.Ci();
if (x.FL()) {
x Ci = this.sdk.Ci();
Ci.f("AppLovinCmpService", "showCmpForExistingUser(activity=" + activity + ", completedListener=" + onCompletedListener + ")");
}
if (!hasSupportedCmp()) {
onCompletedListener.onCompleted(new CmpErrorImpl(AppLovinCmpError.Code.INTEGRATION_ERROR, "A supported CMP is not integrated"));
return;
}
Ak();
loadCmp(activity, new a() {
@Override
public void c(AppLovinCmpError appLovinCmpError) {
if (appLovinCmpError != null) {
onCompletedListener.onCompleted(appLovinCmpError);
} else {
CmpServiceImpl.this.showCmp(activity, new b() {
@Override
public void d(AppLovinCmpError appLovinCmpError2) {
onCompletedListener.onCompleted(appLovinCmpError2);
}
});
}
}
});
}
@NonNull
public String toString() {
return "[CmpService]";
}
}