Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package com.google.firebase.crashlytics.ndk;
import android.content.Context;
import com.google.firebase.components.Component;
import com.google.firebase.components.ComponentContainer;
import com.google.firebase.components.ComponentFactory;
import com.google.firebase.components.ComponentRegistrar;
import com.google.firebase.components.Dependency;
import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent;
import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider;
import com.google.firebase.platforminfo.LibraryVersionComponent;
import java.util.Arrays;
import java.util.List;
/* loaded from: classes3.dex */
public class CrashlyticsNdkRegistrar implements ComponentRegistrar {
@Override // com.google.firebase.components.ComponentRegistrar
public List getComponents() {
return Arrays.asList(Component.builder(CrashlyticsNativeComponent.class).name("fire-cls-ndk").add(Dependency.required(Context.class)).factory(new ComponentFactory() { // from class: com.google.firebase.crashlytics.ndk.CrashlyticsNdkRegistrar$$ExternalSyntheticLambda0
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
CrashlyticsNativeComponent buildCrashlyticsNdk;
buildCrashlyticsNdk = CrashlyticsNdkRegistrar.this.buildCrashlyticsNdk(componentContainer);
return buildCrashlyticsNdk;
}
}).eagerInDefaultApp().build(), LibraryVersionComponent.create("fire-cls-ndk", "19.0.1"));
}
public final CrashlyticsNativeComponent buildCrashlyticsNdk(ComponentContainer componentContainer) {
return FirebaseCrashlyticsNdk.create((Context) componentContainer.get(Context.class), !DevelopmentPlatformProvider.isUnity(r2));
}
}

View File

@@ -0,0 +1,252 @@
package com.google.firebase.crashlytics.ndk;
import android.app.ActivityManager;
import android.app.ApplicationExitInfo;
import android.content.Context;
import android.os.Build;
import androidx.work.impl.utils.ForceStopRunnable$$ExternalSyntheticApiModelOutline1;
import com.google.firebase.crashlytics.internal.Logger;
import com.google.firebase.crashlytics.internal.common.CommonUtils;
import com.google.firebase.crashlytics.internal.model.CrashlyticsReport;
import com.google.firebase.crashlytics.internal.model.StaticSessionData;
import com.google.firebase.crashlytics.internal.persistence.FileStore;
import com.google.firebase.crashlytics.ndk.SessionFiles;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Iterator;
import java.util.List;
import java.util.zip.GZIPOutputStream;
/* loaded from: classes3.dex */
public class CrashpadController {
public static final Charset UTF_8 = Charset.forName("UTF-8");
public final Context context;
public final FileStore fileStore;
public final NativeApi nativeApi;
public CrashpadController(Context context, NativeApi nativeApi, FileStore fileStore) {
this.context = context;
this.nativeApi = nativeApi;
this.fileStore = fileStore;
}
public boolean initialize(String str, String str2, long j, StaticSessionData staticSessionData) {
File nativeSessionDir = this.fileStore.getNativeSessionDir(str);
if (nativeSessionDir == null) {
return false;
}
try {
if (!this.nativeApi.initialize(nativeSessionDir.getCanonicalPath(), this.context.getAssets())) {
return false;
}
writeBeginSession(str, str2, j);
writeSessionApp(str, staticSessionData.appData());
writeSessionOs(str, staticSessionData.osData());
writeSessionDevice(str, staticSessionData.deviceData());
return true;
} catch (IOException e) {
Logger.getLogger().e("Error initializing Crashlytics NDK", e);
return false;
}
}
public boolean hasCrashDataForSession(String str) {
SessionFiles.NativeCore nativeCore = getFilesForSession(str).nativeCore;
return nativeCore != null && nativeCore.hasCore();
}
public SessionFiles getFilesForSession(String str) {
File nativeSessionDir = this.fileStore.getNativeSessionDir(str);
File file = new File(nativeSessionDir, "pending");
Logger.getLogger().v("Minidump directory: " + file.getAbsolutePath());
File singleFileWithExtension = getSingleFileWithExtension(file, ".dmp");
Logger logger = Logger.getLogger();
StringBuilder sb = new StringBuilder();
sb.append("Minidump file ");
sb.append((singleFileWithExtension == null || !singleFileWithExtension.exists()) ? "does not exist" : "exists");
logger.v(sb.toString());
SessionFiles.Builder builder = new SessionFiles.Builder();
if (nativeSessionDir != null && nativeSessionDir.exists() && file.exists()) {
builder.nativeCore(getNativeCore(str, file)).metadataFile(getSingleFileWithExtension(nativeSessionDir, ".device_info")).sessionFile(new File(nativeSessionDir, "session.json")).appFile(new File(nativeSessionDir, "app.json")).deviceFile(new File(nativeSessionDir, "device.json")).osFile(new File(nativeSessionDir, "os.json"));
}
return builder.build();
}
public final SessionFiles.NativeCore getNativeCore(String str, File file) {
return new SessionFiles.NativeCore(getSingleFileWithExtension(file, ".dmp"), getApplicationExitInfo(str));
}
public final CrashlyticsReport.ApplicationExitInfo getApplicationExitInfo(String str) {
if (Build.VERSION.SDK_INT >= 31) {
return getNativeCrashApplicationExitInfo(str);
}
return null;
}
public final CrashlyticsReport.ApplicationExitInfo getNativeCrashApplicationExitInfo(String str) {
List historicalProcessExitReasons;
historicalProcessExitReasons = ((ActivityManager) this.context.getSystemService("activity")).getHistoricalProcessExitReasons(null, 0, 0);
File sessionFile = this.fileStore.getSessionFile(str, "start-time");
return getRelevantApplicationExitInfo(sessionFile == null ? System.currentTimeMillis() : sessionFile.lastModified(), historicalProcessExitReasons);
}
public final CrashlyticsReport.ApplicationExitInfo getRelevantApplicationExitInfo(long j, List list) {
int reason;
long timestamp;
ArrayList arrayList = new ArrayList();
Iterator it = list.iterator();
while (it.hasNext()) {
ApplicationExitInfo m = ForceStopRunnable$$ExternalSyntheticApiModelOutline1.m(it.next());
reason = m.getReason();
if (reason == 5) {
timestamp = m.getTimestamp();
if (timestamp >= j) {
arrayList.add(m);
}
}
}
if (arrayList.isEmpty()) {
return null;
}
return convertApplicationExitInfoToModel(ForceStopRunnable$$ExternalSyntheticApiModelOutline1.m(arrayList.get(0)));
}
public void writeBeginSession(String str, String str2, long j) {
writeSessionJsonFile(this.fileStore, str, SessionMetadataJsonSerializer.serializeBeginSession(str, str2, j), "session.json");
}
public void writeSessionApp(String str, StaticSessionData.AppData appData) {
writeSessionJsonFile(this.fileStore, str, SessionMetadataJsonSerializer.serializeSessionApp(appData.appIdentifier(), appData.versionCode(), appData.versionName(), appData.installUuid(), appData.deliveryMechanism(), appData.developmentPlatformProvider().getDevelopmentPlatform(), appData.developmentPlatformProvider().getDevelopmentPlatformVersion()), "app.json");
}
public void writeSessionOs(String str, StaticSessionData.OsData osData) {
writeSessionJsonFile(this.fileStore, str, SessionMetadataJsonSerializer.serializeSessionOs(osData.osRelease(), osData.osCodeName(), osData.isRooted()), "os.json");
}
public void writeSessionDevice(String str, StaticSessionData.DeviceData deviceData) {
writeSessionJsonFile(this.fileStore, str, SessionMetadataJsonSerializer.serializeSessionDevice(deviceData.arch(), deviceData.model(), deviceData.availableProcessors(), deviceData.totalRam(), deviceData.diskSpace(), deviceData.isEmulator(), deviceData.state(), deviceData.manufacturer(), deviceData.modelClass()), "device.json");
}
public static void writeSessionJsonFile(FileStore fileStore, String str, String str2, String str3) {
writeTextFile(new File(fileStore.getNativeSessionDir(str), str3), str2);
}
public static void writeTextFile(File file, String str) {
BufferedWriter bufferedWriter;
BufferedWriter bufferedWriter2 = null;
try {
bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), UTF_8));
} catch (IOException unused) {
} catch (Throwable th) {
th = th;
}
try {
bufferedWriter.write(str);
CommonUtils.closeOrLog(bufferedWriter, "Failed to close " + file);
} catch (IOException unused2) {
bufferedWriter2 = bufferedWriter;
CommonUtils.closeOrLog(bufferedWriter2, "Failed to close " + file);
} catch (Throwable th2) {
th = th2;
bufferedWriter2 = bufferedWriter;
CommonUtils.closeOrLog(bufferedWriter2, "Failed to close " + file);
throw th;
}
}
public static File getSingleFileWithExtension(File file, String str) {
File[] listFiles = file.listFiles();
if (listFiles == null) {
return null;
}
for (File file2 : listFiles) {
if (file2.getName().endsWith(str)) {
return file2;
}
}
return null;
}
public static CrashlyticsReport.ApplicationExitInfo convertApplicationExitInfoToModel(ApplicationExitInfo applicationExitInfo) {
int importance;
String processName;
int reason;
long timestamp;
int pid;
long pss;
long rss;
CrashlyticsReport.ApplicationExitInfo.Builder builder = CrashlyticsReport.ApplicationExitInfo.builder();
importance = applicationExitInfo.getImportance();
CrashlyticsReport.ApplicationExitInfo.Builder importance2 = builder.setImportance(importance);
processName = applicationExitInfo.getProcessName();
CrashlyticsReport.ApplicationExitInfo.Builder processName2 = importance2.setProcessName(processName);
reason = applicationExitInfo.getReason();
CrashlyticsReport.ApplicationExitInfo.Builder reasonCode = processName2.setReasonCode(reason);
timestamp = applicationExitInfo.getTimestamp();
CrashlyticsReport.ApplicationExitInfo.Builder timestamp2 = reasonCode.setTimestamp(timestamp);
pid = applicationExitInfo.getPid();
CrashlyticsReport.ApplicationExitInfo.Builder pid2 = timestamp2.setPid(pid);
pss = applicationExitInfo.getPss();
CrashlyticsReport.ApplicationExitInfo.Builder pss2 = pid2.setPss(pss);
rss = applicationExitInfo.getRss();
return pss2.setRss(rss).setTraceFile(getTraceFileFromApplicationExitInfo(applicationExitInfo)).build();
}
public static String getTraceFileFromApplicationExitInfo(ApplicationExitInfo applicationExitInfo) {
InputStream traceInputStream;
try {
traceInputStream = applicationExitInfo.getTraceInputStream();
return convertInputStreamToString(traceInputStream);
} catch (IOException unused) {
Logger.getLogger().w("Failed to get input stream from ApplicationExitInfo");
return null;
}
}
public static String convertInputStreamToString(InputStream inputStream) {
if (inputStream == null) {
return null;
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] bArr = new byte[8192];
while (true) {
int read = inputStream.read(bArr);
if (read != -1) {
byteArrayOutputStream.write(bArr, 0, read);
} else {
return zipAndEncode(byteArrayOutputStream.toByteArray());
}
}
}
public static String zipAndEncode(byte[] bArr) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
try {
gZIPOutputStream.write(bArr);
gZIPOutputStream.finish();
String encodeToString = Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray());
gZIPOutputStream.close();
byteArrayOutputStream.close();
return encodeToString;
} finally {
}
} catch (Throwable th) {
try {
byteArrayOutputStream.close();
} catch (Throwable th2) {
th.addSuppressed(th2);
}
throw th;
}
}
}

View File

@@ -0,0 +1,19 @@
package com.google.firebase.crashlytics.ndk;
/* loaded from: classes3.dex */
public class CrashpadMain {
public static native void crashpadMain(String[] strArr);
public static void main(String[] strArr) {
try {
String str = strArr[1];
StringBuilder sb = new StringBuilder();
sb.append("Path to shared objects is ");
sb.append(str);
System.load(str + "libcrashlytics-handler.so");
crashpadMain(strArr);
} catch (UnsatisfiedLinkError e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -0,0 +1,71 @@
package com.google.firebase.crashlytics.ndk;
import android.content.Context;
import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent;
import com.google.firebase.crashlytics.internal.Logger;
import com.google.firebase.crashlytics.internal.NativeSessionFileProvider;
import com.google.firebase.crashlytics.internal.model.StaticSessionData;
import com.google.firebase.crashlytics.internal.persistence.FileStore;
/* loaded from: classes3.dex */
public class FirebaseCrashlyticsNdk implements CrashlyticsNativeComponent {
public static FirebaseCrashlyticsNdk instance;
public final CrashpadController controller;
public String currentSessionId;
public boolean installHandlerDuringPrepareSession;
public SignalHandlerInstaller signalHandlerInstaller;
public interface SignalHandlerInstaller {
void installHandler();
}
public static FirebaseCrashlyticsNdk create(Context context, boolean z) {
FirebaseCrashlyticsNdk firebaseCrashlyticsNdk = new FirebaseCrashlyticsNdk(new CrashpadController(context, new JniNativeApi(context), new FileStore(context)), z);
instance = firebaseCrashlyticsNdk;
return firebaseCrashlyticsNdk;
}
public FirebaseCrashlyticsNdk(CrashpadController crashpadController, boolean z) {
this.controller = crashpadController;
this.installHandlerDuringPrepareSession = z;
}
@Override // com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent
public boolean hasCrashDataForCurrentSession() {
String str = this.currentSessionId;
return str != null && hasCrashDataForSession(str);
}
@Override // com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent
public boolean hasCrashDataForSession(String str) {
return this.controller.hasCrashDataForSession(str);
}
@Override // com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent
public synchronized void prepareNativeSession(final String str, final String str2, final long j, final StaticSessionData staticSessionData) {
this.currentSessionId = str;
SignalHandlerInstaller signalHandlerInstaller = new SignalHandlerInstaller() { // from class: com.google.firebase.crashlytics.ndk.FirebaseCrashlyticsNdk$$ExternalSyntheticLambda0
@Override // com.google.firebase.crashlytics.ndk.FirebaseCrashlyticsNdk.SignalHandlerInstaller
public final void installHandler() {
FirebaseCrashlyticsNdk.this.lambda$prepareNativeSession$0(str, str2, j, staticSessionData);
}
};
this.signalHandlerInstaller = signalHandlerInstaller;
if (this.installHandlerDuringPrepareSession) {
signalHandlerInstaller.installHandler();
}
}
public final /* synthetic */ void lambda$prepareNativeSession$0(String str, String str2, long j, StaticSessionData staticSessionData) {
Logger.getLogger().d("Initializing native session: " + str);
if (this.controller.initialize(str, str2, j, staticSessionData)) {
return;
}
Logger.getLogger().w("Failed to initialize Crashlytics NDK for session " + str);
}
@Override // com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent
public NativeSessionFileProvider getSessionFileProvider(String str) {
return new SessionFilesProvider(this.controller.getFilesForSession(str));
}
}

View File

@@ -0,0 +1,136 @@
package com.google.firebase.crashlytics.ndk;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.os.Build;
import android.text.TextUtils;
import com.google.firebase.crashlytics.internal.Logger;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/* loaded from: classes3.dex */
class JniNativeApi implements NativeApi {
public static final FilenameFilter APK_FILTER = new FilenameFilter() { // from class: com.google.firebase.crashlytics.ndk.JniNativeApi$$ExternalSyntheticLambda0
@Override // java.io.FilenameFilter
public final boolean accept(File file, String str) {
boolean lambda$static$0;
lambda$static$0 = JniNativeApi.lambda$static$0(file, str);
return lambda$static$0;
}
};
public static final boolean LIB_CRASHLYTICS_LOADED;
public final Context context;
public static int getPackageInfoFlags() {
return 9216;
}
public static boolean isAtLeastLollipop() {
return true;
}
private native boolean nativeInit(String[] strArr, Object obj);
static {
boolean z;
try {
System.loadLibrary("crashlytics");
z = true;
} catch (UnsatisfiedLinkError e) {
Logger.getLogger().e("libcrashlytics could not be loaded. This APK may not have been compiled for this device's architecture. NDK crashes will not be reported to Crashlytics:\n" + e.getLocalizedMessage());
z = false;
}
LIB_CRASHLYTICS_LOADED = z;
}
public static /* synthetic */ boolean lambda$static$0(File file, String str) {
return str.toLowerCase().endsWith(".apk");
}
public JniNativeApi(Context context) {
this.context = context;
}
public static String getVersionCodeAsString(PackageInfo packageInfo) {
long longVersionCode;
if (Build.VERSION.SDK_INT >= 28) {
longVersionCode = packageInfo.getLongVersionCode();
return Long.toString(longVersionCode);
}
return Integer.toString(packageInfo.versionCode);
}
public static void addSplitSourceDirs(List list, PackageInfo packageInfo) {
ApplicationInfo applicationInfo = packageInfo.applicationInfo;
String[] strArr = applicationInfo.splitSourceDirs;
if (strArr != null) {
Collections.addAll(list, strArr);
}
File file = new File(applicationInfo.dataDir, String.format("files/splitcompat/%s/verified-splits", getVersionCodeAsString(packageInfo)));
if (!file.exists()) {
Logger.getLogger().d("No dynamic features found at " + file.getAbsolutePath());
return;
}
File[] listFiles = file.listFiles(APK_FILTER);
if (listFiles == null) {
listFiles = new File[0];
}
Logger.getLogger().d("Found " + listFiles.length + " APKs in " + file.getAbsolutePath());
for (File file2 : listFiles) {
Logger.getLogger().d("Adding " + file2.getName() + " to classpath.");
list.add(file2.getAbsolutePath());
}
}
public String[] makePackagePaths(String str) {
try {
PackageInfo packageInfo = this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), getPackageInfoFlags());
ArrayList<String> arrayList = new ArrayList(10);
arrayList.add(packageInfo.applicationInfo.sourceDir);
if (isAtLeastLollipop()) {
addSplitSourceDirs(arrayList, packageInfo);
}
String[] strArr = packageInfo.applicationInfo.sharedLibraryFiles;
if (strArr != null) {
Collections.addAll(arrayList, strArr);
}
ArrayList arrayList2 = new ArrayList(10);
File parentFile = new File(packageInfo.applicationInfo.nativeLibraryDir).getParentFile();
if (parentFile != null) {
arrayList2.add(new File(parentFile, str).getPath());
if (str.startsWith("arm64")) {
arrayList2.add(new File(parentFile, "arm64").getPath());
} else if (str.startsWith("arm")) {
arrayList2.add(new File(parentFile, "arm").getPath());
}
}
for (String str2 : arrayList) {
if (str2.endsWith(".apk")) {
arrayList2.add(str2 + "!/lib/" + str);
}
}
arrayList2.add(System.getProperty("java.library.path"));
arrayList2.add(packageInfo.applicationInfo.nativeLibraryDir);
String str3 = File.pathSeparator;
return new String[]{TextUtils.join(str3, arrayList), TextUtils.join(str3, arrayList2)};
} catch (PackageManager.NameNotFoundException e) {
Logger.getLogger().e("Unable to compose package paths", e);
throw new RuntimeException(e);
}
}
@Override // com.google.firebase.crashlytics.ndk.NativeApi
public boolean initialize(String str, AssetManager assetManager) {
String[] makePackagePaths = makePackagePaths(Build.CPU_ABI);
if (makePackagePaths.length < 2) {
return false;
}
return LIB_CRASHLYTICS_LOADED && nativeInit(new String[]{makePackagePaths[0], makePackagePaths[1], str}, assetManager);
}
}

View File

@@ -0,0 +1,8 @@
package com.google.firebase.crashlytics.ndk;
import android.content.res.AssetManager;
/* loaded from: classes3.dex */
public interface NativeApi {
boolean initialize(String str, AssetManager assetManager);
}

View File

@@ -0,0 +1,84 @@
package com.google.firebase.crashlytics.ndk;
import com.google.firebase.crashlytics.internal.model.CrashlyticsReport;
import java.io.File;
/* loaded from: classes3.dex */
public final class SessionFiles {
public final File app;
public final File binaryImages;
public final File device;
public final File metadata;
public final NativeCore nativeCore;
public final File os;
public final File session;
public static final class NativeCore {
public final CrashlyticsReport.ApplicationExitInfo applicationExitInfo;
public final File minidump;
public NativeCore(File file, CrashlyticsReport.ApplicationExitInfo applicationExitInfo) {
this.minidump = file;
this.applicationExitInfo = applicationExitInfo;
}
public boolean hasCore() {
File file = this.minidump;
return (file != null && file.exists()) || this.applicationExitInfo != null;
}
}
public static final class Builder {
public File app;
public File binaryImages;
public File device;
public File metadata;
public NativeCore nativeCore;
public File os;
public File session;
public Builder appFile(File file) {
this.app = file;
return this;
}
public Builder deviceFile(File file) {
this.device = file;
return this;
}
public Builder metadataFile(File file) {
this.metadata = file;
return this;
}
public Builder nativeCore(NativeCore nativeCore) {
this.nativeCore = nativeCore;
return this;
}
public Builder osFile(File file) {
this.os = file;
return this;
}
public Builder sessionFile(File file) {
this.session = file;
return this;
}
public SessionFiles build() {
return new SessionFiles(this);
}
}
public SessionFiles(Builder builder) {
this.nativeCore = builder.nativeCore;
this.binaryImages = builder.binaryImages;
this.metadata = builder.metadata;
this.session = builder.session;
this.app = builder.app;
this.device = builder.device;
this.os = builder.os;
}
}

View File

@@ -0,0 +1,54 @@
package com.google.firebase.crashlytics.ndk;
import com.google.firebase.crashlytics.internal.NativeSessionFileProvider;
import com.google.firebase.crashlytics.internal.model.CrashlyticsReport;
import com.google.firebase.crashlytics.ndk.SessionFiles;
import java.io.File;
/* loaded from: classes3.dex */
public class SessionFilesProvider implements NativeSessionFileProvider {
public final SessionFiles sessionFiles;
public SessionFilesProvider(SessionFiles sessionFiles) {
this.sessionFiles = sessionFiles;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getMinidumpFile() {
return this.sessionFiles.nativeCore.minidump;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public CrashlyticsReport.ApplicationExitInfo getApplicationExitInto() {
SessionFiles.NativeCore nativeCore = this.sessionFiles.nativeCore;
if (nativeCore != null) {
return nativeCore.applicationExitInfo;
}
return null;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getMetadataFile() {
return this.sessionFiles.metadata;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getSessionFile() {
return this.sessionFiles.session;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getAppFile() {
return this.sessionFiles.app;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getDeviceFile() {
return this.sessionFiles.device;
}
@Override // com.google.firebase.crashlytics.internal.NativeSessionFileProvider
public File getOsFile() {
return this.sessionFiles.os;
}
}

View File

@@ -0,0 +1,54 @@
package com.google.firebase.crashlytics.ndk;
import com.facebook.gamingservices.cloudgaming.internal.SDKAnalyticsEvents;
import java.util.HashMap;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public abstract class SessionMetadataJsonSerializer {
public static String emptyIfNull(String str) {
return str == null ? "" : str;
}
public static String serializeBeginSession(String str, String str2, long j) {
HashMap hashMap = new HashMap();
hashMap.put(SDKAnalyticsEvents.PARAMETER_SESSION_ID, str);
hashMap.put("generator", str2);
hashMap.put("started_at_seconds", Long.valueOf(j));
return new JSONObject(hashMap).toString();
}
public static String serializeSessionApp(String str, String str2, String str3, String str4, int i, String str5, String str6) {
HashMap hashMap = new HashMap();
hashMap.put("app_identifier", str);
hashMap.put("version_code", str2);
hashMap.put("version_name", str3);
hashMap.put("install_uuid", str4);
hashMap.put("delivery_mechanism", Integer.valueOf(i));
hashMap.put("development_platform", emptyIfNull(str5));
hashMap.put("development_platform_version", emptyIfNull(str6));
return new JSONObject(hashMap).toString();
}
public static String serializeSessionOs(String str, String str2, boolean z) {
HashMap hashMap = new HashMap();
hashMap.put("version", str);
hashMap.put("build_version", str2);
hashMap.put("is_rooted", Boolean.valueOf(z));
return new JSONObject(hashMap).toString();
}
public static String serializeSessionDevice(int i, String str, int i2, long j, long j2, boolean z, int i3, String str2, String str3) {
HashMap hashMap = new HashMap();
hashMap.put("arch", Integer.valueOf(i));
hashMap.put("build_model", str);
hashMap.put("available_processors", Integer.valueOf(i2));
hashMap.put("total_ram", Long.valueOf(j));
hashMap.put("disk_space", Long.valueOf(j2));
hashMap.put("is_emulator", Boolean.valueOf(z));
hashMap.put("state", Integer.valueOf(i3));
hashMap.put("build_manufacturer", str2);
hashMap.put("build_product", str3);
return new JSONObject(hashMap).toString();
}
}