384 lines
9.1 KiB
Smali
384 lines
9.1 KiB
Smali
.class final Lcom/crashlytics/android/core/ao;
|
|
.super Ljava/lang/Object;
|
|
|
|
# interfaces
|
|
.implements Lcom/crashlytics/android/core/aa;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/crashlytics/android/core/ao$a;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final se:Ljava/io/File;
|
|
|
|
.field private final sf:I
|
|
|
|
.field private sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/io/File;I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/crashlytics/android/core/ao;->se:Ljava/io/File;
|
|
|
|
const/high16 p1, 0x10000
|
|
|
|
iput p1, p0, Lcom/crashlytics/android/core/ao;->sf:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private cW()Lcom/crashlytics/android/core/ao$a;
|
|
.locals 7
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->se:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/crashlytics/android/core/ao;->cX()V
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
return-object v1
|
|
|
|
:cond_1
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aput v1, v0, v1
|
|
|
|
iget-object v2, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
invoke-virtual {v2}, Lio/fabric/sdk/android/a/b/r;->Ee()I
|
|
|
|
move-result v2
|
|
|
|
new-array v2, v2, [B
|
|
|
|
:try_start_0
|
|
iget-object v3, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
new-instance v4, Lcom/crashlytics/android/core/ao$1;
|
|
|
|
invoke-direct {v4, p0, v2, v0}, Lcom/crashlytics/android/core/ao$1;-><init>(Lcom/crashlytics/android/core/ao;[B[I)V
|
|
|
|
invoke-virtual {v3, v4}, Lio/fabric/sdk/android/a/b/r;->a(Lio/fabric/sdk/android/a/b/r$c;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v3
|
|
|
|
invoke-static {}, Lio/fabric/sdk/android/c;->DH()Lio/fabric/sdk/android/l;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v5, "CrashlyticsCore"
|
|
|
|
const-string v6, "A problem occurred while reading the Crashlytics log file."
|
|
|
|
invoke-interface {v4, v5, v6, v3}, Lio/fabric/sdk/android/l;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
new-instance v3, Lcom/crashlytics/android/core/ao$a;
|
|
|
|
aget v0, v0, v1
|
|
|
|
invoke-direct {v3, p0, v2, v0}, Lcom/crashlytics/android/core/ao$a;-><init>(Lcom/crashlytics/android/core/ao;[BI)V
|
|
|
|
return-object v3
|
|
.end method
|
|
|
|
.method private cX()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
:try_start_0
|
|
new-instance v0, Lio/fabric/sdk/android/a/b/r;
|
|
|
|
iget-object v1, p0, Lcom/crashlytics/android/core/ao;->se:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1}, Lio/fabric/sdk/android/a/b/r;-><init>(Ljava/io/File;)V
|
|
|
|
iput-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
invoke-static {}, Lio/fabric/sdk/android/c;->DH()Lio/fabric/sdk/android/l;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "CrashlyticsCore"
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, "Could not open log file: "
|
|
|
|
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v4, p0, Lcom/crashlytics/android/core/ao;->se:Ljava/io/File;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v1, v2, v3, v0}, Lio/fabric/sdk/android/l;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(JLjava/lang/String;)V
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lcom/crashlytics/android/core/ao;->cX()V
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
const-string p3, "null"
|
|
|
|
:cond_0
|
|
:try_start_0
|
|
iget v0, p0, Lcom/crashlytics/android/core/ao;->sf:I
|
|
|
|
div-int/lit8 v0, v0, 0x4
|
|
|
|
invoke-virtual {p3}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
if-le v1, v0, :cond_1
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "..."
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p3}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v2, v0
|
|
|
|
invoke-virtual {p3, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
:cond_1
|
|
const-string v0, "\r"
|
|
|
|
const-string v1, " "
|
|
|
|
invoke-virtual {p3, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
const-string v0, "\n"
|
|
|
|
const-string v1, " "
|
|
|
|
invoke-virtual {p3, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
sget-object v0, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
const-string v1, "%d %s%n"
|
|
|
|
const/4 v2, 0x2
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v2, v3
|
|
|
|
const/4 p1, 0x1
|
|
|
|
aput-object p3, v2, p1
|
|
|
|
invoke-static {v0, v1, v2}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "UTF-8"
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
array-length p3, p1
|
|
|
|
invoke-virtual {p2, p1, p3}, Lio/fabric/sdk/android/a/b/r;->w([BI)V
|
|
|
|
:goto_0
|
|
iget-object p1, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
invoke-virtual {p1}, Lio/fabric/sdk/android/a/b/r;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
iget-object p1, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
invoke-virtual {p1}, Lio/fabric/sdk/android/a/b/r;->Ee()I
|
|
|
|
move-result p1
|
|
|
|
iget p2, p0, Lcom/crashlytics/android/core/ao;->sf:I
|
|
|
|
if-le p1, p2, :cond_2
|
|
|
|
iget-object p1, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
invoke-virtual {p1}, Lio/fabric/sdk/android/a/b/r;->remove()V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-static {}, Lio/fabric/sdk/android/c;->DH()Lio/fabric/sdk/android/l;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p3, "CrashlyticsCore"
|
|
|
|
const-string v0, "There was a problem writing to the Crashlytics log."
|
|
|
|
invoke-interface {p2, p3, v0, p1}, Lio/fabric/sdk/android/l;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:cond_3
|
|
return-void
|
|
.end method
|
|
|
|
.method public final cM()Lcom/crashlytics/android/core/d;
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lcom/crashlytics/android/core/ao;->cW()Lcom/crashlytics/android/core/ao$a;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object v1, v0, Lcom/crashlytics/android/core/ao$a;->pF:[B
|
|
|
|
iget v0, v0, Lcom/crashlytics/android/core/ao$a;->offset:I
|
|
|
|
invoke-static {v1, v0}, Lcom/crashlytics/android/core/d;->a([BI)Lcom/crashlytics/android/core/d;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final cN()[B
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/crashlytics/android/core/ao;->cW()Lcom/crashlytics/android/core/ao$a;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object v0, v0, Lcom/crashlytics/android/core/ao$a;->pF:[B
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final cO()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
const-string v1, "There was a problem closing the Crashlytics log file."
|
|
|
|
invoke-static {v0, v1}, Lio/fabric/sdk/android/a/b/i;->a(Ljava/io/Closeable;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/crashlytics/android/core/ao;->sg:Lio/fabric/sdk/android/a/b/r;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final cP()V
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Lcom/crashlytics/android/core/ao;->cO()V
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/ao;->se:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
return-void
|
|
.end method
|