CrashReportService.smali

.class public Lcom/cleanmaster/base/crash/CrashReportService;
.super Landroid/app/IntentService;
.source "CrashReportService.java"


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

    .prologue
    .line 26
    const-string v0, "CrashReportService"

    invoke-direct {p0, v0}, Landroid/app/IntentService;-><init>(Ljava/lang/String;)V

    .line 27
    return-void
.end method

.method static synthetic a(Lcom/cleanmaster/base/crash/CrashReportService;Ljava/lang/String;)V
    .registers 2

    .prologue
    .line 18
    invoke-direct {p0, p1}, Lcom/cleanmaster/base/crash/CrashReportService;->a(Ljava/lang/String;)V

    return-void
.end method

.method public static a(Lcom/cleanmaster/base/crash/infoc_crash/CrashInfocData;)V
    .registers 4

    .prologue
    .line 109
    if-nez p0, :cond_3

    .line 117
    :goto_2
    return-void

    .line 113
    :cond_3
    :try_start_3
    new-instance v0, Lcom/cleanmaster/base/crash/a/a;

    invoke-direct {v0}, Lcom/cleanmaster/base/crash/a/a;-><init>()V

    invoke-virtual {v0, p0}, Lcom/cleanmaster/base/crash/a/a;->a(Lcom/cleanmaster/base/crash/infoc_crash/CrashInfocData;)V
    :try_end_b
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_b} :catch_c

    goto :goto_2

    .line 114
    :catch_c
    move-exception v0

    .line 115
    const-string v1, "Crash"

    const-string v2, "Report Crash To Infoc Exception!"

    invoke-static {v1, v2, v0}, Lcom/cleanmaster/util/CMLogUtils;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_2
.end method

.method private a(Ljava/lang/String;)V
    .registers 6

    .prologue
    .line 55
    .line 56
    const/16 v2, 0x7530

    .line 58
    const/4 v1, 0x0

    .line 61
    :try_start_3
    new-instance v0, Ljava/net/URL;

    invoke-direct {v0, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    .line 62
    invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v0

    check-cast v0, Ljava/net/HttpURLConnection;
    :try_end_e
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_e} :catch_25
    .catchall {:try_start_3 .. :try_end_e} :catchall_2f

    .line 63
    :try_start_e
    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    .line 64
    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    .line 66
    if-eqz v0, :cond_1f

    .line 67
    if-eqz v0, :cond_1f

    .line 68
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getResponseCode()I
    :try_end_1b
    .catch Ljava/lang/Exception; {:try_start_e .. :try_end_1b} :catch_3b
    .catchall {:try_start_e .. :try_end_1b} :catchall_36

    move-result v1

    .line 69
    packed-switch v1, :pswitch_data_40

    .line 82
    :cond_1f
    :pswitch_1f
    if-eqz v0, :cond_24

    .line 83
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V

    .line 87
    :cond_24
    :goto_24
    return-void

    .line 79
    :catch_25
    move-exception v0

    .line 80
    :goto_26
    :try_start_26
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_29
    .catchall {:try_start_26 .. :try_end_29} :catchall_2f

    .line 82
    if-eqz v1, :cond_24

    .line 83
    invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V

    goto :goto_24

    .line 82
    :catchall_2f
    move-exception v0

    :goto_30
    if-eqz v1, :cond_35

    .line 83
    invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V

    .line 84
    :cond_35
    throw v0

    .line 82
    :catchall_36
    move-exception v1

    move-object v3, v1

    move-object v1, v0

    move-object v0, v3

    goto :goto_30

    .line 79
    :catch_3b
    move-exception v1

    move-object v3, v1

    move-object v1, v0

    move-object v0, v3

    goto :goto_26

    .line 69
    :pswitch_data_40
    .packed-switch 0xc8
        :pswitch_1f
    .end packed-switch
.end method

.method public static a(Ljava/lang/String;Ljava/lang/String;Z)V
    .registers 7

    .prologue
    .line 94
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v0

    .line 95
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 96
    const-class v2, Lcom/cleanmaster/base/crash/CrashReportService;

    invoke-virtual {v1, v0, v2}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 97
    const-string v2, "com.cleanmaster.crash.report"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 98
    const-string v2, "extra_url"

    invoke-virtual {v1, v2, p0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 99
    const-string v2, "need_infoc_report"

    invoke-virtual {v1, v2, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 101
    if-eqz p2, :cond_28

    .line 102
    invoke-static {p1}, Lcom/cleanmaster/base/crash/infoc_crash/b;->a(Ljava/lang/String;)Lcom/cleanmaster/base/crash/infoc_crash/CrashInfocData;

    move-result-object v2

    .line 103
    const-string v3, "infoc_data"

    invoke-virtual {v1, v3, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 105
    :cond_28
    invoke-virtual {v0, v1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 106
    return-void
.end method


# virtual methods
.method protected onHandleIntent(Landroid/content/Intent;)V
    .registers 7

    .prologue
    .line 31
    invoke-virtual {p0}, Lcom/cleanmaster/base/crash/CrashReportService;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v0

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->processName:Ljava/lang/String;

    .line 32
    const-string v1, "cm_cn_crash"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "proNmae = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 33
    if-eqz p1, :cond_4f

    const-string v0, "com.cleanmaster.crash.report"

    invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_4f

    .line 35
    const-string v0, "extra_url"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 36
    const-string v0, "need_infoc_report"

    const/4 v2, 0x0

    invoke-virtual {p1, v0, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v2

    .line 37
    const-string v0, "infoc_data"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Lcom/cleanmaster/base/crash/infoc_crash/CrashInfocData;

    .line 38
    new-instance v3, Ljava/lang/Thread;

    new-instance v4, Lcom/cleanmaster/base/crash/d;

    invoke-direct {v4, p0, v2, v0, v1}, Lcom/cleanmaster/base/crash/d;-><init>(Lcom/cleanmaster/base/crash/CrashReportService;ZLcom/cleanmaster/base/crash/infoc_crash/CrashInfocData;Ljava/lang/String;)V

    invoke-direct {v3, v4}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 49
    invoke-virtual {v3}, Ljava/lang/Thread;->start()V

    .line 51
    :cond_4f
    return-void
.end method