VegeFruits v7.1版本的 MD5 值为:2ff167dfba698c783e879938fe00b9ce

以下内容为反编译后的 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.g;
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(a = true)
    private f SimpleToken = new f();

    @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 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 == 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 !g.a(context, "userDisabledAdInformation", (Boolean) false).booleanValue() && d();
    }

    public void a(Context context, boolean z) {
        g.b(context, "userDisabledAdInformation", Boolean.valueOf(!z));
    }

    public float e() {
        return this.fatFingersFactor / 100.0f;
    }

    protected void a(ImageResourceType imageResourceType, e eVar) {
        k().put((EnumMap<ImageResourceType, e>) imageResourceType, (ImageResourceType) eVar);
    }

    public String f() {
        return this.dialogUrl;
    }

    public f 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 e a(ImageResourceType imageResourceType) {
        return k().get(imageResourceType);
    }

    public void h() {
        for (e eVar : this.ImageResources) {
            a(ImageResourceType.getByName(eVar.a()), eVar);
            eVar.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()) {
            e eVar = k().get(imageResourceType);
            if (eVar == null) {
                e c = e.c(imageResourceType.name());
                Iterator<e> 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, e>) imageResourceType, (ImageResourceType) c);
                if (bool.booleanValue()) {
                    this.ImageResources.add(c);
                }
                eVar = c;
            }
            eVar.a(imageResourceType.getDefaultWidth());
            eVar.b(imageResourceType.getDefaultHeight());
            eVar.a(imageResourceType.name().toLowerCase() + ".png");
        }
    }

    public EnumMap<ImageResourceType, e> k() {
        return this.a;
    }

    public void l() {
        this.a = new EnumMap<>(ImageResourceType.class);
    }
}