VegeFruits v7.1版本的 MD5 值为:2ff167dfba698c783e879938fe00b9ce
以下内容为反编译后的 MetaData.java 源代码,内容仅作参考
package com.startapp.android.publish.common.metaData;
import android.content.Context;
import android.graphics.Bitmap;
import com.startapp.android.publish.common.BaseResponse;
import com.startapp.android.publish.common.Constants;
import com.startapp.android.publish.common.a;
import com.startapp.android.publish.common.commonUtils.g;
import com.startapp.android.publish.common.commonUtils.j;
import com.startapp.android.publish.common.commonUtils.q;
import com.startapp.android.publish.common.metaData.MetaDataRequest;
import com.startapp.android.publish.common.model.AdPreferences;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
public class MetaData extends BaseResponse {
public static final int DEFAULT_ACTIVITIES_BETWEEN_ADS = 1;
public static final boolean DEFAULT_ALWAYS_SEND_TOKEN = true;
public static final boolean DEFAULT_APP_PRESENCE = true;
public static final boolean DEFAULT_AUTO_INTERSTITIAL_ENABLED = true;
public static final int DEFAULT_BG_BOTTOM = -14606047;
public static final int DEFAULT_BG_TOP = -14606047;
public static final boolean DEFAULT_BT_ENABLED = false;
public static final boolean DEFAULT_COMPRESSION_ENABLED = false;
public static final boolean DEFAULT_DISABLE_INAPP_STORE = false;
public static final boolean DEFAULT_DISABLE_RETURN_AD = false;
public static final boolean DEFAULT_DISABLE_SPLASH_AD = false;
public static final boolean DEFAULT_DISABLE_TWO_CLICKS = false;
public static final int DEFAULT_FULLSCREEN_OVERLAY_PROBABILITY = 0;
public static final int DEFAULT_HOME_PROBABILITY_3D = 80;
public static final int DEFAULT_HTML_3D_PROBABILITY_3D = 100;
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 int DEFAULT_MAX_ADS = 10;
public static final boolean DEFAULT_PERIODIC_INFOEVENT_ENABLED = false;
public static final int DEFAULT_PERIODIC_INFOEVENT_INTERVAL = 360;
public static final boolean DEFAULT_PERIODIC_METADATA_ENABLED = false;
public static final int DEFAULT_PERIODIC_METADATA_INTERVAL = 360;
public static final int DEFAULT_PROBABILITY_3D = 0;
public static final long DEFAULT_RETURN_AD_MIN_BACKGROUND_TIME = 300;
public static final int DEFAULT_SECONDS_BETWEEN_ADS = 0;
public static final int DEFAULT_SESSION_MAX_BACKGROUND_TIME = 1800;
public static final boolean DEFAULT_SIMPLE_TOKEN_ENABLED = true;
public static final boolean DEFAULT_SMART_REDIRECT_ENABLED = true;
public static final int DEFAULT_SMART_REDIRECT_TIMEOUT = 5;
public static final String DEFAULT_TITLE_CONTENT = "Recommended for you";
public static final boolean DEFAULT_WF_SCAN_ENABLED = true;
public static final String KEY_METADATA = "metaData";
public static final String TEXT_DECORATION_ITALIC = "ITALIC";
public static final String TEXT_DECORATION_UNDERLINE = "UNDERLINE";
private static final long serialVersionUID = 1;
private static transient c task;
@com.startapp.android.publish.common.c.e(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.j));
public static final Integer DEFAULT_TITLE_TEXT_SIZE = 18;
public static final Integer DEFAULT_TITLE_TEXT_COLOR = -1;
public static final String TEXT_DECORATION_BOLD = "BOLD";
public static final Set<String> DEFAULT_TITLE_TEXT_DECORATION = new HashSet(Arrays.asList(TEXT_DECORATION_BOLD));
public static final Integer DEFAULT_TITLE_LINE_COLOR = -16777216;
public static final int DEFAULT_TITLE_BG = -14803426;
public static final Integer DEFAULT_POWERED_BY_BG = Integer.valueOf(DEFAULT_TITLE_BG);
public static final Integer DEFAULT_POWERED_BY_TEXT_COLOR = -1;
public static final String DEFAULT_AD_CLICK_URL = "http://www.startappexchange.com/tracking/adClick";
public static final String DEFAULT_METADATA_HOST = "https://init.startappservice.com/1.4/";
public static final String DEFAULT_AD_PLATFORM_HOST = "http://www.startappexchange.com/1.4/";
public static final String DEFAULT_PROFILE_ID = null;
private static transient MetaData instance = new MetaData();
private Integer probability3D = 0;
private Integer homeProbability3D = 80;
private Integer fullpageOfferWallProbability = 100;
private Integer fullpageOverlayProbability = 0;
private Integer backgroundGradientTop = -14606047;
private Integer backgroundGradientBottom = -14606047;
private Integer maxAds = 10;
private Integer titleBackgroundColor = Integer.valueOf(DEFAULT_TITLE_BG);
private String titleContent = DEFAULT_TITLE_CONTENT;
private Integer titleTextSize = DEFAULT_TITLE_TEXT_SIZE;
private Integer titleTextColor = DEFAULT_TITLE_TEXT_COLOR;
@com.startapp.android.publish.common.c.e(b = HashSet.class)
private Set<String> titleTextDecoration = DEFAULT_TITLE_TEXT_DECORATION;
private Integer titleLineColor = DEFAULT_TITLE_LINE_COLOR;
private Integer itemGradientTop = Integer.valueOf(MetaDataStyle.DEFAULT_ITEM_TOP);
private Integer itemGradientBottom = Integer.valueOf(MetaDataStyle.DEFAULT_ITEM_BOTTOM);
private Integer itemTitleTextSize = MetaDataStyle.DEFAULT_ITEM_TITLE_TEXT_SIZE;
private Integer itemTitleTextColor = MetaDataStyle.DEFAULT_ITEM_TITLE_TEXT_COLOR;
@com.startapp.android.publish.common.c.e(b = HashSet.class)
private Set<String> itemTitleTextDecoration = MetaDataStyle.DEFAULT_ITEM_TITLE_TEXT_DECORATION;
private Integer itemDescriptionTextSize = MetaDataStyle.DEFAULT_ITEM_DESC_TEXT_SIZE;
private Integer itemDescriptionTextColor = MetaDataStyle.DEFAULT_ITEM_DESC_TEXT_COLOR;
@com.startapp.android.publish.common.c.e(b = HashSet.class)
private Set<String> itemDescriptionTextDecoration = MetaDataStyle.DEFAULT_ITEM_DESC_TEXT_DECORATION;
@com.startapp.android.publish.common.c.e(b = HashMap.class, c = MetaDataStyle.class)
private HashMap<String, MetaDataStyle> templates = new HashMap<>();
@com.startapp.android.publish.common.c.e(a = true)
private com.startapp.android.publish.adsCommon.a.d adRules = new com.startapp.android.publish.adsCommon.a.d();
private Integer poweredByBackgroundColor = DEFAULT_POWERED_BY_BG;
private Integer poweredByTextColor = DEFAULT_POWERED_BY_TEXT_COLOR;
private String adClickURL = DEFAULT_AD_CLICK_URL;
private String metaDataHostSecured = DEFAULT_METADATA_HOST;
private String adPlatformHostGeneric = DEFAULT_AD_PLATFORM_HOST;
private int sessionMaxBackgroundTime = DEFAULT_SESSION_MAX_BACKGROUND_TIME;
private String profileId = DEFAULT_PROFILE_ID;
private long returnAdMinBackgroundTime = 300;
private boolean disableReturnAd = false;
private boolean disableSplashAd = false;
private int smartRedirectTimeout = 5;
private boolean enableSmartRedirect = true;
@com.startapp.android.publish.common.c.e(b = HashSet.class)
private Set<String> installersList = DEFAULT_INSTALLERS_LIST;
private boolean simpleToken2 = true;
private boolean alwaysSendToken = true;
private boolean compressionEnabled = false;
private boolean btEnabled = false;
private boolean autoInterstitialEnabled = true;
private int defaultActivitiesBetweenAds = 1;
private int defaultSecondsBetweenAds = 0;
private boolean periodicMetaDataEnabled = false;
private int periodicMetaDataIntervalInMinutes = 360;
private boolean periodicInfoEventEnabled = false;
private int periodicInfoEventIntervalInMinutes = 360;
private boolean inAppBrowser = true;
private boolean SupportIABViewability = true;
private long IABDisplayImpressionDelayInSeconds = 1;
private long IABVideoImpressionDelayInSeconds = 2;
@com.startapp.android.publish.common.c.e(a = true)
private e sensorsConfig = new e();
@com.startapp.android.publish.common.c.e(a = true)
private com.startapp.android.publish.common.metaData.b btConfig = new com.startapp.android.publish.common.metaData.b();
private String assetsBaseUrl = "";
private boolean disableTwoClicks = false;
private boolean appPresence = true;
private boolean disableInAppStore = false;
@com.startapp.android.publish.common.c.e(a = true)
private com.startapp.android.publish.common.b.a analytics = new com.startapp.android.publish.common.b.a();
@com.startapp.android.publish.common.c.e(a = true)
private f video = new f();
@com.startapp.android.publish.common.c.e(a = true)
private LocationConfig location = new LocationConfig();
private boolean wfScanEnabled = true;
private transient boolean loading = false;
private transient boolean ready = false;
private transient List<d> metaDataListeners = new ArrayList();
private String metadataUpdateVersion = Constants.h;
private int forceExternalBrowserDaysInterval = 7;
private boolean enableForceExternalBrowser = true;
public enum b {
DISABLED,
CONTENT,
FULL
}
private MetaData() {
}
public static void init(Context context) {
MetaData metaData = (MetaData) g.a(context, "StartappMetadata", MetaData.class);
MetaData metaData2 = new MetaData();
if (metaData != null) {
if (metaData.isMetaDataVersionChanged()) {
q.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()) {
j.a(3, "MetaData received:");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
com.startapp.android.publish.common.c.b bVar = new com.startapp.android.publish.common.c.b(byteArrayOutputStream);
bVar.a(metaData);
bVar.close();
j.a(3, byteArrayOutputStream.toString());
}
getInstance().applyAdPlatformProtocolToHosts();
metaData.metadataUpdateVersion = Constants.h;
g.a(context, "StartappMetadata", metaData);
j.a(3, "MetaData saved:");
getInstance().loading = false;
getInstance().ready = true;
if (getInstance().metaDataListeners != null) {
ArrayList arrayList = new ArrayList(getInstance().metaDataListeners);
getInstance().metaDataListeners.clear();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((d) it.next()).onFinishLoadingMeta();
}
}
com.startapp.android.publish.common.g.b(context, "totalSessions", Integer.valueOf(com.startapp.android.publish.common.g.a(context, "totalSessions", (Integer) 0).intValue() + 1));
task = null;
}
}
public static void failedLoading() {
ArrayList arrayList = null;
synchronized (lock) {
if (getInstance().metaDataListeners != null) {
arrayList = new ArrayList(getInstance().metaDataListeners);
getInstance().metaDataListeners.clear();
}
getInstance().loading = false;
}
if (arrayList != null) {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((d) it.next()).onFailedLoadingMeta();
}
}
}
public void loadFromServer(Context context, AdPreferences adPreferences, MetaDataRequest.a reason, boolean waitForMetadata, d listener) {
loadFromServer(context, adPreferences, reason, waitForMetadata, listener, false);
}
public void loadFromServer(Context context, AdPreferences adPreferences, MetaDataRequest.a reason, boolean waitForMetadata, d listener, boolean force) {
if (!waitForMetadata && listener != null) {
listener.onFinishLoadingMeta();
}
synchronized (lock) {
if (!getInstance().isReady() || force) {
if (!getInstance().isLoading() || force) {
this.loading = true;
this.ready = false;
if (task != null) {
task.b();
}
task = new c(context, adPreferences, reason);
task.a();
}
if (waitForMetadata && listener != null) {
getInstance().addMetaDataListener(listener);
}
return;
}
if (waitForMetadata && listener != null) {
listener.onFinishLoadingMeta();
}
}
}
public void addMetaDataListener(d metaDataListener) {
synchronized (lock) {
this.metaDataListeners.add(metaDataListener);
}
}
public static Object getLock() {
return lock;
}
public boolean isLoading() {
return this.loading;
}
public boolean isReady() {
return this.ready;
}
private boolean isMetaDataVersionChanged() {
return !Constants.h.equals(this.metadataUpdateVersion);
}
public String getAssetsBaseUrl() {
return this.assetsBaseUrl;
}
public boolean isPeriodicMetaDataEnabled() {
return this.periodicMetaDataEnabled;
}
public void setPeriodicMetaDataEnabled(boolean periodicMetaDataEnabled) {
this.periodicMetaDataEnabled = periodicMetaDataEnabled;
}
public int getPeriodicMetaDataInterval() {
return this.periodicMetaDataIntervalInMinutes;
}
public void setPeriodicMetaDataInterval(int periodicMetaDataInterval) {
this.periodicMetaDataIntervalInMinutes = periodicMetaDataInterval;
}
public boolean isPeriodicInfoEventEnabled() {
return this.periodicInfoEventEnabled;
}
public void setPeriodicInfoEventEnabled(boolean periodicInfoEventEnabled) {
this.periodicInfoEventEnabled = periodicInfoEventEnabled;
}
public int getPeriodicInfoEventIntervalInMinutes() {
return this.periodicInfoEventIntervalInMinutes;
}
public void setPeriodicInfoEventIntervalInMinutes(int periodicInfoEventIntervalInMinutes) {
this.periodicInfoEventIntervalInMinutes = periodicInfoEventIntervalInMinutes;
}
public int getFullpageOfferwallProbability() {
return this.fullpageOfferWallProbability.intValue();
}
public int getFullscreenOverlayProbability() {
return this.fullpageOverlayProbability.intValue();
}
public int getProbability3D() {
return this.probability3D.intValue();
}
public int getHomeProbability3D() {
return this.homeProbability3D.intValue();
}
public int getBackgroundGradientTop() {
return this.backgroundGradientTop.intValue();
}
public MetaDataStyle getTemplate(String templateName) {
return this.templates.get(templateName);
}
public int getBackgroundGradientBottom() {
return this.backgroundGradientBottom.intValue();
}
public int getMaxAds() {
return this.maxAds.intValue();
}
public Integer getTitleBackgroundColor() {
return this.titleBackgroundColor;
}
public String getTitleContent() {
return this.titleContent;
}
public Integer getTitleTextSize() {
return this.titleTextSize;
}
public Integer getTitleTextColor() {
return this.titleTextColor;
}
public Set<String> getTitleTextDecoration() {
return this.titleTextDecoration;
}
public Integer getTitleLineColor() {
return this.titleLineColor;
}
public int getItemGradientTop() {
return this.itemGradientTop.intValue();
}
public int getItemGradientBottom() {
return this.itemGradientBottom.intValue();
}
public Integer getItemTitleTextSize() {
return this.itemTitleTextSize;
}
public Integer getItemTitleTextColor() {
return this.itemTitleTextColor;
}
public Set<String> getItemTitleTextDecoration() {
return this.itemTitleTextDecoration;
}
public Integer getItemDescriptionTextSize() {
return this.itemDescriptionTextSize;
}
public Integer getItemDescriptionTextColor() {
return this.itemDescriptionTextColor;
}
public Set<String> getItemDescriptionTextDecoration() {
return this.itemDescriptionTextDecoration;
}
public Integer getPoweredByBackgroundColor() {
return this.poweredByBackgroundColor;
}
public Integer getPoweredByTextColor() {
return this.poweredByTextColor;
}
public String getAdClickUrl() {
return this.adClickURL;
}
public String getMetaDataHost() {
return Constants.OVERRIDE_HOST != null ? Constants.OVERRIDE_HOST : this.metaDataHostSecured;
}
public String getAdPlatformHost() {
return Constants.OVERRIDE_HOST != null ? Constants.OVERRIDE_HOST : this.adPlatformHostGeneric;
}
public long getSessionMaxBackgroundTime() {
return TimeUnit.SECONDS.toMillis(this.sessionMaxBackgroundTime);
}
public long getReturnAdMinBackgroundTime() {
return TimeUnit.SECONDS.toMillis(this.returnAdMinBackgroundTime);
}
public boolean isDisableReturnAd() {
return this.disableReturnAd;
}
public boolean isDisableSplashAd() {
return this.disableSplashAd;
}
public long getSmartRedirectTimeout() {
return TimeUnit.SECONDS.toMillis(this.smartRedirectTimeout);
}
public boolean isEnableSmartRedirect() {
return this.enableSmartRedirect;
}
public void setEnableSmartRedirect(boolean enableSmartRedirect) {
this.enableSmartRedirect = enableSmartRedirect;
}
public Set<String> getInstallersList() {
return this.installersList;
}
public void setInstallersList(Set<String> installersList) {
this.installersList = installersList;
}
public boolean isSimpleToken2() {
return this.simpleToken2;
}
public void setSimpleToken2(boolean simpleToken2) {
this.simpleToken2 = simpleToken2;
}
public boolean isAlwaysSendToken() {
return this.alwaysSendToken;
}
public void setAlwaysSendToken(boolean alwaysSendToken) {
this.alwaysSendToken = alwaysSendToken;
}
public boolean isCompressionEnabled() {
return this.compressionEnabled;
}
public void setCompressionEnabled(boolean compressionEnabled) {
this.compressionEnabled = compressionEnabled;
}
public boolean isInAppBrowser() {
return q.a(256L) && this.inAppBrowser;
}
public void setInAppBrowser(boolean inAppBrowser) {
this.inAppBrowser = inAppBrowser;
}
public b getInAppBrowserPreLoad() {
return this.inAppBrowserPreLoad;
}
public void setInAppBrowserPreLoad(b inAppBrowserPreLoad) {
this.inAppBrowserPreLoad = inAppBrowserPreLoad;
}
public boolean isDisableTwoClicks() {
return this.disableTwoClicks;
}
public boolean isAppPresenceEnabled() {
return this.appPresence;
}
public String getProfileId() {
return this.profileId;
}
public com.startapp.android.publish.adsCommon.a.d getAdRules() {
return this.adRules;
}
public boolean isDisableInAppStore() {
return this.disableInAppStore;
}
public com.startapp.android.publish.common.b.a getAnalyticsConfig() {
return this.analytics;
}
public f getVideoConfig() {
return this.video;
}
public e 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 boolean isAutoInterstitialEnabled() {
return this.autoInterstitialEnabled;
}
public int getDefaultActivitiesBetweenAds() {
return this.defaultActivitiesBetweenAds;
}
public int getDefaultSecondsBetweenAds() {
return this.defaultSecondsBetweenAds;
}
public static MetaData getInstance() {
return instance;
}
public long getIABDisplayImpressionDelayInSeconds() {
return this.IABDisplayImpressionDelayInSeconds;
}
public long getIABVideoImpressionDelayInSeconds() {
return this.IABVideoImpressionDelayInSeconds;
}
public boolean isSupportIABViewability() {
return this.SupportIABViewability;
}
public void applyAdPlatformProtocolToHosts() {
this.adPlatformHostGeneric = replaceAdProtocol(this.adPlatformHostGeneric, DEFAULT_AD_PLATFORM_HOST);
this.metaDataHostSecured = replaceAdProtocol(this.metaDataHostSecured, DEFAULT_METADATA_HOST);
}
private String replaceAdProtocol(String target, String defaultVal) {
if (target != null) {
String defaultVal2 = target.replace("%AdPlatformProtocol%", "1.4");
return defaultVal2;
}
return defaultVal;
}
private void initTransientFields() {
this.loading = false;
this.ready = false;
this.metaDataListeners = new ArrayList();
this.adRules.b();
}
public static void preCacheResources(Context context) {
String assetsBaseUrl = getInstance().getAssetsBaseUrl();
if (!assetsBaseUrl.equals("")) {
if (!com.startapp.android.publish.common.commonUtils.e.b(context, "close_button.png") && !q.a()) {
new com.startapp.android.publish.common.a(assetsBaseUrl + "close_button.png", new a(context, "close_button"), 0).a();
}
if (q.a(256L)) {
for (String str : Constants.k) {
if (!com.startapp.android.publish.common.commonUtils.e.b(context, str + ".png")) {
new com.startapp.android.publish.common.a(assetsBaseUrl + str + ".png", new a(context, str), 0).a();
}
}
}
if (q.a(64L)) {
for (String str2 : Constants.l) {
if (!com.startapp.android.publish.common.commonUtils.e.b(context, str2 + ".png")) {
new com.startapp.android.publish.common.a(assetsBaseUrl + str2 + ".png", new a(context, str2), 0).a();
}
}
if (!com.startapp.android.publish.common.commonUtils.e.b(context, "logo.png")) {
new com.startapp.android.publish.common.a(assetsBaseUrl + "logo.png", new a(context, "logo"), 0).a();
return;
}
return;
}
if (q.a(32L)) {
for (String str3 : Constants.l) {
if (!com.startapp.android.publish.common.commonUtils.e.b(context, str3 + ".png")) {
new com.startapp.android.publish.common.a(assetsBaseUrl + str3 + ".png", new a(context, str3), 0).a();
}
}
}
}
}
public static class a implements a.InterfaceC0086a {
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.common.commonUtils.e.a(this.a, bitmap, this.b);
}
}
}
public int getCookieDaysInterval() {
return this.forceExternalBrowserDaysInterval;
}
public boolean forceExternalOpen() {
return this.enableForceExternalBrowser;
}
}