e.smali
.class public final Lcom/bytedance/sdk/adnet/c/e;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static final d:Ljava/lang/Object;
# instance fields
.field public a:Landroid/content/Context;
.field public b:Lcom/bytedance/sdk/adnet/c/d;
.field public c:Z
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 25
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Lcom/bytedance/sdk/adnet/c/e;->d:Ljava/lang/Object;
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Z)V
.registers 4
.line 27
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x1
.line 24
iput-boolean v0, p0, Lcom/bytedance/sdk/adnet/c/e;->c:Z
.line 28
iput-object p1, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
.line 29
iput-boolean p2, p0, Lcom/bytedance/sdk/adnet/c/e;->c:Z
.line 30
new-instance p1, Lcom/bytedance/sdk/adnet/c/d;
invoke-direct {p1}, Lcom/bytedance/sdk/adnet/c/d;-><init>()V
iput-object p1, p0, Lcom/bytedance/sdk/adnet/c/e;->b:Lcom/bytedance/sdk/adnet/c/d;
return-void
.end method
.method public static b(Lorg/json/JSONObject;)Lcom/bytedance/sdk/adnet/c/d;
.registers 10
const-string v0, "host_replace_map"
const-string v1, "local_host_filter"
const-string v2, "probe_enable"
const-string v3, "local_enable"
const/4 v4, 0x0
.line 156
:try_start_9
new-instance v5, Lcom/bytedance/sdk/adnet/c/d;
invoke-direct {v5}, Lcom/bytedance/sdk/adnet/c/d;-><init>()V
.line 157
invoke-virtual {p0, v3}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v6
const/4 v7, 0x1
const/4 v8, 0x0
if-eqz v6, :cond_21
.line 158
invoke-virtual {p0, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
move-result v3
if-nez v3, :cond_1e
const/4 v3, 0x0
goto :goto_1f
:cond_1e
const/4 v3, 0x1
:goto_1f
iput-boolean v3, v5, Lcom/bytedance/sdk/adnet/c/d;->a:Z
.line 160
:cond_21
invoke-virtual {p0, v2}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v3
if-eqz v3, :cond_30
.line 161
invoke-virtual {p0, v2}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
move-result v2
if-nez v2, :cond_2e
const/4 v7, 0x0
:cond_2e
iput-boolean v7, v5, Lcom/bytedance/sdk/adnet/c/d;->b:Z
.line 164
:cond_30
invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_63
.line 165
invoke-virtual {p0, v1}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object v1
.line 166
new-instance v2, Ljava/util/HashMap;
invoke-direct {v2}, Ljava/util/HashMap;-><init>()V
.line 167
invoke-virtual {v1}, Lorg/json/JSONArray;->length()I
move-result v3
if-lez v3, :cond_60
const/4 v3, 0x0
.line 168
:goto_46
invoke-virtual {v1}, Lorg/json/JSONArray;->length()I
move-result v6
if-ge v3, v6, :cond_60
.line 169
invoke-virtual {v1, v3}, Lorg/json/JSONArray;->getString(I)Ljava/lang/String;
move-result-object v6
.line 170
invoke-static {v6}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v7
if-nez v7, :cond_5d
.line 173
invoke-static {v8}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v7
invoke-virtual {v2, v6, v7}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:cond_5d
add-int/lit8 v3, v3, 0x1
goto :goto_46
.line 176
:cond_60
iput-object v2, v5, Lcom/bytedance/sdk/adnet/c/d;->c:Ljava/util/Map;
goto :goto_65
.line 178
:cond_63
iput-object v4, v5, Lcom/bytedance/sdk/adnet/c/d;->c:Ljava/util/Map;
.line 189
:goto_65
invoke-virtual {p0, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_a1
.line 190
invoke-virtual {p0, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object v0
.line 191
new-instance v1, Ljava/util/HashMap;
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
.line 192
invoke-virtual {v0}, Lorg/json/JSONObject;->length()I
move-result v2
if-lez v2, :cond_9e
.line 193
invoke-virtual {v0}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;
move-result-object v2
.line 194
:cond_7e
:goto_7e
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_9e
.line 195
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
.line 196
invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v6
.line 197
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v7
if-nez v7, :cond_7e
invoke-static {v6}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v7
if-nez v7, :cond_7e
.line 200
invoke-interface {v1, v3, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_7e
.line 203
:cond_9e
iput-object v1, v5, Lcom/bytedance/sdk/adnet/c/d;->d:Ljava/util/Map;
goto :goto_a3
.line 205
:cond_a1
iput-object v4, v5, Lcom/bytedance/sdk/adnet/c/d;->d:Ljava/util/Map;
:goto_a3
const-string v0, "req_to_cnt"
.line 215
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->e:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->e:I
const-string v0, "req_to_api_cnt"
.line 216
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->f:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->f:I
const-string v0, "req_to_ip_cnt"
.line 217
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->g:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->g:I
const-string v0, "req_err_cnt"
.line 218
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->h:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->h:I
const-string v0, "req_err_api_cnt"
.line 219
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->i:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->i:I
const-string v0, "req_err_ip_cnt"
.line 220
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->j:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->j:I
const-string v0, "update_interval"
.line 221
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->k:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->k:I
const-string v0, "update_random_range"
.line 222
iget v1, v5, Lcom/bytedance/sdk/adnet/c/d;->l:I
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v0
iput v0, v5, Lcom/bytedance/sdk/adnet/c/d;->l:I
const-string v0, "http_code_black"
.line 223
iget-object v1, v5, Lcom/bytedance/sdk/adnet/c/d;->m:Ljava/lang/String;
invoke-virtual {p0, v0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
iput-object p0, v5, Lcom/bytedance/sdk/adnet/c/d;->m:Ljava/lang/String;
:try_end_fd
.catchall {:try_start_9 .. :try_end_fd} :catchall_fe
return-object v5
:catchall_fe
return-object v4
.end method
# virtual methods
.method public final a(Lorg/json/JSONObject;)V
.registers 11
.line 34
iget-boolean v0, p0, Lcom/bytedance/sdk/adnet/c/e;->c:Z
if-nez v0, :cond_8
.line 35
invoke-static {}, Lcom/bytedance/sdk/adnet/e/c;->a()V
return-void
.line 38
:cond_8
invoke-static {}, Lcom/bytedance/sdk/adnet/c/f;->a()Lcom/bytedance/sdk/adnet/c/f;
move-result-object v0
.line 1083
iget-object v0, v0, Lcom/bytedance/sdk/adnet/c/f;->d:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->clear()V
const-string v0, ""
const/4 v1, 0x0
:try_start_14
const-string v2, "ttnet_url_dispatcher_enabled"
.line 43
invoke-virtual {p1, v2, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v2
if-lez v2, :cond_1e
const/4 v2, 0x1
goto :goto_1f
:cond_1e
const/4 v2, 0x0
:goto_1f
const-string v3, "ttnet_dispatch_actions"
.line 44
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object v3
const/4 v4, 0x0
.line 46
invoke-static {}, Lcom/bytedance/sdk/adnet/a;->c()Z
move-result v5
if-eqz v5, :cond_97
if-eqz v2, :cond_97
if-eqz v3, :cond_97
.line 47
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
const/4 v5, 0x0
.line 48
:goto_36
invoke-virtual {v3}, Lorg/json/JSONArray;->length()I
move-result v6
if-ge v5, v6, :cond_64
.line 49
invoke-virtual {v3, v5}, Lorg/json/JSONArray;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Lorg/json/JSONObject;
const-string v7, "param"
.line 50
invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object v6
const-string v7, "service_name"
const-string v8, ""
.line 51
invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v7
const-string v8, "idc_selection"
.line 52
invoke-virtual {v7, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_61
const-string v7, "strategy_info"
.line 53
invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object v6
.line 54
invoke-virtual {v2, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_61
add-int/lit8 v5, v5, 0x1
goto :goto_36
.line 58
:cond_64
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v3
if-nez v3, :cond_97
.line 59
new-instance v4, Lorg/json/JSONObject;
invoke-direct {v4}, Lorg/json/JSONObject;-><init>()V
.line 60
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_73
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_97
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lorg/json/JSONObject;
.line 61
invoke-virtual {v3}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;
move-result-object v5
.line 62
:goto_83
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
move-result v6
if-eqz v6, :cond_73
.line 63
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v6
check-cast v6, Ljava/lang/String;
.line 64
invoke-virtual {v3, v6}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v7
.line 65
invoke-virtual {v4, v6, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
goto :goto_83
:cond_97
const-string v2, "tnc_config"
.line 71
invoke-virtual {p1, v2}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object p1
if-nez p1, :cond_a9
if-nez v4, :cond_a9
const-string v2, "TNCConfigHandler"
const-string v3, " tnc host_replace_map config is null"
.line 73
invoke-static {v2, v3}, Lcom/bytedance/sdk/adnet/e/c;->a(Ljava/lang/String;Ljava/lang/String;)V
goto :goto_bd
:cond_a9
if-nez p1, :cond_b6
.line 75
new-instance p1, Lorg/json/JSONObject;
invoke-direct {p1}, Lorg/json/JSONObject;-><init>()V
const-string v2, "host_replace_map"
.line 76
invoke-virtual {p1, v2, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
goto :goto_bd
:cond_b6
if-eqz v4, :cond_bd
const-string v2, "host_replace_map"
.line 78
invoke-virtual {p1, v2, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
.line 81
:cond_bd
:goto_bd
invoke-static {p1}, Lcom/bytedance/sdk/adnet/c/e;->b(Lorg/json/JSONObject;)Lcom/bytedance/sdk/adnet/c/d;
move-result-object v2
.line 82
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "handleConfigChanged, newConfig: "
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
if-nez v2, :cond_cd
const-string v4, "null"
goto :goto_d1
.line 83
:cond_cd
invoke-virtual {v2}, Lcom/bytedance/sdk/adnet/c/d;->toString()Ljava/lang/String;
move-result-object v4
:goto_d1
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 82
invoke-static {}, Lcom/bytedance/sdk/adnet/e/c;->a()V
:try_end_d7
.catchall {:try_start_14 .. :try_end_d7} :catchall_123
if-nez v2, :cond_fb
.line 95
sget-object v3, Lcom/bytedance/sdk/adnet/c/e;->d:Ljava/lang/Object;
monitor-enter v3
.line 96
:try_start_dc
iget-object p1, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
const-string v2, "ttnet_tnc_config"
invoke-virtual {p1, v2, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p1
.line 98
invoke-interface {p1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p1
const-string v1, "tnc_config_str"
.line 99
invoke-interface {p1, v1, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object p1
invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 100
iget-object p1, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
invoke-static {p1, v0}, Lcom/bytedance/sdk/adnet/e/d;->a(Landroid/content/Context;Ljava/lang/String;)V
.line 101
monitor-exit v3
return-void
:catchall_f8
move-exception p1
monitor-exit v3
:try_end_fa
.catchall {:try_start_dc .. :try_end_fa} :catchall_f8
throw p1
.line 87
:cond_fb
:try_start_fb
iput-object v2, p0, Lcom/bytedance/sdk/adnet/c/e;->b:Lcom/bytedance/sdk/adnet/c/d;
.line 88
invoke-virtual {p1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object p1
:try_end_101
.catchall {:try_start_fb .. :try_end_101} :catchall_123
.line 95
sget-object v2, Lcom/bytedance/sdk/adnet/c/e;->d:Ljava/lang/Object;
monitor-enter v2
.line 96
:try_start_104
iget-object v0, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
const-string v3, "ttnet_tnc_config"
invoke-virtual {v0, v3, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
.line 98
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "tnc_config_str"
.line 99
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 100
iget-object v0, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
invoke-static {v0, p1}, Lcom/bytedance/sdk/adnet/e/d;->a(Landroid/content/Context;Ljava/lang/String;)V
.line 101
monitor-exit v2
return-void
:catchall_120
move-exception p1
monitor-exit v2
:try_end_122
.catchall {:try_start_104 .. :try_end_122} :catchall_120
throw p1
.line 92
:catchall_123
:try_start_123
new-instance p1, Lcom/bytedance/sdk/adnet/c/d;
invoke-direct {p1}, Lcom/bytedance/sdk/adnet/c/d;-><init>()V
iput-object p1, p0, Lcom/bytedance/sdk/adnet/c/e;->b:Lcom/bytedance/sdk/adnet/c/d;
:try_end_12a
.catchall {:try_start_123 .. :try_end_12a} :catchall_14c
.line 95
sget-object p1, Lcom/bytedance/sdk/adnet/c/e;->d:Ljava/lang/Object;
monitor-enter p1
.line 96
:try_start_12d
iget-object v2, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
const-string v3, "ttnet_tnc_config"
invoke-virtual {v2, v3, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v1
.line 98
invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v1
const-string v2, "tnc_config_str"
.line 99
invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object v1
invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 100
iget-object v1, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
invoke-static {v1, v0}, Lcom/bytedance/sdk/adnet/e/d;->a(Landroid/content/Context;Ljava/lang/String;)V
.line 101
monitor-exit p1
return-void
:catchall_149
move-exception v0
monitor-exit p1
:try_end_14b
.catchall {:try_start_12d .. :try_end_14b} :catchall_149
throw v0
:catchall_14c
move-exception p1
.line 95
sget-object v2, Lcom/bytedance/sdk/adnet/c/e;->d:Ljava/lang/Object;
monitor-enter v2
.line 96
:try_start_150
iget-object v3, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
const-string v4, "ttnet_tnc_config"
invoke-virtual {v3, v4, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v1
.line 98
invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v1
const-string v3, "tnc_config_str"
.line 99
invoke-interface {v1, v3, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object v1
invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 100
iget-object v1, p0, Lcom/bytedance/sdk/adnet/c/e;->a:Landroid/content/Context;
invoke-static {v1, v0}, Lcom/bytedance/sdk/adnet/e/d;->a(Landroid/content/Context;Ljava/lang/String;)V
.line 101
monitor-exit v2
:try_end_16b
.catchall {:try_start_150 .. :try_end_16b} :catchall_16c
.line 102
throw p1
:catchall_16c
move-exception p1
.line 101
:try_start_16d
monitor-exit v2
:try_end_16e
.catchall {:try_start_16d .. :try_end_16e} :catchall_16c
goto :goto_170
:goto_16f
throw p1
:goto_170
goto :goto_16f
.end method