269 lines
6.9 KiB
Smali
269 lines
6.9 KiB
Smali
.class final Lcom/crashlytics/android/core/f;
|
|
.super Ljava/io/FileOutputStream;
|
|
.source "ClsFileOutputStream.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final qF:Ljava/io/FilenameFilter;
|
|
|
|
|
|
# instance fields
|
|
.field private closed:Z
|
|
|
|
.field private final qC:Ljava/lang/String;
|
|
|
|
.field private qD:Ljava/io/File;
|
|
|
|
.field private qE:Ljava/io/File;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/crashlytics/android/core/f$1;
|
|
|
|
invoke-direct {v0}, Lcom/crashlytics/android/core/f$1;-><init>()V
|
|
|
|
sput-object v0, Lcom/crashlytics/android/core/f;->qF:Ljava/io/FilenameFilter;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/io/File;Ljava/lang/String;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/FileNotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ".cls_temp"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, p1, v1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v0}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/crashlytics/android/core/f;->closed:Z
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
sget-object p1, Ljava/io/File;->separator:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/crashlytics/android/core/f;->qC:Ljava/lang/String;
|
|
|
|
new-instance p1, Ljava/io/File;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v0, p0, Lcom/crashlytics/android/core/f;->qC:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/crashlytics/android/core/f;->qD:Ljava/io/File;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final cj()V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-boolean v0, p0, Lcom/crashlytics/android/core/f;->closed:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/crashlytics/android/core/f;->closed:Z
|
|
|
|
invoke-super {p0}, Ljava/io/FileOutputStream;->flush()V
|
|
|
|
invoke-super {p0}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final declared-synchronized close()V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lcom/crashlytics/android/core/f;->closed:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
:try_start_1
|
|
iput-boolean v0, p0, Lcom/crashlytics/android/core/f;->closed:Z
|
|
|
|
invoke-super {p0}, Ljava/io/FileOutputStream;->flush()V
|
|
|
|
invoke-super {p0}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v2, p0, Lcom/crashlytics/android/core/f;->qC:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ".cls"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Lcom/crashlytics/android/core/f;->qD:Ljava/io/File;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iput-object v1, p0, Lcom/crashlytics/android/core/f;->qD:Ljava/io/File;
|
|
|
|
iput-object v0, p0, Lcom/crashlytics/android/core/f;->qE:Ljava/io/File;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:try_start_2
|
|
const-string v1, ""
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
iget-object v2, p0, Lcom/crashlytics/android/core/f;->qD:Ljava/io/File;
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
const-string v1, " (source does not exist)"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const-string v1, " (target already exists)"
|
|
|
|
:cond_3
|
|
:goto_0
|
|
new-instance v2, Ljava/io/IOException;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, "Could not rename temp file: "
|
|
|
|
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v4, p0, Lcom/crashlytics/android/core/f;->qD:Ljava/io/File;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, " -> "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|