p.smali

.class public Lcom/fulishe/shadow/e/p;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static a:J = 0x1b7740L

.field public static b:Landroid/os/Handler;

.field public static c:Lcom/fulishe/shadow/e/o;

.field public static d:J

.field public static e:Z


# direct methods
.method public static constructor <clinit>()V
    .registers 2

    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

    sput-object v0, Lcom/fulishe/shadow/e/p;->b:Landroid/os/Handler;

    const-wide/16 v0, -0x1

    sput-wide v0, Lcom/fulishe/shadow/e/p;->d:J

    return-void
.end method

.method public static a(Landroid/location/LocationManager;)Landroid/location/Location;
    .registers 2

    const-string v0, "gps"

    invoke-static {p0, v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;Ljava/lang/String;)Landroid/location/Location;

    move-result-object v0

    if-nez v0, :cond_e

    const-string v0, "network"

    invoke-static {p0, v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;Ljava/lang/String;)Landroid/location/Location;

    move-result-object v0

    :cond_e
    if-nez v0, :cond_16

    const-string v0, "passive"

    invoke-static {p0, v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;Ljava/lang/String;)Landroid/location/Location;

    move-result-object v0

    :cond_16
    return-object v0
.end method

.method public static a(Landroid/location/LocationManager;Ljava/lang/String;)Landroid/location/Location;
    .registers 3

    :try_start_0
    invoke-virtual {p0, p1}, Landroid/location/LocationManager;->getLastKnownLocation(Ljava/lang/String;)Landroid/location/Location;
    :try_end_3
    .catchall {:try_start_0 .. :try_end_3} :catchall_5

    move-result-object v0

    :goto_4
    return-object v0

    :catchall_5
    move-exception v0

    const/4 v0, 0x0

    goto :goto_4
.end method

.method public static a(Landroid/content/Context;)Lcom/fulishe/shadow/e/o;
    .registers 5

    sget-object v0, Lcom/fulishe/shadow/e/p;->c:Lcom/fulishe/shadow/e/o;

    if-eqz v0, :cond_d

    invoke-static {p0}, Lcom/fulishe/shadow/e/p;->c(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_d

    sget-object v0, Lcom/fulishe/shadow/e/p;->c:Lcom/fulishe/shadow/e/o;

    :goto_c
    return-object v0

    :cond_d
    invoke-static {p0}, Lcom/fulishe/shadow/e/p;->d(Landroid/content/Context;)Lcom/fulishe/shadow/e/o;

    move-result-object v0

    sput-object v0, Lcom/fulishe/shadow/e/p;->c:Lcom/fulishe/shadow/e/o;

    const-string v0, "xm_lbsTime"

    const-wide/16 v2, -0x1

    invoke-static {p0, v0, v2, v3}, Lcom/fulishe/shadow/e/x;->b(Landroid/content/Context;Ljava/lang/String;J)J

    move-result-wide v0

    sput-wide v0, Lcom/fulishe/shadow/e/p;->d:J

    sget-object v0, Lcom/fulishe/shadow/e/p;->c:Lcom/fulishe/shadow/e/o;

    if-eqz v0, :cond_2a

    invoke-static {p0}, Lcom/fulishe/shadow/e/p;->c(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_2a

    sget-object v0, Lcom/fulishe/shadow/e/p;->c:Lcom/fulishe/shadow/e/o;

    goto :goto_c

    :cond_2a
    invoke-static {p0}, Lcom/fulishe/shadow/e/p;->e(Landroid/content/Context;)Lcom/fulishe/shadow/e/o;

    move-result-object v0

    goto :goto_c
.end method

.method public static a(Landroid/content/Context;Landroid/location/Location;)V
    .registers 5

    invoke-static {p1}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/Location;)Z

    move-result v0

    if-eqz v0, :cond_23

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

    move-result-wide v0

    double-to-float v0, v0

    const-string v1, "xm_lat"

    invoke-static {p0, v1, v0}, Lcom/fulishe/shadow/e/x;->a(Landroid/content/Context;Ljava/lang/String;F)V

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

    move-result-wide v0

    double-to-float v0, v0

    const-string v1, "xm_lng"

    invoke-static {p0, v1, v0}, Lcom/fulishe/shadow/e/x;->a(Landroid/content/Context;Ljava/lang/String;F)V

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

    move-result-wide v0

    const-string v2, "xm_lbsTime"

    invoke-static {p0, v2, v0, v1}, Lcom/fulishe/shadow/e/x;->a(Landroid/content/Context;Ljava/lang/String;J)V

    :cond_23
    return-void
.end method

.method public static a(Landroid/content/Context;Landroid/location/LocationManager;)V
    .registers 8

    sget-boolean v0, Lcom/fulishe/shadow/e/p;->e:Z

    if-eqz v0, :cond_5

    :cond_4
    :goto_4
    return-void

    :cond_5
    if-eqz p0, :cond_4

    if-eqz p1, :cond_4

    new-instance v0, Lcom/fulishe/shadow/e/r;

    invoke-direct {v0, p0, p1}, Lcom/fulishe/shadow/e/r;-><init>(Landroid/content/Context;Landroid/location/LocationManager;)V

    :try_start_e
    invoke-static {p1}, Lcom/fulishe/shadow/e/p;->b(Landroid/location/LocationManager;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_4

    invoke-static {}, Lcom/fulishe/shadow/base/o;->G()Lcom/fulishe/shadow/base/m;

    move-result-object v2

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

    invoke-interface {v2, p0, v3}, Lcom/fulishe/shadow/base/m;->c(Landroid/content/Context;Ljava/lang/String;)I

    move-result v2

    if-eqz v2, :cond_30

    invoke-static {}, Lcom/fulishe/shadow/base/o;->G()Lcom/fulishe/shadow/base/m;

    move-result-object v2

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

    invoke-interface {v2, p0, v3}, Lcom/fulishe/shadow/base/m;->c(Landroid/content/Context;Ljava/lang/String;)I

    move-result v2

    if-nez v2, :cond_4

    :cond_30
    const/4 v2, 0x1

    sput-boolean v2, Lcom/fulishe/shadow/e/p;->e:Z

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v2

    invoke-virtual {p1, v1, v0, v2}, Landroid/location/LocationManager;->requestSingleUpdate(Ljava/lang/String;Landroid/location/LocationListener;Landroid/os/Looper;)V

    sget-object v1, Lcom/fulishe/shadow/e/p;->b:Landroid/os/Handler;

    new-instance v2, Lcom/fulishe/shadow/e/s;

    invoke-direct {v2, p1, v0}, Lcom/fulishe/shadow/e/s;-><init>(Landroid/location/LocationManager;Landroid/location/LocationListener;)V

    const-wide/16 v4, 0x7530

    invoke-virtual {v1, v2, v4, v5}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
    :try_end_46
    .catchall {:try_start_e .. :try_end_46} :catchall_47

    goto :goto_4

    :catchall_47
    move-exception v1

    invoke-static {p1, v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;Landroid/location/LocationListener;)V

    goto :goto_4
.end method

.method public static a(Landroid/location/LocationManager;Landroid/location/LocationListener;)V
    .registers 3

    const/4 v0, 0x0

    sput-boolean v0, Lcom/fulishe/shadow/e/p;->e:Z

    if-eqz p0, :cond_a

    if-eqz p1, :cond_a

    :try_start_7
    invoke-virtual {p0, p1}, Landroid/location/LocationManager;->removeUpdates(Landroid/location/LocationListener;)V
    :try_end_a
    .catchall {:try_start_7 .. :try_end_a} :catchall_b

    :cond_a
    :goto_a
    return-void

    :catchall_b
    move-exception v0

    goto :goto_a
.end method

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

    const-wide/16 v2, 0x0

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

    move-result-wide v0

    cmpl-double v0, v0, v2

    if-eqz v0, :cond_14

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

    move-result-wide v0

    cmpl-double v0, v0, v2

    if-eqz v0, :cond_14

    const/4 v0, 0x1

    :goto_13
    return v0

    :cond_14
    const/4 v0, 0x0

    goto :goto_13
.end method

.method public static b(Landroid/content/Context;)J
    .registers 3

    sget-wide v0, Lcom/fulishe/shadow/e/p;->d:J

    return-wide v0
.end method

.method public static b(Landroid/location/LocationManager;)Ljava/lang/String;
    .registers 2

    const-string v0, "gps"

    invoke-virtual {p0, v0}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_b

    const-string v0, "gps"

    :goto_a
    return-object v0

    :cond_b
    const-string v0, "network"

    invoke-virtual {p0, v0}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_16

    const-string v0, "network"

    goto :goto_a

    :cond_16
    const-string v0, "passive"

    invoke-virtual {p0, v0}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_21

    const-string v0, "passive"

    goto :goto_a

    :cond_21
    const/4 v0, 0x0

    goto :goto_a
.end method

.method public static synthetic b(Landroid/content/Context;Landroid/location/Location;)V
    .registers 2

    invoke-static {p0, p1}, Lcom/fulishe/shadow/e/p;->a(Landroid/content/Context;Landroid/location/Location;)V

    return-void
.end method

.method public static synthetic b(Landroid/content/Context;Landroid/location/LocationManager;)V
    .registers 2

    invoke-static {p0, p1}, Lcom/fulishe/shadow/e/p;->a(Landroid/content/Context;Landroid/location/LocationManager;)V

    return-void
.end method

.method public static synthetic b(Landroid/location/LocationManager;Landroid/location/LocationListener;)V
    .registers 2

    invoke-static {p0, p1}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;Landroid/location/LocationListener;)V

    return-void
.end method

.method public static synthetic b(Landroid/location/Location;)Z
    .registers 2

    invoke-static {p0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/Location;)Z

    move-result v0

    return v0
.end method

.method public static c(Landroid/content/Context;)Z
    .registers 5

    sget-wide v0, Lcom/fulishe/shadow/e/p;->d:J

    const-wide/16 v2, -0x1

    cmp-long v0, v0, v2

    if-eqz v0, :cond_15

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

    move-result-wide v0

    sget-wide v2, Lcom/fulishe/shadow/e/p;->d:J

    sub-long/2addr v0, v2

    sget-wide v2, Lcom/fulishe/shadow/e/p;->a:J

    cmp-long v0, v0, v2

    if-lez v0, :cond_17

    :cond_15
    const/4 v0, 0x1

    :goto_16
    return v0

    :cond_17
    const/4 v0, 0x0

    goto :goto_16
.end method

.method public static d(Landroid/content/Context;)Lcom/fulishe/shadow/e/o;
    .registers 5

    const/high16 v3, -0x40800000    # -1.0f

    const-string v0, "xm_lat"

    invoke-static {p0, v0, v3}, Lcom/fulishe/shadow/e/x;->b(Landroid/content/Context;Ljava/lang/String;F)F

    move-result v1

    const-string v0, "xm_lng"

    invoke-static {p0, v0, v3}, Lcom/fulishe/shadow/e/x;->b(Landroid/content/Context;Ljava/lang/String;F)F

    move-result v2

    cmpl-float v0, v1, v3

    if-eqz v0, :cond_16

    cmpl-float v0, v2, v3

    if-nez v0, :cond_18

    :cond_16
    const/4 v0, 0x0

    :goto_17
    return-object v0

    :cond_18
    new-instance v0, Lcom/fulishe/shadow/e/o;

    invoke-direct {v0, v1, v2}, Lcom/fulishe/shadow/e/o;-><init>(FF)V

    goto :goto_17
.end method

.method public static e(Landroid/content/Context;)Lcom/fulishe/shadow/e/o;
    .registers 9

    const/4 v1, 0x0

    const-string v0, "location"

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

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    if-nez v0, :cond_d

    move-object v0, v1

    :goto_c
    return-object v0

    :cond_d
    :try_start_d
    invoke-static {v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/LocationManager;)Landroid/location/Location;

    move-result-object v3

    if-eqz v3, :cond_4f

    invoke-static {v3}, Lcom/fulishe/shadow/e/p;->a(Landroid/location/Location;)Z

    move-result v2

    if-eqz v2, :cond_4f

    invoke-static {p0, v3}, Lcom/fulishe/shadow/e/p;->a(Landroid/content/Context;Landroid/location/Location;)V

    new-instance v2, Lcom/fulishe/shadow/e/o;

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

    move-result-wide v4

    double-to-float v4, v4

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

    move-result-wide v6

    double-to-float v3, v6

    invoke-direct {v2, v4, v3}, Lcom/fulishe/shadow/e/o;-><init>(FF)V

    :goto_2b
    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v3

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v4

    if-eq v3, v4, :cond_48

    new-instance v3, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v4

    invoke-direct {v3, v4}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    new-instance v4, Lcom/fulishe/shadow/e/q;

    invoke-direct {v4, p0, v0}, Lcom/fulishe/shadow/e/q;-><init>(Landroid/content/Context;Landroid/location/LocationManager;)V

    invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :goto_46
    move-object v0, v2

    goto :goto_c

    :cond_48
    invoke-static {p0, v0}, Lcom/fulishe/shadow/e/p;->a(Landroid/content/Context;Landroid/location/LocationManager;)V
    :try_end_4b
    .catchall {:try_start_d .. :try_end_4b} :catchall_4c

    goto :goto_46

    :catchall_4c
    move-exception v0

    move-object v0, v1

    goto :goto_c

    :cond_4f
    move-object v2, v1

    goto :goto_2b
.end method