g.smali

.class public Lcom/cleanmaster/giftbox/g;
.super Lcom/cleanmaster/giftbox/GiftBoxBaseManager;
.source "GiftBoxPicksManager.java"


# static fields
.field private static b:Lcom/cleanmaster/giftbox/g;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 28
    const/4 v0, 0x0

    sput-object v0, Lcom/cleanmaster/giftbox/g;->b:Lcom/cleanmaster/giftbox/g;

    return-void
.end method

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

    .prologue
    .line 27
    invoke-direct {p0}, Lcom/cleanmaster/giftbox/GiftBoxBaseManager;-><init>()V

    return-void
.end method

.method public static c()Lcom/cleanmaster/giftbox/g;
    .registers 2

    .prologue
    .line 31
    sget-object v0, Lcom/cleanmaster/giftbox/g;->b:Lcom/cleanmaster/giftbox/g;

    if-nez v0, :cond_13

    .line 32
    const-class v1, Lcom/cleanmaster/giftbox/g;

    monitor-enter v1

    .line 33
    :try_start_7
    sget-object v0, Lcom/cleanmaster/giftbox/g;->b:Lcom/cleanmaster/giftbox/g;

    if-nez v0, :cond_12

    .line 34
    new-instance v0, Lcom/cleanmaster/giftbox/g;

    invoke-direct {v0}, Lcom/cleanmaster/giftbox/g;-><init>()V

    sput-object v0, Lcom/cleanmaster/giftbox/g;->b:Lcom/cleanmaster/giftbox/g;

    .line 36
    :cond_12
    monitor-exit v1
    :try_end_13
    .catchall {:try_start_7 .. :try_end_13} :catchall_16

    .line 38
    :cond_13
    sget-object v0, Lcom/cleanmaster/giftbox/g;->b:Lcom/cleanmaster/giftbox/g;

    return-object v0

    .line 36
    :catchall_16
    move-exception v0

    :try_start_17
    monitor-exit v1
    :try_end_18
    .catchall {:try_start_17 .. :try_end_18} :catchall_16

    throw v0
.end method

.method private d()I
    .registers 7

    .prologue
    const/4 v0, 0x1

    .line 56
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v1

    invoke-virtual {v1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getGiftBoxAdRedPointLastShowTime()J

    move-result-wide v2

    .line 57
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    sub-long v2, v4, v2

    const-string v1, "gamebox_key_main_gift_box_show_interval"

    const/16 v4, 0x18

    .line 58
    invoke-static {v1, v4}, Lcom/cleanmaster/ui/game/leftstone/a;->a(Ljava/lang/String;I)I

    move-result v1

    mul-int/lit8 v1, v1, 0x3c

    mul-int/lit8 v1, v1, 0x3c

    mul-int/lit16 v1, v1, 0x3e8

    int-to-long v4, v1

    cmp-long v1, v2, v4

    if-gtz v1, :cond_27

    .line 75
    :cond_26
    :goto_26
    return v0

    .line 64
    :cond_27
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v1

    invoke-virtual {v1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBox2GameCenterRedShow()I

    move-result v1

    .line 65
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v2

    invoke-virtual {v2}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getGiftboxFirstShowPicks()Z

    move-result v2

    .line 66
    if-eq v1, v0, :cond_47

    if-eqz v2, :cond_26

    .line 71
    :cond_47
    if-eq v1, v0, :cond_4b

    .line 72
    const/4 v0, 0x3

    goto :goto_26

    .line 75
    :cond_4b
    const/4 v0, 0x5

    goto :goto_26
.end method


# virtual methods
.method public a(Landroid/content/Context;Z)V
    .registers 4

    .prologue
    .line 126
    invoke-direct {p0}, Lcom/cleanmaster/giftbox/g;->d()I

    .line 127
    invoke-static {p1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v0

    .line 128
    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getGiftboxFirstShowPicks()Z

    .line 133
    invoke-static {p1}, Lcom/cm/plugincluster/gamebox/GameBoxPluginDelegate;->whenCouldCfg2GameBoxOrPicks(Landroid/content/Context;)V

    .line 147
    invoke-static {p1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->setGiftboxShowPicksBefore()V

    .line 148
    invoke-static {p1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->recordGiftBoxAdRedPointLastShowTime()V

    .line 149
    return-void
.end method

.method public a(Lcom/cleanmaster/base/util/ui/HeadGiftBtn;Landroid/content/Context;ZLandroid/widget/TextView;)V
    .registers 12

    .prologue
    const/4 v6, 0x0

    .line 158
    if-nez p1, :cond_4

    .line 223
    :cond_3
    :goto_3
    return-void

    .line 161
    :cond_4
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v0

    .line 162
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/cleanmaster/configmanager/a;->a(Landroid/content/Context;)Lcom/cleanmaster/configmanager/a;

    move-result-object v1

    .line 163
    if-eqz v0, :cond_3

    if-eqz v1, :cond_3

    .line 167
    const v2, 0x7f020144

    invoke-virtual {p1, v2}, Lcom/cleanmaster/base/util/ui/HeadGiftBtn;->setGiftBtnImage(I)V

    .line 168
    const/4 v2, 0x2

    iput v2, p0, Lcom/cleanmaster/giftbox/g;->a:I

    .line 169
    if-eqz p2, :cond_2f

    instance-of v2, p2, Landroid/app/Activity;

    if-eqz v2, :cond_2f

    .line 170
    check-cast p2, Landroid/app/Activity;

    invoke-virtual {p2}, Landroid/app/Activity;->isFinishing()Z

    move-result v2

    if-nez v2, :cond_3

    .line 174
    :cond_2f
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-virtual {v1}, Lcom/cleanmaster/configmanager/a;->t()J

    move-result-wide v4

    sub-long/2addr v2, v4

    const-wide/32 v4, 0xa4cb800

    cmp-long v1, v2, v4

    if-gtz v1, :cond_47

    const-string v1, "newuser_main_hotposition_isshow"

    .line 175
    invoke-static {v1, v6}, Lcom/cleanmaster/ui/game/leftstone/a;->a(Ljava/lang/String;Z)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 178
    :cond_47
    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBox2GameCenterTipsShow()Ljava/lang/String;

    move-result-object v1

    .line 179
    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBoxShowH5UrlAppId()I

    move-result v2

    .line 180
    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBox2GameCenterTipsAppid()I

    move-result v3

    .line 181
    if-eqz p4, :cond_aa

    if-eqz v2, :cond_aa

    if-ne v2, v3, :cond_aa

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_aa

    .line 182
    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBox2GameCenterH5Url()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_aa

    .line 183
    invoke-virtual {p4, v6}, Landroid/widget/TextView;->setVisibility(I)V

    .line 184
    invoke-virtual {p4, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 185
    const/high16 v1, 0x41500000    # 13.0f

    invoke-virtual {p4, v1}, Landroid/widget/TextView;->setTextSize(F)V

    .line 186
    invoke-virtual {p4}, Landroid/widget/TextView;->setSingleLine()V

    .line 187
    sget-object v1, Landroid/text/TextUtils$TruncateAt;->END:Landroid/text/TextUtils$TruncateAt;

    invoke-virtual {p4, v1}, Landroid/widget/TextView;->setEllipsize(Landroid/text/TextUtils$TruncateAt;)V

    .line 188
    invoke-static {}, Lcom/cleanmaster/hpsharelib/base/Commons;->getWindowWidth()I

    move-result v1

    .line 189
    if-eqz v1, :cond_96

    .line 190
    invoke-static {}, Lcom/cleanmaster/hpsharelib/base/Commons;->getWindowWidth()I

    move-result v1

    div-int/lit8 v1, v1, 0x2

    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v2

    const/high16 v3, 0x41800000    # 16.0f

    invoke-static {v2, v3}, Lcom/cleanmaster/base/util/system/DimenUtils;->dp2px(Landroid/content/Context;F)I

    move-result v2

    sub-int/2addr v1, v2

    invoke-virtual {p4, v1}, Landroid/widget/TextView;->setMaxWidth(I)V

    .line 192
    :cond_96
    const-string v1, ""

    invoke-virtual {v0, v1}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->setCmGiftBox2GameCenterTipsShow(Ljava/lang/String;)V

    .line 193
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    new-instance v1, Lcom/cleanmaster/giftbox/h;

    invoke-direct {v1, p0, p4}, Lcom/cleanmaster/giftbox/h;-><init>(Lcom/cleanmaster/giftbox/g;Landroid/widget/TextView;)V

    const-wide/16 v2, 0x2710

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 201
    :cond_aa
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getInstanse(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/configmanager/UIConfigManager;->getCmGiftBox2GameCenterIconUrl()Ljava/lang/String;

    move-result-object v0

    .line 202
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_3

    .line 203
    invoke-static {}, Lcom/cleanmaster/bitmapcache/MyVolley;->getInstance()Lcom/cleanmaster/bitmapcache/MyVolley;

    move-result-object v1

    invoke-virtual {v1}, Lcom/cleanmaster/bitmapcache/MyVolley;->getImageLoader()Lcom/android/volley/toolbox/ImageLoader;

    move-result-object v1

    new-instance v2, Lcom/cleanmaster/giftbox/i;

    invoke-direct {v2, p0, p1}, Lcom/cleanmaster/giftbox/i;-><init>(Lcom/cleanmaster/giftbox/g;Lcom/cleanmaster/base/util/ui/HeadGiftBtn;)V

    invoke-virtual {v1, v0, v2}, Lcom/android/volley/toolbox/ImageLoader;->get(Ljava/lang/String;Lcom/android/volley/toolbox/ImageLoader$ImageListener;)Lcom/android/volley/toolbox/ImageLoader$ImageContainer;

    goto/16 :goto_3
.end method

.method public a(Lcom/cleanmaster/giftbox/GiftBoxBaseManager$IResultCallBack;)V
    .registers 4

    .prologue
    const/16 v1, 0x3eb

    .line 43
    if-nez p1, :cond_5

    .line 52
    :goto_4
    return-void

    .line 47
    :cond_5
    invoke-static {}, Lcom/cleanmaster/hpsharelib/ctrl/MarketShowPolicy;->isShow_MARKET_PICKS()Z

    move-result v0

    if-nez v0, :cond_10

    .line 48
    const/4 v0, 0x0

    invoke-interface {p1, v1, v0}, Lcom/cleanmaster/giftbox/GiftBoxBaseManager$IResultCallBack;->onResult(II)V

    goto :goto_4

    .line 51
    :cond_10
    invoke-direct {p0}, Lcom/cleanmaster/giftbox/g;->d()I

    move-result v0

    invoke-interface {p1, v1, v0}, Lcom/cleanmaster/giftbox/GiftBoxBaseManager$IResultCallBack;->onResult(II)V

    goto :goto_4
.end method

.method public b()Z
    .registers 2

    .prologue
    .line 118
    invoke-static {}, Lcom/cm/plugincluster/gamebox/GameBoxPluginDelegate;->doPreLoadGameCenterPicksData()V

    .line 119
    const/4 v0, 0x1

    return v0
.end method