- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
62 lines
2.1 KiB
Java
62 lines
2.1 KiB
Java
package com.google.firebase.crashlytics.internal.common;
|
|
|
|
import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.zip.GZIPOutputStream;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public abstract class NativeSessionFileGzipper {
|
|
public static void processNativeSessions(File file, List list) {
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
NativeSessionFile nativeSessionFile = (NativeSessionFile) it.next();
|
|
InputStream inputStream = null;
|
|
try {
|
|
inputStream = nativeSessionFile.getStream();
|
|
if (inputStream != null) {
|
|
gzipInputStream(inputStream, new File(file, nativeSessionFile.getReportsEndpointFilename()));
|
|
}
|
|
} catch (IOException unused) {
|
|
} catch (Throwable th) {
|
|
CommonUtils.closeQuietly(null);
|
|
throw th;
|
|
}
|
|
CommonUtils.closeQuietly(inputStream);
|
|
}
|
|
}
|
|
|
|
public static void gzipInputStream(InputStream inputStream, File file) {
|
|
if (inputStream == null) {
|
|
return;
|
|
}
|
|
byte[] bArr = new byte[8192];
|
|
GZIPOutputStream gZIPOutputStream = null;
|
|
try {
|
|
GZIPOutputStream gZIPOutputStream2 = new GZIPOutputStream(new FileOutputStream(file));
|
|
while (true) {
|
|
try {
|
|
int read = inputStream.read(bArr);
|
|
if (read > 0) {
|
|
gZIPOutputStream2.write(bArr, 0, read);
|
|
} else {
|
|
gZIPOutputStream2.finish();
|
|
CommonUtils.closeQuietly(gZIPOutputStream2);
|
|
return;
|
|
}
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
gZIPOutputStream = gZIPOutputStream2;
|
|
CommonUtils.closeQuietly(gZIPOutputStream);
|
|
throw th;
|
|
}
|
|
}
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
}
|
|
}
|
|
}
|