329 lines
8.7 KiB
Smali
329 lines
8.7 KiB
Smali
.class Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;
|
|
.super Ljava/lang/Object;
|
|
.source "FileBackedNativeSessionFile.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;
|
|
|
|
|
|
# instance fields
|
|
.field private final dataTransportFilename:Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final file:Ljava/io/File;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final reportsEndpointFilename:Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)V
|
|
.locals 0
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Ljava/io/File;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->dataTransportFilename:Ljava/lang/String;
|
|
|
|
.line 3
|
|
iput-object p2, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->reportsEndpointFilename:Ljava/lang/String;
|
|
|
|
.line 4
|
|
iput-object p3, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->file:Ljava/io/File;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private asGzippedBytes()[B
|
|
.locals 7
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/16 v0, 0x2000
|
|
|
|
new-array v0, v0, [B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0}, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->getStream()Ljava/io/InputStream;
|
|
|
|
move-result-object v2
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 2
|
|
:try_start_1
|
|
new-instance v3, Ljava/io/ByteArrayOutputStream;
|
|
|
|
invoke-direct {v3}, Ljava/io/ByteArrayOutputStream;-><init>()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_4
|
|
|
|
.line 3
|
|
:try_start_2
|
|
new-instance v4, Ljava/util/zip/GZIPOutputStream;
|
|
|
|
invoke-direct {v4, v3}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 4
|
|
invoke-virtual {v4}, Ljava/util/zip/GZIPOutputStream;->close()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_2
|
|
|
|
:try_start_3
|
|
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_4
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
:try_start_4
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_4
|
|
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
|
|
|
|
:cond_0
|
|
return-object v1
|
|
|
|
.line 5
|
|
:cond_1
|
|
:goto_0
|
|
:try_start_5
|
|
invoke-virtual {v2, v0}, Ljava/io/InputStream;->read([B)I
|
|
|
|
move-result v5
|
|
|
|
if-lez v5, :cond_2
|
|
|
|
const/4 v6, 0x0
|
|
|
|
.line 6
|
|
invoke-virtual {v4, v0, v6, v5}, Ljava/util/zip/GZIPOutputStream;->write([BII)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_2
|
|
invoke-virtual {v4}, Ljava/util/zip/GZIPOutputStream;->finish()V
|
|
|
|
.line 8
|
|
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
|
|
|
|
move-result-object v0
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
|
|
|
.line 9
|
|
:try_start_6
|
|
invoke-virtual {v4}, Ljava/util/zip/GZIPOutputStream;->close()V
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_2
|
|
|
|
:try_start_7
|
|
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
|
|
:try_end_7
|
|
.catchall {:try_start_7 .. :try_end_7} :catchall_4
|
|
|
|
:try_start_8
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_8
|
|
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
.line 10
|
|
:try_start_9
|
|
invoke-virtual {v4}, Ljava/util/zip/GZIPOutputStream;->close()V
|
|
:try_end_9
|
|
.catchall {:try_start_9 .. :try_end_9} :catchall_1
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_1
|
|
move-exception v4
|
|
|
|
:try_start_a
|
|
invoke-virtual {v0, v4}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:goto_1
|
|
throw v0
|
|
:try_end_a
|
|
.catchall {:try_start_a .. :try_end_a} :catchall_2
|
|
|
|
:catchall_2
|
|
move-exception v0
|
|
|
|
:try_start_b
|
|
invoke-virtual {v3}, Ljava/io/ByteArrayOutputStream;->close()V
|
|
:try_end_b
|
|
.catchall {:try_start_b .. :try_end_b} :catchall_3
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_3
|
|
move-exception v3
|
|
|
|
:try_start_c
|
|
invoke-virtual {v0, v3}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:goto_2
|
|
throw v0
|
|
:try_end_c
|
|
.catchall {:try_start_c .. :try_end_c} :catchall_4
|
|
|
|
:catchall_4
|
|
move-exception v0
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
:try_start_d
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_d
|
|
.catchall {:try_start_d .. :try_end_d} :catchall_5
|
|
|
|
goto :goto_3
|
|
|
|
:catchall_5
|
|
move-exception v2
|
|
|
|
:try_start_e
|
|
invoke-virtual {v0, v2}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:cond_3
|
|
:goto_3
|
|
throw v0
|
|
:try_end_e
|
|
.catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_0
|
|
|
|
:catch_0
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public asFilePayload()Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->asGzippedBytes()[B
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {}, Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File;->builder()Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;
|
|
|
|
move-result-object v1
|
|
|
|
.line 3
|
|
invoke-virtual {v1, v0}, Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;->setContents([B)Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->dataTransportFilename:Ljava/lang/String;
|
|
|
|
.line 4
|
|
invoke-virtual {v0, v1}, Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;->setFilename(Ljava/lang/String;)Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
.line 5
|
|
invoke-virtual {v0}, Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File$Builder;->build()Lcom/google/firebase/crashlytics/internal/model/CrashlyticsReport$FilesPayload$File;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getReportsEndpointFilename()Ljava/lang/String;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->reportsEndpointFilename:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getStream()Ljava/io/InputStream;
|
|
.locals 3
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->file:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->file:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v0, Ljava/io/FileInputStream;
|
|
|
|
iget-object v2, p0, Lcom/google/firebase/crashlytics/internal/common/FileBackedNativeSessionFile;->file:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object v0
|
|
|
|
:catch_0
|
|
:cond_1
|
|
:goto_0
|
|
return-object v1
|
|
.end method
|