co.smali
.class public final Lcom/loc/co;
.super Ljava/lang/Object;
# static fields
.field public static b:Lcom/loc/br;
.field public static g:J
# instance fields
.field a:Ljava/lang/String;
.field c:Lcom/loc/br;
.field d:Lcom/loc/br;
.field e:Lcom/loc/g;
.field f:J
.field h:Z
.field private i:Landroid/content/Context;
# direct methods
.method static constructor <clinit>()V
.registers 2
const/4 v0, 0x0
sput-object v0, Lcom/loc/co;->b:Lcom/loc/br;
const-wide/16 v0, 0x0
sput-wide v0, Lcom/loc/co;->g:J
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 4
const/4 v0, 0x0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lcom/loc/co;->a:Ljava/lang/String;
iput-object v0, p0, Lcom/loc/co;->c:Lcom/loc/br;
iput-object v0, p0, Lcom/loc/co;->d:Lcom/loc/br;
iput-object v0, p0, Lcom/loc/co;->e:Lcom/loc/g;
const-wide/16 v0, 0x0
iput-wide v0, p0, Lcom/loc/co;->f:J
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/loc/co;->h:Z
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
iput-object v0, p0, Lcom/loc/co;->i:Landroid/content/Context;
return-void
.end method
.method private e()V
.registers 5
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
if-eqz v0, :cond_12
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v0
sget-wide v2, Lcom/loc/co;->g:J
sub-long/2addr v0, v2
const-wide/32 v2, 0x2bf20
cmp-long v0, v0, v2
if-lez v0, :cond_2a
:cond_12
invoke-direct {p0}, Lcom/loc/co;->f()Lcom/loc/br;
move-result-object v0
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v2
sput-wide v2, Lcom/loc/co;->g:J
if-eqz v0, :cond_2a
invoke-virtual {v0}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v1
invoke-static {v1}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z
move-result v1
if-eqz v1, :cond_2a
sput-object v0, Lcom/loc/co;->b:Lcom/loc/br;
:cond_2a
return-void
.end method
.method private f()Lcom/loc/br;
.registers 7
const/4 v1, 0x0
iget-object v0, p0, Lcom/loc/co;->i:Landroid/content/Context;
if-nez v0, :cond_7
move-object v0, v1
:cond_6
:goto_6
return-object v0
:cond_7
invoke-virtual {p0}, Lcom/loc/co;->a()V
:try_start_a
iget-object v0, p0, Lcom/loc/co;->e:Lcom/loc/g;
if-nez v0, :cond_10
move-object v0, v1
goto :goto_6
:cond_10
iget-object v0, p0, Lcom/loc/co;->e:Lcom/loc/g;
const-string/jumbo v2, "_id=1"
const-class v3, Lcom/loc/br;
invoke-virtual {v0, v2, v3}, Lcom/loc/g;->b(Ljava/lang/String;Ljava/lang/Class;)Ljava/util/List;
move-result-object v0
if-eqz v0, :cond_a2
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v2
if-lez v2, :cond_a2
const/4 v2, 0x0
invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/loc/br;
:try_end_2a
.catch Ljava/lang/Throwable; {:try_start_a .. :try_end_2a} :catch_9b
:try_start_2a
invoke-virtual {v0}, Lcom/loc/br;->c()Ljava/lang/String;
move-result-object v2
invoke-static {v2}, Lcom/loc/cu;->b(Ljava/lang/String;)[B
move-result-object v2
if-eqz v2, :cond_a0
array-length v3, v2
if-lez v3, :cond_a0
iget-object v3, p0, Lcom/loc/co;->a:Ljava/lang/String;
invoke-static {v2, v3}, Lcom/loc/bn;->d([BLjava/lang/String;)[B
move-result-object v3
if-eqz v3, :cond_a0
array-length v2, v3
if-lez v2, :cond_a0
new-instance v2, Ljava/lang/String;
const-string/jumbo v4, "UTF-8"
invoke-direct {v2, v3, v4}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
:goto_4a
invoke-virtual {v0}, Lcom/loc/br;->b()Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Lcom/loc/cu;->b(Ljava/lang/String;)[B
move-result-object v3
if-eqz v3, :cond_6a
array-length v4, v3
if-lez v4, :cond_6a
iget-object v4, p0, Lcom/loc/co;->a:Ljava/lang/String;
invoke-static {v3, v4}, Lcom/loc/bn;->d([BLjava/lang/String;)[B
move-result-object v3
if-eqz v3, :cond_6a
array-length v4, v3
if-lez v4, :cond_6a
new-instance v1, Ljava/lang/String;
const-string/jumbo v4, "UTF-8"
invoke-direct {v1, v3, v4}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
:cond_6a
invoke-virtual {v0, v1}, Lcom/loc/br;->a(Ljava/lang/String;)V
move-object v1, v2
:goto_6e
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-nez v2, :cond_6
new-instance v2, Lcom/amap/api/location/AMapLocation;
const-string/jumbo v3, ""
invoke-direct {v2, v3}, Lcom/amap/api/location/AMapLocation;-><init>(Ljava/lang/String;)V
new-instance v3, Lorg/json/JSONObject;
invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
invoke-static {v2, v3}, Lcom/loc/ca;->a(Lcom/amap/api/location/AMapLocation;Lorg/json/JSONObject;)V
invoke-static {v2}, Lcom/loc/cj;->b(Lcom/amap/api/location/AMapLocation;)Z
move-result v1
if-eqz v1, :cond_6
invoke-virtual {v0, v2}, Lcom/loc/br;->a(Lcom/amap/api/location/AMapLocation;)V
:try_end_8d
.catch Ljava/lang/Throwable; {:try_start_2a .. :try_end_8d} :catch_8f
goto/16 :goto_6
:catch_8f
move-exception v1
:goto_90
const-string/jumbo v2, "LastLocationManager"
const-string/jumbo v3, "readLastFix"
invoke-static {v1, v2, v3}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto/16 :goto_6
:catch_9b
move-exception v0
move-object v5, v0
move-object v0, v1
move-object v1, v5
goto :goto_90
:cond_a0
move-object v2, v1
goto :goto_4a
:cond_a2
move-object v0, v1
goto :goto_6e
.end method
# virtual methods
.method public final a(Lcom/amap/api/location/AMapLocation;Ljava/lang/String;J)Lcom/amap/api/location/AMapLocation;
.registers 10
const/4 v1, 0x1
if-nez p1, :cond_4
:cond_3
:goto_3
return-object p1
:cond_4
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->getErrorCode()I
move-result v0
if-eqz v0, :cond_3
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->getLocationType()I
move-result v0
if-eq v0, v1, :cond_3
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->getErrorCode()I
move-result v0
const/4 v1, 0x7
if-eq v0, v1, :cond_3
:try_start_17
invoke-direct {p0}, Lcom/loc/co;->e()V
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
if-eqz v0, :cond_3
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v0}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v0
if-eqz v0, :cond_3
invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_5c
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v0
sget-object v2, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v2}, Lcom/loc/br;->d()J
move-result-wide v2
sub-long/2addr v0, v2
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-ltz v2, :cond_3
cmp-long v0, v0, p3
if-gtz v0, :cond_3
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v0}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object p1
const/16 v0, 0x9
invoke-virtual {p1, v0}, Lcom/amap/api/location/AMapLocation;->setLocationType(I)V
const/4 v0, 0x1
invoke-virtual {p1, v0}, Lcom/amap/api/location/AMapLocation;->setFixLastLocation(Z)V
:try_end_50
.catch Ljava/lang/Throwable; {:try_start_17 .. :try_end_50} :catch_51
goto :goto_3
:catch_51
move-exception v0
const-string/jumbo v1, "LastLocationManager"
const-string/jumbo v2, "fixLastLocation"
invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_3
:cond_5c
:try_start_5c
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v0}, Lcom/loc/br;->b()Ljava/lang/String;
move-result-object v0
invoke-static {v0, p2}, Lcom/loc/cj;->a(Ljava/lang/String;Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_3
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v0}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object p1
const/16 v0, 0x9
invoke-virtual {p1, v0}, Lcom/amap/api/location/AMapLocation;->setLocationType(I)V
const/4 v0, 0x1
invoke-virtual {p1, v0}, Lcom/amap/api/location/AMapLocation;->setFixLastLocation(Z)V
:try_end_77
.catch Ljava/lang/Throwable; {:try_start_5c .. :try_end_77} :catch_51
goto :goto_3
.end method
.method public final a()V
.registers 5
iget-boolean v0, p0, Lcom/loc/co;->h:Z
if-eqz v0, :cond_5
:goto_4
return-void
:cond_5
:try_start_5
iget-object v0, p0, Lcom/loc/co;->a:Ljava/lang/String;
if-nez v0, :cond_18
const-string/jumbo v0, "MD5"
iget-object v1, p0, Lcom/loc/co;->i:Landroid/content/Context;
invoke-static {v1}, Lcom/loc/ct;->q(Landroid/content/Context;)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/loc/bn;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/loc/co;->a:Ljava/lang/String;
:cond_18
iget-object v0, p0, Lcom/loc/co;->e:Lcom/loc/g;
if-nez v0, :cond_2f
const-class v0, Lcom/loc/bs;
invoke-static {v0}, Lcom/loc/g;->a(Ljava/lang/Class;)Lcom/loc/f;
move-result-object v0
new-instance v1, Lcom/loc/g;
iget-object v2, p0, Lcom/loc/co;->i:Landroid/content/Context;
invoke-static {}, Lcom/loc/cj;->i()Ljava/lang/String;
move-result-object v3
invoke-direct {v1, v2, v0, v3}, Lcom/loc/g;-><init>(Landroid/content/Context;Lcom/loc/f;Ljava/lang/String;)V
iput-object v1, p0, Lcom/loc/co;->e:Lcom/loc/g;
:try_end_2f
.catch Ljava/lang/Throwable; {:try_start_5 .. :try_end_2f} :catch_33
:cond_2f
:goto_2f
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/loc/co;->h:Z
goto :goto_4
:catch_33
move-exception v0
const-string/jumbo v1, "LastLocationManager"
const-string/jumbo v2, "<init>:DBOperation"
invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_2f
.end method
.method public final a(Lcom/amap/api/location/AMapLocation;Ljava/lang/String;)Z
.registers 9
const/4 v1, 0x1
const/4 v0, 0x0
iget-object v2, p0, Lcom/loc/co;->i:Landroid/content/Context;
if-eqz v2, :cond_8
if-nez p1, :cond_9
:cond_8
:goto_8
return v0
:cond_9
invoke-static {p1}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z
move-result v2
if-eqz v2, :cond_8
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->getLocationType()I
move-result v2
const/4 v3, 0x2
if-eq v2, v3, :cond_8
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->isMock()Z
move-result v2
if-nez v2, :cond_8
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->isFixLastLocation()Z
move-result v2
if-nez v2, :cond_8
new-instance v2, Lcom/loc/br;
invoke-direct {v2}, Lcom/loc/br;-><init>()V
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->clone()Lcom/amap/api/location/AMapLocation;
move-result-object v3
invoke-virtual {v2, v3}, Lcom/loc/br;->a(Lcom/amap/api/location/AMapLocation;)V
invoke-virtual {p1}, Lcom/amap/api/location/AMapLocation;->getLocationType()I
move-result v3
if-ne v3, v1, :cond_69
const/4 v3, 0x0
invoke-virtual {v2, v3}, Lcom/loc/br;->a(Ljava/lang/String;)V
:goto_38
:try_start_38
sput-object v2, Lcom/loc/co;->b:Lcom/loc/br;
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v4
sput-wide v4, Lcom/loc/co;->g:J
iput-object v2, p0, Lcom/loc/co;->c:Lcom/loc/br;
iget-object v3, p0, Lcom/loc/co;->d:Lcom/loc/br;
if-eqz v3, :cond_5a
iget-object v3, p0, Lcom/loc/co;->d:Lcom/loc/br;
invoke-virtual {v3}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v3
invoke-virtual {v2}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v2
invoke-static {v3, v2}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;Lcom/amap/api/location/AMapLocation;)F
move-result v2
const/high16 v3, 0x43fa0000 # 500.0f
cmpg-float v2, v2, v3
if-lez v2, :cond_8
:cond_5a
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v2
iget-wide v4, p0, Lcom/loc/co;->f:J
:try_end_60
.catch Ljava/lang/Throwable; {:try_start_38 .. :try_end_60} :catch_6d
sub-long/2addr v2, v4
const-wide/16 v4, 0x7530
cmp-long v2, v2, v4
if-lez v2, :cond_8
move v0, v1
goto :goto_8
:cond_69
invoke-virtual {v2, p2}, Lcom/loc/br;->a(Ljava/lang/String;)V
goto :goto_38
:catch_6d
move-exception v1
const-string/jumbo v2, "LastLocationManager"
const-string/jumbo v3, "setLastFix"
invoke-static {v1, v2, v3}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_8
.end method
.method public final b()Lcom/amap/api/location/AMapLocation;
.registers 3
const/4 v0, 0x0
invoke-direct {p0}, Lcom/loc/co;->e()V
sget-object v1, Lcom/loc/co;->b:Lcom/loc/br;
if-nez v1, :cond_9
:cond_8
:goto_8
return-object v0
:cond_9
sget-object v1, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v1}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v1
invoke-static {v1}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z
move-result v1
if-eqz v1, :cond_8
sget-object v0, Lcom/loc/co;->b:Lcom/loc/br;
invoke-virtual {v0}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v0
goto :goto_8
.end method
.method public final c()V
.registers 4
:try_start_0
invoke-virtual {p0}, Lcom/loc/co;->d()V
const-wide/16 v0, 0x0
iput-wide v0, p0, Lcom/loc/co;->f:J
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/loc/co;->h:Z
const/4 v0, 0x0
iput-object v0, p0, Lcom/loc/co;->c:Lcom/loc/br;
const/4 v0, 0x0
iput-object v0, p0, Lcom/loc/co;->d:Lcom/loc/br;
:try_end_10
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_10} :catch_11
:goto_10
return-void
:catch_11
move-exception v0
const-string/jumbo v1, "LastLocationManager"
const-string/jumbo v2, "destroy"
invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_10
.end method
.method public final d()V
.registers 7
const/4 v0, 0x0
:try_start_1
invoke-virtual {p0}, Lcom/loc/co;->a()V
iget-object v1, p0, Lcom/loc/co;->c:Lcom/loc/br;
if-eqz v1, :cond_2a
iget-object v1, p0, Lcom/loc/co;->c:Lcom/loc/br;
invoke-virtual {v1}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v1
invoke-static {v1}, Lcom/loc/cj;->a(Lcom/amap/api/location/AMapLocation;)Z
move-result v1
if-eqz v1, :cond_2a
iget-object v1, p0, Lcom/loc/co;->e:Lcom/loc/g;
if-eqz v1, :cond_2a
iget-object v1, p0, Lcom/loc/co;->c:Lcom/loc/br;
iget-object v2, p0, Lcom/loc/co;->d:Lcom/loc/br;
if-eq v1, v2, :cond_2a
iget-object v1, p0, Lcom/loc/co;->c:Lcom/loc/br;
invoke-virtual {v1}, Lcom/loc/br;->d()J
move-result-wide v2
const-wide/16 v4, 0x0
cmp-long v1, v2, v4
if-eqz v1, :cond_2b
:cond_2a
:goto_2a
return-void
:cond_2b
iget-object v1, p0, Lcom/loc/co;->c:Lcom/loc/br;
invoke-virtual {v1}, Lcom/loc/br;->a()Lcom/amap/api/location/AMapLocation;
move-result-object v1
invoke-virtual {v1}, Lcom/amap/api/location/AMapLocation;->toStr()Ljava/lang/String;
move-result-object v1
iget-object v2, p0, Lcom/loc/co;->c:Lcom/loc/br;
invoke-virtual {v2}, Lcom/loc/br;->b()Ljava/lang/String;
move-result-object v2
iget-object v3, p0, Lcom/loc/co;->c:Lcom/loc/br;
iput-object v3, p0, Lcom/loc/co;->d:Lcom/loc/br;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_9f
const-string/jumbo v3, "UTF-8"
invoke-virtual {v1, v3}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object v1
iget-object v3, p0, Lcom/loc/co;->a:Ljava/lang/String;
invoke-static {v1, v3}, Lcom/loc/bn;->c([BLjava/lang/String;)[B
move-result-object v1
invoke-static {v1}, Lcom/loc/cu;->a([B)Ljava/lang/String;
move-result-object v1
invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_6d
const-string/jumbo v0, "UTF-8"
invoke-virtual {v2, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
move-result-object v0
iget-object v2, p0, Lcom/loc/co;->a:Ljava/lang/String;
invoke-static {v0, v2}, Lcom/loc/bn;->c([BLjava/lang/String;)[B
move-result-object v0
invoke-static {v0}, Lcom/loc/cu;->a([B)Ljava/lang/String;
move-result-object v0
:cond_6d
:goto_6d
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-nez v2, :cond_2a
new-instance v2, Lcom/loc/br;
invoke-direct {v2}, Lcom/loc/br;-><init>()V
invoke-virtual {v2, v1}, Lcom/loc/br;->b(Ljava/lang/String;)V
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v4
invoke-virtual {v2, v4, v5}, Lcom/loc/br;->a(J)V
invoke-virtual {v2, v0}, Lcom/loc/br;->a(Ljava/lang/String;)V
iget-object v0, p0, Lcom/loc/co;->e:Lcom/loc/g;
const-string/jumbo v1, "_id=1"
invoke-virtual {v0, v2, v1}, Lcom/loc/g;->a(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {}, Lcom/loc/cj;->b()J
move-result-wide v0
iput-wide v0, p0, Lcom/loc/co;->f:J
:try_end_93
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_93} :catch_94
goto :goto_2a
:catch_94
move-exception v0
const-string/jumbo v1, "LastLocationManager"
const-string/jumbo v2, "saveLastFix"
invoke-static {v0, v1, v2}, Lcom/loc/ca;->a(Ljava/lang/Throwable;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_2a
:cond_9f
move-object v1, v0
goto :goto_6d
.end method