.class public final Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;
.super Landroid/app/Service;
.source ""


# static fields
.field public static final synthetic s:I


# instance fields
.field public r:Ljava/lang/String;


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

    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    return-void
.end method


# virtual methods
.method public final a(Ljava/lang/String;)V
    .registers 6

    const-string v0, "GameCenter marking "

    const-string v1, " as game"

    invoke-static {v0, p1, v1}, Le/b;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lbb/a;->a(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {p0}, Landroid/app/Service;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "_game"

    invoke-static {p1, v1}, Lx/e;->k(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x1

    invoke-static {v0, v1, v2}, Landroid/provider/Settings$Secure;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    sget-object v0, Lo4/b;->a:Lo4/b;

    sget-object v1, Lo4/b$a;->w:Lo4/b$a;

    invoke-virtual {v0, p0, v1}, Lo4/b;->b(Landroid/content/Context;Lo4/b$a;)Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_30

    invoke-virtual {v2, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    invoke-virtual {v0, p0, v1, v2}, Lo4/b;->e(Landroid/content/Context;Lo4/b$a;Ljava/util/List;)V

    :cond_30
    return-void
.end method

.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .registers 2

    const/4 p1, 0x0

    return-object p1
.end method

.method public onStartCommand(Landroid/content/Intent;II)I
    .registers 5

    if-eqz p1, :cond_6c

    const-string p2, "package"

    invoke-virtual {p1, p2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p2

    iput-object p2, p0, Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;->r:Ljava/lang/String;

    const/4 p3, 0x0

    const/4 v0, 0x1

    if-eqz p2, :cond_17

    invoke-static {p2}, Lp9/h;->s(Ljava/lang/CharSequence;)Z

    move-result p2

    if-eqz p2, :cond_15

    goto :goto_17

    :cond_15
    move p2, p3

    goto :goto_18

    :cond_17
    :goto_17
    move p2, v0

    :goto_18
    if-nez p2, :cond_6c

    const-string p2, "manual_mode"

    invoke-virtual {p1, p2, p3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result p2

    if-eqz p2, :cond_33

    const-string p2, "add_as_game"

    invoke-virtual {p1, p2, v0}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result p1

    if-eqz p1, :cond_6c

    iget-object p1, p0, Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;->r:Ljava/lang/String;

    invoke-static {p1}, Lx/e;->d(Ljava/lang/Object;)V

    invoke-virtual {p0, p1}, Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;->a(Ljava/lang/String;)V

    goto :goto_6c

    :cond_33
    iget-object p1, p0, Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;->r:Ljava/lang/String;

    invoke-static {p1}, Lx/e;->d(Ljava/lang/Object;)V

    .line 1
    invoke-virtual {p0}, Landroid/app/Service;->getResources()Landroid/content/res/Resources;

    move-result-object p2

    const/high16 p3, 0x7f030000

    invoke-virtual {p2, p3}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object p2

    const-string p3, "resources.getStringArray(R.array.games)"

    invoke-static {p2, p3}, Lx/e;->e(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-static {p2}, Lz8/d;->E([Ljava/lang/Object;)Ljava/util/List;

    move-result-object p2

    invoke-interface {p2, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_55

    invoke-virtual {p0, p1}, Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;->a(Ljava/lang/String;)V

    goto :goto_6c

    .line 2
    :cond_55
    sget-object p2, Lp4/b;->a:Lp4/b;

    invoke-virtual {p2}, Lp4/b;->a()Lp4/a;

    move-result-object p2

    new-instance p3, Lcom/floydwiz/gamingcenter/models/network/GameDetectorRequest;

    invoke-direct {p3, p1}, Lcom/floydwiz/gamingcenter/models/network/GameDetectorRequest;-><init>(Ljava/lang/String;)V

    invoke-interface {p2, p3}, Lp4/a;->e(Lcom/floydwiz/gamingcenter/models/network/GameDetectorRequest;)Lya/b;

    move-result-object p2

    new-instance p3, Ln4/a;

    invoke-direct {p3, p0, p1}, Ln4/a;-><init>(Lcom/floydwiz/gamingcenter/services/AppInstallListenerService;Ljava/lang/String;)V

    invoke-interface {p2, p3}, Lya/b;->o(Lya/d;)V

    :cond_6c
    :goto_6c
    const/4 p1, 0x2

    return p1
.end method
