GDPRUtils.smali

.class public Lcom/taboola/android/utils/GDPRUtils;
.super Ljava/lang/Object;
.source "GDPRUtils.java"


# static fields
.field private static final CMP_PRESENT:Ljava/lang/String; = "IABConsent_CMPPresent"

.field private static final CMP_PRESENT_V2:Ljava/lang/String; = "IABTCF_CmpSdkID"

.field private static final CMP_V2_NA:I = -0x1

.field private static final CONSENT_STRING:Ljava/lang/String; = "IABConsent_ConsentString"

.field private static final CONSENT_STRING_V2:Ljava/lang/String; = "IABTCF_TCString"

.field private static final EMPTY_DEFAULT_STRING:Ljava/lang/String; = ""

.field public static final SDK_API_FETCH_KEY_CONSENT_STRING_V1:Ljava/lang/String; = "consent.daisybit"

.field public static final SDK_API_FETCH_KEY_CONSENT_STRING_V2:Ljava/lang/String; = "consent.tcstring"

.field private static final SUBJECT_TO_GDPR:Ljava/lang/String; = "IABConsent_SubjectToGDPR"

.field private static final SUBJECT_TO_GDPR_V2:Ljava/lang/String; = "IABTCF_gdprApplies"

.field private static final SUBJECT_TO_GDPR_VALUE_DEFAULT:Ljava/lang/String; = "0"

.field private static final SUBJECT_TO_GDPR_VALUE_DEFAULT_V2:I = 0x0

.field private static final SUBJECT_TO_GDPR_VALUE_ENABLED:Ljava/lang/String; = "1"

.field private static final SUBJECT_TO_GDPR_VALUE_ENABLED_V2:I = 0x1


# direct methods
.method public constructor <init>()V
    .registers 1

    .line 18
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getCmpPresentValue(Landroid/content/Context;)Z
    .registers 3

    const-string v0, "IABConsent_CMPPresent"

    const/4 v1, 0x0

    .line 74
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getBooleanFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;Z)Z

    move-result p0

    return p0
.end method

.method public static getCmpPresentValueV2(Landroid/content/Context;)Z
    .registers 3

    const-string v0, "IABTCF_CmpSdkID"

    const/4 v1, -0x1

    .line 123
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getIntFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;I)I

    move-result p0

    if-eq p0, v1, :cond_b

    const/4 p0, 0x1

    goto :goto_c

    :cond_b
    const/4 p0, 0x0

    :goto_c
    return p0
.end method

.method public static getConsentString(Landroid/content/Context;)Ljava/lang/String;
    .registers 3

    const-string v0, "IABConsent_ConsentString"

    const-string v1, ""

    .line 53
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getStringFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method public static getConsentStringV2(Landroid/content/Context;)Ljava/lang/String;
    .registers 3

    const-string v0, "IABTCF_TCString"

    const-string v1, ""

    .line 99
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getStringFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method public static getSubjectToGdpr(Landroid/content/Context;)Ljava/lang/String;
    .registers 3

    const-string v0, "IABConsent_SubjectToGDPR"

    const-string v1, "0"

    .line 64
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getStringFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method public static getSubjectToGdprV2(Landroid/content/Context;)I
    .registers 3

    const-string v0, "IABTCF_gdprApplies"

    const/4 v1, 0x0

    .line 110
    invoke-static {p0, v0, v1}, Lcom/taboola/android/utils/SharedPrefUtil;->getIntFromDefaultSharedPref(Landroid/content/Context;Ljava/lang/String;I)I

    move-result p0

    return p0
.end method

.method public static isSubjectToGdpr(Landroid/content/Context;)Z
    .registers 2

    .line 85
    invoke-static {p0}, Lcom/taboola/android/utils/GDPRUtils;->getSubjectToGdpr(Landroid/content/Context;)Ljava/lang/String;

    move-result-object p0

    const-string v0, "1"

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p0

    return p0
.end method

.method public static isSubjectToGdprV2(Landroid/content/Context;)Z
    .registers 2

    .line 134
    invoke-static {p0}, Lcom/taboola/android/utils/GDPRUtils;->getSubjectToGdprV2(Landroid/content/Context;)I

    move-result p0

    const/4 v0, 0x1

    if-ne p0, v0, :cond_8

    goto :goto_9

    :cond_8
    const/4 v0, 0x0

    :goto_9
    return v0
.end method