e.smali

.class public Lcn/jiguang/i/e;
.super Lcn/jiguang/o/a;


# static fields
.field private static a:Lcn/jiguang/i/e;


# instance fields
.field private b:Landroid/content/Context;


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

    invoke-direct {p0}, Lcn/jiguang/o/a;-><init>()V

    return-void
.end method

.method public static a()Lcn/jiguang/i/e;
    .registers 2

    sget-object v0, Lcn/jiguang/i/e;->a:Lcn/jiguang/i/e;

    if-nez v0, :cond_13

    const-class v1, Lcn/jiguang/i/e;

    monitor-enter v1

    :try_start_7
    sget-object v0, Lcn/jiguang/i/e;->a:Lcn/jiguang/i/e;

    if-nez v0, :cond_12

    new-instance v0, Lcn/jiguang/i/e;

    invoke-direct {v0}, Lcn/jiguang/i/e;-><init>()V

    sput-object v0, Lcn/jiguang/i/e;->a:Lcn/jiguang/i/e;

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

    :cond_13
    sget-object v0, Lcn/jiguang/i/e;->a:Lcn/jiguang/i/e;

    return-object v0

    :catchall_16
    move-exception v0

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

    throw v0
.end method

.method private a(Ljava/util/List;)Lorg/json/JSONArray;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcn/jiguang/j/a;",
            ">;)",
            "Lorg/json/JSONArray;"
        }
    .end annotation

    new-instance v1, Lorg/json/JSONArray;

    invoke-direct {v1}, Lorg/json/JSONArray;-><init>()V

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_9
    :goto_9
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_25

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcn/jiguang/j/a;

    iget v3, v0, Lcn/jiguang/j/a;->f:I

    if-eqz v3, :cond_9

    const/16 v3, 0x80

    invoke-virtual {v0, v3}, Lcn/jiguang/j/a;->b(I)Lorg/json/JSONObject;

    move-result-object v0

    if-eqz v0, :cond_9

    invoke-virtual {v1, v0}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    goto :goto_9

    :cond_25
    return-object v1
.end method


# virtual methods
.method protected a(Landroid/content/Context;)Ljava/lang/String;
    .registers 3

    iput-object p1, p0, Lcn/jiguang/i/e;->b:Landroid/content/Context;

    const-string v0, "JAppSdk"

    return-object v0
.end method

.method protected a(Landroid/content/Context;Ljava/lang/String;)V
    .registers 3

    return-void
.end method

.method protected b(Landroid/content/Context;Ljava/lang/String;)V
    .registers 7

    const-string v0, "JAppSdk"

    const-string v1, "doBusiness"

    invoke-static {v0, v1}, Lcn/jiguang/an/a;->a(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, 0x1

    const/4 v1, 0x1

    :try_start_9
    invoke-static {p1, v0, v1}, Lcn/jiguang/k/a;->a(Landroid/content/Context;ZZ)Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_15

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-eqz v1, :cond_1d

    :cond_15
    const-string v0, "JAppSdk"

    const-string v1, "there are no data to report"

    invoke-static {v0, v1}, Lcn/jiguang/an/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    :cond_1c
    :goto_1c
    return-void

    :cond_1d
    invoke-direct {p0, v0}, Lcn/jiguang/i/e;->a(Ljava/util/List;)Lorg/json/JSONArray;

    move-result-object v0

    if-eqz v0, :cond_1c

    invoke-virtual {v0}, Lorg/json/JSONArray;->length()I

    move-result v1

    if-eqz v1, :cond_1c

    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    const-string v2, "data"

    invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v0, "app_sdk"

    invoke-static {p1, v1, v0}, Lcn/jiguang/o/d;->a(Landroid/content/Context;Lorg/json/JSONObject;Ljava/lang/String;)Lorg/json/JSONObject;

    invoke-static {p1, v1}, Lcn/jiguang/o/d;->a(Landroid/content/Context;Ljava/lang/Object;)V

    invoke-super {p0, p1, p2}, Lcn/jiguang/o/a;->b(Landroid/content/Context;Ljava/lang/String;)V
    :try_end_3e
    .catch Ljava/lang/Throwable; {:try_start_9 .. :try_end_3e} :catch_3f

    goto :goto_1c

    :catch_3f
    move-exception v0

    const-string v1, "JAppSdk"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "package json exception:"

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

    move-result-object v2

    invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

    move-result-object v0

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

    move-result-object v0

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

    move-result-object v0

    invoke-static {v1, v0}, Lcn/jiguang/an/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1c
.end method

.method protected b()Z
    .registers 2

    const/4 v0, 0x1

    return v0
.end method