PushCenter.smali
.class public Lcom/tradplus/ads/pushcenter/PushCenter;
.super Ljava/lang/Object;
# static fields
.field private static a:Lcom/tradplus/ads/pushcenter/PushCenter;
# instance fields
.field private b:Lcom/tradplus/ads/pushcenter/utils/PushTimer;
.field private c:Ljava/util/concurrent/ExecutorService;
.field private d:Landroid/content/Context;
# direct methods
.method public constructor <init>()V
.registers 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
invoke-virtual {p0}, Lcom/tradplus/ads/pushcenter/PushCenter;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;
move-result-object v0
iput-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
return-void
.end method
.method static synthetic a(Lcom/tradplus/ads/pushcenter/PushCenter;)Landroid/content/Context;
.registers 1
iget-object p0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->d:Landroid/content/Context;
return-object p0
.end method
.method private a(Landroid/content/Context;)V
.registers 9
invoke-static {p1}, Lcom/tradplus/ads/common/util/DeviceUtils;->isNetworkAvailable(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_40
invoke-static {}, Lcom/tradplus/ads/pushcenter/utils/RequestUtils;->getInstance()Lcom/tradplus/ads/pushcenter/utils/RequestUtils;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/tradplus/ads/pushcenter/utils/RequestUtils;->getTrackUrls(Landroid/content/Context;)Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_40
const-string v1, ","
invoke-virtual {v0, v1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_40
const/4 v1, 0x0
const/4 v2, 0x0
:goto_1e
array-length v3, v0
if-ge v2, v3, :cond_40
new-instance v3, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;
invoke-direct {v3}, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;-><init>()V
aget-object v4, v0, v2
const-string v5, "@"
invoke-virtual {v4, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v4
aget-object v4, v4, v1
invoke-static {}, Lcom/tradplus/ads/pushcenter/utils/RequestUtils;->getInstance()Lcom/tradplus/ads/pushcenter/utils/RequestUtils;
move-result-object v5
aget-object v6, v0, v2
invoke-virtual {v5, p1, v6}, Lcom/tradplus/ads/pushcenter/utils/RequestUtils;->getTrackMessage(Landroid/content/Context;Ljava/lang/String;)Lcom/tradplus/ads/pushcenter/event/request/EventShowEndRequest;
move-result-object v5
invoke-virtual {v3, p1, v4, v5}, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;->pushTrackMessage(Landroid/content/Context;Ljava/lang/String;Lcom/tradplus/ads/pushcenter/event/request/EventShowEndRequest;)V
add-int/lit8 v2, v2, 0x1
goto :goto_1e
:cond_40
return-void
.end method
.method private a(Landroid/content/Context;I)V
.registers 5
invoke-static {p1}, Lcom/tradplus/ads/common/util/DeviceUtils;->isNetworkAvailable(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_1c
invoke-static {}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->getInstance()Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;
move-result-object v0
invoke-virtual {v0, p1, p2}, Lcom/tradplus/ads/pushcenter/utils/PushMessageUtils;->sortPushMessageArray(Landroid/content/Context;I)Lorg/json/JSONArray;
move-result-object v0
invoke-virtual {v0}, Lorg/json/JSONArray;->length()I
move-result v1
if-lez v1, :cond_1c
new-instance v1, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;
invoke-direct {v1}, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;-><init>()V
invoke-virtual {v1, p1, v0, p2}, Lcom/tradplus/ads/pushcenter/http/PushCenterHttpUtils;->pushGroupMessage(Landroid/content/Context;Lorg/json/JSONArray;I)V
:cond_1c
return-void
.end method
.method static synthetic a(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;)V
.registers 2
invoke-direct {p0, p1}, Lcom/tradplus/ads/pushcenter/PushCenter;->a(Landroid/content/Context;)V
return-void
.end method
.method static synthetic a(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;I)V
.registers 3
invoke-direct {p0, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter;->a(Landroid/content/Context;I)V
return-void
.end method
.method public static fixedGrouping(Lorg/json/JSONArray;I)Ljava/util/List;
.registers 10
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Lorg/json/JSONArray;",
"I)",
"Ljava/util/List<",
"Lorg/json/JSONArray;",
">;"
}
.end annotation
if-eqz p0, :cond_42
invoke-virtual {p0}, Lorg/json/JSONArray;->length()I
move-result v0
if-eqz v0, :cond_42
if-gtz p1, :cond_b
goto :goto_42
:cond_b
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
invoke-virtual {p0}, Lorg/json/JSONArray;->length()I
move-result v1
invoke-virtual {p0}, Lorg/json/JSONArray;->length()I
move-result v2
div-int/2addr v2, p1
add-int/lit8 v2, v2, 0x1
const/4 v3, 0x0
:goto_1c
if-ge v3, v2, :cond_41
new-instance v4, Lorg/json/JSONArray;
invoke-direct {v4}, Lorg/json/JSONArray;-><init>()V
mul-int v5, v3, p1
:goto_25
add-int/lit8 v6, v3, 0x1
mul-int v7, v6, p1
if-ge v5, v7, :cond_3c
if-ge v5, v1, :cond_39
:try_start_2d
invoke-virtual {p0, v5}, Lorg/json/JSONArray;->get(I)Ljava/lang/Object;
move-result-object v6
invoke-virtual {v4, v6}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
:try_end_34
.catch Lorg/json/JSONException; {:try_start_2d .. :try_end_34} :catch_35
goto :goto_39
:catch_35
move-exception v6
invoke-virtual {v6}, Lorg/json/JSONException;->printStackTrace()V
:cond_39
:goto_39
add-int/lit8 v5, v5, 0x1
goto :goto_25
:cond_3c
invoke-interface {v0, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
move v3, v6
goto :goto_1c
:cond_41
return-object v0
:cond_42
:goto_42
const/4 p0, 0x0
return-object p0
.end method
.method public static getInstance()Lcom/tradplus/ads/pushcenter/PushCenter;
.registers 1
sget-object v0, Lcom/tradplus/ads/pushcenter/PushCenter;->a:Lcom/tradplus/ads/pushcenter/PushCenter;
if-nez v0, :cond_b
new-instance v0, Lcom/tradplus/ads/pushcenter/PushCenter;
invoke-direct {v0}, Lcom/tradplus/ads/pushcenter/PushCenter;-><init>()V
sput-object v0, Lcom/tradplus/ads/pushcenter/PushCenter;->a:Lcom/tradplus/ads/pushcenter/PushCenter;
:cond_b
sget-object v0, Lcom/tradplus/ads/pushcenter/PushCenter;->a:Lcom/tradplus/ads/pushcenter/PushCenter;
return-object v0
.end method
# virtual methods
.method public destory()V
.registers 2
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->b:Lcom/tradplus/ads/pushcenter/utils/PushTimer;
if-eqz v0, :cond_7
invoke-virtual {v0}, Lcom/tradplus/ads/pushcenter/utils/PushTimer;->stop()V
:cond_7
return-void
.end method
.method public init(Landroid/content/Context;)V
.registers 3
iput-object p1, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->d:Landroid/content/Context;
new-instance v0, Lcom/tradplus/ads/pushcenter/utils/PushTimer;
invoke-direct {v0, p1}, Lcom/tradplus/ads/pushcenter/utils/PushTimer;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->b:Lcom/tradplus/ads/pushcenter/utils/PushTimer;
iget-object p1, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->b:Lcom/tradplus/ads/pushcenter/utils/PushTimer;
invoke-virtual {p1}, Lcom/tradplus/ads/pushcenter/utils/PushTimer;->start()V
return-void
.end method
.method public newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;
.registers 9
new-instance v7, Ljava/util/concurrent/ThreadPoolExecutor;
sget-object v5, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
new-instance v6, Ljava/util/concurrent/LinkedBlockingQueue;
invoke-direct {v6}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
const/4 v1, 0x1
const/4 v2, 0x1
const-wide/16 v3, 0x0
move-object v0, v7
invoke-direct/range {v0 .. v6}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V
return-object v7
.end method
.method public removeTrackMessage(Landroid/content/Context;Ljava/lang/String;)V
.registers 5
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$9;
invoke-direct {v1, p0, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$9;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;Ljava/lang/String;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public removeTrackUrls(Landroid/content/Context;)V
.registers 4
sget v0, Lcom/tradplus/ads/mobileads/util/TradPlusDataConstants;->TRACKTYPE:I
invoke-static {p1, v0}, Lcom/tradplus/ads/mobileads/util/ACache;->get(Landroid/content/Context;I)Lcom/tradplus/ads/mobileads/util/ACache;
move-result-object p1
const-string v0, "ev_track"
const-string v1, ""
invoke-virtual {p1, v0, v1}, Lcom/tradplus/ads/mobileads/util/ACache;->put(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public removeTrackUrls(Landroid/content/Context;Ljava/lang/String;)V
.registers 5
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$7;
invoke-direct {v1, p0, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$7;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;Ljava/lang/String;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;II)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$16;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$16;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;I)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;JI)V
.registers 13
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v7, Lcom/tradplus/ads/pushcenter/PushCenter$15;
move-object v1, v7
move-object v2, p0
move v3, p4
move-object v4, p1
move-wide v5, p2
invoke-direct/range {v1 .. v6}, Lcom/tradplus/ads/pushcenter/PushCenter$15;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;J)V
invoke-interface {v0, v7}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Lcom/tradplus/ads/network/FSAdResponse;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$18;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$18;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Lcom/tradplus/ads/network/FSAdResponse;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Lcom/tradplus/ads/network/FSOpenResponse;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$3;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$3;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Lcom/tradplus/ads/network/FSOpenResponse;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Lcom/tradplus/ads/network/response/ConfigResponse$FrequencyBean;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$13;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$13;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Lcom/tradplus/ads/network/response/ConfigResponse$FrequencyBean;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Lcom/tradplus/ads/network/response/ConfigResponse;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$2;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$2;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Lcom/tradplus/ads/network/response/ConfigResponse;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Ljava/lang/String;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$14;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$14;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Ljava/lang/String;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public saveMessageToLocal(Ljava/lang/String;Lorg/json/JSONArray;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$17;
invoke-direct {v1, p0, p3, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$17;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;ILjava/lang/String;Lorg/json/JSONArray;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendGroupMeesageToServer(Landroid/content/Context;)V
.registers 4
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$5;
invoke-direct {v1, p0, p1}, Lcom/tradplus/ads/pushcenter/PushCenter$5;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendGroupMessageToCenter(Landroid/content/Context;Lorg/json/JSONArray;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$12;
invoke-direct {v1, p0, p2, p1, p3}, Lcom/tradplus/ads/pushcenter/PushCenter$12;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Lorg/json/JSONArray;Landroid/content/Context;I)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendMeesageToServer(Landroid/content/Context;I)V
.registers 5
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$4;
invoke-direct {v1, p0, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$4;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;I)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendMeesageToServer(Landroid/content/Context;Ljava/lang/Object;I)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$10;
invoke-direct {v1, p0, p1, p2, p3}, Lcom/tradplus/ads/pushcenter/PushCenter$10;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;Ljava/lang/Object;I)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendMessageToCenter(Landroid/content/Context;Ljava/lang/Object;I)V
.registers 5
iget-object p1, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v0, Lcom/tradplus/ads/pushcenter/PushCenter$1;
invoke-direct {v0, p0, p2, p3}, Lcom/tradplus/ads/pushcenter/PushCenter$1;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Ljava/lang/Object;I)V
invoke-interface {p1, v0}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public sendMessageToCenter(Landroid/content/Context;Lorg/json/JSONArray;I)V
.registers 5
iget-object p1, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v0, Lcom/tradplus/ads/pushcenter/PushCenter$11;
invoke-direct {v0, p0, p2, p3}, Lcom/tradplus/ads/pushcenter/PushCenter$11;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Lorg/json/JSONArray;I)V
invoke-interface {p1, v0}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public setTrackMessage(Landroid/content/Context;Ljava/lang/String;Lcom/tradplus/ads/pushcenter/event/request/EventShowEndRequest;)V
.registers 6
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$8;
invoke-direct {v1, p0, p1, p2, p3}, Lcom/tradplus/ads/pushcenter/PushCenter$8;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;Ljava/lang/String;Lcom/tradplus/ads/pushcenter/event/request/EventShowEndRequest;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method
.method public setTrackUrls(Landroid/content/Context;Ljava/lang/String;)V
.registers 5
iget-object v0, p0, Lcom/tradplus/ads/pushcenter/PushCenter;->c:Ljava/util/concurrent/ExecutorService;
new-instance v1, Lcom/tradplus/ads/pushcenter/PushCenter$6;
invoke-direct {v1, p0, p1, p2}, Lcom/tradplus/ads/pushcenter/PushCenter$6;-><init>(Lcom/tradplus/ads/pushcenter/PushCenter;Landroid/content/Context;Ljava/lang/String;)V
invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
return-void
.end method