PSP Dragon Emulator v1.0版本的 MD5 值为:c6379fb6b63c27b6a7d2f2f6f6f51637
以下内容为反编译后的 AdInformationConfig.java 源代码,内容仅作参考
package com.startapp.android.publish.adsCommon.adinformation;
import android.content.Context;
import com.startapp.android.publish.adsCommon.adinformation.AdInformationPositions;
import com.startapp.android.publish.common.f;
import com.startapp.android.publish.common.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://www.startapp.com/policy/sdk-policy/";
@com.startapp.android.publish.common.c.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, e> a = new EnumMap<>(ImageResourceType.class);
@com.startapp.android.publish.common.c.e(b = ArrayList.class, c = e.class)
private List<e> ImageResources = new ArrayList();
public enum ImageResourceType {
INFO_S(17, 14),
INFO_EX_S(88, 14),
INFO_L(25, 21),
INFO_EX_L(130, 21);
private int height;
private int width;
ImageResourceType(int i, int i2) {
this.width = i;
this.height = i2;
}
public int getDefaultWidth() {
return this.width;
}
public int getDefaultHeight() {
return this.height;
}
public static ImageResourceType getByName(String str) {
ImageResourceType imageResourceType = INFO_S;
ImageResourceType[] values = values();
for (int i = 0; i < values.length; i++) {
if (values[i].name().toLowerCase().compareTo(str.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.i();
adInformationConfig.h();
}
public String b() {
return (this.eulaUrl == null || this.eulaUrl.equals("")) ? "http://www.startapp.com/policy/sdk-policy/" : this.eulaUrl;
}
public String c() {
return (!this.a.containsKey(ImageResourceType.INFO_L) || this.a.get(ImageResourceType.INFO_L).d().equals("")) ? "http://info.static.startappservice.com/InApp/resources/info_l.png" : this.a.get(ImageResourceType.INFO_L).d();
}
public boolean d() {
return this.enabled;
}
public boolean a(Context context) {
return !f.a(context, "userDisabledAdInformation", (Boolean) false).booleanValue() && d();
}
public void a(Context context, boolean z) {
f.b(context, "userDisabledAdInformation", Boolean.valueOf(!z));
}
public float e() {
return this.fatFingersFactor / 100.0f;
}
protected void a(ImageResourceType imageResourceType, e eVar) {
j().put((EnumMap<ImageResourceType, e>) imageResourceType, (ImageResourceType) eVar);
}
public String f() {
return this.dialogUrl;
}
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 e a(ImageResourceType imageResourceType) {
return j().get(imageResourceType);
}
public void g() {
for (e eVar : this.ImageResources) {
a(ImageResourceType.getByName(eVar.a()), eVar);
eVar.e();
}
}
protected void h() {
ImageResourceType[] values;
for (ImageResourceType imageResourceType : ImageResourceType.values()) {
if (j().get(imageResourceType) == null) {
throw new IllegalArgumentException("AdInformation error in ImageResource [" + imageResourceType + "] cannot be found in MetaData");
}
}
}
protected void i() {
ImageResourceType[] values;
for (ImageResourceType imageResourceType : ImageResourceType.values()) {
e eVar = j().get(imageResourceType);
Boolean bool = true;
if (eVar == null) {
eVar = e.c(imageResourceType.name());
Iterator<e> it = this.ImageResources.iterator();
while (true) {
if (it.hasNext()) {
if (ImageResourceType.getByName(it.next().a()).equals(imageResourceType)) {
bool = false;
break;
}
} else {
break;
}
}
j().put((EnumMap<ImageResourceType, e>) imageResourceType, (ImageResourceType) eVar);
if (bool.booleanValue()) {
this.ImageResources.add(eVar);
}
}
eVar.a(imageResourceType.getDefaultWidth());
eVar.b(imageResourceType.getDefaultHeight());
eVar.a(imageResourceType.name().toLowerCase() + ".png");
}
}
public EnumMap<ImageResourceType, e> j() {
return this.a;
}
public void k() {
this.a = new EnumMap<>(ImageResourceType.class);
}
}