text:
.class public Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;
.super Landroid/app/Activity;
.source "BillboardManagementActivity.java"

# static fields
.field static final INTENT_EXTRA_MARKETING_CONTENT_DIALOG_THEME:Ljava/lang/String; = "marketingContentDialogTheme"

.field static final INTENT_EXTRA_MARKETING_CONTENT_ID:Ljava/lang/String; = "marketingContentId"

.field static final INTENT_EXTRA_MARKETING_CONTENT_PREFERRED_STYLE:Ljava/lang/String; = "marketingContentPreferredStyle"

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

.field private static final STYLE_DIALOG:I

.field private static final STYLE_FULLSCREEN:I = 0x103012a

# instance fields
.field private mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

.field private mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

.field mContentStore:Lcom/upsight/android/marketing/internal/content/MarketingContentStore;
    .annotation runtime Ljavax/inject/Inject;
    .end annotation
.end field

.field private mDataStoreSubscription:Lcom/upsight/android/persistence/UpsightSubscription;

.field private mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

.field private mIsForeground:Z

.field private mShouldAttachOnResume:Z

.field mUpsight:Lcom/upsight/android/UpsightContext;
    .annotation runtime Ljavax/inject/Inject;
    .end annotation
.end field

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

    .prologue
    .line 51
    sget v0, Lcom/upsight/android/marketing/R$style;->Theme_DeviceDefault_Light_Dialog_NoActionBar_UpsightDialog:I

    sput v0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->STYLE_DIALOG:I

    return-void
.end method

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

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 38
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 64
    iput-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 66
    iput-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

    .line 68
    iput-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .line 70
    iput-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mDataStoreSubscription:Lcom/upsight/android/persistence/UpsightSubscription;

    .line 72
    iput-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    .line 74
    iput-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mShouldAttachOnResume:Z

    return-void
.end method

.method private handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;)V
    .registers 10
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;

    .prologue
    .line 273
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 274
    .local v1, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v1, :cond_50

    invoke-virtual {v1}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getId()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;->getParentId()Ljava/lang/String;

    move-result-object v7

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

    move-result v6

    if-eqz v6, :cond_50

    .line 276
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

    .line 277
    .local v0, "billboard":Lcom/upsight/android/marketing/internal/billboard/Billboard;
    if-eqz v0, :cond_50

    .line 278
    iget-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContentStore:Lcom/upsight/android/marketing/internal/content/MarketingContentStore;

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-interface {v6, v7}, Lcom/upsight/android/marketing/internal/content/MarketingContentStore;->get(Ljava/lang/String;)Lcom/upsight/android/analytics/internal/action/Actionable;

    move-result-object v4

    check-cast v4, Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 279
    .local v4, "nextContent":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v4, :cond_50

    invoke-virtual {v4}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->isAvailable()Z

    move-result v6

    if-eqz v6, :cond_50

    .line 280
    invoke-virtual {v1}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getContentMediator()Lcom/upsight/android/marketing/UpsightContentMediator;

    move-result-object v3

    .line 281
    .local v3, "mediator":Lcom/upsight/android/marketing/UpsightContentMediator;, "Lcom/upsight/android/marketing/UpsightContentMediator<*>;"
    invoke-virtual {v4}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getContentMediator()Lcom/upsight/android/marketing/UpsightContentMediator;

    move-result-object v5

    .line 282
    .local v5, "nextMediator":Lcom/upsight/android/marketing/UpsightContentMediator;, "Lcom/upsight/android/marketing/UpsightContentMediator<*>;"
    if-eqz v3, :cond_50

    if-eqz v5, :cond_50

    .line 284
    iput-object v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 287
    invoke-virtual {v4, v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->bindBillboard(Lcom/upsight/android/marketing/internal/billboard/Billboard;)V

    .line 290
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/billboard/Billboard;->getHandler()Lcom/upsight/android/marketing/UpsightBillboard$Handler;

    move-result-object v6

    invoke-interface {v6}, Lcom/upsight/android/marketing/UpsightBillboard$Handler;->onNextView()V

    .line 293
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v2

    .line 294
    .local v2, "fragmentManager":Landroid/app/FragmentManager;
    iget-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    invoke-virtual {v3, v1, v2, v6}, Lcom/upsight/android/marketing/UpsightContentMediator;->hideContent(Lcom/upsight/android/marketing/internal/content/MarketingContent;Landroid/app/FragmentManager;Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;)V

    .line 295
    iget-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    invoke-virtual {v5, v4, v2, v6}, Lcom/upsight/android/marketing/UpsightContentMediator;->displayContent(Lcom/upsight/android/marketing/internal/content/MarketingContent;Landroid/app/FragmentManager;Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;)V

    .line 300
    .end local v0    # "billboard":Lcom/upsight/android/marketing/internal/billboard/Billboard;
    .end local v2    # "fragmentManager":Landroid/app/FragmentManager;
    .end local v3    # "mediator":Lcom/upsight/android/marketing/UpsightContentMediator;, "Lcom/upsight/android/marketing/UpsightContentMediator<*>;"
    .end local v4    # "nextContent":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    .end local v5    # "nextMediator":Lcom/upsight/android/marketing/UpsightContentMediator;, "Lcom/upsight/android/marketing/UpsightContentMediator<*>;"
    :cond_50
    return-void
.end method

.method private handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;)V
    .registers 5
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;

    .prologue
    .line 259
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 260
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v0, :cond_15

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getId()Ljava/lang/String;

    move-result-object v2

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

    move-result v1

    if-eqz v1, :cond_15

    .line 261
    invoke-virtual {p0, v0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->attachBillboard(Lcom/upsight/android/marketing/internal/content/MarketingContent;)V

    .line 263
    :cond_15
    return-void
.end method

.method private handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;)V
    .registers 5
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;

    .prologue
    .line 266
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 267
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v0, :cond_19

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getId()Ljava/lang/String;

    move-result-object v2

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

    move-result v1

    if-eqz v1, :cond_19

    .line 268
    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;->getPendingDialog()Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->attachDialog(Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;)V

    .line 270
    :cond_19
    return-void
.end method

.method private handle(Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;)V
    .registers 5
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;

    .prologue
    .line 303
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 304
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v0, :cond_13

    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getId()Ljava/lang/String;

    move-result-object v1

    iget-object v2, p1, Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;->mId:Ljava/lang/String;

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

    move-result v1

    if-eqz v1, :cond_13

    .line 305
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->detachBillboard()V

    .line 307
    :cond_13
    return-void
.end method

# virtual methods
.method attachBillboard(Lcom/upsight/android/marketing/internal/content/MarketingContent;)V
    .registers 11
    .param p1, "content"    # Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .prologue
    const/4 v8, 0x0

    .line 332
    iget-object v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v4}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v4

    const-string v5, "BillboardActivity"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Attach billboard activity="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " marketingContentId="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    new-array v7, v8, [Ljava/lang/Object;

    invoke-interface {v4, v5, v6, v7}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 334
    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getContentMediator()Lcom/upsight/android/marketing/UpsightContentMediator;

    move-result-object v1

    .line 335
    .local v1, "mediator":Lcom/upsight/android/marketing/UpsightContentMediator;, "Lcom/upsight/android/marketing/UpsightContentMediator<*>;"
    if-eqz v1, :cond_78

    .line 338
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    const-string v5, "marketingContentPreferredStyle"

    invoke-virtual {v4, v5}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v2

    check-cast v2, Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;

    .line 339
    .local v2, "preferredStyle":Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;
    if-eqz v2, :cond_4b

    sget-object v4, Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;->None:Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;

    invoke-virtual {v2, v4}, Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_4f

    .line 341
    :cond_4b
    invoke-virtual {v1, p1}, Lcom/upsight/android/marketing/UpsightContentMediator;->getPresentationStyle(Lcom/upsight/android/marketing/internal/content/MarketingContent;)Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;

    move-result-object v2

    .line 346
    :cond_4f
    const/4 v0, 0x0

    .line 347
    .local v0, "fragmentDimensions":Ljava/util/Set;, "Ljava/util/Set<Lcom/upsight/android/marketing/UpsightBillboard$Dimensions;>;"
    sget-object v4, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity$1;->$SwitchMap$com$upsight$android$marketing$UpsightBillboard$PresentationStyle:[I

    invoke-virtual {v2}, Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;->ordinal()I

    move-result v5

    aget v4, v4, v5

    packed-switch v4, :pswitch_data_80

    .line 354
    const v3, 0x103012a

    .line 358
    .local v3, "style":I
    :goto_5e
    invoke-static {p0, v0}, Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;->newInstance(Landroid/content/Context;Ljava/util/Set;)Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    move-result-object v4

    iput-object v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .line 359
    iget-object v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    const/4 v5, 0x1

    invoke-virtual {v4, v5, v3}, Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;->setStyle(II)V

    .line 360
    iget-object v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    invoke-virtual {v4, v8}, Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;->setCancelable(Z)V

    .line 361
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v4

    iget-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    invoke-virtual {v1, p1, v4, v5}, Lcom/upsight/android/marketing/UpsightContentMediator;->displayContent(Lcom/upsight/android/marketing/internal/content/MarketingContent;Landroid/app/FragmentManager;Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;)V

    .line 363
    .end local v0    # "fragmentDimensions":Ljava/util/Set;, "Ljava/util/Set<Lcom/upsight/android/marketing/UpsightBillboard$Dimensions;>;"
    .end local v2    # "preferredStyle":Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;
    .end local v3    # "style":I
    :cond_78
    return-void

    .line 349
    .restart local v0    # "fragmentDimensions":Ljava/util/Set;, "Ljava/util/Set<Lcom/upsight/android/marketing/UpsightBillboard$Dimensions;>;"
    .restart local v2    # "preferredStyle":Lcom/upsight/android/marketing/UpsightBillboard$PresentationStyle;
    :pswitch_79
    sget v3, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->STYLE_DIALOG:I

    .line 350
    .restart local v3    # "style":I
    invoke-virtual {v1, p1}, Lcom/upsight/android/marketing/UpsightContentMediator;->getDimensions(Lcom/upsight/android/marketing/internal/content/MarketingContent;)Ljava/util/Set;

    move-result-object v0

    .line 351
    goto :goto_5e

    .line 347
    :pswitch_data_80
    .packed-switch 0x1
        :pswitch_79
    .end packed-switch
.end method

.method attachDialog(Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;)V
    .registers 9
    .param p1, "pendingDialog"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;

    .prologue
    const/4 v6, 0x0

    .line 315
    iget-object v2, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v2}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v2

    const-string v3, "BillboardActivity"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Attach dialog activity="

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, " marketingContentId="

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, p1, Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;->mId:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x0

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

    invoke-interface {v2, v3, v4, v5}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 317
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    .line 318
    .local v1, "intent":Landroid/content/Intent;
    const-string v2, "marketingContentDialogTheme"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_4e

    .line 319
    const-string v2, "marketingContentDialogTheme"

    const/high16 v3, -0x80000000

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    .line 320
    .local v0, "dialogTheme":I
    invoke-static {p1, v0}, Lcom/upsight/android/marketing/internal/billboard/BillboardDialogFragment;->newInstance(Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;I)Landroid/app/DialogFragment;

    move-result-object v2

    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v3

    invoke-virtual {v2, v3, v6}, Landroid/app/DialogFragment;->show(Landroid/app/FragmentManager;Ljava/lang/String;)V

    .line 324
    .end local v0    # "dialogTheme":I
    :goto_4d
    return-void

    .line 322
    :cond_4e
    invoke-static {p1}, Lcom/upsight/android/marketing/internal/billboard/BillboardDialogFragment;->newInstance(Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;)Landroid/app/DialogFragment;

    move-result-object v2

    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v3

    invoke-virtual {v2, v3, v6}, Landroid/app/DialogFragment;->show(Landroid/app/FragmentManager;Ljava/lang/String;)V

    goto :goto_4d
.end method

.method detachBillboard()V
    .registers 8

    .prologue
    const/4 v6, 0x0

    .line 369
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

    .line 370
    .local v0, "billboard":Lcom/upsight/android/marketing/internal/billboard/Billboard;
    if-eqz v0, :cond_51

    .line 371
    iget-object v2, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v2}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v2

    const-string v3, "BillboardActivity"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Detach billboard activity="

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, " scope="

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/billboard/Billboard;->getScope()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x0

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

    invoke-interface {v2, v3, v4, v5}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 374
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .line 375
    .local v1, "fragment":Landroid/app/DialogFragment;
    if-eqz v1, :cond_41

    invoke-virtual {v1}, Landroid/app/DialogFragment;->isAdded()Z

    move-result v2

    if-eqz v2, :cond_41

    .line 376
    invoke-virtual {v1}, Landroid/app/DialogFragment;->dismiss()V

    .line 380
    :cond_41
    iput-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 381
    iput-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

    .line 382
    iput-object v6, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .line 385
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->finish()V

    .line 388
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/billboard/Billboard;->getHandler()Lcom/upsight/android/marketing/UpsightBillboard$Handler;

    move-result-object v2

    invoke-interface {v2}, Lcom/upsight/android/marketing/UpsightBillboard$Handler;->onDetach()V

    .line 390
    .end local v1    # "fragment":Landroid/app/DialogFragment;
    :cond_51
    return-void
.end method

.method public handleActionEvent(Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;)V
    .registers 7
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;
    .annotation runtime Lcom/squareup/otto/Subscribe;
    .end annotation

    .prologue
    .line 233
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v1}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v1

    const-string v2, "BillboardActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Received DestroyEvent activity="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " marketingContentId="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, p1, Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;->mId:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

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

    invoke-interface {v1, v2, v3, v4}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 235
    iget-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    if-eqz v1, :cond_35

    .line 236
    invoke-direct {p0, p1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;)V

    .line 243
    :cond_34
    :goto_34
    return-void

    .line 238
    :cond_35
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 239
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;, "Lcom/upsight/android/marketing/internal/content/MarketingContent<*>;"
    if-eqz v0, :cond_34

    .line 240
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getEventQueue()Ljava/util/Queue;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    goto :goto_34
.end method

.method public handleAvailabilityEvent(Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;)V
    .registers 7
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;
    .annotation runtime Lcom/squareup/otto/Subscribe;
    .end annotation

    .prologue
    .line 219
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v1}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v1

    const-string v2, "BillboardActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Received ScopelessAvailabilityEvent activity="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " marketingContentId="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

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

    invoke-interface {v1, v2, v3, v4}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 221
    iget-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    if-eqz v1, :cond_37

    .line 222
    invoke-direct {p0, p1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;)V

    .line 229
    :cond_36
    :goto_36
    return-void

    .line 224
    :cond_37
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 225
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;, "Lcom/upsight/android/marketing/internal/content/MarketingContent<*>;"
    if-eqz v0, :cond_36

    .line 226
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getEventQueue()Ljava/util/Queue;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    goto :goto_36
.end method

.method public handleAvailabilityEvent(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;)V
    .registers 7
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;
    .annotation runtime Lcom/squareup/otto/Subscribe;
    .end annotation

    .prologue
    .line 191
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v1}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v1

    const-string v2, "BillboardActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Received SubcontentAvailabilityEvent activity="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " marketingContentId="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

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

    invoke-interface {v1, v2, v3, v4}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 193
    iget-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    if-eqz v1, :cond_37

    .line 194
    invoke-direct {p0, p1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;)V

    .line 201
    :cond_36
    :goto_36
    return-void

    .line 196
    :cond_37
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 197
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;, "Lcom/upsight/android/marketing/internal/content/MarketingContent<*>;"
    if-eqz v0, :cond_36

    .line 198
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getEventQueue()Ljava/util/Queue;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    goto :goto_36
.end method

.method public handleAvailabilityEvent(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;)V
    .registers 7
    .param p1, "event"    # Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;
    .annotation runtime Lcom/squareup/otto/Subscribe;
    .end annotation

    .prologue
    .line 205
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v1}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v1

    const-string v2, "BillboardActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Received SubdialogAvailabilityEvent activity="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " marketingContentId="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1}, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;->getId()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

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

    invoke-interface {v1, v2, v3, v4}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 207
    iget-boolean v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    if-eqz v1, :cond_37

    .line 208
    invoke-direct {p0, p1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;)V

    .line 215
    :cond_36
    :goto_36
    return-void

    .line 210
    :cond_37
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 211
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;, "Lcom/upsight/android/marketing/internal/content/MarketingContent<*>;"
    if-eqz v0, :cond_36

    .line 212
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getEventQueue()Ljava/util/Queue;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    goto :goto_36
.end method

.method public onApplicationStatus(Lcom/upsight/android/analytics/internal/session/ApplicationStatus;)V
    .registers 7
    .param p1, "appStatus"    # Lcom/upsight/android/analytics/internal/session/ApplicationStatus;
    .annotation runtime Lcom/upsight/android/persistence/annotation/Created;
    .end annotation

    .annotation runtime Lcom/upsight/android/persistence/annotation/Updated;
    .end annotation

    .prologue
    .line 248
    invoke-virtual {p1}, Lcom/upsight/android/analytics/internal/session/ApplicationStatus;->getState()Lcom/upsight/android/analytics/internal/session/ApplicationStatus$State;

    move-result-object v1

    sget-object v2, Lcom/upsight/android/analytics/internal/session/ApplicationStatus$State;->BACKGROUND:Lcom/upsight/android/analytics/internal/session/ApplicationStatus$State;

    if-ne v1, v2, :cond_32

    .line 249
    iget-object v1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v1}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v1

    const-string v2, "BillboardActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Received application background event activity="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

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

    invoke-interface {v1, v2, v3, v4}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 251
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 252
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v0, :cond_32

    .line 253
    const-string v1, "app_backgrounded"

    invoke-virtual {v0, v1}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->executeActions(Ljava/lang/String;)V

    .line 256
    .end local v0    # "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    :cond_32
    return-void
.end method

.method public onAttachFragment(Landroid/app/Fragment;)V
    .registers 3
    .param p1, "fragment"    # Landroid/app/Fragment;

    .prologue
    .line 181
    invoke-super {p0, p1}, Landroid/app/Activity;->onAttachFragment(Landroid/app/Fragment;)V

    .line 184
    instance-of v0, p1, Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    if-eqz v0, :cond_b

    .line 185
    check-cast p1, Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .end local p1    # "fragment":Landroid/app/Fragment;
    iput-object p1, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mFragment:Lcom/upsight/android/marketing/internal/billboard/BillboardFragment;

    .line 187
    :cond_b
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .registers 12
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    const/4 v6, 0x0

    .line 78
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 80
    invoke-static {p0}, Lcom/upsight/android/Upsight;->createContext(Landroid/content/Context;)Lcom/upsight/android/UpsightContext;

    move-result-object v4

    .line 81
    .local v4, "upsight":Lcom/upsight/android/UpsightContext;
    const-string v5, "com.upsight.extension.marketing"

    invoke-virtual {v4, v5}, Lcom/upsight/android/UpsightContext;->getUpsightExtension(Ljava/lang/String;)Lcom/upsight/android/UpsightExtension;

    move-result-object v5

    check-cast v5, Lcom/upsight/android/UpsightMarketingExtension;

    move-object v1, v5

    check-cast v1, Lcom/upsight/android/UpsightMarketingExtension;

    .line 82
    .local v1, "extension":Lcom/upsight/android/UpsightMarketingExtension;
    if-nez v1, :cond_16

    .line 115
    :goto_15
    return-void

    .line 85
    :cond_16
    invoke-virtual {v1}, Lcom/upsight/android/UpsightMarketingExtension;->getComponent()Lcom/upsight/android/UpsightExtension$BaseComponent;

    move-result-object v5

    check-cast v5, Lcom/upsight/android/marketing/UpsightMarketingComponent;

    invoke-interface {v5, p0}, Lcom/upsight/android/marketing/UpsightMarketingComponent;->inject(Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;)V

    .line 87
    sget v5, Lcom/upsight/android/marketing/R$layout;->upsight_activity_billboard_management:I

    invoke-virtual {p0, v5}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->setContentView(I)V

    .line 90
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->getIntent()Landroid/content/Intent;

    move-result-object v3

    .line 91
    .local v3, "intent":Landroid/content/Intent;
    const-string v5, "marketingContentId"

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

    move-result-object v2

    .line 93
    .local v2, "id":Ljava/lang/String;
    iget-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v5}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v5

    const-string v7, "BillboardActivity"

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "onCreate activity="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v8

    const-string v9, " marketingContentId="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    new-array v9, v6, [Ljava/lang/Object;

    invoke-interface {v5, v7, v8, v9}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

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

    move-result v5

    if-eqz v5, :cond_62

    .line 96
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->finish()V

    goto :goto_15

    .line 101
    :cond_62
    iget-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContentStore:Lcom/upsight/android/marketing/internal/content/MarketingContentStore;

    invoke-interface {v5, v2}, Lcom/upsight/android/marketing/internal/content/MarketingContentStore;->get(Ljava/lang/String;)Lcom/upsight/android/analytics/internal/action/Actionable;

    move-result-object v0

    check-cast v0, Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 102
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;
    if-eqz v0, :cond_95

    .line 103
    iput-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 104
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getBoundBillboard()Lcom/upsight/android/marketing/internal/billboard/Billboard;

    move-result-object v5

    iput-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mBillboard:Lcom/upsight/android/marketing/internal/billboard/Billboard;

    .line 107
    if-nez p1, :cond_93

    const/4 v5, 0x1

    :goto_77
    iput-boolean v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mShouldAttachOnResume:Z

    .line 113
    :goto_79
    iget-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v5}, Lcom/upsight/android/UpsightContext;->getDataStore()Lcom/upsight/android/persistence/UpsightDataStore;

    move-result-object v5

    invoke-interface {v5, p0}, Lcom/upsight/android/persistence/UpsightDataStore;->subscribe(Ljava/lang/Object;)Lcom/upsight/android/persistence/UpsightSubscription;

    move-result-object v5

    iput-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mDataStoreSubscription:Lcom/upsight/android/persistence/UpsightSubscription;

    .line 114
    iget-object v5, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v5}, Lcom/upsight/android/UpsightContext;->getCoreComponent()Lcom/upsight/android/UpsightCoreComponent;

    move-result-object v5

    invoke-interface {v5}, Lcom/upsight/android/UpsightCoreComponent;->bus()Lcom/squareup/otto/Bus;

    move-result-object v5

    invoke-virtual {v5, p0}, Lcom/squareup/otto/Bus;->register(Ljava/lang/Object;)V

    goto :goto_15

    :cond_93
    move v5, v6

    .line 107
    goto :goto_77

    .line 109
    :cond_95
    invoke-virtual {p0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->finish()V

    goto :goto_79
.end method

.method protected onDestroy()V
    .registers 5

    .prologue
    .line 171
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mDataStoreSubscription:Lcom/upsight/android/persistence/UpsightSubscription;

    invoke-interface {v0}, Lcom/upsight/android/persistence/UpsightSubscription;->unsubscribe()V

    .line 172
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v0}, Lcom/upsight/android/UpsightContext;->getCoreComponent()Lcom/upsight/android/UpsightCoreComponent;

    move-result-object v0

    invoke-interface {v0}, Lcom/upsight/android/UpsightCoreComponent;->bus()Lcom/squareup/otto/Bus;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/squareup/otto/Bus;->unregister(Ljava/lang/Object;)V

    .line 174
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v0}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v0

    const-string v1, "BillboardActivity"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "onDestroy activity="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

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

    invoke-interface {v0, v1, v2, v3}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 176
    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    .line 177
    return-void
.end method

.method protected onPause()V
    .registers 6

    .prologue
    const/4 v4, 0x0

    .line 162
    iput-boolean v4, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    .line 164
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v0}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v0

    const-string v1, "BillboardActivity"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "onPause activity="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    new-array v3, v4, [Ljava/lang/Object;

    invoke-interface {v0, v1, v2, v3}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 166
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 167
    return-void
.end method

.method protected onResume()V
    .registers 9

    .prologue
    const/4 v7, 0x0

    .line 119
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 121
    const/4 v3, 0x1

    iput-boolean v3, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mIsForeground:Z

    .line 123
    iget-object v0, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mContent:Lcom/upsight/android/marketing/internal/content/MarketingContent;

    .line 125
    .local v0, "content":Lcom/upsight/android/marketing/internal/content/MarketingContent;, "Lcom/upsight/android/marketing/internal/content/MarketingContent<*>;"
    if-nez v0, :cond_c

    .line 158
    :cond_b
    return-void

    .line 130
    :cond_c
    iget-boolean v3, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mShouldAttachOnResume:Z

    if-eqz v3, :cond_1f

    .line 131
    iput-boolean v7, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mShouldAttachOnResume:Z

    .line 134
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->hasPendingDialog()Z

    move-result v3

    if-eqz v3, :cond_65

    .line 135
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->popPendingDialog()Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->attachDialog(Lcom/upsight/android/marketing/internal/content/MarketingContent$PendingDialog;)V

    .line 142
    :cond_1f
    :goto_1f
    invoke-virtual {v0}, Lcom/upsight/android/marketing/internal/content/MarketingContent;->getEventQueue()Ljava/util/Queue;

    move-result-object v2

    .line 144
    .local v2, "eventQueue":Ljava/util/Queue;, "Ljava/util/Queue<Ljava/lang/Object;>;"
    iget-object v3, p0, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->mUpsight:Lcom/upsight/android/UpsightContext;

    invoke-virtual {v3}, Lcom/upsight/android/UpsightContext;->getLogger()Lcom/upsight/android/logger/UpsightLogger;

    move-result-object v3

    const-string v4, "BillboardActivity"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "onResume activity="

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " eventQueueSize="

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-interface {v2}, Ljava/util/Queue;->size()I

    move-result v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    new-array v6, v7, [Ljava/lang/Object;

    invoke-interface {v3, v4, v5, v6}, Lcom/upsight/android/logger/UpsightLogger;->d(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 146
    :cond_51
    :goto_51
    invoke-interface {v2}, Ljava/util/Queue;->isEmpty()Z

    move-result v3

    if-nez v3, :cond_b

    .line 147
    invoke-interface {v2}, Ljava/util/Queue;->poll()Ljava/lang/Object;

    move-result-object v1

    .line 148
    .local v1, "event":Ljava/lang/Object;
    instance-of v3, v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;

    if-eqz v3, :cond_69

    .line 149
    check-cast v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;

    .end local v1    # "event":Ljava/lang/Object;
    invoke-direct {p0, v1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubcontentAvailabilityEvent;)V

    goto :goto_51

    .line 137
    .end local v2    # "eventQueue":Ljava/util/Queue;, "Ljava/util/Queue<Ljava/lang/Object;>;"
    :cond_65
    invoke-virtual {p0, v0}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->attachBillboard(Lcom/upsight/android/marketing/internal/content/MarketingContent;)V

    goto :goto_1f

    .line 150
    .restart local v1    # "event":Ljava/lang/Object;
    .restart local v2    # "eventQueue":Ljava/util/Queue;, "Ljava/util/Queue<Ljava/lang/Object;>;"
    :cond_69
    instance-of v3, v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;

    if-eqz v3, :cond_73

    .line 151
    check-cast v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;

    .end local v1    # "event":Ljava/lang/Object;
    invoke-direct {p0, v1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$SubdialogAvailabilityEvent;)V

    goto :goto_51

    .line 152
    .restart local v1    # "event":Ljava/lang/Object;
    :cond_73
    instance-of v3, v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;

    if-eqz v3, :cond_7d

    .line 153
    check-cast v1, Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;

    .end local v1    # "event":Ljava/lang/Object;
    invoke-direct {p0, v1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContent$ScopelessAvailabilityEvent;)V

    goto :goto_51

    .line 154
    .restart local v1    # "event":Ljava/lang/Object;
    :cond_7d
    instance-of v3, v1, Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;

    if-eqz v3, :cond_51

    .line 155
    check-cast v1, Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;

    .end local v1    # "event":Ljava/lang/Object;
    invoke-direct {p0, v1}, Lcom/upsight/android/marketing/internal/billboard/BillboardManagementActivity;->handle(Lcom/upsight/android/marketing/internal/content/MarketingContentActions$DestroyEvent;)V

    goto :goto_51
.end method


text:
module Main where

import qualified System.Process as Proc
import qualified System.IO as IO

import System.Console.GetOpt
          (getOpt, ArgOrder(..), OptDescr(..), ArgDescr(..), usageInfo, )
import System.Exit (exitWith, ExitCode(..), )
import qualified System.Environment as Env

import qualified Distribution.Verbosity as Verbosity
import qualified Distribution.ReadE as ReadE
import qualified Distribution.Package as Pkg
import qualified Distribution.Text as DistText

import qualified Control.Monad.Exception.Synchronous as Exc
import qualified Control.Monad.Trans.State as State
import qualified Control.Monad.Trans.Class as Trans
-- import Control.Monad.IO.Class (liftIO, )

import qualified Data.Set as Set

import qualified Data.ByteString.Char8 as B

import qualified Data.List.HT as ListHT
import qualified Data.List as List
import qualified Data.Char as Char
import Control.Monad (when, guard, )
import Data.Maybe (fromMaybe, )

main :: IO ()
main =
   Exc.resolveT (\e -> IO.hPutStr IO.stderr $ "Aborted: " ++ e ++ "\n") $ do
      argv <- Trans.lift Env.getArgs
      let (opts, pgkNames, errors) =
             getOpt RequireOrder options argv
      when (not (null errors)) $ Exc.throwT $ concat $ errors
      flags <-
         Exc.ExceptionalT $ return $
            foldr (flip (>>=)) (return defltFlags) opts
      when (optHelp flags)
         (Trans.lift $
          Env.getProgName >>= \programName ->
          putStrLn
             (usageInfo ("Usage: " ++ programName ++
                         " [OPTIONS] PKG-NAMES ...") options) >>
          exitWith ExitSuccess)

      mapM_ (Trans.lift . putStrLn) =<<
         (Exc.mapExceptionalT (flip State.evalStateT Set.empty) $
          fmap concat $ mapM (getAllDependencies flags True) pgkNames)

data Flags =
   Flags {
      optHelp :: Bool,
      optVerbosity :: Verbosity.Verbosity,
      optUser, optGlobal :: Bool,
      optShowVersions :: Bool,
      optPkgCmd :: String
   }

defltFlags :: Flags
defltFlags =
   Flags {
      optHelp = False,
      optVerbosity = Verbosity.silent,
      optUser = False,
      optGlobal = False,
      optShowVersions = False,
      optPkgCmd = "ghc-pkg"
   }

options :: [OptDescr (Flags -> Exc.Exceptional String Flags)]
options =
   Option ['h'] ["help"]
      (NoArg (\flags -> return $ flags{optHelp = True}))
      "show options" :
   Option ['v'] ["verbose"]
      (ReqArg
         (\str flags ->
            fmap (\n -> flags{optVerbosity = n}) $
            Exc.fromEither $
            ReadE.runReadE Verbosity.flagToVerbosity str)
         "N")
      "verbosity level: 0..3" :
   Option [] ["user"]
      (NoArg (\flags -> return $ flags{optUser = True}))
      "query GHC's local user package database" :
   Option [] ["global"]
      (NoArg (\flags -> return $ flags{optGlobal = True}))
      "query GHC's global package database" :
   Option [] ["show-versions"]
      (NoArg (\flags -> return $ flags{optShowVersions = True}))
      "show package version numbers in the output" :
   Option [] ["pkg-cmd"]
      (ReqArg
         (\str flags -> return flags{optPkgCmd = str})
         "COMMAND")
      ("command for querying the package database (default: " ++
       optPkgCmd defltFlags ++ ")") :
   []

type PkgName = String

getAllDependencies ::
   Flags -> Bool -> PkgName ->
   Exc.ExceptionalT String (State.StateT (Set.Set PkgName) IO) [PkgName]
getAllDependencies flags userSuppliedName name = do
   when (optVerbosity flags >= Verbosity.deafening)
      (Trans.lift $
         Trans.lift . print =<< State.get)
   b <- Trans.lift $ State.gets (Set.member name)
   if b
     then return []
     else
       Exc.catchT
          (do {- register this name _before_ calling ghc-pkg,
                 because ghc-pkg may not find the package,
                 and then we do not need to query again -}
              Trans.lift $ State.modify (Set.insert name)
              deps <-
                 Exc.mapExceptionalT Trans.lift $
                 getDirectDependencies flags name
              allDeps <- mapM (getAllDependencies flags False) deps
              let strippedName = fromMaybe name $ do
                     guard $ not $ optShowVersions flags
                     Pkg.PackageName pname <-
                        fmap Pkg.pkgName $ DistText.simpleParse name
                     return pname
              return $ concat allDeps ++ [strippedName])
          (\errTxt ->
             if not userSuppliedName &&
                B.isInfixOf (B.pack "cannot find") (B.pack errTxt)
               then return []
               else Exc.throwT errTxt)

getDirectDependencies ::
   Flags -> PkgName ->
   Exc.ExceptionalT String IO [PkgName]
getDirectDependencies flags name = do
   let cmd = optPkgCmd flags
       args =
          (if optUser   flags then ("--user"   :) else id) $
          (if optGlobal flags then ("--global" :) else id) $
          ["field", name, "depends"]
   when (optVerbosity flags >= Verbosity.verbose)
      (Trans.lift $ putStrLn $ unwords $ cmd : args)
   (inp,out,err,pid) <-
      Trans.lift (Proc.runInteractiveProcess cmd args Nothing Nothing)
   txt    <- Trans.lift $ B.hGetContents out
   errTxt <- Trans.lift $ B.hGetContents err
   when (optVerbosity flags >= Verbosity.normal) $
      Trans.lift $ putStr $ B.unpack errTxt
   Exc.mapExceptionT (\n ->
      "ghc-pkg exited with code " ++ show n ++ "\n" ++ B.unpack errTxt) $
         Exc.fromExitCodeT $
         Proc.waitForProcess pid
   Trans.lift (mapM_ IO.hClose [inp,out,err])
   case words (B.unpack txt) of
      "depends:":names ->
         {-
         If multiple packages are installed,
         then the dependencies of each are preceded by a 'depends:' prefix.

         ghc-pkg lists 'builtin_rts' as dependency of 'base',
         but does not accept this identifier as package name,
         since it contains an underscore.
         -}
         return $
            map stripHashId $
            filter (not . flip elem ["depends:", "builtin_rts"]) names
      _ -> Exc.throwT $
              "unexpected output of ghc-pkg - " ++
              "it should start with 'depends:'" ++
              if optVerbosity flags >= Verbosity.verbose
                then "\n" ++ B.unpack txt
                else ""

stripHashId :: PkgName -> PkgName
stripHashId name =
   (\parts ->
      let lastPart = last parts
      in  if (not $ null $ drop 15 lastPart) &&
             all Char.isHexDigit lastPart
            then List.intercalate "-" $ init parts
            else name)
   .
   ListHT.chop ('-'==)
   $
   name

redpajama_set_name: RedPajamaGithub


text:
#ifndef __HIREDIS_SSL_H
#define __HIREDIS_SSL_H

#ifdef __cplusplus
extern "C" {
#endif

/* This is the underlying struct for SSL in ssl.h, which is not included to
 * keep build dependencies short here.
 */
struct ssl_st;

/* A wrapper around OpenSSL SSL_CTX to allow easy SSL use without directly
 * calling OpenSSL.
 */
typedef struct redisSSLContext redisSSLContext;

/**
 * Initialization errors that redisCreateSSLContext() may return.
 */

typedef enum {
    REDIS_SSL_CTX_NONE = 0,                     /* No Error */
    REDIS_SSL_CTX_CREATE_FAILED,                /* Failed to create OpenSSL SSL_CTX */
    REDIS_SSL_CTX_CERT_KEY_REQUIRED,            /* Client cert and key must both be specified or skipped */
    REDIS_SSL_CTX_CA_CERT_LOAD_FAILED,          /* Failed to load CA Certificate or CA Path */
    REDIS_SSL_CTX_CLIENT_CERT_LOAD_FAILED,      /* Failed to load client certificate */
    REDIS_SSL_CTX_CLIENT_DEFAULT_CERT_FAILED,   /* Failed to set client default certificate directory */
    REDIS_SSL_CTX_PRIVATE_KEY_LOAD_FAILED,      /* Failed to load private key */
    REDIS_SSL_CTX_OS_CERTSTORE_OPEN_FAILED,     /* Failed to open system certifcate store */
    REDIS_SSL_CTX_OS_CERT_ADD_FAILED            /* Failed to add CA certificates obtained from system to the SSL context */
} redisSSLContextError;

/* Constants that mirror OpenSSL's verify modes. By default,
 * REDIS_SSL_VERIFY_PEER is used with redisCreateSSLContext().
 * Some Redis clients disable peer verification if there are no
 * certificates specified.
 */
#define REDIS_SSL_VERIFY_NONE 0x00
#define REDIS_SSL_VERIFY_PEER 0x01
#define REDIS_SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
#define REDIS_SSL_VERIFY_CLIENT_ONCE 0x04
#define REDIS_SSL_VERIFY_POST_HANDSHAKE 0x08

/* Options to create an OpenSSL context. */
typedef struct {
    const char *cacert_filename;
    const char *capath;
    const char *cert_filename;
    const char *private_key_filename;
    const char *server_name;
    int verify_mode;
} redisSSLOptions;

/**
 * Return the error message corresponding with the specified error code.
 */

const char *redisSSLContextGetError(redisSSLContextError error);

/**
 * Helper function to initialize the OpenSSL library.
 *
 * OpenSSL requires one-time initialization before it can be used. Callers should
 * call this function only once, and only if OpenSSL is not directly initialized
 * elsewhere.
 */
int redisInitOpenSSL(void);

/**
 * Helper function to initialize an OpenSSL context that can be used
 * to initiate SSL connections.
 *
 * cacert_filename is an optional name of a CA certificate/bundle file to load
 * and use for validation.
 *
 * capath is an optional directory path where trusted CA certificate files are
 * stored in an OpenSSL-compatible structure.
 *
 * cert_filename and private_key_filename are optional names of a client side
 * certificate and private key files to use for authentication. They need to
 * be both specified or omitted.
 *
 * server_name is an optional and will be used as a server name indication
 * (SNI) TLS extension.
 *
 * If error is non-null, it will be populated in case the context creation fails
 * (returning a NULL).
 */

redisSSLContext *redisCreateSSLContext(const char *cacert_filename, const char *capath,
        const char *cert_filename, const char *private_key_filename,
        const char *server_name, redisSSLContextError *error);

/**
  * Helper function to initialize an OpenSSL context that can be used
  * to initiate SSL connections. This is a more extensible version of redisCreateSSLContext().
  *
  * options contains a structure of SSL options to use.
  *
  * If error is non-null, it will be populated in case the context creation fails
  * (returning a NULL).
*/
redisSSLContext *redisCreateSSLContextWithOptions(redisSSLOptions *options,
        redisSSLContextError *error);

/**
 * Free a previously created OpenSSL context.
 */
void redisFreeSSLContext(redisSSLContext *redis_ssl_ctx);

/**
 * Initiate SSL on an existing redisContext.
 *
 * This is similar to redisInitiateSSL() but does not require the caller
 * to directly interact with OpenSSL, and instead uses a redisSSLContext
 * previously created using redisCreateSSLContext().
 */

int redisInitiateSSLWithContext(redisContext *c, redisSSLContext *redis_ssl_ctx);

/**
 * Initiate SSL/TLS negotiation on a provided OpenSSL SSL object.
 */

int redisInitiateSSL(redisContext *c, struct ssl_st *ssl);

#ifdef __cplusplus
}
#endif

#endif  /* __HIREDIS_SSL_H */


text:
A test app made with Flask, similar to urban dictionary.

Requires:
* python
* flask
* mongodb
* flask-login
* flask-pymongo
* flask-bcrypt
* flask-jsglue

Features:
* login system
* search
* typical dictionary features

###If you want to give it a try
You will need to have mongodb, and all the dependecies installed.

Then use `python fdict.py` assuming you have Python 3.

**Project status: partially complete, mostly usable, some sloppy code that I should look into making better.**


text:
import { Cmd, Loop, loop, LoopReducer } from "redux-loop";
import { getType } from "typesafe-actions";

import { Action } from "../actions";
import {
  organizationFetch,
  organizationFetchFailure,
  organizationFetchSuccess,
  exportOrgUsers,
  exportOrgUsersFailure,
  exportProjects,
  exportProjectsFailure
} from "../actions/organization";

import { IOrganization } from "../../shared/entities";
import {
  fetchOrganization,
  exportOrganizationUsersCsv,
  exportOrganizationProjectsCsv
} from "../api";
import { showResourceFailedToast, showActionFailedToast } from "../functions";
import { Resource } from "../resource";

export type OrganizationState = Resource<IOrganization>;

export const initialState = {
  isPending: false
};

const organizationReducer: LoopReducer<OrganizationState, Action> = (
  state: OrganizationState = initialState,
  action: Action
): OrganizationState | Loop<OrganizationState, Action> => {
  switch (action.type) {
    case getType(organizationFetch):
      return loop(
        {
          isPending: true
        },
        Cmd.run(fetchOrganization, {
          successActionCreator: organizationFetchSuccess,
          failActionCreator: organizationFetchFailure,
          args: [action.payload] as Parameters<typeof fetchOrganization>
        })
      );
    case getType(organizationFetchSuccess):
      return {
        resource: action.payload
      };
    case getType(organizationFetchFailure):
      return loop(
        {
          ...action.payload
        },
        action.payload.statusCode && action.payload.statusCode >= 500
          ? Cmd.run(showResourceFailedToast)
          : Cmd.none
      );
    case getType(exportProjects):
      return loop(
        state,
        Cmd.run(exportOrganizationProjectsCsv, {
          failActionCreator: exportProjectsFailure,
          args: [action.payload] as Parameters<typeof exportOrganizationProjectsCsv>
        })
      );
    case getType(exportProjectsFailure):
      return loop(state, Cmd.run(showActionFailedToast));
    case getType(exportOrgUsers):
      return loop(
        state,
        Cmd.run(exportOrganizationUsersCsv, {
          failActionCreator: exportOrgUsersFailure,
          args: [action.payload] as Parameters<typeof exportOrganizationUsersCsv>
        })
      );
    case getType(exportOrgUsersFailure):
      return loop(state, Cmd.run(showActionFailedToast));
    default:
      return state;
  }
};

export default organizationReducer;


text:
<?php

namespace FirstEngineBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ContratoVencimiento
 *
 * @ORM\Table(name="contrato_vencimiento")
 * @ORM\Entity(repositoryClass="FirstEngineBundle\Repository\ContratoVencimientoRepository")
 */
class ContratoVencimiento
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="Comentarios", type="string", length=255)
     */
    private $comentarios;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set comentarios
     *
     * @param string $comentarios
     * @return ContratoVencimiento
     */
    public function setComentarios($comentarios)
    {
        $this->comentarios = $comentarios;

        return $this;
    }

    /**
     * Get comentarios
     *
     * @return string
     */
    public function getComentarios()
    {
        return $this->comentarios;
    }
}


text:
#ifndef __FILEEM2K_H__
#define __FILEEM2K_H__

#if 1

#define SIZE_IN_MB 128
//#define SIZE_IN_MB 8000
#define PAGE_DATA_SIZE (2048)
#define PAGE_SPARE_SIZE  (64)
#define PAGE_SIZE  (PAGE_DATA_SIZE + PAGE_SPARE_SIZE)
#define PAGES_PER_BLOCK (64)
#define BLOCK_DATA_SIZE (PAGE_DATA_SIZE * PAGES_PER_BLOCK)
#define BLOCK_SIZE (PAGES_PER_BLOCK * (PAGE_SIZE))
#define BLOCKS_PER_MB ((1024*1024)/BLOCK_DATA_SIZE)
#define SIZE_IN_BLOCKS (BLOCKS_PER_MB * SIZE_IN_MB)

#else

#define SIZE_IN_MB 128
#define PAGE_DATA_SIZE (512)
#define SPARE_SIZE  (16)
#define PAGE_SIZE  (PAGE_DATA_SIZE + SPARE_SIZE)
#define PAGES_PER_BLOCK (32)
#define BLOCK_DATA_SIZE (PAGE_SIZE * PAGES_PER_BLOCK)
#define BLOCK_SIZE (PAGES_PER_BLOCK * (PAGE_SIZE))
#define BLOCKS_PER_MB ((1024*1024)/BLOCK_DATA_SIZE)
#define SIZE_IN_BLOCKS (BLOCKS_PER_MB * SIZE_IN_MB)

#endif

int yflash_GetNumberOfBlocks(void);

#endif


text:
const shellScript = require('raw!../mac-signature-installer.command');
const keyword = 'EndOfStaticRawSignature';
const search = `${keyword}\n${keyword}`;

/**
 * Put in the signature encoded as email message and you'll get the
 * installer Bash script returned, with the signature embedded.
 */
function macSignatureInstaller(message) {
	if (message.includes(keyword)) {
		throw new Error(`String must not include the word ${keyword}`);
	}
	return message ? shellScript.replace(search, `${keyword}\n${message}\n${keyword}`) : shellScript;
};

module.exports = macSignatureInstaller;


text:
<?php

$languageStrings = array(
    'Reports'                      => 'Rapporten'                   ,
    'SINGLE_Reports'               => 'Rapport'                     ,
    'LBL_FOLDER_NOT_EMPTY'         => 'Map is niet leeg'            ,
    'LBL_MOVE_REPORT'              => 'Verhuis Rapport'             ,
    'LBL_CUSTOMIZE'                => 'Bewerk'                      ,
    'LBL_REPORT_EXPORT_EXCEL'      => 'Exporteer als Excel'         ,
    'LBL_REPORT_PRINT'             => 'Print'                       ,
    'LBL_STEP_1'                   => 'Stap 1'                      ,
    'LBL_STEP_2'                   => 'Stap 2'                      ,
    'LBL_STEP_3'                   => 'Stap 3'                      ,
    'LBL_REPORT_DETAILS'           => 'Rapportdetails'              ,
    'LBL_SELECT_COLUMNS'           => 'Selecteer kolom'             ,
    'LBL_FILTERS'                  => 'Filters'                     ,
    'LBL_FOLDERS'                  => 'Mappen'                      ,
    'LBL_ADD_NEW_FOLDER'           => 'Nieuwe groep toevoegen'      ,
    'LBL_FOLDER_NAME'              => 'Mapnaam'                     ,
    'LBL_FOLDER_DESCRIPTION'       => 'Map Omschrijving'            ,
    'LBL_WRITE_YOUR_DESCRIPTION_HERE' => 'Voer Omschrijving in'     ,
    'LBL_DUPLICATES_EXIST'         => 'Duplicaat bestaat'           ,
    'LBL_FOLDERS_LIST'             => 'Mappenlijst'                 ,
    'LBL_DENIED_REPORTS'           => 'Geweigerde Rapportages'      ,
    'LBL_NO_OF_RECORDS'            => 'Aantal records : '           ,
	'LBL_MORE_RECORDS_TXT'		   => 'Slechts 1000 records worden hieronder weergegeven. Gelieve exporteren naar alle records te zien', // @TODO frist see it on the screen
    'LBL_ADD_RECORD'               => 'Voeg Rapportage toe'         ,
    'LBL_ADD_FOLDER'               => 'Voeg Map toe'                ,
    'LBL_REPORT_DELETE_DENIED'     => 'Geen recht om de rapportage te verwijderen',
    'LBL_FOLDER_CAN_NOT_BE_DELETED' => 'Deze map kan niet worden verwijderd',
    'LBL_REPORTS_LIST'             => 'Rapportenlijst'              ,
    'LBL_REPORT_NAME'              => 'Rapportnaam'                 ,
    'LBL_REPORT_FOLDER'            => 'Rapportmap'                  ,
    'LBL_DESCRIPTION'              => 'Omschrijving'                ,
    'PRIMARY_MODULE'               => 'Primaire Module'             ,
    'LBL_SELECT_RELATED_MODULES'   => 'Selecteer Gerelateerde Modules',
    'LBL_MAX'                      => 'MAX'                         ,
    'LBL_NEXT'                     => 'Volgende'                    ,
    'LBL_REPORTS'                  => 'Rapportenlijst'              ,
    'LBL_GROUP_BY'                 => 'Groeperen op'                ,
    'LBL_SORT_ORDER'               => 'Sorteervolgorde'             ,
    'LBL_ASCENDING'                => 'Oplopend'                    ,
    'LBL_DESCENDING'               => 'Aflopend'                    ,
    'LBL_CALCULATIONS'             => 'Berekeningen'                ,
    'LBL_COLUMNS'                  => 'Kolommen'                    ,
    'LBL_SUM_VALUE'                => 'Opgeteld'                    ,
    'LBL_AVERAGE'                  => 'Gemiddeld'                   ,
    'LBL_LOWEST_VALUE'             => 'Laagste waarde'              ,
    'LBL_HIGHEST_VALUE'            => 'Hoogste waarde'              ,
    'LBL_GENERATE_REPORT'          => 'Genereer Rapport'            ,
    'LBL_SUM'                      => 'Totaal'                      ,
    'LBL_AVG'                      => 'Gemiddeld'                   ,
    'LBL_MIN'                      => 'MIN'                         ,
    'LBL_FIELD_NAMES'              => 'Totalen'                     ,
    'LBL_REPORT_CSV'               => 'Exporteer als CSV'           ,
    'LBL_VIEW_DETAILS'             => 'Toon Details'                ,
    'LBL_GENERATE_NOW'             => 'Genereer nu'                 ,
    'Report Name'                  => 'Rapportnaam'                 ,
    'Account and Contact Reports'  => 'Organisatie en Contact rapport'  ,
    'Lead Reports'                 => 'Lead rapport'                ,
    'Potential Reports'            => 'Verkoopkans rapport'         ,
    'Activity Reports'             => 'Activiteit rapport'          ,
    'HelpDesk Reports'             => 'Ticket rapport'              ,
    'Product Reports'              => 'Product rapport'             ,
    'Quote Reports'                => 'Offerte rapport'             ,
    'PurchaseOrder Reports'        => 'Inkooporder rapport'         ,
    'SalesOrder Reports'           => 'Verkooporder rapport'        ,
    'Invoice Reports'              => 'Factuur rapport'             ,
    'Campaign Reports'             => 'Campagne rapport'            ,
    'Contacts by Accounts'         => 'Contacten bij Organisaties'      ,
    'Contacts without Accounts'    => 'Contacten zonder Organisaties'   ,
    'Contacts by Potentials'       => 'Contacten bij Verkoopkansen' ,
    'Contacts related to Accounts' => 'Contacten gerelateerd aan Organisaties',
    'Contacts not related to Accounts' => 'Contacten niet gerelateerd aan Organisaties',
    'Contacts related to Potentials' => 'Contacten gerelateerd aan Verkoopkansen',
    'Lead by Source'               => 'Lead per bron'               ,
    'Lead Status Report'           => 'Lead status rapport'         ,
    'Potential Pipeline'           => 'Verkoopkans Pijplijn'        ,
    'Closed Potentials'            => 'Gesloten Verkoopkansen'      ,
    'Potential that have Won'      => 'Gewonnen Verkoopkansen'      ,
    'Tickets by Products'          => 'Tickets per Product'         ,
    'Tickets by Priority'          => 'Tickets per prioriteit'      ,
    'Open Tickets'                 => 'Open Tickets'                ,
    'Tickets related to Products'  => 'Tickets gerelateerd aan Producten',
    'Tickets that are Open'        => 'Tickets die open zijn'       ,
    'Product Details'              => 'Product details'             ,
    'Products by Contacts'         => 'Products per Contact'        ,
    'Product Detailed Report'      => 'Gedetailleerd Product rapport',
    'Products related to Contacts' => 'Producten gerelateerd aan Contacten',
    'Open Quotes'                  => 'Open Offertes'               ,
    'Quotes Detailed Report'       => 'Gedetailleerd Factuur rapport',
    'Quotes that are Open'         => 'Offertes die open zijn'      ,
    'PurchaseOrder by Contacts'    => 'Inkooporder van Contacten'   ,
    'PurchaseOrder Detailed Report' => 'Gedetailleerd Inkooporder rapport',
    'PurchaseOrder related to Contacts' => 'Inkooporder gerelateerd aan Contacten',
    'Invoice Detailed Report'      => 'Gedetailleerd Factuur rapport',
    'Last Month Activities'        => 'Afspraken verleden maand' ,
    'This Month Activities'        => 'Afspraken van deze maand' ,
    'Campaign Expectations and Actuals' => 'Campagne verwachting + actueel',
    'SalesOrder Detailed Report'   => 'Gedetailleerd Verkooporder rapport',
    'Email Reports'                => 'E-mail Raportages'           ,
    'Contacts Email Report'        => 'Contacten E-mail Rapportage' ,
    'Accounts Email Report'        => 'Organisaties E-mail Rapportage',
    'Leads Email Report'           => 'Leads E-mail Rapportage'     ,
    'Vendors Email Report'         => 'Vendors E-mail Rapportage'   ,
    'Emails sent to Contacts'      => 'E-mails verzonden naar Contacten',
    'Emails sent to Organizations' => 'E-mails verzonden naar Organisaties',
    'Emails sent to Leads'         => 'E-mails verzonden naar Leads',
    'Emails sent to Vendors'       => 'E-mails verzonden naar Leveranciers',
    'LBL_PRINT_REPORT'             => 'Print Rapport'                ,
    'LBL_RECORDS'                  => 'Records'                     ,
    'LBL_LIMIT_EXCEEDED'           => 'Maximaal 1000 + records worden getoond. Gebruik CSV of Excel Export om alle records te zien',
    'LBL_TOP'                      => 'Top'                         ,
    'LBL_ALL_REPORTS'              => 'Alle Rapporten'                 ,
    'LBL_CALCULATION_CONVERSION_MESSAGE' => 'Berekeningen zijn gebaseerd op de in het CRM ingestelde valuata',
);
$jsLanguageStrings = array(
    'JS_DUPLICATE_RECORD'          => 'Dubbel Rapport'            ,
    'JS_CALCULATION_LINE_ITEM_FIELDS_SELECTION_LIMITATION' => 'Beperking: Regelvelden (Lijstprijs, Korting & Hoeveelheid) kunnen alleen worden gebruikt wanneer andere rekenvelden niet worden geselecteerd.',
);

$languageStrings['Employees'] = 'Medewerkers'; # auto added 2014-04-17 20:04:47


text:
package org.lily.scanner;

public enum Token {

	LIST_START('('),
	LIST_END(')'),
	COMMA(','),
	LITERAL('\0'),
	LIST_SEPARATOR(';');

	private char value;

	private Token(char value) {
		this.value = value;
	}

	public char getValue() {
		return this.value;
	}
}


text:
using static Oxide.Options;

namespace Oxide
{
    /// <summary>
    ///     Environment helpers.
    /// </summary>
    public static class Environment
    {
        /// <summary>
        ///     Gets an <see cref="Option{TOption}" /> for the value of the given environment variable.
        /// </summary>
        /// <param name="environmentVariable">The environment variable name.</param>
        /// <returns>
        ///     <see cref="Some{T}" /> with the value of the environment variable, if there is a value,
        ///     <see cref="None{T}" /> otherwise.
        /// </returns>
        public static Option<string> GetEnvironmentVariable(string environmentVariable)
        {
            try {
                var value = System.Environment.GetEnvironmentVariable(environmentVariable);
                return string.IsNullOrWhiteSpace(value) ? None<string>() : Some(value);
            } catch {
                return None<string>();
            }
        }
    }
}