Stick Squad 3 v1.2.5.9版本的 MD5 值为:375cf7f77a7075270cd68d1397368279
以下内容为反编译后的 MetaData.java 源代码,内容仅作参考
package com.fusepowered.sa.android.publish.model;
import android.content.Context;
import android.content.SharedPreferences;
import com.fusepowered.sa.android.publish.adinformation.AdInformationConfig;
import com.fusepowered.sa.android.publish.b;
import com.fusepowered.sa.android.publish.banner.BannerOptions;
import com.fusepowered.sa.android.publish.c.h;
import com.fusepowered.sa.android.publish.c.p;
import com.fusepowered.sa.android.publish.f.g;
import com.fusepowered.sa.android.publish.f.o;
import com.fusepowered.sa.android.publish.gson.Gson;
import com.fusepowered.sa.android.publish.splash.SplashConfig;
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 long DEFAULT_AD_CACHE_TTL = 172800;
public static final String DEFAULT_AD_CLICK_URL = "http://www.startappexchange.com/tracking/adClick";
public static final int DEFAULT_BG_BOTTOM = -14606047;
public static final int DEFAULT_BG_TOP = -14606047;
public static final boolean DEFAULT_DISABLE_RETURN_AD = false;
public static final int DEFAULT_FULLSCREEN_OVERLAY_PROBABILITY = 50;
public static final int DEFAULT_HOME_PROBABILITY_3D = 80;
public static final int DEFAULT_HTML_3D_PROBABILITY_3D = 50;
public static final int DEFAULT_MAX_ADS = 10;
public static final long DEFAULT_METADATA_TTL = 86400;
public static final int DEFAULT_PROBABILITY_3D = 80;
public static final long DEFAULT_RETURN_AD_MIN_BACKGROUND_TIME = 300;
public static final String DEFAULT_TITLE_CONTENT = "Free Apps of the day";
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 = 7816991301474641323L;
private static transient MetaData instance = new MetaData();
private static transient Object lock = new Object();
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;
private Integer probability3D = 80;
private Integer homeProbability3D = 80;
private Integer fullpageOfferWallProbability = 50;
private Integer fullpageOverlayProbability = 50;
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;
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;
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;
private Set<String> itemDescriptionTextDecoration = MetaDataStyle.DEFAULT_ITEM_DESC_TEXT_DECORATION;
private BannerOptions BannerOptions = new BannerOptions();
private HashMap<String, MetaDataStyle> templates = new HashMap<>();
private Integer poweredByBackgroundColor = DEFAULT_POWERED_BY_BG;
private Integer poweredByTextColor = DEFAULT_POWERED_BY_TEXT_COLOR;
private SplashConfig SplashConfig = new SplashConfig();
private AdInformationConfig AdInformation = AdInformationConfig.a();
private String adClickURL = DEFAULT_AD_CLICK_URL;
private Long metaDataTTL = Long.valueOf(DEFAULT_METADATA_TTL);
private String version = "";
private long returnAdMinBackgroundTime = 300;
private long adCacheTTL = DEFAULT_AD_CACHE_TTL;
private boolean disableReturnAd = false;
private long lastUpdate = 0;
private transient boolean loading = false;
private transient List<p> metaDataListeners = new ArrayList();
private MetaData() {
getAdInformationConfig().f();
}
public static void failedLoading() {
synchronized (lock) {
if (getInstance().metaDataListeners != null) {
Iterator<p> it = getInstance().metaDataListeners.iterator();
while (it.hasNext()) {
it.next().onFailedLoadingMeta();
}
getInstance().metaDataListeners.clear();
}
getInstance().loading = false;
}
}
public static MetaData getInstance() {
return instance;
}
public static Object getLock() {
return lock;
}
public static void init(Context context) {
MetaData metaData = (MetaData) new Gson().fromJson(context.getSharedPreferences("com.fusepowered.sa.android.publish", 0).getString(KEY_METADATA, ""), MetaData.class);
if (metaData != null) {
instance = metaData;
} else {
instance = new MetaData();
}
getInstance().getAdInformationConfig().f();
}
public static void update(Context context, MetaData metaData) {
synchronized (lock) {
metaData.metaDataListeners = getInstance().metaDataListeners;
instance = metaData;
if (b.DEBUG.booleanValue()) {
g.a(3, "MetaData received:");
g.a(3, new Gson().toJson(metaData));
}
AdInformationConfig.a(getInstance().AdInformation);
getInstance().lastUpdate = System.currentTimeMillis();
SharedPreferences.Editor edit = context.getSharedPreferences("com.fusepowered.sa.android.publish", 0).edit();
String json = new Gson().toJson(getInstance());
edit.putString(KEY_METADATA, json);
edit.commit();
g.a(3, "MetaData saved:");
g.a(3, json);
getInstance().getAdInformationConfig().f();
if (getInstance().metaDataListeners != null) {
Iterator<p> it = getInstance().metaDataListeners.iterator();
while (it.hasNext()) {
it.next().onFinishLoadingMeta();
}
getInstance().metaDataListeners.clear();
}
getInstance().loading = false;
}
}
public void addMetaDataListener(p pVar) {
this.metaDataListeners.add(pVar);
}
public long getAdCacheTtl() {
return TimeUnit.SECONDS.toMillis(this.adCacheTTL);
}
public String getAdClickUrl() {
return this.adClickURL;
}
public AdInformationConfig getAdInformationConfig() {
return this.AdInformation;
}
public int getBackgroundGradientBottom() {
return this.backgroundGradientBottom.intValue();
}
public int getBackgroundGradientTop() {
return this.backgroundGradientTop.intValue();
}
public BannerOptions getBannerOptions() {
return this.BannerOptions;
}
public int getFullscreenOverlayProbability() {
return this.fullpageOverlayProbability.intValue();
}
public int getHomeProbability3D() {
return this.homeProbability3D.intValue();
}
public int getHtml3DProbability() {
return this.fullpageOfferWallProbability.intValue();
}
public Integer getItemDescriptionTextColor() {
return this.itemDescriptionTextColor;
}
public Set<String> getItemDescriptionTextDecoration() {
return this.itemDescriptionTextDecoration;
}
public Integer getItemDescriptionTextSize() {
return this.itemDescriptionTextSize;
}
public int getItemGradientBottom() {
return this.itemGradientBottom.intValue();
}
public int getItemGradientTop() {
return this.itemGradientTop.intValue();
}
public Integer getItemTitleTextColor() {
return this.itemTitleTextColor;
}
public Set<String> getItemTitleTextDecoration() {
return this.itemTitleTextDecoration;
}
public Integer getItemTitleTextSize() {
return this.itemTitleTextSize;
}
public int getMaxAds() {
return this.maxAds.intValue();
}
public Integer getPoweredByBackgroundColor() {
return this.poweredByBackgroundColor;
}
public Integer getPoweredByTextColor() {
return this.poweredByTextColor;
}
public int getProbability3D() {
return this.probability3D.intValue();
}
public long getReturnAdMinBackgroundTime() {
return TimeUnit.SECONDS.toMillis(this.returnAdMinBackgroundTime);
}
public SplashConfig getSplashConfig() {
return this.SplashConfig;
}
public MetaDataStyle getTemplate(String str) {
return this.templates.get(str);
}
public Integer getTitleBackgroundColor() {
return this.titleBackgroundColor;
}
public String getTitleContent() {
return this.titleContent;
}
public Integer getTitleLineColor() {
return this.titleLineColor;
}
public Integer getTitleTextColor() {
return this.titleTextColor;
}
public Set<String> getTitleTextDecoration() {
return this.titleTextDecoration;
}
public Integer getTitleTextSize() {
return this.titleTextSize;
}
public boolean isDisableReturnAd() {
return this.disableReturnAd;
}
public boolean isLoading() {
return this.loading;
}
public boolean isReady() {
return (((System.currentTimeMillis() - this.lastUpdate) > TimeUnit.SECONDS.toMillis(this.metaDataTTL.longValue()) ? 1 : ((System.currentTimeMillis() - this.lastUpdate) == TimeUnit.SECONDS.toMillis(this.metaDataTTL.longValue()) ? 0 : -1)) < 0) && o.a().equals(this.version);
}
public void loadFromServer(Context context, AdPreferences adPreferences, boolean z, p pVar) {
if (!z && pVar != null) {
pVar.onFinishLoadingMeta();
}
synchronized (lock) {
if (getInstance().isReady()) {
if (!z || pVar == null) {
return;
}
pVar.onFinishLoadingMeta();
return;
}
if (!getInstance().isLoading()) {
this.loading = true;
new h(context, adPreferences).a();
}
if (z && pVar != null) {
getInstance().addMetaDataListener(pVar);
}
}
}
public void setVersion(String str) {
this.version = str;
}
}