Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c
以下内容为反编译后的 MetaData.java 源代码,内容仅作参考
package com.startapp.android.publish.common.metaData;
import android.content.Context;
import android.graphics.Bitmap;
import com.applovin.sdk.AppLovinErrorCodes;
import com.startapp.android.publish.adsCommon.AdsConstants;
import com.startapp.android.publish.adsCommon.Utils.i;
import com.startapp.android.publish.adsCommon.k;
import com.startapp.android.publish.common.metaData.MetaDataRequest;
import com.startapp.android.publish.common.model.AdPreferences;
import com.startapp.common.Constants;
import com.startapp.common.a;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
public class MetaData implements Serializable {
public static final boolean DEFAULT_ALWAYS_SEND_TOKEN = true;
public static final String DEFAULT_ASSETS_BASE_URL_SECURED = "";
public static final boolean DEFAULT_BT_ENABLED = false;
public static final boolean DEFAULT_COMPRESSION_ENABLED = false;
public static final boolean DEFAULT_INAPPBROWSER = true;
public static final long DEFAULT_LAST_KNOWN_LOCATION_THRESHOLD = 30;
public static final String DEFAULT_LOCATION_SOURCE = "API";
public static final boolean DEFAULT_PERIODIC_INFOEVENT_ENABLED = false;
public static final int DEFAULT_PERIODIC_INFOEVENT_INTERVAL = 360;
public static final boolean DEFAULT_PERIODIC_INFOEVENT_ON_RUN_TIME = false;
public static final boolean DEFAULT_PERIODIC_METADATA_ENABLED = false;
public static final int DEFAULT_PERIODIC_METADATA_INTERVAL = 360;
public static final String DEFAULT_PROFILE_ID = null;
public static final int DEFAULT_SESSION_MAX_BACKGROUND_TIME = 1800;
public static final boolean DEFAULT_SIMPLE_TOKEN_ENABLED = true;
public static final boolean DEFAULT_WF_SCAN_ENABLED = false;
public static final String KEY_METADATA = "metaData";
private static final long serialVersionUID = 1;
private static transient c task;
@com.startapp.common.b.f(b = b.class)
private b inAppBrowserPreLoad;
private static transient Object lock = new Object();
public static final Set<String> DEFAULT_INSTALLERS_LIST = new HashSet(Arrays.asList(Constants.a));
public static final String DEFAULT_METADATA_HOST = "https://init.startappservice.com/1.4/";
public static final String DEFAULT_AD_PLATFORM_HOST = "https://req.startappservice.com/1.4/";
public static final int[] DEFAULT_PERIODIC_INFOEVENT_INTERVALS = {60, 60, 240};
public static final Set<String> DEFAULT_PRE_INSTALLED_PACKAGES = new HashSet(Arrays.asList("com.facebook.katana", "com.yandex.browser"));
public static final Set<Integer> DEFAULT_INVALID_NETWORK_CODES_INFO_EVENTS = new HashSet(Arrays.asList(Integer.valueOf((int) AppLovinErrorCodes.NO_FILL)));
private static transient MetaData instance = new MetaData();
@com.startapp.common.b.f(a = true)
private h SimpleToken = new h();
private String metaDataHostSecured = DEFAULT_METADATA_HOST;
private String adPlatformHostSecured = DEFAULT_AD_PLATFORM_HOST;
private int sessionMaxBackgroundTime = 1800;
private String profileId = DEFAULT_PROFILE_ID;
@com.startapp.common.b.f(b = HashSet.class)
private Set<String> installersList = DEFAULT_INSTALLERS_LIST;
@com.startapp.common.b.f(b = HashSet.class)
private Set<String> preInstalledPackages = DEFAULT_PRE_INSTALLED_PACKAGES;
private boolean simpleToken2 = true;
private boolean alwaysSendToken = true;
private boolean compressionEnabled = false;
private boolean btEnabled = false;
private boolean periodicMetaDataEnabled = false;
private int periodicMetaDataIntervalInMinutes = 360;
private boolean periodicInfoEventEnabled = false;
private boolean periodicInfoEventOnRunTimeEnabled = false;
private int periodicInfoEventIntervalInMinutes = 360;
private int[] periodicEventIntMin = DEFAULT_PERIODIC_INFOEVENT_INTERVALS;
private boolean inAppBrowser = true;
private boolean SupportIABViewability = true;
private long IABDisplayImpressionDelayInSeconds = 1;
private long IABVideoImpressionDelayInSeconds = 2;
private long userAgentDelayInSeconds = 5;
private boolean userAgentEnabled = true;
@com.startapp.common.b.f(a = true)
private g sensorsConfig = new g();
@com.startapp.common.b.f(a = true)
private com.startapp.android.publish.common.metaData.b btConfig = new com.startapp.android.publish.common.metaData.b();
private String assetsBaseUrlSecured = "";
@com.startapp.common.b.f(b = HashSet.class)
private Set<Integer> invalidForRetry = new HashSet();
@com.startapp.common.b.f(b = HashSet.class)
private Set<Integer> invalidNetworkCodesInfoEvents = DEFAULT_INVALID_NETWORK_CODES_INFO_EVENTS;
@com.startapp.common.b.f(a = true)
private com.startapp.android.publish.adsCommon.e.a analytics = new com.startapp.android.publish.adsCommon.e.a();
@com.startapp.common.b.f(a = true)
private LocationConfig location = new LocationConfig();
private boolean wfScanEnabled = false;
private transient boolean loading = false;
private transient boolean ready = false;
private transient List<d> metaDataListeners = new ArrayList();
private String metadataUpdateVersion = AdsConstants.h;
private boolean dns = false;
public enum b {
DISABLED,
CONTENT,
FULL
}
private MetaData() {
}
public h getSimpleTokenConfig() {
return this.SimpleToken;
}
protected void setSimpleTokenConfig(h hVar) {
this.SimpleToken = hVar;
}
public static void init(Context context) {
MetaData metaData = (MetaData) com.startapp.common.a.f.a(context, "StartappMetadata", (Class<Object>) MetaData.class);
MetaData metaData2 = new MetaData();
if (metaData != null) {
if (metaData.isMetaDataVersionChanged()) {
i.a(metaData, metaData2);
}
metaData.initTransientFields();
instance = metaData;
} else {
instance = metaData2;
}
getInstance().applyAdPlatformProtocolToHosts();
}
public static void update(Context context, MetaData metaData) {
synchronized (lock) {
metaData.metaDataListeners = getInstance().metaDataListeners;
instance = metaData;
if (Constants.a().booleanValue()) {
com.startapp.common.a.h.a(3, "MetaData received:");
com.startapp.common.a.h.a(3, com.startapp.common.b.b.a(metaData));
}
getInstance().applyAdPlatformProtocolToHosts();
metaData.metadataUpdateVersion = AdsConstants.h;
com.startapp.common.a.f.b(context, "StartappMetadata", metaData);
com.startapp.common.a.h.a(3, "MetaData saved:");
getInstance().loading = false;
getInstance().ready = true;
if (getInstance().metaDataListeners != null) {
ArrayList<d> arrayList = new ArrayList(getInstance().metaDataListeners);
getInstance().metaDataListeners.clear();
for (d dVar : arrayList) {
dVar.a();
}
}
k.b(context, "totalSessions", Integer.valueOf(k.a(context, "totalSessions", (Integer) 0).intValue() + 1));
task = null;
}
}
public static void failedLoading() {
ArrayList<d> arrayList;
synchronized (lock) {
if (getInstance().metaDataListeners != null) {
arrayList = new ArrayList(getInstance().metaDataListeners);
getInstance().metaDataListeners.clear();
} else {
arrayList = null;
}
getInstance().loading = false;
}
if (arrayList != null) {
for (d dVar : arrayList) {
dVar.b();
}
}
}
public void loadFromServer(Context context, AdPreferences adPreferences, MetaDataRequest.a aVar, boolean z, d dVar) {
loadFromServer(context, adPreferences, aVar, z, dVar, false);
}
public void loadFromServer(Context context, AdPreferences adPreferences, MetaDataRequest.a aVar, boolean z, d dVar, boolean z2) {
if (!z && dVar != null) {
dVar.a();
}
synchronized (lock) {
if (getInstance().isReady() && !z2) {
if (!z || dVar == null) {
return;
}
dVar.a();
return;
}
if (!getInstance().isLoading() || z2) {
this.loading = true;
this.ready = false;
if (task != null) {
task.b();
}
task = new c(context, adPreferences, aVar);
task.a();
}
if (z && dVar != null) {
getInstance().addMetaDataListener(dVar);
}
}
}
public void addMetaDataListener(d dVar) {
synchronized (lock) {
this.metaDataListeners.add(dVar);
}
}
public void removeMetaDataListener(d dVar) {
synchronized (lock) {
this.metaDataListeners.remove(dVar);
}
}
public static Object getLock() {
return lock;
}
public boolean isLoading() {
return this.loading;
}
public boolean isReady() {
return this.ready;
}
public void setReady(boolean z) {
this.ready = z;
}
private boolean isMetaDataVersionChanged() {
return !AdsConstants.h.equals(this.metadataUpdateVersion);
}
public String getAssetsBaseUrl() {
return this.assetsBaseUrlSecured != null ? this.assetsBaseUrlSecured : "";
}
public boolean isPeriodicMetaDataEnabled() {
return this.periodicMetaDataEnabled;
}
public void setPeriodicMetaDataEnabled(boolean z) {
this.periodicMetaDataEnabled = z;
}
public int getPeriodicMetaDataInterval() {
return this.periodicMetaDataIntervalInMinutes;
}
public void setPeriodicMetaDataInterval(int i) {
this.periodicMetaDataIntervalInMinutes = i;
}
public boolean isPeriodicInfoEventEnabled() {
return this.periodicInfoEventEnabled;
}
public boolean isPeriodicInfoEventOnRunTimeEnabled() {
return this.periodicInfoEventOnRunTimeEnabled;
}
public void setPeriodicInfoEventEnabled(boolean z) {
this.periodicInfoEventEnabled = z;
}
public int getPeriodicInfoEventIntervalInMinutes(Context context) {
if (this.periodicEventIntMin == null || this.periodicEventIntMin.length < 3) {
this.periodicEventIntMin = DEFAULT_PERIODIC_INFOEVENT_INTERVALS;
}
if (com.startapp.common.a.c.a(context, "android.permission.ACCESS_FINE_LOCATION")) {
int i = this.periodicEventIntMin[0];
return i <= 0 ? DEFAULT_PERIODIC_INFOEVENT_INTERVALS[0] : i;
} else if (com.startapp.common.a.c.a(context, "android.permission.ACCESS_COARSE_LOCATION")) {
int i2 = this.periodicEventIntMin[1];
return i2 <= 0 ? DEFAULT_PERIODIC_INFOEVENT_INTERVALS[1] : i2;
} else {
return this.periodicEventIntMin[2];
}
}
public void setPeriodicInfoEventIntervalInMinutes(int i) {
this.periodicInfoEventIntervalInMinutes = i;
}
public Set<Integer> getInvalidForRetry() {
if (this.invalidForRetry != null) {
return this.invalidForRetry;
}
return new HashSet();
}
public Set<Integer> getInvalidNetworkCodesInfoEvents() {
if (this.invalidNetworkCodesInfoEvents != null) {
return this.invalidNetworkCodesInfoEvents;
}
return DEFAULT_INVALID_NETWORK_CODES_INFO_EVENTS;
}
public String getMetaDataHost() {
if (AdsConstants.OVERRIDE_HOST != null) {
return AdsConstants.OVERRIDE_HOST;
}
return this.metaDataHostSecured;
}
public String getAdPlatformHost() {
if (AdsConstants.OVERRIDE_HOST != null) {
return AdsConstants.OVERRIDE_HOST;
}
return this.adPlatformHostSecured != null ? this.adPlatformHostSecured : DEFAULT_AD_PLATFORM_HOST;
}
public long getSessionMaxBackgroundTime() {
return TimeUnit.SECONDS.toMillis(this.sessionMaxBackgroundTime);
}
public Set<String> getInstallersList() {
return this.installersList;
}
public void setInstallersList(Set<String> set) {
this.installersList = set;
}
public Set<String> getPreInstalledPackages() {
Set<String> set = this.preInstalledPackages;
if (set == null) {
set = DEFAULT_PRE_INSTALLED_PACKAGES;
}
return Collections.unmodifiableSet(set);
}
public void setPreInstalledPackages(Set<String> set) {
this.preInstalledPackages = set;
}
public boolean isSimpleToken2() {
return this.simpleToken2;
}
public void setSimpleToken2(boolean z) {
this.simpleToken2 = z;
}
public boolean isAlwaysSendToken() {
return this.alwaysSendToken;
}
public void setAlwaysSendToken(boolean z) {
this.alwaysSendToken = z;
}
public boolean isCompressionEnabled() {
return this.compressionEnabled;
}
public void setCompressionEnabled(boolean z) {
this.compressionEnabled = z;
}
public boolean isInAppBrowser() {
return i.a(256L) && this.inAppBrowser;
}
public void setInAppBrowser(boolean z) {
this.inAppBrowser = z;
}
public b getInAppBrowserPreLoad() {
return this.inAppBrowserPreLoad;
}
public void setInAppBrowserPreLoad(b bVar) {
this.inAppBrowserPreLoad = bVar;
}
public String getProfileId() {
return this.profileId;
}
public com.startapp.android.publish.adsCommon.e.a getAnalyticsConfig() {
return this.analytics;
}
public g getSensorsConfig() {
return this.sensorsConfig;
}
public com.startapp.android.publish.common.metaData.b getBluetoothConfig() {
return this.btConfig;
}
public LocationConfig getLocationConfig() {
return this.location;
}
public boolean isWfScanEnabled() {
return this.wfScanEnabled;
}
public static MetaData getInstance() {
return instance;
}
public long getIABDisplayImpressionDelayInSeconds() {
return this.IABDisplayImpressionDelayInSeconds;
}
public long getIABVideoImpressionDelayInSeconds() {
return this.IABVideoImpressionDelayInSeconds;
}
public long getUserAgentDelayInSeconds() {
return this.userAgentDelayInSeconds;
}
public boolean isUserAgentEnabled() {
return this.userAgentEnabled;
}
public boolean isSupportIABViewability() {
return this.SupportIABViewability;
}
public void applyAdPlatformProtocolToHosts() {
this.adPlatformHostSecured = replaceAdProtocol(this.adPlatformHostSecured, DEFAULT_AD_PLATFORM_HOST);
this.metaDataHostSecured = replaceAdProtocol(this.metaDataHostSecured, DEFAULT_METADATA_HOST);
}
public boolean canShowAd() {
return !this.dns;
}
private String replaceAdProtocol(String str, String str2) {
return str != null ? str.replace("%AdPlatformProtocol%", "1.4") : str2;
}
private void initTransientFields() {
this.loading = false;
this.ready = false;
this.metaDataListeners = new ArrayList();
}
public static void preCacheResources(Context context, String str) {
String[] strArr;
String[] strArr2;
String[] strArr3;
if (str == null || str.equals("")) {
return;
}
if (!com.startapp.android.publish.adsCommon.Utils.a.a(context, "close_button.png", ".png") && !i.a()) {
new com.startapp.common.a(str + "close_button.png", new a(context, "close_button"), 0).a();
}
if (i.a(256L)) {
for (String str2 : AdsConstants.k) {
if (!com.startapp.android.publish.adsCommon.Utils.a.a(context, str2 + ".png", ".png")) {
new com.startapp.common.a(str + str2 + ".png", new a(context, str2), 0).a();
}
}
}
if (i.a(64L)) {
for (String str3 : AdsConstants.l) {
if (!com.startapp.android.publish.adsCommon.Utils.a.a(context, str3 + ".png", ".png")) {
new com.startapp.common.a(str + str3 + ".png", new a(context, str3), 0).a();
}
}
if (com.startapp.android.publish.adsCommon.Utils.a.a(context, "logo.png", ".png")) {
return;
}
new com.startapp.common.a(str + "logo.png", new a(context, "logo"), 0).a();
} else if (i.a(32L)) {
for (String str4 : AdsConstants.l) {
if (!com.startapp.android.publish.adsCommon.Utils.a.a(context, str4 + ".png", ".png")) {
new com.startapp.common.a(str + str4 + ".png", new a(context, str4), 0).a();
}
}
}
}
public static class a implements a.InterfaceC0138a {
Context a;
String b;
public a(Context context, String str) {
this.a = context;
this.b = str;
}
@Override
public void a(Bitmap bitmap, int i) {
if (bitmap != null) {
com.startapp.android.publish.adsCommon.Utils.a.a(this.a, bitmap, this.b, ".png");
}
}
}
}