m.smali
.class public Lcom/amap/api/services/a/m;
.super Ljava/lang/Object;
# direct methods
.method private static a()Ljava/lang/String;
.registers 3
:try_start_0
invoke-static {}, Landroid/net/Proxy;->getDefaultHost()Ljava/lang/String;
:try_end_3
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_3} :catch_a
move-result-object v0
:goto_4
if-nez v0, :cond_9
const-string/jumbo v0, "null"
:cond_9
return-object v0
:catch_a
move-exception v0
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v2, "getDefHost"
invoke-static {v0, v1, v2}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
const/4 v0, 0x0
goto :goto_4
.end method
.method public static a(Ljava/lang/String;)Ljava/lang/String;
.registers 2
invoke-static {p0}, Lcom/amap/api/services/a/o;->c(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public static a(Landroid/content/Context;)Ljava/net/Proxy;
.registers 5
const/4 v0, 0x0
:try_start_1
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0xb
if-lt v1, v2, :cond_14
new-instance v1, Ljava/net/URI;
const-string/jumbo v2, "http://restapi.amap.com"
invoke-direct {v1, v2}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
invoke-static {p0, v1}, Lcom/amap/api/services/a/m;->a(Landroid/content/Context;Ljava/net/URI;)Ljava/net/Proxy;
move-result-object v0
:goto_13
return-object v0
:cond_14
invoke-static {p0}, Lcom/amap/api/services/a/m;->b(Landroid/content/Context;)Ljava/net/Proxy;
:try_end_17
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_17} :catch_19
move-result-object v0
goto :goto_13
:catch_19
move-exception v1
const-string/jumbo v2, "ProxyUtil"
const-string/jumbo v3, "getProxy"
invoke-static {v1, v2, v3}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_13
.end method
.method private static a(Landroid/content/Context;Ljava/net/URI;)Ljava/net/Proxy;
.registers 6
const/4 v1, 0x0
invoke-static {p0}, Lcom/amap/api/services/a/m;->c(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_34
:try_start_7
invoke-static {}, Ljava/net/ProxySelector;->getDefault()Ljava/net/ProxySelector;
move-result-object v0
invoke-virtual {v0, p1}, Ljava/net/ProxySelector;->select(Ljava/net/URI;)Ljava/util/List;
move-result-object v0
if-eqz v0, :cond_36
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v2
if-nez v2, :cond_36
const/4 v2, 0x0
invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/net/Proxy;
if-eqz v0, :cond_28
invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
move-result-object v2
sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;
:try_end_26
.catch Ljava/lang/Throwable; {:try_start_7 .. :try_end_26} :catch_2a
if-ne v2, v3, :cond_29
:cond_28
move-object v0, v1
:cond_29
:goto_29
return-object v0
:catch_2a
move-exception v0
const-string/jumbo v2, "ProxyUtil"
const-string/jumbo v3, "getProxySelectorCfg"
invoke-static {v0, v2, v3}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
:cond_34
move-object v0, v1
goto :goto_29
:cond_36
move-object v0, v1
goto :goto_29
.end method
.method private static a(Ljava/lang/String;I)Z
.registers 3
if-eqz p0, :cond_d
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
if-lez v0, :cond_d
const/4 v0, -0x1
if-eq p1, v0, :cond_d
const/4 v0, 0x1
:goto_c
return v0
:cond_d
const/4 v0, 0x0
goto :goto_c
.end method
.method private static b()I
.registers 4
const/4 v0, -0x1
:try_start_1
invoke-static {}, Landroid/net/Proxy;->getDefaultPort()I
:try_end_4
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_4} :catch_6
move-result v0
:goto_5
return v0
:catch_6
move-exception v1
const-string/jumbo v2, "ProxyUtil"
const-string/jumbo v3, "getDefPort"
invoke-static {v1, v2, v3}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_5
.end method
.method private static b(Landroid/content/Context;)Ljava/net/Proxy;
.registers 13
const/4 v10, 0x0
const/16 v6, 0x50
const/4 v9, 0x1
const/4 v8, -0x1
const/4 v7, 0x0
invoke-static {p0}, Lcom/amap/api/services/a/m;->c(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_189
const-string/jumbo v0, "content://telephony/carriers/preferapn"
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
:try_start_1b
invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
:try_end_1e
.catch Ljava/lang/SecurityException; {:try_start_1b .. :try_end_1e} :catch_bf
.catch Ljava/lang/Throwable; {:try_start_1b .. :try_end_1e} :catch_141
.catchall {:try_start_1b .. :try_end_1e} :catchall_166
move-result-object v2
if-eqz v2, :cond_1d4
:try_start_21
invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z
move-result v0
if-eqz v0, :cond_1d4
const-string/jumbo v0, "apn"
invoke-interface {v2, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
move-result v0
invoke-interface {v2, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_3a
sget-object v1, Ljava/util/Locale;->US:Ljava/util/Locale;
invoke-virtual {v0, v1}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object v0
:cond_3a
if-eqz v0, :cond_81
const-string/jumbo v1, "ctwap"
invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_81
invoke-static {}, Lcom/amap/api/services/a/m;->a()Ljava/lang/String;
move-result-object v3
invoke-static {}, Lcom/amap/api/services/a/m;->b()I
:try_end_4c
.catch Ljava/lang/SecurityException; {:try_start_21 .. :try_end_4c} :catch_1a4
.catch Ljava/lang/Throwable; {:try_start_21 .. :try_end_4c} :catch_191
.catchall {:try_start_21 .. :try_end_4c} :catchall_18c
move-result v0
:try_start_4d
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1d7
const-string/jumbo v1, "null"
invoke-virtual {v3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
:try_end_59
.catch Ljava/lang/SecurityException; {:try_start_4d .. :try_end_59} :catch_1aa
.catch Ljava/lang/Throwable; {:try_start_4d .. :try_end_59} :catch_194
.catchall {:try_start_4d .. :try_end_59} :catchall_18c
move-result v1
if-nez v1, :cond_1d7
move v1, v9
:goto_5d
if-nez v1, :cond_66
:try_start_5f
const-string/jumbo v1, "QMTAuMC4wLjIwMA=="
invoke-static {v1}, Lcom/amap/api/services/a/m;->a(Ljava/lang/String;)Ljava/lang/String;
:try_end_65
.catch Ljava/lang/SecurityException; {:try_start_5f .. :try_end_65} :catch_1b2
.catch Ljava/lang/Throwable; {:try_start_5f .. :try_end_65} :catch_199
.catchall {:try_start_5f .. :try_end_65} :catchall_18c
move-result-object v3
:cond_66
if-ne v0, v8, :cond_69
move v0, v6
:cond_69
move v8, v0
:goto_6a
if-eqz v2, :cond_6f
:try_start_6c
invoke-interface {v2}, Landroid/database/Cursor;->close()V
:try_end_6f
.catch Ljava/lang/Throwable; {:try_start_6c .. :try_end_6f} :catch_b1
:cond_6f
:goto_6f
:try_start_6f
invoke-static {v3, v8}, Lcom/amap/api/services/a/m;->a(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_189
new-instance v0, Ljava/net/Proxy;
sget-object v1, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;
invoke-static {v3, v8}, Ljava/net/InetSocketAddress;->createUnresolved(Ljava/lang/String;I)Ljava/net/InetSocketAddress;
move-result-object v2
invoke-direct {v0, v1, v2}, Ljava/net/Proxy;-><init>(Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V
:try_end_80
.catch Ljava/lang/Throwable; {:try_start_6f .. :try_end_80} :catch_17c
:goto_80
return-object v0
:cond_81
if-eqz v0, :cond_1d4
:try_start_83
const-string/jumbo v1, "wap"
invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_1d4
invoke-static {}, Lcom/amap/api/services/a/m;->a()Ljava/lang/String;
move-result-object v3
invoke-static {}, Lcom/amap/api/services/a/m;->b()I
:try_end_93
.catch Ljava/lang/SecurityException; {:try_start_83 .. :try_end_93} :catch_1a4
.catch Ljava/lang/Throwable; {:try_start_83 .. :try_end_93} :catch_191
.catchall {:try_start_83 .. :try_end_93} :catchall_18c
move-result v1
:try_start_94
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_1d0
const-string/jumbo v0, "null"
invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
:try_end_a0
.catch Ljava/lang/SecurityException; {:try_start_94 .. :try_end_a0} :catch_1b9
.catch Ljava/lang/Throwable; {:try_start_94 .. :try_end_a0} :catch_19d
.catchall {:try_start_94 .. :try_end_a0} :catchall_18c
move-result v0
if-nez v0, :cond_1d0
move v0, v9
:goto_a4
if-nez v0, :cond_ad
:try_start_a6
const-string/jumbo v0, "QMTAuMC4wLjE3Mg=="
invoke-static {v0}, Lcom/amap/api/services/a/m;->a(Ljava/lang/String;)Ljava/lang/String;
:try_end_ac
.catch Ljava/lang/SecurityException; {:try_start_a6 .. :try_end_ac} :catch_1c0
.catch Ljava/lang/Throwable; {:try_start_a6 .. :try_end_ac} :catch_1a1
.catchall {:try_start_a6 .. :try_end_ac} :catchall_18c
move-result-object v3
:cond_ad
if-ne v1, v8, :cond_1cd
move v8, v6
goto :goto_6a
:catch_b1
move-exception v0
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v2, "getHostProxy2"
invoke-static {v0, v1, v2}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
goto :goto_6f
:catch_bf
move-exception v0
move-object v1, v7
move v2, v8
move-object v3, v7
:goto_c3
:try_start_c3
const-string/jumbo v4, "ProxyUtil"
const-string/jumbo v5, "getHostProxy"
invoke-static {v0, v4, v5}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-static {p0}, Lcom/amap/api/services/a/j;->o(Landroid/content/Context;)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_1ca
sget-object v2, Ljava/util/Locale;->US:Ljava/util/Locale;
invoke-virtual {v0, v2}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object v4
invoke-static {}, Lcom/amap/api/services/a/m;->a()Ljava/lang/String;
move-result-object v0
invoke-static {}, Lcom/amap/api/services/a/m;->b()I
move-result v2
const-string/jumbo v5, "ctwap"
invoke-virtual {v4, v5}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v5
if-eq v5, v8, :cond_11c
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
if-nez v4, :cond_fa
const-string/jumbo v4, "null"
invoke-virtual {v0, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-nez v4, :cond_fa
move v10, v9
move-object v3, v0
:cond_fa
if-nez v10, :cond_103
const-string/jumbo v0, "QMTAuMC4wLjIwMA=="
invoke-static {v0}, Lcom/amap/api/services/a/m;->a(Ljava/lang/String;)Ljava/lang/String;
:try_end_102
.catchall {:try_start_c3 .. :try_end_102} :catchall_18e
move-result-object v3
:cond_103
if-ne v2, v8, :cond_1ca
move v8, v6
:goto_106
if-eqz v1, :cond_6f
:try_start_108
invoke-interface {v1}, Landroid/database/Cursor;->close()V
:try_end_10b
.catch Ljava/lang/Throwable; {:try_start_108 .. :try_end_10b} :catch_10d
goto/16 :goto_6f
:catch_10d
move-exception v0
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v2, "getHostProxy2"
invoke-static {v0, v1, v2}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
goto/16 :goto_6f
:cond_11c
:try_start_11c
const-string/jumbo v5, "wap"
invoke-virtual {v4, v5}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v4
if-eq v4, v8, :cond_1ca
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-nez v2, :cond_1c6
const-string/jumbo v2, "null"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_1c6
move v2, v9
:goto_135
if-nez v2, :cond_13e
const-string/jumbo v0, "QMTAuMC4wLjE3Mg=="
invoke-static {v0}, Lcom/amap/api/services/a/m;->a(Ljava/lang/String;)Ljava/lang/String;
:try_end_13d
.catchall {:try_start_11c .. :try_end_13d} :catchall_18e
move-result-object v0
:cond_13e
move v8, v6
move-object v3, v0
goto :goto_106
:catch_141
move-exception v0
move-object v2, v7
move-object v3, v7
:goto_144
:try_start_144
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v4, "getHostProxy1"
invoke-static {v0, v1, v4}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
:try_end_150
.catchall {:try_start_144 .. :try_end_150} :catchall_18c
if-eqz v2, :cond_6f
:try_start_152
invoke-interface {v2}, Landroid/database/Cursor;->close()V
:try_end_155
.catch Ljava/lang/Throwable; {:try_start_152 .. :try_end_155} :catch_157
goto/16 :goto_6f
:catch_157
move-exception v0
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v2, "getHostProxy2"
invoke-static {v0, v1, v2}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
goto/16 :goto_6f
:catchall_166
move-exception v0
move-object v2, v7
:goto_168
if-eqz v2, :cond_16d
:try_start_16a
invoke-interface {v2}, Landroid/database/Cursor;->close()V
:try_end_16d
.catch Ljava/lang/Throwable; {:try_start_16a .. :try_end_16d} :catch_16e
:cond_16d
:goto_16d
throw v0
:catch_16e
move-exception v1
const-string/jumbo v2, "ProxyUtil"
const-string/jumbo v3, "getHostProxy2"
invoke-static {v1, v2, v3}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Throwable;->printStackTrace()V
goto :goto_16d
:catch_17c
move-exception v0
const-string/jumbo v1, "ProxyUtil"
const-string/jumbo v2, "getHostProxy2"
invoke-static {v0, v1, v2}, Lcom/amap/api/services/a/q;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V
:cond_189
move-object v0, v7
goto/16 :goto_80
:catchall_18c
move-exception v0
goto :goto_168
:catchall_18e
move-exception v0
move-object v2, v1
goto :goto_168
:catch_191
move-exception v0
move-object v3, v7
goto :goto_144
:catch_194
move-exception v1
move v8, v0
move-object v3, v7
move-object v0, v1
goto :goto_144
:catch_199
move-exception v1
move v8, v0
move-object v0, v1
goto :goto_144
:catch_19d
move-exception v0
move v8, v1
move-object v3, v7
goto :goto_144
:catch_1a1
move-exception v0
move v8, v1
goto :goto_144
:catch_1a4
move-exception v0
move-object v1, v2
move-object v3, v7
move v2, v8
goto/16 :goto_c3
:catch_1aa
move-exception v1
move-object v3, v7
move-object v11, v2
move v2, v0
move-object v0, v1
move-object v1, v11
goto/16 :goto_c3
:catch_1b2
move-exception v1
move-object v11, v1
move-object v1, v2
move v2, v0
move-object v0, v11
goto/16 :goto_c3
:catch_1b9
move-exception v0
move-object v3, v7
move v11, v1
move-object v1, v2
move v2, v11
goto/16 :goto_c3
:catch_1c0
move-exception v0
move-object v11, v2
move v2, v1
move-object v1, v11
goto/16 :goto_c3
:cond_1c6
move v2, v10
move-object v0, v3
goto/16 :goto_135
:cond_1ca
move v8, v2
goto/16 :goto_106
:cond_1cd
move v8, v1
goto/16 :goto_6a
:cond_1d0
move v0, v10
move-object v3, v7
goto/16 :goto_a4
:cond_1d4
move-object v3, v7
goto/16 :goto_6a
:cond_1d7
move v1, v10
move-object v3, v7
goto/16 :goto_5d
.end method
.method private static c(Landroid/content/Context;)Z
.registers 2
invoke-static {p0}, Lcom/amap/api/services/a/j;->m(Landroid/content/Context;)I
move-result v0
if-nez v0, :cond_8
const/4 v0, 0x1
:goto_7
return v0
:cond_8
const/4 v0, 0x0
goto :goto_7
.end method