Stick Squad 3 v1.2.5.9版本的 MD5 值为:375cf7f77a7075270cd68d1397368279

以下内容为反编译后的 AdInformationConfig.java 源代码,内容仅作参考


package com.fusepowered.sa.android.publish.adinformation;

import android.content.Context;
import com.fusepowered.sa.android.publish.adinformation.AdInformationPositions;
import com.fusepowered.sa.android.publish.f.f;
import com.fusepowered.sa.android.publish.model.AdPreferences;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class AdInformationConfig implements Serializable {
    private static final long serialVersionUID = 375946262751346862L;
    private boolean enabled = true;
    private float fatFingersFactor = 200.0f;
    private String dialogUrl = "http://d1byvlfiet2h9q.cloudfront.net/InApp/resources/adInformationDialog3.html";
    private e SimpleToken = new e();
    protected HashMap<AdPreferences.Placement, AdInformationPositions.Position> Positions = new HashMap<>();
    private transient HashMap<ImageResourceType, d> a = new HashMap<>();
    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(130, 21);

        private int height;
        private int width;

        ImageResourceType(int i, int i2) {
            this.width = i;
            this.height = i2;
        }

        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;
        }

        public int getDefaultHeight() {
            return this.height;
        }

        public int getDefaultWidth() {
            return this.width;
        }
    }

    private AdInformationConfig() {
    }

    public static AdInformationConfig a() {
        AdInformationConfig adInformationConfig = new AdInformationConfig();
        a(adInformationConfig);
        return adInformationConfig;
    }

    public static void a(AdInformationConfig adInformationConfig) {
        adInformationConfig.h();
        adInformationConfig.g();
    }

    public AdInformationPositions.Position a(AdPreferences.Placement placement) {
        AdInformationPositions.Position position = this.Positions.get(placement);
        if (position != null) {
            return position;
        }
        AdInformationPositions.Position position2 = AdInformationPositions.Position.BOTTOM_LEFT;
        this.Positions.put(placement, position2);
        return position2;
    }

    public d a(ImageResourceType imageResourceType) {
        return this.a.get(imageResourceType);
    }

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

    protected void a(ImageResourceType imageResourceType, d dVar) {
        this.a.put(imageResourceType, dVar);
    }

    public boolean a(Context context) {
        return !f.a(context, "userDisabledAdInformation", (Boolean) false).booleanValue() && b();
    }

    public boolean b() {
        return this.enabled;
    }

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

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

    public e e() {
        return this.SimpleToken;
    }

    public void f() {
        for (d dVar : this.ImageResources) {
            a(ImageResourceType.getByName(dVar.a()), dVar);
            dVar.d();
        }
    }

    protected void g() {
        for (ImageResourceType imageResourceType : ImageResourceType.values()) {
            if (this.a.get(imageResourceType) == null) {
                throw new IllegalArgumentException("AdInformation error in ImageResource [" + imageResourceType + "] cannot be found in MetaData");
            }
        }
    }

    protected void h() {
        for (ImageResourceType imageResourceType : ImageResourceType.values()) {
            d dVar = this.a.get(imageResourceType);
            if (dVar == null) {
                dVar = d.c(imageResourceType.name());
                this.a.put(imageResourceType, dVar);
                this.ImageResources.add(dVar);
            }
            dVar.a(imageResourceType.getDefaultWidth());
            dVar.b(imageResourceType.getDefaultHeight());
            dVar.a(imageResourceType.name().toLowerCase() + ".png");
        }
    }
}