Pixel Fusion v1.0.2版本的 MD5 值为:7c04c460c2996569d4ad075cd671a946
以下内容为反编译后的 dcaDDdccCCc.java 源代码,内容仅作参考
package io.bidmachine;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.explorestack.protobuf.ListValue;
import com.explorestack.protobuf.Struct;
import com.explorestack.protobuf.Value;
import com.explorestack.protobuf.adcom.Context;
import com.explorestack.protobuf.adcom.DeviceType;
import com.explorestack.protobuf.adcom.OS;
import io.bidmachine.ApiRequest;
import io.bidmachine.ads.networks.adaptiverendering.AdaptiveRenderingAdapter;
import io.bidmachine.ads.networks.nast.NastAdapter;
import io.bidmachine.ads.networks.vast.VastAdapter;
import io.bidmachine.core.Logger;
import io.bidmachine.core.NetworkRequest;
import io.bidmachine.core.Utils;
import io.bidmachine.protobuf.InitRequest;
import io.bidmachine.protobuf.InitResponse;
import io.bidmachine.utils.BMError;
import io.bidmachine.utils.DeviceUtils;
import io.bidmachine.utils.ProtoUtils;
import java.lang.ref.WeakReference;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
public class dcaDDdccCCc {
private static final long MAX_INIT_REQUEST_DELAY_MS;
private static final long MIN_INIT_REQUEST_DELAY_MS;
@NonNull
private final Context applicationContext;
@NonNull
private final Queue<String> baseUrlQueue;
@Nullable
private ApiRequest<InitRequest, InitResponse> currentInitRequest;
@NonNull
private final Queue<String> currentUrlQueue;
@Nullable
private babbDABcB listener;
@NonNull
private final String sellerId;
private long initRequestDelayMs = 0;
@NonNull
private final TrackingObject trackingObject = new SimpleTrackingObject();
@NonNull
private final Runnable initialRunnable = new DAbacDAb(this);
public class BbdcDCacCa implements Runnable {
public class C0808BbdcDCacCa implements NetworkRequest.Callback<InitResponse, BMError> {
public C0808BbdcDCacCa() {
}
@Override
public void onFail(@Nullable BMError bMError) {
long j;
dcaDDdccCCc.this.currentInitRequest = null;
if (dcaDDdccCCc.this.currentUrlQueue.isEmpty()) {
j = dcaDDdccCCc.this.calculateDelay();
Logger.log(String.format("reschedule init request (%s)", Long.valueOf(j)));
if (dcaDDdccCCc.this.listener != null) {
dcaDDdccCCc.this.listener.onFail(bMError);
}
} else {
j = 0;
}
Utils.onBackgroundThread(dcaDDdccCCc.this.initialRunnable, j);
dcaDDdccCCc.this.trackingObject.eventFinish(TrackEventType.InitLoading, (AdsType) null, (EventData) null, bMError);
}
@Override
public void onSuccess(@Nullable InitResponse initResponse) {
dcaDDdccCCc.this.currentInitRequest = null;
dcaDDdccCCc.this.initRequestDelayMs = 0L;
Utils.cancelBackgroundThreadTask(dcaDDdccCCc.this.initialRunnable);
if (dcaDDdccCCc.this.listener != null) {
dcaDDdccCCc.this.listener.onSuccess(initResponse);
}
dcaDDdccCCc.this.trackingObject.eventFinish(TrackEventType.InitLoading, (AdsType) null, (EventData) null, (BMError) null);
}
}
public BbdcDCacCa() {
}
@Override
public void run() {
dcaDDdccCCc.this.currentInitRequest = new ApiRequest.Builder().url(dcaDDdccCCc.this.pollUrl()).setDataBinder(new ApiRequest.ApiInitDataBinder()).setRequestData(dcaDDdccCCc.this.createInitRequest()).setCallback(new C0808BbdcDCacCa()).request();
}
}
public static class DAbacDAb implements Runnable {
@NonNull
private final WeakReference<dcaDDdccCCc> weakInitialRequest;
public DAbacDAb(@NonNull dcaDDdccCCc dcadddccccc) {
this.weakInitialRequest = new WeakReference<>(dcadddccccc);
}
@Override
public void run() {
dcaDDdccCCc dcadddccccc = this.weakInitialRequest.get();
if (dcadddccccc != null) {
dcadddccccc.request();
}
}
}
public interface babbDABcB extends NetworkRequest.Callback<InitResponse, BMError> {
}
static {
TimeUnit timeUnit = TimeUnit.SECONDS;
MIN_INIT_REQUEST_DELAY_MS = timeUnit.toMillis(2L);
MAX_INIT_REQUEST_DELAY_MS = timeUnit.toMillis(128L);
}
public dcaDDdccCCc(@NonNull Context context, @NonNull String str, @NonNull Queue<String> queue) {
this.applicationContext = context;
this.sellerId = str;
this.baseUrlQueue = new LinkedList(queue);
this.currentUrlQueue = new LinkedList(queue);
}
public long calculateDelay() {
long j = this.initRequestDelayMs;
if (j <= 0) {
this.initRequestDelayMs = MIN_INIT_REQUEST_DELAY_MS;
} else {
long j2 = j * 2;
this.initRequestDelayMs = j2;
long j3 = MAX_INIT_REQUEST_DELAY_MS;
if (j2 >= j3) {
this.initRequestDelayMs = j3;
}
}
return this.initRequestDelayMs;
}
@NonNull
private Struct createExtension(@NonNull Context context) {
Struct.Builder newBuilder = Struct.newBuilder();
newBuilder.putFields("networks_info", Value.newBuilder().setListValue(createNetworkInfoListValue(context)).build());
return newBuilder.build();
}
@NonNull
public InitRequest createInitRequest() {
DeviceType deviceType;
Accbcd.updateInfo(this.applicationContext);
bDCaDADc bdcadadc = bDCaDADc.get();
ccbbCCad userRestrictionParams = bdcadadc.getUserRestrictionParams();
TargetingParams targetingParams = bdcadadc.getTargetingParams();
InitRequest.Builder newBuilder = InitRequest.newBuilder();
String packageName = this.applicationContext.getPackageName();
if (packageName != null) {
newBuilder.setBundle(packageName);
}
newBuilder.setSellerId(this.sellerId);
newBuilder.setOs(OS.OS_ANDROID);
newBuilder.setOsv(DeviceUtils.getOsVersion());
String appVersion = Utils.getAppVersion(this.applicationContext);
if (appVersion != null) {
newBuilder.setAppVer(appVersion);
}
newBuilder.setSdk(BidMachine.NAME);
newBuilder.setSdkver("2.6.0");
newBuilder.setIfa(Accbcd.getAdvertisingId(this.applicationContext, !userRestrictionParams.canSendIfa()));
newBuilder.setBmIfv(bdcadadc.obtainIFV(this.applicationContext));
newBuilder.setSessionId(SessionManager.get().getSessionId());
DeviceInfo obtain = DeviceInfo.obtain(this.applicationContext);
String str = obtain.manufacturer;
if (str != null) {
newBuilder.setMake(str);
}
String str2 = obtain.model;
if (str2 != null) {
newBuilder.setModel(str2);
}
String hwv = obtain.getHWV();
if (hwv != null) {
newBuilder.setHwv(hwv);
}
if (obtain.isTablet) {
deviceType = DeviceType.DEVICE_TYPE_TABLET;
} else {
deviceType = DeviceType.DEVICE_TYPE_PHONE_DEVICE;
}
newBuilder.setDeviceType(deviceType);
if (userRestrictionParams.canSendDeviceInfo()) {
newBuilder.setContype(DeviceUtils.getConnectionType(this.applicationContext));
}
if (userRestrictionParams.canSendGeoPosition()) {
Context.Geo.Builder createGeoBuilderWithLocation = ProtoUtils.createGeoBuilderWithLocation(this.applicationContext, targetingParams.getDeviceLocation(), null, true);
targetingParams.build(createGeoBuilderWithLocation);
newBuilder.setGeo(createGeoBuilderWithLocation);
}
newBuilder.setContext(RequestDataRetriever.collectContext(this.applicationContext, bdcadadc, userRestrictionParams, targetingParams, null));
newBuilder.setExt(createExtension(this.applicationContext));
return newBuilder.build();
}
@NonNull
private ListValue.Builder createNetworkInfoListValue(@NonNull android.content.Context context) {
ListValue.Builder newBuilder = ListValue.newBuilder();
for (BdabccCdB bdabccCdB : bdbBBaA.getNetworkAssetParamsMap(context).values()) {
newBuilder.addValues(createNetworkInfoValue(bdabccCdB.getName(), bdabccCdB.getSdkVersion(), bdabccCdB.getAdapterVersion()));
}
newBuilder.addValues(createNetworkInfoValue("mraid", "1.8.0", "2.6.0.1"));
newBuilder.addValues(createNetworkInfoValue(VastAdapter.KEY, "1.8.0", "2.6.0.1"));
newBuilder.addValues(createNetworkInfoValue(NastAdapter.KEY, "1.0", "2.6.0.1"));
newBuilder.addValues(createNetworkInfoValue(AdaptiveRenderingAdapter.KEY, "0.8.1", "2.6.0.1"));
return newBuilder;
}
@NonNull
private Value createNetworkInfoValue(@NonNull String str, @NonNull String str2, @NonNull String str3) {
Value build = Value.newBuilder().setStringValue(str).build();
Value build2 = Value.newBuilder().setStringValue(str2).build();
return Value.newBuilder().setStructValue(Struct.newBuilder().putFields("network", build).putFields("network_version", build2).putFields("network_adapter_version", Value.newBuilder().setStringValue(str3).build()).build()).build();
}
public String pollUrl() {
if (this.currentUrlQueue.isEmpty()) {
this.currentUrlQueue.addAll(this.baseUrlQueue);
}
return this.currentUrlQueue.poll();
}
public void destroy() {
this.listener = null;
this.currentInitRequest = null;
}
public void request() {
this.trackingObject.eventStart(TrackEventType.InitLoading, null);
Utils.onBackgroundThread(new BbdcDCacCa());
}
public void setListener(@Nullable babbDABcB babbdabcb) {
this.listener = babbdabcb;
}
}