.class public Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;
.super Landroid/content/BroadcastReceiver;
.source "AppStorePackageReceiver.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;
    }
.end annotation


# static fields
.field private static a:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

.field private static b:Landroid/content/IntentFilter;


# instance fields
.field private c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method public constructor <init>(Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;)V
    .locals 1

    .line 19
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    const/4 v0, 0x0

    .line 17
    iput-object v0, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    .line 20
    iput-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    return-void
.end method

.method public static a(Landroid/content/Context;)Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;
    .locals 2

    .line 25
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->a:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    if-nez v0, :cond_0

    .line 26
    new-instance v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    new-instance v1, Lcom/moji/mjappstore/engine/DefaultPackageInfoAction;

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

    move-result-object p0

    invoke-direct {v1, p0}, Lcom/moji/mjappstore/engine/DefaultPackageInfoAction;-><init>(Landroid/content/Context;)V

    invoke-direct {v0, v1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;-><init>(Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;)V

    sput-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->a:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    .line 29
    :cond_0
    sget-object p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->a:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    return-object p0
.end method

.method public static a(Landroid/content/Context;Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;)V
    .locals 2

    .line 34
    new-instance v0, Landroid/content/IntentFilter;

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

    sput-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    .line 35
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    const-string v1, "package"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V

    .line 36
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

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

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 37
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

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

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 38
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

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

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 39
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    const-string v1, "com.moji.mjweather.appstore.package_downloading"

    .line 40
    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 41
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    const-string v1, "com.moji.mjweather.appstore.package_download_finish"

    .line 42
    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 43
    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    const-string v1, "com.moji.mjweather.appstore.package_download_failure"

    .line 44
    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    if-nez p1, :cond_0

    .line 46
    invoke-static {p0}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->a(Landroid/content/Context;)Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    move-result-object p1

    .line 47
    :cond_0
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    invoke-virtual {p0, p1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    return-void
.end method

.method public static b(Landroid/content/Context;Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;)V
    .locals 1

    if-nez p1, :cond_0

    .line 54
    invoke-static {p0}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->a(Landroid/content/Context;)Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;

    move-result-object p1

    .line 55
    :cond_0
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    sget-object v0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->b:Landroid/content/IntentFilter;

    invoke-virtual {p0, p1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 0

    .line 61
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object p1

    const-string p2, "android.intent.action.PACKAGE_ADDED"

    .line 62
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_0

    .line 63
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 64
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onInstalled()V

    goto :goto_0

    :cond_0
    const-string p2, "android.intent.action.PACKAGE_REMOVED"

    .line 66
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_1

    .line 67
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 68
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onUninstalled()V

    goto :goto_0

    :cond_1
    const-string p2, "android.intent.action.PACKAGE_REPLACED"

    .line 69
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_2

    .line 70
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 71
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onInstalled()V

    goto :goto_0

    :cond_2
    const-string p2, "com.moji.mjweather.appstore.package_downloading"

    .line 72
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_3

    .line 73
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 75
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onDownloading()V

    goto :goto_0

    :cond_3
    const-string p2, "com.moji.mjweather.appstore.package_download_finish"

    .line 77
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_4

    .line 78
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 80
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onDownloadFinish()V

    goto :goto_0

    :cond_4
    const-string p2, "com.moji.mjweather.appstore.package_download_failure"

    .line 82
    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_5

    .line 83
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    if-eqz p1, :cond_5

    .line 85
    iget-object p1, p0, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver;->c:Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;

    invoke-interface {p1}, Lcom/moji/mjappstore/receiver/AppStorePackageReceiver$IPackageInfoAction;->onInstalled()V

    :cond_5
    :goto_0
    return-void
.end method
