GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5
以下内容为反编译后的 FacebookAdapterConfiguration.java 源代码,内容仅作参考
package com.mopub.mobileads;
import android.content.Context;
import android.text.TextUtils;
import com.facebook.ads.AudienceNetworkAds;
import com.facebook.ads.BidderTokenProvider;
import com.mopub.common.BaseAdapterConfiguration;
import com.mopub.common.OnNetworkInitializationFinishedListener;
import com.mopub.common.Preconditions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
public class FacebookAdapterConfiguration extends BaseAdapterConfiguration {
private static final String ADAPTER_VERSION = "6.4.0.1";
private static final String MOPUB_NETWORK_NAME = "facebook";
private static final String NATIVE_BANNER_KEY = "native_banner";
private static final String PLACEMENT_IDS_KEY = "placement_ids";
private static final String SDK_VERSION = "6.4.0";
private static Boolean isNativeBanner;
private final AtomicReference<String> tokenReference = new AtomicReference<>(null);
private final AtomicBoolean isComputingToken = new AtomicBoolean(false);
@Override
public String getAdapterVersion() {
return "6.4.0.1";
}
@Override
public String getMoPubNetworkName() {
return "facebook";
}
@Override
public String getNetworkSdkVersion() {
return "6.4.0";
}
@Override
public String getBiddingToken(Context context) {
Preconditions.checkNotNull(context);
refreshBidderToken(context);
return this.tokenReference.get();
}
@Override
public void initializeNetwork(Context context, Map<String, String> map, OnNetworkInitializationFinishedListener onNetworkInitializationFinishedListener) {
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(onNetworkInitializationFinishedListener);
synchronized (FacebookAdapterConfiguration.class) {
try {
this.tokenReference.set(BidderTokenProvider.getBidderToken(context));
List<String> arrayList = new ArrayList<>();
if (map != null && !map.isEmpty()) {
String str = map.get(PLACEMENT_IDS_KEY);
if (!TextUtils.isEmpty(str)) {
arrayList = Arrays.asList(str.split("\\s*,\\s*"));
}
Boolean valueOf = Boolean.valueOf(map.get(NATIVE_BANNER_KEY));
isNativeBanner = valueOf;
setNativeBannerPref(valueOf);
}
if (!AudienceNetworkAds.isInitialized(context)) {
AudienceNetworkAds.buildInitSettings(context).withPlacementIds(arrayList).withMediationService("MOPUB_5.16.4:6.4.0.1").initialize();
}
} finally {
onNetworkInitializationFinishedListener.onNetworkInitializationFinished(getClass(), MoPubErrorCode.ADAPTER_INITIALIZATION_SUCCESS);
}
}
onNetworkInitializationFinishedListener.onNetworkInitializationFinished(getClass(), MoPubErrorCode.ADAPTER_INITIALIZATION_SUCCESS);
}
public static Boolean getNativeBannerPref() {
return isNativeBanner;
}
private static void setNativeBannerPref(Boolean bool) {
isNativeBanner = bool;
}
private void refreshBidderToken(final Context context) {
if (this.isComputingToken.compareAndSet(false, true)) {
new Thread(new Runnable() {
@Override
public void run() {
String bidderToken = BidderTokenProvider.getBidderToken(context);
if (bidderToken != null) {
FacebookAdapterConfiguration.this.tokenReference.set(bidderToken);
}
FacebookAdapterConfiguration.this.isComputingToken.set(false);
}
}).start();
}
}
}