GrayService.smali
.class public Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;
.super Landroid/app/Service;
.source "GrayService.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService$GrayInnerService;
}
.end annotation
# static fields
.field private static ALARM_INTERVAL:J = 0x0L
.field private static final GRAY_SERVICE_ID:I = -0x3e9
.field private static final TAG:Ljava/lang/String;
.field private static final WAKE_REQUEST_CODE:I = 0x1a0a
# instance fields
.field protected mGrayServiceId:I
.field protected mIsResident:Z
.field protected mNonResidentId:I
# direct methods
.method static constructor <clinit>()V
.registers 2
.prologue
.line 22
const-class v0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;
invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object v0
sput-object v0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->TAG:Ljava/lang/String;
.line 26
const-wide/16 v0, 0x7530
sput-wide v0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->ALARM_INTERVAL:J
return-void
.end method
.method public constructor <init>()V
.registers 2
.prologue
.line 20
invoke-direct {p0}, Landroid/app/Service;-><init>()V
.line 31
const/4 v0, -0x1
iput v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
.line 32
const/16 v0, -0x3e9
iput v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mGrayServiceId:I
.line 33
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mIsResident:Z
return-void
.end method
.method private getInnerServiceIntent(Ljava/lang/Class;)Landroid/content/Intent;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class",
"<*>;)",
"Landroid/content/Intent;"
}
.end annotation
.prologue
const/4 v0, 0x0
.line 76
iget v1, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
const/4 v2, -0x1
if-ne v1, v2, :cond_e
.line 77
new-instance v0, Landroid/content/Intent;
const-class v1, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService$GrayInnerService;
invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
.line 91
:cond_d
:goto_d
return-object v0
.line 79
:cond_e
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v2, "$GrayInnerService"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
.line 82
:try_start_25
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget v2, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_3f
.catch Ljava/lang/Exception; {:try_start_25 .. :try_end_3f} :catch_4f
move-result-object v1
.line 85
:goto_40
if-eqz v1, :cond_d
.line 88
new-instance v0, Landroid/content/Intent;
invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
.line 89
const-string v1, "nonResidentId"
iget v2, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
goto :goto_d
.line 83
:catch_4f
move-exception v1
move-object v1, v0
goto :goto_40
.end method
# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
.registers 4
.prologue
.line 96
new-instance v0, Ljava/lang/UnsupportedOperationException;
const-string v1, "Not yet implemented"
invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public onCreate()V
.registers 1
.prologue
.line 37
invoke-super {p0}, Landroid/app/Service;->onCreate()V
.line 38
return-void
.end method
.method public onDestroy()V
.registers 1
.prologue
.line 101
invoke-super {p0}, Landroid/app/Service;->onDestroy()V
.line 102
return-void
.end method
.method public onStartCommand(Landroid/content/Intent;II)I
.registers 12
.prologue
const/4 v7, 0x1
.line 45
if-nez p1, :cond_4
.line 71
:cond_3
:goto_3
return v7
.line 48
:cond_4
const-string v0, "isResident"
invoke-virtual {p1, v0, v7}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
iput-boolean v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mIsResident:Z
.line 49
const-string v0, "nonResidentId"
const/4 v1, -0x1
invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result v0
iput v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
.line 50
iget v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mNonResidentId:I
rsub-int v0, v0, -0x3e9
iput v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mGrayServiceId:I
.line 52
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x12
if-ge v0, v1, :cond_5a
.line 53
iget v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mGrayServiceId:I
new-instance v1, Landroid/app/Notification;
invoke-direct {v1}, Landroid/app/Notification;-><init>()V
invoke-virtual {p0, v0, v1}, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->startForeground(ILandroid/app/Notification;)V
.line 64
:goto_2b
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-le v0, v1, :cond_3
iget-boolean v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mIsResident:Z
if-eqz v0, :cond_3
.line 65
const-string v0, "alarm"
invoke-virtual {p0, v0}, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/AlarmManager;
.line 66
new-instance v1, Landroid/content/Intent;
invoke-direct {v1}, Landroid/content/Intent;-><init>()V
.line 67
const-string v2, "com.wake.gray"
invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 68
const/16 v2, 0x1a0a
const/high16 v3, 0x8000000
invoke-static {p0, v2, v1, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
move-result-object v6
.line 69
const/4 v1, 0x0
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
sget-wide v4, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->ALARM_INTERVAL:J
invoke-virtual/range {v0 .. v6}, Landroid/app/AlarmManager;->setInexactRepeating(IJJLandroid/app/PendingIntent;)V
goto :goto_3
.line 55
:cond_5a
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
invoke-direct {p0, v0}, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->getInnerServiceIntent(Ljava/lang/Class;)Landroid/content/Intent;
move-result-object v0
.line 56
if-eqz v0, :cond_3
.line 59
invoke-virtual {p0, v0}, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
.line 60
iget v0, p0, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->mGrayServiceId:I
new-instance v1, Landroid/app/Notification;
invoke-direct {v1}, Landroid/app/Notification;-><init>()V
invoke-virtual {p0, v0, v1}, Lcom/cleanmaster/daemon/foreServiceforlive/service/GrayService;->startForeground(ILandroid/app/Notification;)V
goto :goto_2b
.end method