Weather/smali_classes2/com/moji/location/util/LocationUtil.smali
2021-05-10 10:13:34 +02:00

669 lines
13 KiB
Smali

.class public Lcom/moji/location/util/LocationUtil;
.super Ljava/lang/Object;
.source "LocationUtil.java"
# static fields
.field private static a:Z = false
# direct methods
.method static constructor <clinit>()V
.locals 0
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static a(Ljava/lang/String;)Ljava/lang/Object;
.locals 2
const/4 v0, 0x0
:try_start_0
const-string v1, "com.moji.mjweather.BuildConfig"
.line 55
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v1
.line 56
invoke-virtual {v1, p0}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object p0
.line 57
invoke-virtual {p0, v0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
:try_end_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
return-object p0
:catch_0
move-exception p0
const-string v1, "LocationUtil"
.line 63
invoke-static {v1, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_0
:catch_1
move-exception p0
const-string v1, "LocationUtil"
.line 61
invoke-static {v1, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_0
:catch_2
move-exception p0
const-string v1, "LocationUtil"
.line 59
invoke-static {v1, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
:goto_0
return-object v0
.end method
.method public static a(Z)V
.locals 0
.line 30
sput-boolean p0, Lcom/moji/location/util/LocationUtil;->a:Z
return-void
.end method
.method public static a()Z
.locals 3
.line 34
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "setting_develop_console_mock_location"
const/4 v2, 0x0
.line 35
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
return v0
.line 38
:cond_0
sget-boolean v0, Lcom/moji/location/util/LocationUtil;->a:Z
if-nez v0, :cond_1
return v2
:cond_1
:try_start_0
const-string v0, "DEBUG_LOCATION"
.line 43
invoke-static {v0}, Lcom/moji/location/util/LocationUtil;->a(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_2
.line 45
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z
move-result v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move v2, v0
goto :goto_0
:catch_0
move-exception v0
const-string v1, "LocationUtil"
.line 48
invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_2
:goto_0
return v2
.end method
.method public static a(D)Z
.locals 3
.line 69
new-instance v0, Ljava/math/BigDecimal;
const-wide/16 v1, 0x0
invoke-direct {v0, v1, v2}, Ljava/math/BigDecimal;-><init>(D)V
.line 70
new-instance v1, Ljava/math/BigDecimal;
invoke-direct {v1, p0, p1}, Ljava/math/BigDecimal;-><init>(D)V
.line 71
invoke-virtual {v0, v1}, Ljava/math/BigDecimal;->compareTo(Ljava/math/BigDecimal;)I
move-result p0
if-nez p0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method public static a(DD)Z
.locals 4
const/4 v0, 0x0
const-wide/16 v1, 0x0
cmpl-double v3, p0, v1
if-nez v3, :cond_0
cmpl-double v3, p2, v1
if-nez v3, :cond_0
return v0
:cond_0
const-wide v1, -0x3f99800000000000L # -180.0
cmpg-double v3, v1, p2
if-gtz v3, :cond_1
const-wide v1, 0x4066800000000000L # 180.0
cmpg-double v3, p2, v1
if-gtz v3, :cond_1
const-wide p2, -0x3fa9800000000000L # -90.0
cmpg-double v1, p2, p0
if-gtz v1, :cond_1
const-wide p2, 0x4056800000000000L # 90.0
cmpg-double v1, p0, p2
if-gtz v1, :cond_1
const/4 p0, 0x1
return p0
:cond_1
return v0
.end method
.method public static a(Landroid/content/Context;)Z
.locals 1
.line 101
invoke-static {p0}, Lcom/moji/location/util/LocationUtil;->c(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_0
invoke-static {p0}, Lcom/moji/location/util/LocationUtil;->d(Landroid/content/Context;)Z
move-result p0
if-eqz p0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method public static a(Lcom/moji/location/entity/MJLocation;)Z
.locals 4
.line 130
:try_start_0
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getCDMALAT()D
move-result-wide v0
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getCDMALNG()D
move-result-wide v2
invoke-static {v0, v1, v2, v3}, Lcom/moji/location/util/LocationUtil;->a(DD)Z
move-result p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
return p0
:catch_0
move-exception p0
const-string v0, "LocationUtil"
.line 132
invoke-virtual {p0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object p0
invoke-static {v0, p0}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V
const/4 p0, 0x0
return p0
.end method
.method public static b()Z
.locals 4
.line 169
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/4 v1, 0x1
const/16 v2, 0x13
if-lt v0, v2, :cond_1
const/4 v0, 0x0
.line 171
:try_start_0
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "location_mode"
invoke-static {v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I
move-result v2
:try_end_0
.catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
if-eqz v2, :cond_0
const/4 v0, 0x1
:cond_0
return v0
:catch_0
move-exception v1
const-string v2, "LocationUtil"
.line 173
invoke-static {v2, v1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
return v0
.line 178
:cond_1
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v2, "location_providers_allowed"
invoke-static {v0, v2}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 179
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
xor-int/2addr v0, v1
return v0
.end method
.method public static b(Landroid/content/Context;)Z
.locals 2
const/4 v0, 0x0
if-nez p0, :cond_0
return v0
:cond_0
:try_start_0
const-string v1, "phone"
.line 111
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/telephony/TelephonyManager;
.line 112
invoke-virtual {p0}, Landroid/telephony/TelephonyManager;->getSimState()I
move-result p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p0
const-string v1, "LocationUtil"
.line 114
invoke-static {v1, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 p0, 0x0
:goto_0
const/4 v1, 0x1
packed-switch p0, :pswitch_data_0
const/4 v0, 0x1
:pswitch_0
return v0
:pswitch_data_0
.packed-switch 0x0
:pswitch_0
:pswitch_0
.end packed-switch
.end method
.method public static b(Lcom/moji/location/entity/MJLocation;)Z
.locals 4
.line 139
:try_start_0
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getLatitude()D
move-result-wide v0
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getLongitude()D
move-result-wide v2
invoke-static {v0, v1, v2, v3}, Lcom/moji/location/util/LocationUtil;->a(DD)Z
move-result p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
return p0
:catch_0
move-exception p0
const-string v0, "LocationUtil"
.line 141
invoke-virtual {p0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object p0
invoke-static {v0, p0}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V
const/4 p0, 0x0
return p0
.end method
.method public static b(Ljava/lang/String;)Z
.locals 1
.line 163
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_1
const-string v0, "null"
invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result p0
if-eqz p0, :cond_0
goto :goto_0
:cond_0
const/4 p0, 0x0
goto :goto_1
:cond_1
:goto_0
const/4 p0, 0x1
:goto_1
return p0
.end method
.method private static c(Landroid/content/Context;)Z
.locals 2
const/4 v0, 0x0
:try_start_0
const-string v1, "phone"
.line 77
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/telephony/TelephonyManager;
.line 78
invoke-virtual {p0}, Landroid/telephony/TelephonyManager;->getPhoneType()I
move-result p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
const/4 v1, 0x2
if-ne p0, v1, :cond_0
const/4 v0, 0x1
:cond_0
return v0
:catch_0
return v0
.end method
.method public static c(Lcom/moji/location/entity/MJLocation;)Z
.locals 1
.line 159
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getGsmLAC()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lcom/moji/location/util/LocationUtil;->b(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
invoke-virtual {p0}, Lcom/moji/location/entity/MJLocation;->getGsmCID()Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Lcom/moji/location/util/LocationUtil;->b(Ljava/lang/String;)Z
move-result p0
if-nez p0, :cond_0
goto :goto_0
:cond_0
const/4 p0, 0x0
goto :goto_1
:cond_1
:goto_0
const/4 p0, 0x1
:goto_1
return p0
.end method
.method private static d(Landroid/content/Context;)Z
.locals 3
.line 85
invoke-static {}, Lcom/moji/tool/preferences/CtaPrefer;->c()Lcom/moji/tool/preferences/CtaPrefer;
move-result-object v0
invoke-virtual {v0}, Lcom/moji/tool/preferences/CtaPrefer;->e()Z
move-result v0
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
:try_start_0
const-string v0, "phone"
.line 89
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/telephony/TelephonyManager;
.line 90
invoke-virtual {p0}, Landroid/telephony/TelephonyManager;->getCellLocation()Landroid/telephony/CellLocation;
move-result-object p0
if-eqz p0, :cond_2
.line 91
instance-of v0, p0, Landroid/telephony/cdma/CdmaCellLocation;
if-eqz v0, :cond_2
.line 92
move-object v0, p0
check-cast v0, Landroid/telephony/cdma/CdmaCellLocation;
invoke-virtual {v0}, Landroid/telephony/cdma/CdmaCellLocation;->getBaseStationLatitude()I
move-result v0
const v2, 0x7fffffff
if-eq v0, v2, :cond_1
check-cast p0, Landroid/telephony/cdma/CdmaCellLocation;
invoke-virtual {p0}, Landroid/telephony/cdma/CdmaCellLocation;->getBaseStationLongitude()I
move-result p0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
if-eq p0, v2, :cond_1
const/4 v1, 0x1
:cond_1
return v1
:cond_2
return v1
:catch_0
return v1
.end method