tmap/smali_classes3/com/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile.smali
2022-06-10 21:38:30 +09:00

275 lines
7.3 KiB
Smali

.class Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;
.super Ljava/lang/Object;
.source "BytesBackedNativeSessionFile.java"
# interfaces
.implements Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;
# instance fields
.field private final bytes:[B
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field private final dataTransportFilename:Ljava/lang/String;
.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;[B)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 # [B
.annotation build Landroidx/annotation/Nullable;
.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/BytesBackedNativeSessionFile;->dataTransportFilename:Ljava/lang/String;
.line 3
iput-object p2, p0, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->reportsEndpointFilename:Ljava/lang/String;
.line 4
iput-object p3, p0, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->bytes:[B
return-void
.end method
.method private asGzippedBytes()[B
.locals 4
.annotation build Landroidx/annotation/Nullable;
.end annotation
.line 1
invoke-direct {p0}, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->isEmpty()Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_0
return-object v1
.line 2
:cond_0
:try_start_0
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 3
:try_start_1
new-instance v2, Ljava/util/zip/GZIPOutputStream;
invoke-direct {v2, v0}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
.line 4
:try_start_2
iget-object v3, p0, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->bytes:[B
invoke-virtual {v2, v3}, Ljava/util/zip/GZIPOutputStream;->write([B)V
.line 5
invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->finish()V
.line 6
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v3
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 7
:try_start_3
invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->close()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_2
:try_start_4
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
return-object v3
:catchall_0
move-exception v3
.line 8
:try_start_5
invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->close()V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
goto :goto_0
:catchall_1
move-exception v2
:try_start_6
invoke-virtual {v3, v2}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_0
throw v3
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_2
:catchall_2
move-exception v2
:try_start_7
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_3
goto :goto_1
:catchall_3
move-exception v0
:try_start_8
invoke-virtual {v2, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
:goto_1
throw v2
:try_end_8
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
:catch_0
return-object v1
.end method
.method private isEmpty()Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->bytes:[B
if-eqz v0, :cond_1
array-length v0, v0
if-nez v0, :cond_0
goto :goto_0
:cond_0
const/4 v0, 0x0
goto :goto_1
:cond_1
:goto_0
const/4 v0, 0x1
:goto_1
return v0
.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/BytesBackedNativeSessionFile;->asGzippedBytes()[B
move-result-object v0
if-nez v0, :cond_0
const/4 v0, 0x0
goto :goto_0
.line 2
:cond_0
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/BytesBackedNativeSessionFile;->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_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/BytesBackedNativeSessionFile;->reportsEndpointFilename:Ljava/lang/String;
return-object v0
.end method
.method public getStream()Ljava/io/InputStream;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
.line 1
invoke-direct {p0}, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x0
goto :goto_0
:cond_0
new-instance v0, Ljava/io/ByteArrayInputStream;
iget-object v1, p0, Lcom/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile;->bytes:[B
invoke-direct {v0, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
:goto_0
return-object v0
.end method