Life Simulator: Game Dev v0.6版本的 MD5 值为:ecca8c682c00d3b861fbed7f58e41c8d
以下内容为反编译后的 AdInformationConfig.java 源代码,内容仅作参考
package com.startapp.android.publish.adinformation;
import android.content.Context;
import android.support.v4.media.TransportMediator;
import com.startapp.android.publish.adinformation.AdInformationPositions;
import com.startapp.android.publish.i.j;
import com.startapp.android.publish.model.AdPreferences;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public class AdInformationConfig implements Serializable {
private static final long serialVersionUID = 1;
private boolean enabled = true;
private float fatFingersFactor = 200.0f;
private String dialogUrl = "http://d1byvlfiet2h9q.cloudfront.net/InApp/resources/adInformationDialog3.html";
private String eulaUrl = "http://searchmobileonline.com/static/eula_more_sdk.html";
@com.startapp.android.publish.e.e(a = true)
private e SimpleToken = new e();
@com.startapp.android.publish.e.e(b = HashMap.class, c = AdInformationPositions.Position.class, d = AdPreferences.Placement.class)
protected HashMap<AdPreferences.Placement, AdInformationPositions.Position> Positions = new HashMap<>();
private transient EnumMap<ImageResourceType, d> a = new EnumMap<>(ImageResourceType.class);
@com.startapp.android.publish.e.e(b = ArrayList.class, c = d.class)
private List<d> ImageResources = new ArrayList();
public enum ImageResourceType {
INFO_S(17, 14),
INFO_EX_S(88, 14),
INFO_L(25, 21),
INFO_EX_L(TransportMediator.KEYCODE_MEDIA_RECORD, 21);
private int height;
private int width;
ImageResourceType(int width, int height) {
this.width = width;
this.height = height;
}
public int getDefaultWidth() {
return this.width;
}
public int getDefaultHeight() {
return this.height;
}
public static ImageResourceType getByName(String name) {
ImageResourceType imageResourceType = INFO_S;
ImageResourceType[] values = values();
for (int i = 0; i < values.length; i++) {
if (values[i].name().toLowerCase().compareTo(name.toLowerCase()) == 0) {
imageResourceType = values[i];
}
}
return imageResourceType;
}
}
private AdInformationConfig() {
}
public static AdInformationConfig a() {
AdInformationConfig adInformationConfig = new AdInformationConfig();
a(adInformationConfig);
return adInformationConfig;
}
public static void a(AdInformationConfig adInformationConfig) {
adInformationConfig.j();
adInformationConfig.i();
}
public String b() {
return this.eulaUrl;
}
public String c() {
return this.a.get(ImageResourceType.INFO_L).d();
}
public boolean d() {
return this.enabled;
}
public boolean a(Context context) {
return !j.a(context, "userDisabledAdInformation", (Boolean) false).booleanValue() && d();
}
public void a(Context context, boolean z) {
j.b(context, "userDisabledAdInformation", Boolean.valueOf(!z));
}
public float e() {
return this.fatFingersFactor / 100.0f;
}
protected void a(ImageResourceType imageResourceType, d dVar) {
k().put((EnumMap<ImageResourceType, d>) imageResourceType, (ImageResourceType) dVar);
}
public String f() {
return this.dialogUrl;
}
public e g() {
return this.SimpleToken;
}
public AdInformationPositions.Position a(AdPreferences.Placement placement) {
AdInformationPositions.Position position = this.Positions.get(placement);
if (position == null) {
AdInformationPositions.Position position2 = AdInformationPositions.Position.BOTTOM_LEFT;
this.Positions.put(placement, position2);
return position2;
}
return position;
}
public d a(ImageResourceType imageResourceType) {
return k().get(imageResourceType);
}
public void h() {
for (d dVar : this.ImageResources) {
a(ImageResourceType.getByName(dVar.a()), dVar);
dVar.e();
}
}
protected void i() {
for (ImageResourceType imageResourceType : ImageResourceType.values()) {
if (k().get(imageResourceType) == null) {
throw new IllegalArgumentException("AdInformation error in ImageResource [" + imageResourceType + "] cannot be found in MetaData");
}
}
}
protected void j() {
Boolean bool;
for (ImageResourceType imageResourceType : ImageResourceType.values()) {
d dVar = k().get(imageResourceType);
if (dVar == null) {
d c = d.c(imageResourceType.name());
Iterator<d> it = this.ImageResources.iterator();
while (true) {
if (!it.hasNext()) {
bool = true;
break;
} else if (ImageResourceType.getByName(it.next().a()).equals(imageResourceType)) {
bool = false;
break;
}
}
k().put((EnumMap<ImageResourceType, d>) imageResourceType, (ImageResourceType) c);
if (bool.booleanValue()) {
this.ImageResources.add(c);
}
dVar = c;
}
dVar.a(imageResourceType.getDefaultWidth());
dVar.b(imageResourceType.getDefaultHeight());
dVar.a(imageResourceType.name().toLowerCase() + ".png");
}
}
public EnumMap<ImageResourceType, d> k() {
return this.a;
}
public void l() {
this.a = new EnumMap<>(ImageResourceType.class);
}
}