a.smali
.class public Lcom/fulishe/shadow/d/a;
.super Ljava/lang/Object;
.source ""
# static fields
.field public static volatile a:Lcom/fulishe/shadow/d/a;
.field public static b:Landroid/telephony/TelephonyManager;
.field public static c:Lcom/fulishe/shadow/d/a/a;
# instance fields
.field public d:Landroid/content/Context;
.field public e:Ljava/util/concurrent/CopyOnWriteArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/concurrent/CopyOnWriteArrayList",
"<",
"Landroid/telephony/CellInfo;",
">;"
}
.end annotation
.end field
.field public f:Landroid/os/Handler;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.registers 4
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList;
invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;-><init>()V
iput-object v0, p0, Lcom/fulishe/shadow/d/a;->e:Ljava/util/concurrent/CopyOnWriteArrayList;
new-instance v0, Landroid/os/Handler;
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v1
invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
iput-object v0, p0, Lcom/fulishe/shadow/d/a;->f:Landroid/os/Handler;
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
iput-object v0, p0, Lcom/fulishe/shadow/d/a;->d:Landroid/content/Context;
const-string v0, "phone"
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/TelephonyManager;
sput-object v0, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
return-void
.end method
.method public static synthetic a()Landroid/telephony/TelephonyManager;
.registers 1
sget-object v0, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
return-object v0
.end method
.method private a(Landroid/telephony/cdma/CdmaCellLocation;Ljava/lang/String;)Lcom/fulishe/shadow/d/a/a;
.registers 8
const/4 v4, 0x3
const/4 v0, -0x1
invoke-virtual {p1}, Landroid/telephony/cdma/CdmaCellLocation;->getNetworkId()I
move-result v1
invoke-virtual {p1}, Landroid/telephony/cdma/CdmaCellLocation;->getBaseStationId()I
move-result v2
if-eq v1, v0, :cond_e
if-ne v2, v0, :cond_10
:cond_e
const/4 v0, 0x0
:goto_f
return-object v0
:cond_10
new-instance v0, Lcom/fulishe/shadow/d/a/a;
invoke-direct {v0}, Lcom/fulishe/shadow/d/a/a;-><init>()V
const-string v3, "cdma"
iput-object v3, v0, Lcom/fulishe/shadow/d/a/a;->f:Ljava/lang/String;
invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->c:Ljava/lang/String;
invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->d:Ljava/lang/String;
if-eqz p2, :cond_34
invoke-virtual {p2}, Ljava/lang/String;->length()I
move-result v1
if-lt v1, v4, :cond_34
const/4 v1, 0x0
invoke-virtual {p2, v1, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->a:Ljava/lang/String;
:cond_34
invoke-virtual {p1}, Landroid/telephony/cdma/CdmaCellLocation;->getSystemId()I
move-result v1
invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->b:Ljava/lang/String;
goto :goto_f
.end method
.method private a(Landroid/telephony/gsm/GsmCellLocation;Ljava/lang/String;)Lcom/fulishe/shadow/d/a/a;
.registers 9
const/4 v5, 0x5
const/4 v4, 0x3
const/4 v0, -0x1
invoke-virtual {p1}, Landroid/telephony/gsm/GsmCellLocation;->getLac()I
move-result v1
invoke-virtual {p1}, Landroid/telephony/gsm/GsmCellLocation;->getCid()I
move-result v2
if-eq v1, v0, :cond_f
if-ne v2, v0, :cond_11
:cond_f
const/4 v0, 0x0
:cond_10
:goto_10
return-object v0
:cond_11
new-instance v0, Lcom/fulishe/shadow/d/a/a;
invoke-direct {v0}, Lcom/fulishe/shadow/d/a/a;-><init>()V
const-string v3, "gsm"
iput-object v3, v0, Lcom/fulishe/shadow/d/a/a;->f:Ljava/lang/String;
invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->c:Ljava/lang/String;
invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->d:Ljava/lang/String;
if-eqz p2, :cond_10
invoke-virtual {p2}, Ljava/lang/String;->length()I
move-result v1
if-lt v1, v5, :cond_10
const/4 v1, 0x0
invoke-virtual {p2, v1, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->a:Ljava/lang/String;
invoke-virtual {p2, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v1
iput-object v1, v0, Lcom/fulishe/shadow/d/a/a;->b:Ljava/lang/String;
goto :goto_10
.end method
.method public static a(Landroid/content/Context;)Lcom/fulishe/shadow/d/a;
.registers 3
sget-object v0, Lcom/fulishe/shadow/d/a;->a:Lcom/fulishe/shadow/d/a;
if-nez v0, :cond_13
const-class v1, Lcom/fulishe/shadow/d/a;
monitor-enter v1
:try_start_7
sget-object v0, Lcom/fulishe/shadow/d/a;->a:Lcom/fulishe/shadow/d/a;
if-nez v0, :cond_12
new-instance v0, Lcom/fulishe/shadow/d/a;
invoke-direct {v0, p0}, Lcom/fulishe/shadow/d/a;-><init>(Landroid/content/Context;)V
sput-object v0, Lcom/fulishe/shadow/d/a;->a:Lcom/fulishe/shadow/d/a;
:cond_12
monitor-exit v1
:try_end_13
.catchall {:try_start_7 .. :try_end_13} :catchall_16
:cond_13
sget-object v0, Lcom/fulishe/shadow/d/a;->a:Lcom/fulishe/shadow/d/a;
return-object v0
:catchall_16
move-exception v0
:try_start_17
monitor-exit v1
:try_end_18
.catchall {:try_start_17 .. :try_end_18} :catchall_16
throw v0
.end method
.method public static synthetic a(Lcom/fulishe/shadow/d/a;)Ljava/util/concurrent/CopyOnWriteArrayList;
.registers 2
iget-object v0, p0, Lcom/fulishe/shadow/d/a;->e:Ljava/util/concurrent/CopyOnWriteArrayList;
return-object v0
.end method
.method private a(I)Z
.registers 3
const v0, 0x7fffffff
if-ne p1, v0, :cond_7
const/4 v0, 0x1
:goto_6
return v0
:cond_7
const/4 v0, 0x0
goto :goto_6
.end method
.method private d()Lorg/json/JSONArray;
.registers 3
new-instance v0, Lorg/json/JSONArray;
invoke-direct {v0}, Lorg/json/JSONArray;-><init>()V
sget-object v1, Lcom/fulishe/shadow/d/a;->c:Lcom/fulishe/shadow/d/a/a;
if-eqz v1, :cond_10
invoke-virtual {v1}, Lcom/fulishe/shadow/d/a/a;->a()Lorg/json/JSONObject;
move-result-object v1
invoke-virtual {v0, v1}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
:cond_10
return-object v0
.end method
# virtual methods
.method public b()Lorg/json/JSONArray;
.registers 14
const/4 v11, 0x3
const/4 v0, 0x0
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x1a
if-lt v1, v2, :cond_16b
iget-object v1, p0, Lcom/fulishe/shadow/d/a;->e:Ljava/util/concurrent/CopyOnWriteArrayList;
if-eqz v1, :cond_12
invoke-virtual {v1}, Ljava/util/concurrent/CopyOnWriteArrayList;->isEmpty()Z
move-result v1
if-eqz v1, :cond_17
:cond_12
invoke-direct {p0}, Lcom/fulishe/shadow/d/a;->d()Lorg/json/JSONArray;
move-result-object v0
:goto_16
return-object v0
:cond_17
new-instance v2, Lorg/json/JSONArray;
invoke-direct {v2}, Lorg/json/JSONArray;-><init>()V
:try_start_1c
iget-object v1, p0, Lcom/fulishe/shadow/d/a;->e:Ljava/util/concurrent/CopyOnWriteArrayList;
invoke-virtual {v1}, Ljava/util/concurrent/CopyOnWriteArrayList;->iterator()Ljava/util/Iterator;
move-result-object v5
move v4, v0
:cond_23
:goto_23
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_33
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/telephony/CellInfo;
const/16 v1, 0xa
if-lt v4, v1, :cond_35
:cond_33
:goto_33
move-object v0, v2
goto :goto_16
:cond_35
const/4 v1, 0x0
instance-of v3, v0, Landroid/telephony/CellInfoGsm;
if-eqz v3, :cond_9e
check-cast v0, Landroid/telephony/CellInfoGsm;
invoke-virtual {v0}, Landroid/telephony/CellInfoGsm;->getCellIdentity()Landroid/telephony/CellIdentityGsm;
move-result-object v3
invoke-virtual {v3}, Landroid/telephony/CellIdentityGsm;->getLac()I
move-result v6
invoke-virtual {v3}, Landroid/telephony/CellIdentityGsm;->getCid()I
move-result v7
invoke-direct {p0, v6}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
invoke-direct {p0, v7}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
new-instance v1, Lcom/fulishe/shadow/d/a/a;
invoke-direct {v1}, Lcom/fulishe/shadow/d/a/a;-><init>()V
const-string v8, "gsm"
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->f:Ljava/lang/String;
invoke-virtual {v3}, Landroid/telephony/CellIdentityGsm;->getMcc()I
move-result v8
invoke-static {v8}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v8
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->a:Ljava/lang/String;
invoke-virtual {v3}, Landroid/telephony/CellIdentityGsm;->getMnc()I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->b:Ljava/lang/String;
invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->c:Ljava/lang/String;
invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->d:Ljava/lang/String;
invoke-virtual {v0}, Landroid/telephony/CellInfoGsm;->getCellSignalStrength()Landroid/telephony/CellSignalStrengthGsm;
move-result-object v0
if-eqz v0, :cond_177
invoke-virtual {v0}, Landroid/telephony/CellSignalStrengthGsm;->getAsuLevel()I
move-result v0
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
move-object v3, v1
move-object v12, v0
move-object v0, v1
move-object v1, v12
:goto_8f
iput-object v1, v3, Lcom/fulishe/shadow/d/a/a;->e:Ljava/lang/String;
:goto_91
if-eqz v0, :cond_23
invoke-virtual {v0}, Lcom/fulishe/shadow/d/a/a;->a()Lorg/json/JSONObject;
move-result-object v0
invoke-virtual {v2, v0}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
add-int/lit8 v0, v4, 0x1
move v4, v0
goto :goto_23
:cond_9e
instance-of v3, v0, Landroid/telephony/CellInfoLte;
if-eqz v3, :cond_f8
check-cast v0, Landroid/telephony/CellInfoLte;
invoke-virtual {v0}, Landroid/telephony/CellInfoLte;->getCellIdentity()Landroid/telephony/CellIdentityLte;
move-result-object v3
invoke-virtual {v3}, Landroid/telephony/CellIdentityLte;->getTac()I
move-result v6
invoke-virtual {v3}, Landroid/telephony/CellIdentityLte;->getCi()I
move-result v7
invoke-direct {p0, v6}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
invoke-direct {p0, v7}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
new-instance v1, Lcom/fulishe/shadow/d/a/a;
invoke-direct {v1}, Lcom/fulishe/shadow/d/a/a;-><init>()V
const-string v8, "lte"
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->f:Ljava/lang/String;
invoke-virtual {v3}, Landroid/telephony/CellIdentityLte;->getMcc()I
move-result v8
invoke-static {v8}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v8
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->a:Ljava/lang/String;
invoke-virtual {v3}, Landroid/telephony/CellIdentityLte;->getMnc()I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->b:Ljava/lang/String;
invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->c:Ljava/lang/String;
invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->d:Ljava/lang/String;
invoke-virtual {v0}, Landroid/telephony/CellInfoLte;->getCellSignalStrength()Landroid/telephony/CellSignalStrengthLte;
move-result-object v0
if-eqz v0, :cond_174
invoke-virtual {v0}, Landroid/telephony/CellSignalStrengthLte;->getAsuLevel()I
move-result v0
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
move-object v3, v1
move-object v12, v0
move-object v0, v1
move-object v1, v12
goto :goto_8f
:cond_f8
instance-of v3, v0, Landroid/telephony/CellInfoCdma;
if-eqz v3, :cond_162
check-cast v0, Landroid/telephony/CellInfoCdma;
invoke-virtual {v0}, Landroid/telephony/CellInfoCdma;->getCellIdentity()Landroid/telephony/CellIdentityCdma;
move-result-object v3
invoke-virtual {v3}, Landroid/telephony/CellIdentityCdma;->getNetworkId()I
move-result v6
invoke-virtual {v3}, Landroid/telephony/CellIdentityCdma;->getBasestationId()I
move-result v7
invoke-direct {p0, v6}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
invoke-direct {p0, v7}, Lcom/fulishe/shadow/d/a;->a(I)Z
move-result v1
if-nez v1, :cond_23
new-instance v1, Lcom/fulishe/shadow/d/a/a;
invoke-direct {v1}, Lcom/fulishe/shadow/d/a/a;-><init>()V
const-string v8, "cdma"
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->f:Ljava/lang/String;
sget-object v8, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
if-eqz v8, :cond_139
sget-object v8, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
invoke-virtual {v8}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;
move-result-object v8
if-eqz v8, :cond_139
invoke-virtual {v8}, Ljava/lang/String;->length()I
move-result v9
if-lt v9, v11, :cond_139
const/4 v9, 0x0
const/4 v10, 0x3
invoke-virtual {v8, v9, v10}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v8
iput-object v8, v1, Lcom/fulishe/shadow/d/a/a;->a:Ljava/lang/String;
:cond_139
invoke-virtual {v3}, Landroid/telephony/CellIdentityCdma;->getSystemId()I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->b:Ljava/lang/String;
invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->c:Ljava/lang/String;
invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
iput-object v3, v1, Lcom/fulishe/shadow/d/a/a;->d:Ljava/lang/String;
invoke-virtual {v0}, Landroid/telephony/CellInfoCdma;->getCellSignalStrength()Landroid/telephony/CellSignalStrengthCdma;
move-result-object v0
if-eqz v0, :cond_171
invoke-virtual {v0}, Landroid/telephony/CellSignalStrengthCdma;->getAsuLevel()I
move-result v0
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
iput-object v0, v1, Lcom/fulishe/shadow/d/a/a;->e:Ljava/lang/String;
:try_end_15f
.catch Ljava/lang/Exception; {:try_start_1c .. :try_end_15f} :catch_165
move-object v0, v1
goto/16 :goto_91
:cond_162
move-object v0, v1
goto/16 :goto_91
:catch_165
move-exception v0
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto/16 :goto_33
:cond_16b
invoke-direct {p0}, Lcom/fulishe/shadow/d/a;->d()Lorg/json/JSONArray;
move-result-object v0
goto/16 :goto_16
:cond_171
move-object v0, v1
goto/16 :goto_91
:cond_174
move-object v0, v1
goto/16 :goto_91
:cond_177
move-object v0, v1
goto/16 :goto_91
.end method
.method public c()V
.registers 5
:try_start_0
iget-object v1, p0, Lcom/fulishe/shadow/d/a;->d:Landroid/content/Context;
if-nez v1, :cond_5
:cond_4
:goto_4
return-void
:cond_5
sget-object v0, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
if-eqz v0, :cond_4
const-string v0, "android.permission.ACCESS_COARSE_LOCATION"
invoke-static {v1, v0}, Landroid/support/v4/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
:try_end_e
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_e} :catch_3c
move-result v0
if-nez v0, :cond_4
:try_start_11
sget-object v0, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getCellLocation()Landroid/telephony/CellLocation;
move-result-object v0
if-eqz v0, :cond_2b
sget-object v2, Lcom/fulishe/shadow/d/a;->b:Landroid/telephony/TelephonyManager;
invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;
move-result-object v2
instance-of v3, v0, Landroid/telephony/gsm/GsmCellLocation;
if-eqz v3, :cond_41
check-cast v0, Landroid/telephony/gsm/GsmCellLocation;
invoke-direct {p0, v0, v2}, Lcom/fulishe/shadow/d/a;->a(Landroid/telephony/gsm/GsmCellLocation;Ljava/lang/String;)Lcom/fulishe/shadow/d/a/a;
move-result-object v0
:goto_29
sput-object v0, Lcom/fulishe/shadow/d/a;->c:Lcom/fulishe/shadow/d/a/a;
:try_end_2b
.catch Ljava/lang/Exception; {:try_start_11 .. :try_end_2b} :catch_4c
:cond_2b
:goto_2b
:try_start_2b
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x1a
if-lt v0, v2, :cond_4
iget-object v0, p0, Lcom/fulishe/shadow/d/a;->f:Landroid/os/Handler;
new-instance v2, Lcom/fulishe/shadow/d/b;
invoke-direct {v2, p0, v1}, Lcom/fulishe/shadow/d/b;-><init>(Lcom/fulishe/shadow/d/a;Landroid/content/Context;)V
invoke-virtual {v0, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
:try_end_3b
.catch Ljava/lang/Exception; {:try_start_2b .. :try_end_3b} :catch_3c
goto :goto_4
:catch_3c
move-exception v0
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_4
:cond_41
:try_start_41
instance-of v3, v0, Landroid/telephony/cdma/CdmaCellLocation;
if-eqz v3, :cond_2b
check-cast v0, Landroid/telephony/cdma/CdmaCellLocation;
invoke-direct {p0, v0, v2}, Lcom/fulishe/shadow/d/a;->a(Landroid/telephony/cdma/CdmaCellLocation;Ljava/lang/String;)Lcom/fulishe/shadow/d/a/a;
:try_end_4a
.catch Ljava/lang/Exception; {:try_start_41 .. :try_end_4a} :catch_4c
move-result-object v0
goto :goto_29
:catch_4c
move-exception v0
:try_start_4d
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
:try_end_50
.catch Ljava/lang/Exception; {:try_start_4d .. :try_end_50} :catch_3c
goto :goto_2b
.end method