Weather/smali_classes2/com/moji/weatherprovider/Service/WeatherUpdateService.smali
2021-05-10 10:13:34 +02:00

230 lines
5.9 KiB
Smali

.class public Lcom/moji/weatherprovider/Service/WeatherUpdateService;
.super Landroid/app/Service;
.source "WeatherUpdateService.java"
# static fields
.field private static a:Ljava/lang/reflect/Method;
# 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}, Landroid/app/Service;-><init>()V
return-void
.end method
.method private a()V
.locals 5
.line 67
new-instance v0, Lcom/moji/statistics/fliter/LogConfigPreferences;
invoke-virtual {p0}, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->getApplicationContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1}, Lcom/moji/statistics/fliter/LogConfigPreferences;-><init>(Landroid/content/Context;)V
.line 68
invoke-virtual {v0}, Lcom/moji/statistics/fliter/LogConfigPreferences;->c()J
move-result-wide v0
.line 69
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
sub-long/2addr v2, v0
const-wide/32 v0, 0x5265c00
cmp-long v4, v2, v0
if-lez v4, :cond_1
.line 70
sget-object v0, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->a:Ljava/lang/reflect/Method;
const/4 v1, 0x0
if-nez v0, :cond_0
:try_start_0
const-string v0, "com.moji.statistics.upload.EventUploader"
.line 72
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
const-string v2, "uploadEventLog"
.line 73
new-array v3, v1, [Ljava/lang/Class;
invoke-virtual {v0, v2, v3}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
sput-object v0, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->a:Ljava/lang/reflect/Method;
:try_end_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v0
const-string v2, "WeatherUpdateService"
.line 77
invoke-static {v2, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_0
:catch_1
move-exception v0
const-string v2, "WeatherUpdateService"
.line 75
invoke-static {v2, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
.line 80
:cond_0
:goto_0
sget-object v0, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->a:Ljava/lang/reflect/Method;
if-eqz v0, :cond_1
.line 82
:try_start_1
sget-object v0, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->a:Ljava/lang/reflect/Method;
const/4 v2, 0x0
new-array v1, v1, [Ljava/lang/Object;
invoke-virtual {v0, v2, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
const-string v0, "checkEventUpload"
const-string v1, "force upload event, last upload over 24h"
.line 83
invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
:try_end_1
.catch Ljava/lang/IllegalAccessException; {:try_start_1 .. :try_end_1} :catch_3
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_1 .. :try_end_1} :catch_2
goto :goto_1
:catch_2
move-exception v0
const-string v1, "WeatherUpdateService"
.line 87
invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_1
:catch_3
move-exception v0
const-string v1, "WeatherUpdateService"
.line 85
invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_1
:goto_1
return-void
.end method
# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
.locals 0
const/4 p1, 0x0
return-object p1
.end method
.method public onCreate()V
.locals 2
.line 31
invoke-super {p0}, Landroid/app/Service;->onCreate()V
const-string v0, "WeatherUpdateService"
const-string v1, "onCreate"
.line 32
invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public onStartCommand(Landroid/content/Intent;II)I
.locals 4
const-string v0, "WeatherUpdateService"
const-string v1, "onStartCommand"
.line 42
invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
.line 43
new-instance v0, Lcom/moji/weatherprovider/update/WeatherUpdater;
const/4 v1, 0x1
invoke-direct {v0, v1}, Lcom/moji/weatherprovider/update/WeatherUpdater;-><init>(Z)V
.line 44
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;
move-result-object v1
if-eqz v1, :cond_0
.line 46
new-instance v2, Lcom/moji/weatherprovider/Service/WeatherUpdateService$1;
invoke-direct {v2, p0}, Lcom/moji/weatherprovider/Service/WeatherUpdateService$1;-><init>(Lcom/moji/weatherprovider/Service/WeatherUpdateService;)V
sget-object v3, Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;->BACKGROUND:Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;
invoke-virtual {v0, v1, v2, v3}, Lcom/moji/weatherprovider/update/WeatherUpdater;->a(Lcom/moji/common/area/AreaInfo;Lcom/moji/weatherprovider/update/WeatherUpdateListener;Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;)V
.line 61
:cond_0
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a()V
.line 62
invoke-direct {p0}, Lcom/moji/weatherprovider/Service/WeatherUpdateService;->a()V
.line 63
invoke-super {p0, p1, p2, p3}, Landroid/app/Service;->onStartCommand(Landroid/content/Intent;II)I
move-result p1
return p1
.end method