181 lines
4.4 KiB
Smali
181 lines
4.4 KiB
Smali
.class Lcom/google/firebase/crashlytics/internal/common/NativeSessionFileGzipper;
|
|
.super Ljava/lang/Object;
|
|
.source "NativeSessionFileGzipper.java"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static gzipInputStream(Ljava/io/InputStream;Ljava/io/File;)V
|
|
.locals 4
|
|
.param p0 # Ljava/io/InputStream;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/io/File;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/16 v0, 0x2000
|
|
|
|
new-array v0, v0, [B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
new-instance v2, Ljava/util/zip/GZIPOutputStream;
|
|
|
|
new-instance v3, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v3, p1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
|
|
|
|
invoke-direct {v2, v3}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
.line 2
|
|
:goto_0
|
|
:try_start_1
|
|
invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
|
|
|
|
move-result p1
|
|
|
|
if-lez p1, :cond_1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 3
|
|
invoke-virtual {v2, v0, v1, p1}, Ljava/util/zip/GZIPOutputStream;->write([BII)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:cond_1
|
|
invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->finish()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
.line 5
|
|
invoke-static {v2}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
move-object v1, v2
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_1
|
|
move-exception p0
|
|
|
|
:goto_1
|
|
invoke-static {v1}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
.line 6
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static processNativeSessions(Ljava/io/File;Ljava/util/List;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/io/File;",
|
|
"Ljava/util/List<",
|
|
"Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
invoke-interface {v0}, Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;->getStream()Ljava/io/InputStream;
|
|
|
|
move-result-object v1
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 3
|
|
:catch_0
|
|
:goto_1
|
|
invoke-static {v1}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:cond_0
|
|
:try_start_1
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
.line 5
|
|
invoke-interface {v0}, Lcom/google/firebase/crashlytics/internal/common/NativeSessionFile;->getReportsEndpointFilename()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, p0, v0}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 6
|
|
invoke-static {v1, v2}, Lcom/google/firebase/crashlytics/internal/common/NativeSessionFileGzipper;->gzipInputStream(Ljava/io/InputStream;Ljava/io/File;)V
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 7
|
|
invoke-static {v1}, Lcom/google/firebase/crashlytics/internal/common/CommonUtils;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
.line 8
|
|
throw p0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|