b.smali

.class public final Lcom/sdk/plus/a/c/b;
.super Ljava/lang/Object;


# instance fields
.field a:Lcom/sdk/plus/a/c/c;

.field protected b:Landroid/location/Location;

.field c:J

.field d:J

.field e:I

.field private f:Landroid/location/LocationManager;

.field private g:Landroid/location/GpsStatus$Listener;


# direct methods
.method public constructor <init>()V
    .registers 5

    const-wide/16 v0, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-wide v0, p0, Lcom/sdk/plus/a/c/b;->c:J

    iput-wide v0, p0, Lcom/sdk/plus/a/c/b;->d:J

    const/4 v0, 0x0

    iput v0, p0, Lcom/sdk/plus/a/c/b;->e:I

    new-instance v0, Lcom/sdk/plus/a/c/b$1;

    invoke-direct {v0, p0}, Lcom/sdk/plus/a/c/b$1;-><init>(Lcom/sdk/plus/a/c/b;)V

    iput-object v0, p0, Lcom/sdk/plus/a/c/b;->g:Landroid/location/GpsStatus$Listener;

    :try_start_13
    sget-object v0, Lcom/sdk/plus/c/b;->c:Landroid/content/Context;

    const-string v1, "location"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    iput-object v0, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    invoke-static {}, Lcom/sdk/plus/j/b;->a()Z

    move-result v0

    const-string v1, "WUS_LA"

    const-string v2, "loc init checkSafe = "

    invoke-static {v0}, Ljava/lang/String;->valueOf(Z)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/sdk/plus/h/d;->a(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v0, :cond_45

    iget-object v0, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    if-eqz v0, :cond_45

    invoke-direct {p0}, Lcom/sdk/plus/a/c/b;->b()Z

    move-result v0

    if-eqz v0, :cond_45

    iget-object v0, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    iget-object v1, p0, Lcom/sdk/plus/a/c/b;->g:Landroid/location/GpsStatus$Listener;

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->addGpsStatusListener(Landroid/location/GpsStatus$Listener;)Z
    :try_end_45
    .catch Ljava/lang/Throwable; {:try_start_13 .. :try_end_45} :catch_46

    :cond_45
    :goto_45
    return-void

    :catch_46
    move-exception v0

    goto :goto_45
.end method

.method private static a(Landroid/location/Location;)Z
    .registers 5

    const-wide/16 v2, 0x0

    if-eqz p0, :cond_26

    invoke-virtual {p0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v0

    cmpl-double v0, v0, v2

    if-nez v0, :cond_26

    invoke-virtual {p0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v0

    cmpl-double v0, v0, v2

    if-nez v0, :cond_26

    invoke-virtual {p0}, Landroid/location/Location;->getTime()J

    move-result-wide v0

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_26

    invoke-virtual {p0}, Landroid/location/Location;->hasAccuracy()Z

    move-result v0

    if-nez v0, :cond_26

    const/4 v0, 0x1

    :goto_25
    return v0

    :cond_26
    const/4 v0, 0x0

    goto :goto_25
.end method

.method private b()Z
    .registers 8

    const/4 v1, 0x1

    const/4 v0, 0x0

    invoke-static {}, Lcom/sdk/plus/a/c/b;->c()Z

    move-result v2

    if-eqz v2, :cond_42

    const-string v2, "com.huawei.android.hwouc"

    invoke-static {v2}, Lcom/sdk/plus/j/i;->c(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_45

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    sget-wide v4, Lcom/sdk/plus/c/d;->h:J

    sub-long/2addr v2, v4

    sget v4, Lcom/sdk/plus/c/c;->C:I

    mul-int/lit8 v4, v4, 0x18

    mul-int/lit8 v4, v4, 0x3c

    mul-int/lit8 v4, v4, 0x3c

    mul-int/lit16 v4, v4, 0x3e8

    int-to-long v4, v4

    sget-boolean v6, Lcom/sdk/plus/c/c;->B:Z

    if-eqz v6, :cond_42

    cmp-long v2, v2, v4

    if-lez v2, :cond_42

    iget-object v2, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    const-string v3, "network"

    invoke-virtual {v2, v3}, Landroid/location/LocationManager;->getLastKnownLocation(Ljava/lang/String;)Landroid/location/Location;

    move-result-object v2

    invoke-static {v2}, Lcom/sdk/plus/a/c/b;->a(Landroid/location/Location;)Z

    move-result v2

    if-eqz v2, :cond_43

    invoke-static {}, Lcom/sdk/plus/e/a/c;->a()Lcom/sdk/plus/e/a/c;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-static {v2, v3}, Lcom/sdk/plus/e/a/c;->a(J)V

    :cond_42
    :goto_42
    return v0

    :cond_43
    move v0, v1

    goto :goto_42

    :cond_45
    move v0, v1

    goto :goto_42
.end method

.method private static c()Z
    .registers 1

    const-string v0, "android.permission.ACCESS_FINE_LOCATION"

    invoke-static {v0}, Lcom/sdk/plus/j/i;->e(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_12

    const-string v0, "android.permission.ACCESS_COARSE_LOCATION"

    invoke-static {v0}, Lcom/sdk/plus/j/i;->e(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_12

    const/4 v0, 0x1

    :goto_11
    return v0

    :cond_12
    const/4 v0, 0x0

    goto :goto_11
.end method


# virtual methods
.method protected final a(Z)Landroid/location/Location;
    .registers 5

    const/4 v0, 0x0

    :try_start_1
    iget-object v1, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    if-eqz v1, :cond_15

    invoke-direct {p0}, Lcom/sdk/plus/a/c/b;->b()Z

    move-result v1

    if-eqz v1, :cond_15

    if-eqz p1, :cond_16

    iget-object v1, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    const-string v2, "gps"

    invoke-virtual {v1, v2}, Landroid/location/LocationManager;->getLastKnownLocation(Ljava/lang/String;)Landroid/location/Location;

    move-result-object v0

    :cond_15
    :goto_15
    return-object v0

    :cond_16
    iget-object v1, p0, Lcom/sdk/plus/a/c/b;->f:Landroid/location/LocationManager;

    const-string v2, "network"

    invoke-virtual {v1, v2}, Landroid/location/LocationManager;->getLastKnownLocation(Ljava/lang/String;)Landroid/location/Location;
    :try_end_1d
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1d} :catch_1f

    move-result-object v0

    goto :goto_15

    :catch_1f
    move-exception v1

    goto :goto_15
.end method

.method protected final a()Lcom/sdk/plus/b/b;
    .registers 11

    const/4 v7, 0x0

    const/4 v5, 0x3

    const/4 v4, 0x0

    :try_start_3
    invoke-direct {p0}, Lcom/sdk/plus/a/c/b;->b()Z

    move-result v1

    if-eqz v1, :cond_8f

    sget-object v1, Lcom/sdk/plus/c/b;->c:Landroid/content/Context;

    const-string v2, "phone"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/telephony/TelephonyManager;

    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getSimState()I

    move-result v2

    const/4 v3, 0x5

    if-ne v2, v3, :cond_99

    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v2

    if-eqz v2, :cond_96

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v3

    if-lt v3, v5, :cond_96

    const/4 v3, 0x0

    const/4 v5, 0x3

    invoke-virtual {v2, v3, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v8

    const/4 v3, 0x3

    invoke-virtual {v2, v3}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
    :try_end_38
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_38} :catch_8e

    move-result v6

    :goto_39
    :try_start_39
    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getCellLocation()Landroid/telephony/CellLocation;

    move-result-object v3

    instance-of v2, v3, Landroid/telephony/gsm/GsmCellLocation;

    if-eqz v2, :cond_69

    move-object v0, v3

    check-cast v0, Landroid/telephony/gsm/GsmCellLocation;

    move-object v2, v0

    invoke-virtual {v2}, Landroid/telephony/gsm/GsmCellLocation;->getLac()I
    :try_end_48
    .catch Ljava/lang/Exception; {:try_start_39 .. :try_end_48} :catch_89
    .catch Ljava/lang/Throwable; {:try_start_39 .. :try_end_48} :catch_8e

    move-result v5

    :try_start_49
    check-cast v3, Landroid/telephony/gsm/GsmCellLocation;

    invoke-virtual {v3}, Landroid/telephony/gsm/GsmCellLocation;->getCid()I
    :try_end_4e
    .catch Ljava/lang/Exception; {:try_start_49 .. :try_end_4e} :catch_91
    .catch Ljava/lang/Throwable; {:try_start_49 .. :try_end_4e} :catch_8e

    move-result v4

    move v2, v5

    move v3, v6

    :goto_51
    :try_start_51
    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getNeighboringCellInfo()Ljava/util/List;

    move-result-object v1

    move v5, v3

    move v6, v8

    move v3, v2

    move-object v2, v1

    :goto_59
    new-instance v1, Lcom/sdk/plus/b/b;

    invoke-direct {v1}, Lcom/sdk/plus/b/b;-><init>()V

    iput v6, v1, Lcom/sdk/plus/b/b;->a:I

    iput v5, v1, Lcom/sdk/plus/b/b;->b:I

    iput v3, v1, Lcom/sdk/plus/b/b;->c:I

    iput v4, v1, Lcom/sdk/plus/b/b;->d:I

    iput-object v2, v1, Lcom/sdk/plus/b/b;->e:Ljava/util/List;
    :try_end_68
    .catch Ljava/lang/Throwable; {:try_start_51 .. :try_end_68} :catch_8e

    :goto_68
    return-object v1

    :cond_69
    :try_start_69
    instance-of v2, v3, Landroid/telephony/cdma/CdmaCellLocation;

    if-eqz v2, :cond_93

    move-object v0, v3

    check-cast v0, Landroid/telephony/cdma/CdmaCellLocation;

    move-object v2, v0

    invoke-virtual {v2}, Landroid/telephony/cdma/CdmaCellLocation;->getNetworkId()I
    :try_end_74
    .catch Ljava/lang/Exception; {:try_start_69 .. :try_end_74} :catch_89
    .catch Ljava/lang/Throwable; {:try_start_69 .. :try_end_74} :catch_8e

    move-result v5

    :try_start_75
    move-object v0, v3

    check-cast v0, Landroid/telephony/cdma/CdmaCellLocation;

    move-object v2, v0

    invoke-virtual {v2}, Landroid/telephony/cdma/CdmaCellLocation;->getSystemId()I

    move-result v6

    check-cast v3, Landroid/telephony/cdma/CdmaCellLocation;

    invoke-virtual {v3}, Landroid/telephony/cdma/CdmaCellLocation;->getBaseStationId()I
    :try_end_82
    .catch Ljava/lang/Exception; {:try_start_75 .. :try_end_82} :catch_91
    .catch Ljava/lang/Throwable; {:try_start_75 .. :try_end_82} :catch_8e

    move-result v2

    move v4, v5

    move v3, v6

    :goto_85
    move v9, v2

    move v2, v4

    move v4, v9

    goto :goto_51

    :catch_89
    move-exception v2

    move v5, v4

    :goto_8b
    move v2, v5

    move v3, v6

    goto :goto_51

    :catch_8e
    move-exception v1

    :cond_8f
    move-object v1, v7

    goto :goto_68

    :catch_91
    move-exception v2

    goto :goto_8b

    :cond_93
    move v2, v4

    move v3, v6

    goto :goto_85

    :cond_96
    move v6, v4

    move v8, v4

    goto :goto_39

    :cond_99
    move-object v2, v7

    move v3, v4

    move v5, v4

    move v6, v4

    goto :goto_59
.end method