我要上王者 v1.1版本的 MD5 值为:b7d3566522def961cabeb92cb17f5db9
以下内容为反编译后的 GDTATInitManager.java 源代码,内容仅作参考
package com.anythink.network.gdt;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.anythink.core.api.ATAdConst;
import com.anythink.core.api.ATBidRequestInfo;
import com.anythink.core.api.ATBidRequestInfoListener;
import com.anythink.core.api.ATInitMediation;
import com.anythink.core.api.ATSDK;
import com.anythink.core.api.MediationInitCallback;
import com.qq.e.ads.interstitial2.UnifiedInterstitialAD;
import com.qq.e.ads.rewardvideo.RewardVideoAD;
import com.qq.e.comm.constants.LoadAdParams;
import com.qq.e.comm.managers.GDTAdSdk;
import com.qq.e.comm.managers.setting.GlobalSetting;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class GDTATInitManager extends ATInitMediation {
public static final String TAG = "GDTATInitManager";
private static volatile GDTATInitManager f4992b;
private boolean f;
private String g;
private Map<String, WeakReference> c = new ConcurrentHashMap();
private Map<String, RewardVideoAD> d = new ConcurrentHashMap();
private Map<String, UnifiedInterstitialAD> e = new ConcurrentHashMap();
private final Object h = new Object();
int f4993a = 0;
@Override
public String getAdapterVersion() {
return "UA_6.2.75.1";
}
@Override
public String getNetworkName() {
return "Tencent";
}
@Override
public String getNetworkSDKClass() {
return "com.qq.e.ads.ADActivity";
}
private GDTATInitManager() {
}
public static GDTATInitManager getInstance() {
if (f4992b == null) {
synchronized (GDTATInitManager.class) {
if (f4992b == null) {
f4992b = new GDTATInitManager();
}
}
}
return f4992b;
}
public void setGDTATCustomController(GDTATCustomController gDTATCustomController) {
if (gDTATCustomController != null) {
GlobalSetting.setAgreePrivacyStrategy(gDTATCustomController.getAgreePrivacyStrategy());
try {
HashMap hashMap = new HashMap();
hashMap.put("mac_address", Boolean.valueOf(gDTATCustomController.isCanUseMacAddress()));
hashMap.put("android_id", Boolean.valueOf(gDTATCustomController.isCanUseAndroidId()));
hashMap.put("device_id", Boolean.valueOf(gDTATCustomController.isCanUseDeviceId()));
GlobalSetting.setAgreeReadPrivacyInfo(hashMap);
} catch (Throwable th) {
th.printStackTrace();
}
}
}
public final void a(String str, WeakReference weakReference) {
try {
this.c.put(str, weakReference);
} catch (Throwable unused) {
}
}
public final void a(String str, RewardVideoAD rewardVideoAD) {
this.d.clear();
this.d.put(str, rewardVideoAD);
}
public final void a() {
this.d.clear();
}
public final void a(String str, UnifiedInterstitialAD unifiedInterstitialAD) {
this.e.clear();
this.e.put(str, unifiedInterstitialAD);
}
public final void b() {
this.e.clear();
}
private void c() {
try {
for (Map.Entry<String, WeakReference> entry : this.c.entrySet()) {
if (entry.getValue().get() == null) {
this.c.remove(entry.getKey());
}
}
} catch (Throwable unused) {
}
}
public synchronized void initSDK(Context context, Map<String, Object> map) {
initSDK(context, map, null);
}
@Override
public synchronized void initSDK(Context context, Map<String, Object> map, MediationInitCallback mediationInitCallback) {
try {
this.f4993a = ATSDK.getPersionalizedAdStatus();
} catch (Throwable unused) {
}
if (this.f4993a == 2) {
GlobalSetting.setPersonalizedState(1);
} else {
GlobalSetting.setPersonalizedState(0);
}
if (ATSDK.isNetworkLogDebug()) {
String str = TAG;
Log.i(str, "GlobalSetting.getPersonalizedState():" + GlobalSetting.getPersonalizedState());
}
c();
String stringFromMap = getStringFromMap(map, "app_id");
if (map.containsKey(ATInitMediation.KEY_LOCAL)) {
this.g = stringFromMap;
} else {
String str2 = this.g;
if (str2 != null && !TextUtils.equals(str2, stringFromMap)) {
checkToSaveInitData(getNetworkName(), map, this.g);
this.g = null;
}
}
if (!this.f) {
GDTAdSdk.init(context.getApplicationContext(), stringFromMap);
this.f = true;
}
if (mediationInitCallback != null) {
mediationInitCallback.onSuccess();
}
}
@Override
public String getNetworkVersion() {
return GDTATConst.getNetworkVersion();
}
@Override
public List getActivityStatus() {
ArrayList arrayList = new ArrayList();
arrayList.add("com.qq.e.ads.ADActivity");
arrayList.add("com.qq.e.ads.PortraitADActivity");
arrayList.add("com.qq.e.ads.LandscapeADActivity");
arrayList.add("com.qq.e.ads.RewardvideoPortraitADActivity");
arrayList.add("com.qq.e.ads.RewardvideoLandscapeADActivity");
return arrayList;
}
@Override
public List getServiceStatus() {
ArrayList arrayList = new ArrayList();
arrayList.add("com.qq.e.comm.DownloadService");
return arrayList;
}
public static int a(Context context, float f) {
float f2 = context.getResources().getDisplayMetrics().density;
if (f2 <= 0.0f) {
f2 = 1.0f;
}
return (int) ((f / f2) + 0.5f);
}
public final void a(Context context, final Map<String, Object> map, final Map<String, Object> map2, final ATBidRequestInfoListener aTBidRequestInfoListener) {
getInstance().initSDK(context, map, new MediationInitCallback() {
@Override
public final void onSuccess() {
GDTATInitManager.this.runOnThreadPool(new Runnable() {
@Override
public final void run() {
GDTBidRequestInfo gDTBidRequestInfo;
synchronized (GDTATInitManager.this.h) {
gDTBidRequestInfo = new GDTBidRequestInfo(map);
}
if (!gDTBidRequestInfo.isValid()) {
if (aTBidRequestInfoListener != null) {
aTBidRequestInfoListener.onFailed(ATBidRequestInfo.BIDTOKEN_EMPTY_ERROR_TYPE);
}
} else if (aTBidRequestInfoListener != null) {
aTBidRequestInfoListener.onSuccess(gDTBidRequestInfo);
}
}
});
}
@Override
public final void onFail(String str) {
ATBidRequestInfoListener aTBidRequestInfoListener2 = aTBidRequestInfoListener;
if (aTBidRequestInfoListener2 != null) {
aTBidRequestInfoListener2.onFailed(ATBidRequestInfo.INIT_ERROR_TYPE);
}
}
});
}
public static LoadAdParams a(Map<String, Object> map) {
LoadAdParams loadAdParams = new LoadAdParams();
HashMap hashMap = new HashMap();
a(hashMap, map);
loadAdParams.setDevExtra(hashMap);
return loadAdParams;
}
public static void a(Map map, Map<String, Object> map2) {
try {
Object obj = map2.get(ATAdConst.NETWORK_REQUEST_PARAMS_KEY.STACK_INFO);
map.put("staIn", obj != null ? obj.toString() : "");
map.put("meSrc", "299");
Object obj2 = map2.get(ATAdConst.NETWORK_REQUEST_PARAMS_KEY.MEDIATION_WF_ID);
map.put("thrmei", obj2 != null ? obj2.toString() : "");
} catch (Exception unused) {
}
}
}