MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3
以下内容为反编译后的 MetaAdapter.java 源代码,内容仅作参考
package com.fyber.fairbid.sdk.mediation.adapter.meta;
import ak.k0;
import ak.q;
import android.content.Context;
import android.text.TextUtils;
import androidx.annotation.Keep;
import bk.o;
import bk.p;
import com.facebook.ads.AdError;
import com.facebook.ads.AdSettings;
import com.facebook.ads.AdSize;
import com.facebook.ads.AdView;
import com.facebook.ads.AudienceNetworkAds;
import com.facebook.ads.BidderTokenProvider;
import com.facebook.ads.CacheFlag;
import com.facebook.ads.InterstitialAd;
import com.facebook.ads.RewardedVideoAd;
import com.facebook.appevents.AppEventsConstants;
import com.fyber.fairbid.ads.RequestFailure;
import com.fyber.fairbid.ads.banner.BannerSize;
import com.fyber.fairbid.ads.banner.internal.InternalBannerOptions;
import com.fyber.fairbid.common.concurrency.SettableFuture;
import com.fyber.fairbid.common.lifecycle.AdDisplay;
import com.fyber.fairbid.common.lifecycle.FetchFailure;
import com.fyber.fairbid.common.lifecycle.FetchOptions;
import com.fyber.fairbid.common.lifecycle.FetchResult;
import com.fyber.fairbid.common.lifecycle.OnScreenAdTracker;
import com.fyber.fairbid.http.FairBidHttpUtils;
import com.fyber.fairbid.internal.ActivityProvider;
import com.fyber.fairbid.internal.Constants;
import com.fyber.fairbid.internal.Logger;
import com.fyber.fairbid.internal.Utils;
import com.fyber.fairbid.internal.utils.DeviceUtils;
import com.fyber.fairbid.internal.utils.ScreenUtils;
import com.fyber.fairbid.ja;
import com.fyber.fairbid.kd;
import com.fyber.fairbid.mediation.LocationProvider;
import com.fyber.fairbid.mediation.Network;
import com.fyber.fairbid.mediation.abstr.AdapterException;
import com.fyber.fairbid.mediation.abstr.DisplayableFetchResult;
import com.fyber.fairbid.mediation.abstr.FetchConstraintsWhileOnScreen;
import com.fyber.fairbid.mediation.abstr.NetworkAdapter;
import com.fyber.fairbid.mediation.analytics.IAdImageReporter;
import com.fyber.fairbid.mediation.display.NetworkModel;
import com.fyber.fairbid.mediation.pmn.ProgrammaticNetworkAdapter;
import com.fyber.fairbid.mediation.pmn.ProgrammaticSessionInfo;
import com.fyber.fairbid.mediation.request.MediationRequest;
import com.fyber.fairbid.nd;
import com.fyber.fairbid.od;
import com.fyber.fairbid.pd;
import com.fyber.fairbid.q0;
import com.fyber.fairbid.qd;
import com.fyber.fairbid.rd;
import com.fyber.fairbid.sdk.R;
import com.fyber.fairbid.sdk.ads.PMNAd;
import com.fyber.fairbid.sdk.mediation.FairBidListenerHandler;
import com.fyber.fairbid.sdk.mediation.adapter.meta.MetaAdapter;
import com.fyber.fairbid.sdk.placements.IPlacementsHandler;
import com.fyber.fairbid.te;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import nk.s;
import wk.e;
public final class MetaAdapter extends NetworkAdapter implements ProgrammaticNetworkAdapter {
public static final int f21357y = 0;
public q0 f21358v;
public final int f21359w;
public final boolean f21360x;
public static final class a {
public static RequestFailure a(AdError adError) {
s.h(adError, "<this>");
int errorCode = adError.getErrorCode();
if (errorCode != 2000) {
if (errorCode != 2001) {
switch (errorCode) {
case 1000:
return RequestFailure.NETWORK_ERROR;
case 1001:
case 1002:
return RequestFailure.NO_FILL;
default:
return RequestFailure.UNKNOWN;
}
}
return RequestFailure.INTERNAL;
}
return RequestFailure.REMOTE_ERROR;
}
}
public class b {
public static final int[] f21361a;
static {
int[] iArr = new int[Constants.AdType.values().length];
try {
iArr[Constants.AdType.BANNER.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[Constants.AdType.REWARDED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[Constants.AdType.INTERSTITIAL.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
f21361a = iArr;
}
}
@Keep
public MetaAdapter(Context context, ActivityProvider activityProvider, Utils.ClockHelper clockHelper, FetchResult.Factory factory, IAdImageReporter iAdImageReporter, ScreenUtils screenUtils, ScheduledExecutorService scheduledExecutorService, ExecutorService executorService, LocationProvider locationProvider, Utils utils, DeviceUtils deviceUtils, FairBidListenerHandler fairBidListenerHandler, IPlacementsHandler iPlacementsHandler, OnScreenAdTracker onScreenAdTracker) {
super(context, activityProvider, clockHelper, factory, iAdImageReporter, screenUtils, scheduledExecutorService, executorService, locationProvider, utils, deviceUtils, fairBidListenerHandler, iPlacementsHandler, onScreenAdTracker);
s.h(context, "context");
s.h(activityProvider, "activityProvider");
s.h(clockHelper, "clockHelper");
s.h(factory, "fetchResultFactory");
s.h(iAdImageReporter, "adImageReporter");
s.h(screenUtils, "screenUtils");
s.h(scheduledExecutorService, "executorService");
s.h(executorService, "uiThreadExecutorService");
s.h(locationProvider, "locationProvider");
s.h(utils, "genericUtils");
s.h(deviceUtils, "deviceUtils");
s.h(fairBidListenerHandler, "fairBidListenerHandler");
s.h(iPlacementsHandler, "placementsHandler");
s.h(onScreenAdTracker, "onScreenAdTracker");
this.f21359w = R.drawable.fb_ic_network_meta;
this.f21360x = true;
}
public static final void a(FetchOptions fetchOptions, od odVar, SettableFuture settableFuture) {
k0 k0Var;
s.h(fetchOptions, "$fetchOptions");
s.h(odVar, "$cachedInterstitialAd");
if (fetchOptions.getPmnAd() != null) {
PMNAd pmnAd = fetchOptions.getPmnAd();
s.g(settableFuture, "fetchResult");
odVar.getClass();
s.h(pmnAd, "pmnAd");
s.h(settableFuture, "fetchResult");
Logger.debug("MetaCachedInterstitialAd - loadPmn() called. PMN = " + pmnAd);
InterstitialAd.InterstitialAdLoadConfigBuilder withAdListener = odVar.f20884a.buildLoadAdConfig().withAdListener(new qd(odVar, settableFuture));
withAdListener.withCacheFlags(CacheFlag.ALL).withBid(pmnAd.getMarkup());
InterstitialAd interstitialAd = odVar.f20884a;
withAdListener.build();
k0Var = k0.f364a;
} else {
k0Var = null;
}
if (k0Var == null) {
s.g(settableFuture, "fetchResult");
odVar.getClass();
s.h(settableFuture, "fetchResult");
Logger.debug("MetaCachedInterstitialAd - load() called");
InterstitialAd.InterstitialAdLoadConfigBuilder withAdListener2 = odVar.f20884a.buildLoadAdConfig().withAdListener(new qd(odVar, settableFuture));
InterstitialAd interstitialAd2 = odVar.f20884a;
withAdListener2.build();
}
}
public static final void a(FetchOptions fetchOptions, pd pdVar, SettableFuture settableFuture) {
k0 k0Var;
s.h(fetchOptions, "$fetchOptions");
s.h(pdVar, "$cachedRewardedVideoAd");
if (fetchOptions.getPmnAd() != null) {
PMNAd pmnAd = fetchOptions.getPmnAd();
s.g(settableFuture, "fetchResult");
pdVar.getClass();
s.h(pmnAd, "pmnAd");
s.h(settableFuture, "fetchResult");
Logger.debug("MetaCachedRewardedVideoAd - loadPmn() called. PMN = " + pmnAd);
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder withAdListener = pdVar.f20953a.buildLoadAdConfig().withAdListener(new rd(pdVar, settableFuture));
withAdListener.withFailOnCacheFailureEnabled(true).withBid(pmnAd.getMarkup());
RewardedVideoAd rewardedVideoAd = pdVar.f20953a;
withAdListener.build();
k0Var = k0.f364a;
} else {
k0Var = null;
}
if (k0Var == null) {
s.g(settableFuture, "fetchResult");
pdVar.getClass();
s.h(settableFuture, "fetchResult");
Logger.debug("MetaCachedRewardedVideoAd - load() called");
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder withAdListener2 = pdVar.f20953a.buildLoadAdConfig().withAdListener(new rd(pdVar, settableFuture));
RewardedVideoAd rewardedVideoAd2 = pdVar.f20953a;
withAdListener2.build();
}
}
@Override
public final void cpraOptOut(boolean z7) {
super.cpraOptOut(z7);
Logger.debug("Meta - cpraOptOut: " + z7);
if (!z7) {
AdSettings.setDataProcessingOptions(new String[]{"LDU"}, 0, 0);
Logger.debug("AdSettings.setDataProcessingOptions(arrayOf(\"LDU\"), 0, 0)");
} else if (z7) {
AdSettings.setDataProcessingOptions(new String[0]);
Logger.debug("AdSettings.setDataProcessingOptions(arrayOf())");
}
}
@Override
public final List<String> getActivities() {
return o.e("com.facebook.ads.AudienceNetworkActivity");
}
@Override
public final q0 getAdapterDisabledReason() {
if (!ja.a("com.facebook.ads.InterstitialAd", "classExists(expectedClassName)")) {
Logger.error(getCanonicalName() + " not 'on board': class com.facebook.ads.InterstitialAd not found in the class path. Make sure you've declared the meta dependency.");
this.f21358v = q0.f21018a;
}
if (!FairBidHttpUtils.INSTANCE.isCleartextPermitted("127.0.0.1")) {
Logger.error(getCanonicalName() + " not 'on board'.\nMeta performs very poorly when 'clearTextTrafficPermitted' is not enabled.\nDeeming Meta not 'on board' to prevent overall poor performance in this integration.\nRead our documentation for more information: \nhttps://fyber-mediation.fyber.com/docs/facebook-audience-network");
this.f21358v = q0.f21019b;
}
return this.f21358v;
}
@Override
public final EnumSet<Constants.AdType> getAllAdTypeCapabilities() {
EnumSet<Constants.AdType> of2 = EnumSet.of(Constants.AdType.INTERSTITIAL, Constants.AdType.BANNER, Constants.AdType.REWARDED);
s.g(of2, "of(Constants.AdType.INTE…onstants.AdType.REWARDED)");
return of2;
}
@Override
public final EnumSet<Constants.AdType> getAllProgrammaticAdTypeCapabilities() {
EnumSet<Constants.AdType> of2 = EnumSet.of(Constants.AdType.INTERSTITIAL, Constants.AdType.REWARDED, Constants.AdType.BANNER);
s.g(of2, "of(Constants.AdType.INTE… Constants.AdType.BANNER)");
return of2;
}
@Override
public final boolean getAreCredentialsAvailable() {
return true;
}
@Override
public final List<String> getCredentialsInfo() {
return p.j();
}
@Override
public final boolean getHasTestMode() {
return true;
}
@Override
public final int getIconResource() {
return this.f21359w;
}
@Override
public final int getInstanceNameResource() {
return R.string.fb_ts_network_instance_placement_id;
}
@Override
public final String getMarketingVersion() {
String valueWithoutInlining = Utils.getValueWithoutInlining("com.facebook.ads.BuildConfig", "VERSION_NAME", AppEventsConstants.EVENT_PARAM_VALUE_NO);
s.g(valueWithoutInlining, "getValueWithoutInlining(…ig\", \"VERSION_NAME\", \"0\")");
return valueWithoutInlining;
}
@Override
public final String getMinimumSupportedVersion() {
return "5.10.0";
}
@Override
public final Network getNetwork() {
return Network.META;
}
@Override
public final List<String> getPermissions() {
return p.l("android.permission.ACCESS_NETWORK_STATE", "android.permission.INTERNET");
}
@Override
public final ProgrammaticSessionInfo getProgrammaticSessionInfo(NetworkModel networkModel, MediationRequest mediationRequest) {
s.h(networkModel, "network");
s.h(mediationRequest, "mediationRequest");
String instanceId = networkModel.getInstanceId();
if (TextUtils.isEmpty(instanceId)) {
return null;
}
return new ProgrammaticSessionInfo(networkModel.getName(), (TextUtils.isEmpty(instanceId) || wk.p.Y(instanceId, '_', 0, false, 6, null) <= 0) ? "" : ((String[]) new e("_").c(instanceId, 0).toArray(new String[0]))[0], BidderTokenProvider.getBidderToken(getContext()));
}
@Override
public final q<String, Boolean> getTestModeInfo() {
return isInitialized() ? new q<>(getContext().getSharedPreferences("FBAdPrefs", 0).getString("deviceIdHash", null), Boolean.valueOf(AdSettings.isTestMode(getContext()))) : new q<>(null, Boolean.FALSE);
}
@Override
public final boolean isMRECSupported() {
return this.f21360x;
}
@Override
public final boolean isOnBoard() {
q0 adapterDisabledReason = getAdapterDisabledReason();
this.f21358v = adapterDisabledReason;
return adapterDisabledReason == null;
}
@Override
public final void muteAdsOnStart(boolean z7) {
}
@Override
public final void onInit() throws AdapterException {
}
@Override
public final void onStart() {
AudienceNetworkAds.initialize(getContext());
}
@Override
public final SettableFuture<DisplayableFetchResult> performNetworkFetch(final FetchOptions fetchOptions) {
AdSize adSize;
s.h(fetchOptions, "fetchOptions");
final SettableFuture<DisplayableFetchResult> create = SettableFuture.create();
Constants.AdType adType = fetchOptions.getAdType();
String networkInstanceId = fetchOptions.getNetworkInstanceId();
if (TextUtils.isEmpty(networkInstanceId)) {
create.set(new DisplayableFetchResult(new FetchFailure(RequestFailure.CONFIGURATION_ERROR, "No placement found.")));
s.g(create, "fetchResult");
return create;
}
int i10 = b.f21361a[adType.ordinal()];
if (i10 == 1) {
Context context = getContext();
s.h(fetchOptions, "fetchOptions");
InternalBannerOptions internalBannerOptions = fetchOptions.getInternalBannerOptions();
k0 k0Var = null;
if ((internalBannerOptions != null ? internalBannerOptions.getBannerSize() : null) == BannerSize.MREC) {
adSize = AdSize.RECTANGLE_HEIGHT_250;
s.g(adSize, "RECTANGLE_HEIGHT_250");
} else if (fetchOptions.isTablet()) {
adSize = AdSize.BANNER_HEIGHT_90;
s.g(adSize, "BANNER_HEIGHT_90");
} else {
adSize = AdSize.BANNER_HEIGHT_50;
s.g(adSize, "BANNER_HEIGHT_50");
}
AdView adView = new AdView(context, networkInstanceId, adSize);
AdDisplay build = AdDisplay.newBuilder().supportsBillableImpressionCallback(true).build();
s.g(build, "newBuilder().supportsBil…ionCallback(true).build()");
nd ndVar = new nd(adView, build);
if (fetchOptions.getPmnAd() != null) {
PMNAd pmnAd = fetchOptions.getPmnAd();
s.g(create, "fetchResult");
s.h(pmnAd, "pmnAd");
s.h(create, "fetchResult");
Logger.debug("MetaCachedBannerAd - loadPmn() called. PMN = " + pmnAd);
AdView.AdViewLoadConfigBuilder withAdListener = ndVar.f20799a.buildLoadAdConfig().withBid(pmnAd.getMarkup()).withAdListener(new kd(ndVar, create));
AdView adView2 = ndVar.f20799a;
withAdListener.build();
k0Var = k0.f364a;
}
if (k0Var == null) {
s.g(create, "fetchResult");
s.h(create, "fetchResult");
Logger.debug("MetaCachedBannerAd - load() called");
AdView.AdViewLoadConfigBuilder withAdListener2 = ndVar.f20799a.buildLoadAdConfig().withAdListener(new kd(ndVar, create));
AdView adView3 = ndVar.f20799a;
withAdListener2.build();
}
} else if (i10 == 2) {
final pd pdVar = new pd(new RewardedVideoAd(getContext(), networkInstanceId), te.a("newBuilder().build()"));
getUiThreadExecutorService().submit(new Runnable() {
@Override
public final void run() {
MetaAdapter.a(FetchOptions.this, pdVar, create);
}
});
} else if (i10 != 3) {
RequestFailure requestFailure = RequestFailure.UNKNOWN;
create.set(new DisplayableFetchResult(new FetchFailure(requestFailure, "Unknown ad type - " + adType)));
} else {
InterstitialAd interstitialAd = new InterstitialAd(getContext(), networkInstanceId);
AdDisplay build2 = AdDisplay.newBuilder().supportsBillableImpressionCallback(true).build();
s.g(build2, "newBuilder().supportsBil…ionCallback(true).build()");
final od odVar = new od(interstitialAd, build2);
getUiThreadExecutorService().submit(new Runnable() {
@Override
public final void run() {
MetaAdapter.a(FetchOptions.this, odVar, create);
}
});
}
s.g(create, "fetchResult");
return create;
}
@Override
public final FetchConstraintsWhileOnScreen programmaticFetchConstraintsWhileShowing() {
return ProgrammaticNetworkAdapter.DefaultImpls.programmaticFetchConstraintsWhileShowing(this);
}
@Override
public final void setGdprConsent(int i10) {
}
@Override
public final void setTestMode(boolean z7) {
if (z7) {
AdSettings.addTestDevice(getContext().getSharedPreferences("FBAdPrefs", 0).getString("deviceIdHash", null));
} else {
AdSettings.clearTestDevices();
}
}
@Override
public final boolean supportsProgrammatic(String str, MediationRequest mediationRequest) {
return ProgrammaticNetworkAdapter.DefaultImpls.supportsProgrammatic(this, str, mediationRequest);
}
}