m.smali
.class public final Lcom/imo/android/imoim/imodns/m;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/imo/android/imoim/imodns/k;
# instance fields
.field a:Ljava/lang/String;
.field b:Ljava/lang/String;
.field c:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
.field d:Ljava/lang/String;
.field e:Ljava/lang/Long;
.field f:Ljava/lang/Long;
.field g:Lorg/json/JSONObject;
.field h:Lcom/imo/android/imoim/imodns/UnblockConfig;
.field private i:Ljava/lang/Long;
# direct methods
.method private constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Lorg/json/JSONObject;)V
.registers 9
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/util/List<",
"Ljava/lang/Integer;",
">;",
"Ljava/lang/String;",
"Ljava/lang/Long;",
"Ljava/lang/Long;",
"Ljava/lang/Long;",
"Lorg/json/JSONObject;",
")V"
}
.end annotation
.line 63
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 64
iput-object p1, p0, Lcom/imo/android/imoim/imodns/m;->a:Ljava/lang/String;
.line 65
iput-object p2, p0, Lcom/imo/android/imoim/imodns/m;->b:Ljava/lang/String;
.line 66
iput-object p3, p0, Lcom/imo/android/imoim/imodns/m;->c:Ljava/util/List;
.line 67
iput-object p4, p0, Lcom/imo/android/imoim/imodns/m;->d:Ljava/lang/String;
.line 68
iput-object p5, p0, Lcom/imo/android/imoim/imodns/m;->e:Ljava/lang/Long;
.line 69
iput-object p6, p0, Lcom/imo/android/imoim/imodns/m;->i:Ljava/lang/Long;
.line 70
iput-object p7, p0, Lcom/imo/android/imoim/imodns/m;->f:Ljava/lang/Long;
.line 71
iput-object p8, p0, Lcom/imo/android/imoim/imodns/m;->g:Lorg/json/JSONObject;
if-eqz p8, :cond_25
.line 74
:try_start_15
invoke-static {p8}, Lcom/imo/android/imoim/imodns/UnblockConfig;->fromJson(Lorg/json/JSONObject;)Lcom/imo/android/imoim/imodns/UnblockConfig;
move-result-object p1
iput-object p1, p0, Lcom/imo/android/imoim/imodns/m;->h:Lcom/imo/android/imoim/imodns/UnblockConfig;
:try_end_1b
.catch Lorg/json/JSONException; {:try_start_15 .. :try_end_1b} :catch_1c
return-void
:catch_1c
move-exception p1
const/4 p2, 0x1
const-string p3, "ImoDNSResponseIP"
const-string p4, "parse unblock config failed"
.line 1083
invoke-static {p3, p4, p1, p2}, Lcom/imo/android/imoim/util/bt;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Z)V
:cond_25
return-void
.end method
.method public static a(Ljava/lang/String;Lorg/json/JSONObject;)Lcom/imo/android/imoim/imodns/m;
.registers 12
.annotation system Ldalvik/annotation/Throws;
value = {
Lorg/json/JSONException;
}
.end annotation
const-string v0, "ip"
.line 40
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
const-string v0, "session_prefix"
.line 41
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v5
const-string v0, "ttl"
.line 42
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getLong(Ljava/lang/String;)J
move-result-wide v0
const-wide/16 v6, 0x3e8
mul-long v0, v0, v6
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v6
.line 44
new-instance v4, Ljava/util/ArrayList;
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
const-string v0, "ports"
.line 45
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object v0
const/4 v1, 0x0
.line 46
:goto_26
invoke-virtual {v0}, Lorg/json/JSONArray;->length()I
move-result v2
if-ge v1, v2, :cond_3a
.line 47
invoke-virtual {v0, v1}, Lorg/json/JSONArray;->getInt(I)I
move-result v2
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
invoke-interface {v4, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
add-int/lit8 v1, v1, 0x1
goto :goto_26
:cond_3a
const-wide/16 v0, 0x0
.line 50
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
const-string v1, "time"
.line 51
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_53
.line 52
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->getLong(Ljava/lang/String;)J
move-result-wide v0
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
move-object v7, v0
move-object v8, v7
goto :goto_5d
.line 55
:cond_53
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v1
move-object v8, v0
move-object v7, v1
:goto_5d
const-string v0, "ub"
.line 58
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object v9
.line 59
new-instance p1, Lcom/imo/android/imoim/imodns/m;
move-object v1, p1
move-object v2, p0
invoke-direct/range {v1 .. v9}, Lcom/imo/android/imoim/imodns/m;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Lorg/json/JSONObject;)V
return-object p1
.end method
# virtual methods
.method public final a()Ljava/lang/Long;
.registers 2
.line 96
iget-object v0, p0, Lcom/imo/android/imoim/imodns/m;->e:Ljava/lang/Long;
return-object v0
.end method
.method public final b()Ljava/lang/String;
.registers 2
const-string v0, "tcp"
return-object v0
.end method
.method public final c()Ljava/lang/String;
.registers 2
.line 91
iget-object v0, p0, Lcom/imo/android/imoim/imodns/m;->d:Ljava/lang/String;
return-object v0
.end method
.method public final d()Z
.registers 6
.line 110
iget-object v0, p0, Lcom/imo/android/imoim/imodns/m;->i:Ljava/lang/Long;
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
move-result-wide v0
iget-object v2, p0, Lcom/imo/android/imoim/imodns/m;->e:Ljava/lang/Long;
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
move-result-wide v2
add-long/2addr v0, v2
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
cmp-long v4, v0, v2
if-lez v4, :cond_17
const/4 v0, 0x1
goto :goto_18
:cond_17
const/4 v0, 0x0
.line 111
:goto_18
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
iget-object v3, p0, Lcom/imo/android/imoim/imodns/m;->i:Ljava/lang/Long;
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
move-result-wide v3
sub-long/2addr v1, v3
invoke-static {v1, v2}, Ljava/lang/Math;->abs(J)J
return v0
.end method
.method public final e()Lcom/imo/android/imoim/imodns/n;
.registers 9
.line 128
new-instance v0, Ljava/util/Random;
invoke-direct {v0}, Ljava/util/Random;-><init>()V
.line 129
iget-object v1, p0, Lcom/imo/android/imoim/imodns/m;->c:Ljava/util/List;
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v2
invoke-virtual {v0, v2}, Ljava/util/Random;->nextInt(I)I
move-result v0
invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
.line 130
new-instance v7, Lcom/imo/android/imoim/imodns/n;
iget-object v2, p0, Lcom/imo/android/imoim/imodns/m;->a:Ljava/lang/String;
iget-object v3, p0, Lcom/imo/android/imoim/imodns/m;->b:Ljava/lang/String;
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
iget-object v5, p0, Lcom/imo/android/imoim/imodns/m;->d:Ljava/lang/String;
iget-object v6, p0, Lcom/imo/android/imoim/imodns/m;->h:Lcom/imo/android/imoim/imodns/UnblockConfig;
move-object v1, v7
invoke-direct/range {v1 .. v6}, Lcom/imo/android/imoim/imodns/n;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Lcom/imo/android/imoim/imodns/UnblockConfig;)V
return-object v7
.end method
.method public final toString()Ljava/lang/String;
.registers 6
.line 158
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "ip:"
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/imo/android/imoim/imodns/m;->b:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ":"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object v1, p0, Lcom/imo/android/imoim/imodns/m;->c:Ljava/util/List;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, " ttl:"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 1105
iget-object v1, p0, Lcom/imo/android/imoim/imodns/m;->i:Ljava/lang/Long;
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v1
iget-object v3, p0, Lcom/imo/android/imoim/imodns/m;->e:Ljava/lang/Long;
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
move-result-wide v3
add-long/2addr v1, v3
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v3
sub-long/2addr v1, v3
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v1
.line 158
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, "ms"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method