.class public final Lq4/d;
.super Ljava/lang/Object;
.source ""


# direct methods
.method public static final a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;ZI)V
    .registers 14

    const-string v0, "context"

    invoke-static {p0, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "title"

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

    const-string v0, "body"

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

    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    if-eqz p3, :cond_16

    goto :goto_18

    :cond_16
    const-string p3, ""

    :goto_18
    invoke-static {p3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p3

    invoke-direct {v0, v1, p3}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    const/high16 p3, 0xc000000

    invoke-static {p0, p6, v0, p3}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p3

    const-string v0, "notification"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x1a

    const/4 v3, 0x0

    const v4, 0x7f0f0001

    const/4 v5, 0x1

    if-lt v1, v2, :cond_e6

    if-eqz p5, :cond_3c

    const/4 p5, 0x4

    goto :goto_3d

    :cond_3c
    const/4 p5, 0x3

    :goto_3d
    new-instance v1, Landroid/app/NotificationChannel;

    const-string v2, "general"

    const-string v6, "gameCentre"

    invoke-direct {v1, v2, v6, p5}, Landroid/app/NotificationChannel;-><init>(Ljava/lang/String;Ljava/lang/CharSequence;I)V

    if-nez v0, :cond_49

    goto :goto_4c

    :cond_49
    invoke-virtual {v0, v1}, Landroid/app/NotificationManager;->createNotificationChannel(Landroid/app/NotificationChannel;)V

    :goto_4c
    new-instance p5, Landroid/app/Notification$Builder;

    const-string v0, "general"

    invoke-direct {p5, p0, v0}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    const v0, 0x7f0800a1

    invoke-virtual {p5, v0}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;

    move-result-object p5

    invoke-static {p0, v4}, Landroid/graphics/drawable/Icon;->createWithResource(Landroid/content/Context;I)Landroid/graphics/drawable/Icon;

    move-result-object v0

    invoke-virtual {p5, v0}, Landroid/app/Notification$Builder;->setLargeIcon(Landroid/graphics/drawable/Icon;)Landroid/app/Notification$Builder;

    move-result-object p5

    const-string v0, "general"

    invoke-virtual {p5, v0}, Landroid/app/Notification$Builder;->setChannelId(Ljava/lang/String;)Landroid/app/Notification$Builder;

    move-result-object p5

    invoke-virtual {p5, p1}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

    move-result-object p1

    if-nez p4, :cond_78

    new-instance p4, Landroid/app/Notification$BigTextStyle;

    invoke-direct {p4}, Landroid/app/Notification$BigTextStyle;-><init>()V

    invoke-virtual {p4, p2}, Landroid/app/Notification$BigTextStyle;->bigText(Ljava/lang/CharSequence;)Landroid/app/Notification$BigTextStyle;

    move-result-object p4

    goto :goto_81

    :cond_78
    new-instance p5, Landroid/app/Notification$BigPictureStyle;

    invoke-direct {p5}, Landroid/app/Notification$BigPictureStyle;-><init>()V

    invoke-virtual {p5, p4}, Landroid/app/Notification$BigPictureStyle;->bigPicture(Landroid/graphics/Bitmap;)Landroid/app/Notification$BigPictureStyle;

    move-result-object p4

    :goto_81
    invoke-virtual {p1, p4}, Landroid/app/Notification$Builder;->setStyle(Landroid/app/Notification$Style;)Landroid/app/Notification$Builder;

    move-result-object p1

    invoke-virtual {p1, p2}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

    move-result-object p1

    invoke-virtual {p1, p3}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;

    move-result-object p1

    invoke-virtual {p1, v5}, Landroid/app/Notification$Builder;->setAutoCancel(Z)Landroid/app/Notification$Builder;

    move-result-object p1

    const-string p2, "Builder(context, GENERAL\u2026     .setAutoCancel(true)"

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

    .line 1
    new-instance p2, Lb0/p;

    invoke-direct {p2, p0}, Lb0/p;-><init>(Landroid/content/Context;)V

    .line 2
    invoke-virtual {p1}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;

    move-result-object p1

    .line 3
    iget-object p3, p1, Landroid/app/Notification;->extras:Landroid/os/Bundle;

    const/4 p4, 0x0

    if-eqz p3, :cond_ad

    const-string p5, "android.support.useSideChannel"

    .line 4
    invoke-virtual {p3, p5}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result p3

    if-eqz p3, :cond_ad

    goto :goto_ae

    :cond_ad
    move v5, p4

    :goto_ae
    if-eqz v5, :cond_e0

    .line 5
    new-instance p3, Lb0/p$a;

    invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object p5

    invoke-direct {p3, p5, p6, v3, p1}, Lb0/p$a;-><init>(Ljava/lang/String;ILjava/lang/String;Landroid/app/Notification;)V

    .line 6
    sget-object p5, Lb0/p;->f:Ljava/lang/Object;

    monitor-enter p5

    :try_start_bc
    sget-object p1, Lb0/p;->g:Lb0/p$c;

    if-nez p1, :cond_cb

    new-instance p1, Lb0/p$c;

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

    move-result-object p0

    invoke-direct {p1, p0}, Lb0/p$c;-><init>(Landroid/content/Context;)V

    sput-object p1, Lb0/p;->g:Lb0/p$c;

    :cond_cb
    sget-object p0, Lb0/p;->g:Lb0/p$c;

    .line 7
    iget-object p0, p0, Lb0/p$c;->s:Landroid/os/Handler;

    invoke-virtual {p0, p4, p3}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object p0

    invoke-virtual {p0}, Landroid/os/Message;->sendToTarget()V

    .line 8
    monitor-exit p5
    :try_end_d7
    .catchall {:try_start_bc .. :try_end_d7} :catchall_dd

    .line 9
    iget-object p0, p2, Lb0/p;->b:Landroid/app/NotificationManager;

    invoke-virtual {p0, v3, p6}, Landroid/app/NotificationManager;->cancel(Ljava/lang/String;I)V

    goto :goto_130

    :catchall_dd
    move-exception p0

    .line 10
    :try_start_de
    monitor-exit p5
    :try_end_df
    .catchall {:try_start_de .. :try_end_df} :catchall_dd

    throw p0

    .line 11
    :cond_e0
    iget-object p0, p2, Lb0/p;->b:Landroid/app/NotificationManager;

    invoke-virtual {p0, v3, p6, p1}, Landroid/app/NotificationManager;->notify(Ljava/lang/String;ILandroid/app/Notification;)V

    goto :goto_130

    .line 12
    :cond_e6
    new-instance v1, Lb0/l;

    .line 13
    invoke-direct {v1, p0, v3}, Lb0/l;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 14
    iget-object v2, v1, Lb0/l;->s:Landroid/app/Notification;

    iput v4, v2, Landroid/app/Notification;->icon:I

    .line 15
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p0

    invoke-static {p0, v4}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object p0

    invoke-virtual {v1, p0}, Lb0/l;->f(Landroid/graphics/Bitmap;)Lb0/l;

    invoke-virtual {v1, p1}, Lb0/l;->e(Ljava/lang/CharSequence;)Lb0/l;

    if-nez p4, :cond_108

    new-instance p0, Lb0/k;

    invoke-direct {p0}, Lb0/k;-><init>()V

    invoke-virtual {p0, p2}, Lb0/k;->d(Ljava/lang/CharSequence;)Lb0/k;

    goto :goto_10f

    :cond_108
    new-instance p0, Lb0/j;

    invoke-direct {p0}, Lb0/j;-><init>()V

    .line 16
    iput-object p4, p0, Lb0/j;->b:Landroid/graphics/Bitmap;

    .line 17
    :goto_10f
    invoke-virtual {v1, p0}, Lb0/l;->g(Lb0/m;)Lb0/l;

    invoke-virtual {v1, p2}, Lb0/l;->d(Ljava/lang/CharSequence;)Lb0/l;

    invoke-virtual {v1, v5}, Lb0/l;->c(Z)Lb0/l;

    .line 18
    iput-object p3, v1, Lb0/l;->g:Landroid/app/PendingIntent;

    const/4 p0, -0x1

    .line 19
    iget-object p1, v1, Lb0/l;->s:Landroid/app/Notification;

    iput p0, p1, Landroid/app/Notification;->defaults:I

    iget p0, p1, Landroid/app/Notification;->flags:I

    or-int/2addr p0, v5

    iput p0, p1, Landroid/app/Notification;->flags:I

    .line 20
    iput p5, v1, Lb0/l;->j:I

    if-nez v0, :cond_129

    goto :goto_130

    .line 21
    :cond_129
    invoke-virtual {v1}, Lb0/l;->a()Landroid/app/Notification;

    move-result-object p0

    invoke-virtual {v0, p6, p0}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    :goto_130
    return-void
.end method
