导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - AdInformationConfig.java 源代码

正在查看: Cantique de Louanges v12 应用的 AdInformationConfig.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.startapp.sdk.adsbase.adinformation;

import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.startapp.json.TypeInfo;
import com.startapp.sdk.adsbase.adinformation.AdInformationPositions;
import com.startapp.sdk.adsbase.model.AdPreferences;
import com.startapp.sdk.internal.gj;
import com.startapp.sdk.internal.i9;
import com.startapp.sdk.internal.jg;
import com.startapp.sdk.internal.kg;
import com.startapp.sdk.internal.o2;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.WeakHashMap;

@Keep
public class AdInformationConfig implements Serializable {
    private static final String DEFAULT_DIALOG_URL = "https://funnel-assets.startappservice.com/consent/index.html";
    protected static final boolean DEFAULT_EANBLED = true;
    private static final String DEFAULT_EULA_URL = "https://www.startapp.com/policy/privacy-policy/";
    private static final float DEFAULT_FAT_FINGERS_FACTOR = 200.0f;
    private static final long serialVersionUID = 8911501868319500986L;

    @Nullable
    private Integer consentTypeInfo;
    private boolean enabled = true;
    private float fatFingersFactor = DEFAULT_FAT_FINGERS_FACTOR;
    private String dialogUrlSecured = DEFAULT_DIALOG_URL;
    private String eulaUrlSecured = DEFAULT_EULA_URL;

    @TypeInfo(key = AdPreferences.Placement.class, type = HashMap.class, value = AdInformationPositions.Position.class)
    protected HashMap<AdPreferences.Placement, AdInformationPositions.Position> Positions = new HashMap<>();
    private transient EnumMap<ImageResourceType, ImageResourceConfig> imageResources = new EnumMap<>(ImageResourceType.class);

    @TypeInfo(type = ArrayList.class, value = ImageResourceConfig.class)
    private List<ImageResourceConfig> ImageResources = new ArrayList();

    @Keep
    public enum ImageResourceType {
        INFO_S(17, 14),
        INFO_EX_S(88, 14),
        INFO_L(25, 21),
        INFO_EX_L(130, 21);

        private final int height;
        private final int width;

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

        public static ImageResourceType getByName(String str) {
            ImageResourceType imageResourceType = INFO_S;
            for (ImageResourceType imageResourceType2 : values()) {
                String name = imageResourceType2.name();
                Locale locale = Locale.ROOT;
                if (name.toLowerCase(locale).compareTo(str.toLowerCase(locale)) == 0) {
                    imageResourceType = imageResourceType2;
                }
            }
            return imageResourceType;
        }

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

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

    @Keep
    private AdInformationConfig() {
    }

    @Keep
    public static AdInformationConfig createAdInformationConfig() {
        AdInformationConfig adInformationConfig = new AdInformationConfig();
        setDefaultValues(adInformationConfig);
        return adInformationConfig;
    }

    @Keep
    public static void setDefaultValues(AdInformationConfig adInformationConfig) {
        adInformationConfig.updateFallbackImageResources();
        adInformationConfig.validateImageResourcesConfig();
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        AdInformationConfig adInformationConfig = (AdInformationConfig) obj;
        return this.enabled == adInformationConfig.enabled && Float.compare(adInformationConfig.fatFingersFactor, this.fatFingersFactor) == 0 && gj.a((Object) this.consentTypeInfo, (Object) adInformationConfig.consentTypeInfo) && gj.a((Object) this.dialogUrlSecured, (Object) adInformationConfig.dialogUrlSecured) && gj.a((Object) this.eulaUrlSecured, (Object) adInformationConfig.eulaUrlSecured) && gj.a((Object) this.Positions, (Object) adInformationConfig.Positions) && gj.a(this.ImageResources, adInformationConfig.ImageResources);
    }

    @Nullable
    @Keep
    public Integer getConsentTypeInfo() {
        return this.consentTypeInfo;
    }

    @NonNull
    @Keep
    public String getDialogUrl() {
        String str = this.dialogUrlSecured;
        return str != null ? str : DEFAULT_DIALOG_URL;
    }

    @Keep
    public String getEulaUrl() {
        String str = this.eulaUrlSecured;
        return (str == null || str.equals("")) ? DEFAULT_EULA_URL : this.eulaUrlSecured;
    }

    @Keep
    public float getFatFingerFactor() {
        return this.fatFingersFactor / 100.0f;
    }

    @Keep
    public ImageResourceConfig getImageResourceConfig(ImageResourceType imageResourceType) {
        return getImageResources().get(imageResourceType);
    }

    @Keep
    public EnumMap<ImageResourceType, ImageResourceConfig> getImageResources() {
        return this.imageResources;
    }

    @Keep
    public AdInformationPositions.Position getPosition(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;
    }

    @Keep
    public String getPrivacyIconImageUrl() {
        EnumMap<ImageResourceType, ImageResourceConfig> enumMap = this.imageResources;
        ImageResourceType imageResourceType = ImageResourceType.INFO_L;
        return (!enumMap.containsKey(imageResourceType) || this.imageResources.get(imageResourceType).b().equals("")) ? "https://info.startappservice.com/InApp/resources/info_l.png" : this.imageResources.get(imageResourceType).b();
    }

    public int hashCode() {
        Object[] objArr = {Boolean.valueOf(this.enabled), this.consentTypeInfo, Float.valueOf(this.fatFingersFactor), this.dialogUrlSecured, this.eulaUrlSecured, this.Positions, this.ImageResources};
        WeakHashMap weakHashMap = gj.a;
        return Arrays.deepHashCode(objArr);
    }

    @Keep
    public void initImageResourceConfigBitmaps(@NonNull Context context) {
        for (ImageResourceConfig imageResourceConfig : this.ImageResources) {
            setImageResourceConfig(ImageResourceType.getByName(imageResourceConfig.c()), imageResourceConfig);
            imageResourceConfig.a = null;
            new o2(context, imageResourceConfig.b(), new i9(imageResourceConfig), 0).a();
        }
    }

    @Keep
    public void initTransientFields() {
        this.imageResources = new EnumMap<>(ImageResourceType.class);
    }

    @Keep
    public boolean isEnabled(Context context) {
        return !((kg) com.startapp.sdk.components.a.a(context).F.a()).getBoolean("userDisabledAdInformation", false) && isMetaDataEnabled();
    }

    @Keep
    public boolean isMetaDataEnabled() {
        return this.enabled;
    }

    protected void setImageResourceConfig(ImageResourceType imageResourceType, ImageResourceConfig imageResourceConfig) {
        getImageResources().put((EnumMap<ImageResourceType, ImageResourceConfig>) imageResourceType, (ImageResourceType) imageResourceConfig);
    }

    @Keep
    public void setUserEnabled(Context context, boolean z) {
        jg edit = ((kg) com.startapp.sdk.components.a.a(context).F.a()).edit();
        boolean z2 = !z;
        edit.a("userDisabledAdInformation", Boolean.valueOf(z2));
        edit.a.putBoolean("userDisabledAdInformation", z2);
        edit.apply();
    }

    protected void updateFallbackImageResources() {
        boolean z;
        for (ImageResourceType imageResourceType : ImageResourceType.values()) {
            ImageResourceConfig imageResourceConfig = getImageResources().get(imageResourceType);
            if (imageResourceConfig == null) {
                imageResourceConfig = ImageResourceConfig.a(imageResourceType.name());
                Iterator<ImageResourceConfig> it = this.ImageResources.iterator();
                while (true) {
                    if (it.hasNext()) {
                        if (ImageResourceType.getByName(it.next().c()).equals(imageResourceType)) {
                            z = false;
                            break;
                        }
                    } else {
                        z = true;
                        break;
                    }
                }
                getImageResources().put((EnumMap<ImageResourceType, ImageResourceConfig>) imageResourceType, (ImageResourceType) imageResourceConfig);
                if (z) {
                    this.ImageResources.add(imageResourceConfig);
                }
            }
            imageResourceConfig.b(imageResourceType.getDefaultWidth());
            imageResourceConfig.a(imageResourceType.getDefaultHeight());
            imageResourceConfig.b(imageResourceType.name().toLowerCase(Locale.ROOT) + ".png");
        }
    }

    protected void validateImageResourcesConfig() {
        for (ImageResourceType imageResourceType : ImageResourceType.values()) {
            if (getImageResources().get(imageResourceType) == null) {
                throw new IllegalArgumentException(String.valueOf(imageResourceType));
            }
        }
    }
}