PushCenter$12.smali

.class Lcom/tradplus/ads/pushcenter/PushCenter$12;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/tradplus/ads/pushcenter/PushCenter;->sendGroupMessageToCenter(Landroid/content/Context;Lorg/json/JSONArray;I)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Lorg/json/JSONArray;

.field final synthetic b:Landroid/content/Context;

.field final synthetic c:I

.field final synthetic d:Lcom/tradplus/ads/pushcenter/PushCenter;


# direct methods
.method constructor <init>(Lcom/tradplus/ads/pushcenter/PushCenter;Lorg/json/JSONArray;Landroid/content/Context;I)V
    .registers 5

    iput-object p1, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->d:Lcom/tradplus/ads/pushcenter/PushCenter;

    iput-object p2, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->a:Lorg/json/JSONArray;

    iput-object p3, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->b:Landroid/content/Context;

    iput p4, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->c:I

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

    return-void
.end method


# virtual methods
.method public run()V
    .registers 5

    invoke-static {}, Lcom/tradplus/ads/mobileads/api/TPMessageManager;->getInstance()Lcom/tradplus/ads/mobileads/api/TPMessageManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tradplus/ads/mobileads/api/TPMessageManager;->isCanUploadMessage()Z

    move-result v0

    if-nez v0, :cond_b

    return-void

    :cond_b
    iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->a:Lorg/json/JSONArray;

    if-eqz v0, :cond_4a

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

    move-result v0

    if-lez v0, :cond_4a

    invoke-static {}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->getInstance()Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;

    move-result-object v0

    iget-object v1, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->b:Landroid/content/Context;

    iget v2, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->c:I

    invoke-virtual {v0, v1, v2}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->getPushMessageArray(Landroid/content/Context;I)Lorg/json/JSONArray;

    move-result-object v0

    const/4 v1, 0x0

    :goto_22
    iget-object v2, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->a:Lorg/json/JSONArray;

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

    move-result v2

    if-ge v1, v2, :cond_3b

    :try_start_2a
    iget-object v2, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->a:Lorg/json/JSONArray;

    invoke-virtual {v2, v1}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    invoke-virtual {v0, v2}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
    :try_end_33
    .catch Lorg/json/JSONException; {:try_start_2a .. :try_end_33} :catch_34

    goto :goto_38

    :catch_34
    move-exception v2

    invoke-virtual {v2}, Lorg/json/JSONException;->printStackTrace()V

    :goto_38
    add-int/lit8 v1, v1, 0x1

    goto :goto_22

    :cond_3b
    invoke-static {}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->getInstance()Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;

    move-result-object v1

    iget-object v2, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->d:Lcom/tradplus/ads/pushcenter/PushCenter;

    invoke-static {v2}, Lcom/tradplus/ads/pushcenter/PushCenter;->a(Lcom/tradplus/ads/pushcenter/PushCenter;)Landroid/content/Context;

    move-result-object v2

    iget v3, p0, Lcom/tradplus/ads/pushcenter/PushCenter$12;->c:I

    invoke-virtual {v1, v2, v0, v3}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->initPushMessageArray(Landroid/content/Context;Lorg/json/JSONArray;I)V

    :cond_4a
    return-void
.end method