Add Discord community version (64-bit only)

- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
This commit is contained in:
2026-02-18 15:48:36 -08:00
parent c19eb3d7ff
commit c080f0d97f
26930 changed files with 2529574 additions and 0 deletions

View File

@@ -0,0 +1,402 @@
package androidx.sqlite.db.framework;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteCursor;
import android.database.sqlite.SQLiteCursorDriver;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQuery;
import android.database.sqlite.SQLiteStatement;
import android.database.sqlite.SQLiteTransactionListener;
import android.os.Build;
import android.os.CancellationSignal;
import android.text.TextUtils;
import android.util.Pair;
import androidx.annotation.DoNotInline;
import androidx.annotation.RequiresApi;
import androidx.sqlite.db.SimpleSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteCompat;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteQuery;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import kotlin.jvm.functions.Function4;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nFrameworkSQLiteDatabase.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FrameworkSQLiteDatabase.kt\nandroidx/sqlite/db/framework/FrameworkSQLiteDatabase\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,336:1\n1#2:337\n*E\n"})
/* loaded from: classes.dex */
public final class FrameworkSQLiteDatabase implements SupportSQLiteDatabase {
private final SQLiteDatabase delegate;
public static final Companion Companion = new Companion(null);
private static final String[] CONFLICT_VALUES = {"", " OR ROLLBACK ", " OR ABORT ", " OR FAIL ", " OR IGNORE ", " OR REPLACE "};
private static final String[] EMPTY_STRING_ARRAY = new String[0];
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isExecPerConnectionSQLSupported() {
return Build.VERSION.SDK_INT >= 30;
}
public FrameworkSQLiteDatabase(SQLiteDatabase delegate) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.delegate = delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public SupportSQLiteStatement compileStatement(String sql) {
Intrinsics.checkNotNullParameter(sql, "sql");
SQLiteStatement compileStatement = this.delegate.compileStatement(sql);
Intrinsics.checkNotNullExpressionValue(compileStatement, "delegate.compileStatement(sql)");
return new FrameworkSQLiteStatement(compileStatement);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransaction() {
this.delegate.beginTransaction();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionNonExclusive() {
this.delegate.beginTransactionNonExclusive();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListener(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
this.delegate.beginTransactionWithListener(transactionListener);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void beginTransactionWithListenerNonExclusive(SQLiteTransactionListener transactionListener) {
Intrinsics.checkNotNullParameter(transactionListener, "transactionListener");
this.delegate.beginTransactionWithListenerNonExclusive(transactionListener);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void endTransaction() {
this.delegate.endTransaction();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setTransactionSuccessful() {
this.delegate.setTransactionSuccessful();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean inTransaction() {
return this.delegate.inTransaction();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDbLockedByCurrentThread() {
return this.delegate.isDbLockedByCurrentThread();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely() {
return this.delegate.yieldIfContendedSafely();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean yieldIfContendedSafely(long j) {
return this.delegate.yieldIfContendedSafely(j);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int getVersion() {
return this.delegate.getVersion();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setVersion(int i) {
this.delegate.setVersion(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getMaximumSize() {
return this.delegate.getMaximumSize();
}
/* renamed from: setMaximumSize, reason: collision with other method in class */
public void m177setMaximumSize(long j) {
this.delegate.setMaximumSize(j);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long setMaximumSize(long j) {
this.delegate.setMaximumSize(j);
return this.delegate.getMaximumSize();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execPerConnectionSQL(String sql, Object[] objArr) {
Intrinsics.checkNotNullParameter(sql, "sql");
int i = Build.VERSION.SDK_INT;
if (i >= 30) {
Api30Impl.INSTANCE.execPerConnectionSQL(this.delegate, sql, objArr);
return;
}
throw new UnsupportedOperationException("execPerConnectionSQL is not supported on a SDK version lower than 30, current version is: " + i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long getPageSize() {
return this.delegate.getPageSize();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setPageSize(long j) {
this.delegate.setPageSize(j);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(String query) {
Intrinsics.checkNotNullParameter(query, "query");
return query(new SimpleSQLiteQuery(query));
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(String query, Object[] bindArgs) {
Intrinsics.checkNotNullParameter(query, "query");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
return query(new SimpleSQLiteQuery(query, bindArgs));
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public Cursor query(final SupportSQLiteQuery query) {
Intrinsics.checkNotNullParameter(query, "query");
final Function4 function4 = new Function4() { // from class: androidx.sqlite.db.framework.FrameworkSQLiteDatabase$query$cursorFactory$1
{
super(4);
}
@Override // kotlin.jvm.functions.Function4
public final SQLiteCursor invoke(SQLiteDatabase sQLiteDatabase, SQLiteCursorDriver sQLiteCursorDriver, String str, SQLiteQuery sQLiteQuery) {
SupportSQLiteQuery supportSQLiteQuery = SupportSQLiteQuery.this;
Intrinsics.checkNotNull(sQLiteQuery);
supportSQLiteQuery.bindTo(new FrameworkSQLiteProgram(sQLiteQuery));
return new SQLiteCursor(sQLiteCursorDriver, str, sQLiteQuery);
}
};
Cursor rawQueryWithFactory = this.delegate.rawQueryWithFactory(new SQLiteDatabase.CursorFactory() { // from class: androidx.sqlite.db.framework.FrameworkSQLiteDatabase$$ExternalSyntheticLambda1
@Override // android.database.sqlite.SQLiteDatabase.CursorFactory
public final Cursor newCursor(SQLiteDatabase sQLiteDatabase, SQLiteCursorDriver sQLiteCursorDriver, String str, SQLiteQuery sQLiteQuery) {
Cursor query$lambda$0;
query$lambda$0 = FrameworkSQLiteDatabase.query$lambda$0(Function4.this, sQLiteDatabase, sQLiteCursorDriver, str, sQLiteQuery);
return query$lambda$0;
}
}, query.getSql(), EMPTY_STRING_ARRAY, null);
Intrinsics.checkNotNullExpressionValue(rawQueryWithFactory, "delegate.rawQueryWithFac…EMPTY_STRING_ARRAY, null)");
return rawQueryWithFactory;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Cursor query$lambda$0(Function4 tmp0, SQLiteDatabase sQLiteDatabase, SQLiteCursorDriver sQLiteCursorDriver, String str, SQLiteQuery sQLiteQuery) {
Intrinsics.checkNotNullParameter(tmp0, "$tmp0");
return (Cursor) tmp0.invoke(sQLiteDatabase, sQLiteCursorDriver, str, sQLiteQuery);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(16)
public Cursor query(final SupportSQLiteQuery query, CancellationSignal cancellationSignal) {
Intrinsics.checkNotNullParameter(query, "query");
SQLiteDatabase sQLiteDatabase = this.delegate;
String sql = query.getSql();
String[] strArr = EMPTY_STRING_ARRAY;
Intrinsics.checkNotNull(cancellationSignal);
return SupportSQLiteCompat.Api16Impl.rawQueryWithFactory(sQLiteDatabase, sql, strArr, null, cancellationSignal, new SQLiteDatabase.CursorFactory() { // from class: androidx.sqlite.db.framework.FrameworkSQLiteDatabase$$ExternalSyntheticLambda0
@Override // android.database.sqlite.SQLiteDatabase.CursorFactory
public final Cursor newCursor(SQLiteDatabase sQLiteDatabase2, SQLiteCursorDriver sQLiteCursorDriver, String str, SQLiteQuery sQLiteQuery) {
Cursor query$lambda$1;
query$lambda$1 = FrameworkSQLiteDatabase.query$lambda$1(SupportSQLiteQuery.this, sQLiteDatabase2, sQLiteCursorDriver, str, sQLiteQuery);
return query$lambda$1;
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static final Cursor query$lambda$1(SupportSQLiteQuery query, SQLiteDatabase sQLiteDatabase, SQLiteCursorDriver sQLiteCursorDriver, String str, SQLiteQuery sQLiteQuery) {
Intrinsics.checkNotNullParameter(query, "$query");
Intrinsics.checkNotNull(sQLiteQuery);
query.bindTo(new FrameworkSQLiteProgram(sQLiteQuery));
return new SQLiteCursor(sQLiteCursorDriver, str, sQLiteQuery);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public long insert(String table, int i, ContentValues values) throws SQLException {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
return this.delegate.insertWithOnConflict(table, null, values, i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int delete(String table, String str, Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
StringBuilder sb = new StringBuilder();
sb.append("DELETE FROM ");
sb.append(table);
if (str != null && str.length() != 0) {
sb.append(" WHERE ");
sb.append(str);
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()");
SupportSQLiteStatement compileStatement = compileStatement(sb2);
SimpleSQLiteQuery.Companion.bind(compileStatement, objArr);
return compileStatement.executeUpdateDelete();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public int update(String table, int i, ContentValues values, String str, Object[] objArr) {
Intrinsics.checkNotNullParameter(table, "table");
Intrinsics.checkNotNullParameter(values, "values");
if (values.size() == 0) {
throw new IllegalArgumentException("Empty values".toString());
}
int size = values.size();
int length = objArr == null ? size : objArr.length + size;
Object[] objArr2 = new Object[length];
StringBuilder sb = new StringBuilder();
sb.append("UPDATE ");
sb.append(CONFLICT_VALUES[i]);
sb.append(table);
sb.append(" SET ");
int i2 = 0;
for (String str2 : values.keySet()) {
sb.append(i2 > 0 ? "," : "");
sb.append(str2);
objArr2[i2] = values.get(str2);
sb.append("=?");
i2++;
}
if (objArr != null) {
for (int i3 = size; i3 < length; i3++) {
objArr2[i3] = objArr[i3 - size];
}
}
if (!TextUtils.isEmpty(str)) {
sb.append(" WHERE ");
sb.append(str);
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()");
SupportSQLiteStatement compileStatement = compileStatement(sb2);
SimpleSQLiteQuery.Companion.bind(compileStatement, objArr2);
return compileStatement.executeUpdateDelete();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(String sql) throws SQLException {
Intrinsics.checkNotNullParameter(sql, "sql");
this.delegate.execSQL(sql);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void execSQL(String sql, Object[] bindArgs) throws SQLException {
Intrinsics.checkNotNullParameter(sql, "sql");
Intrinsics.checkNotNullParameter(bindArgs, "bindArgs");
this.delegate.execSQL(sql, bindArgs);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isReadOnly() {
return this.delegate.isReadOnly();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isOpen() {
return this.delegate.isOpen();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean needUpgrade(int i) {
return this.delegate.needUpgrade(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public String getPath() {
return this.delegate.getPath();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setLocale(Locale locale) {
Intrinsics.checkNotNullParameter(locale, "locale");
this.delegate.setLocale(locale);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public void setMaxSqlCacheSize(int i) {
this.delegate.setMaxSqlCacheSize(i);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public void setForeignKeyConstraintsEnabled(boolean z) {
SupportSQLiteCompat.Api16Impl.setForeignKeyConstraintsEnabled(this.delegate, z);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean enableWriteAheadLogging() {
return this.delegate.enableWriteAheadLogging();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public void disableWriteAheadLogging() {
SupportSQLiteCompat.Api16Impl.disableWriteAheadLogging(this.delegate);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
@RequiresApi(api = 16)
public boolean isWriteAheadLoggingEnabled() {
return SupportSQLiteCompat.Api16Impl.isWriteAheadLoggingEnabled(this.delegate);
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public List<Pair<String, String>> getAttachedDbs() {
return this.delegate.getAttachedDbs();
}
@Override // androidx.sqlite.db.SupportSQLiteDatabase
public boolean isDatabaseIntegrityOk() {
return this.delegate.isDatabaseIntegrityOk();
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
this.delegate.close();
}
public final boolean isDelegate(SQLiteDatabase sqLiteDatabase) {
Intrinsics.checkNotNullParameter(sqLiteDatabase, "sqLiteDatabase");
return Intrinsics.areEqual(this.delegate, sqLiteDatabase);
}
@RequiresApi(30)
public static final class Api30Impl {
public static final Api30Impl INSTANCE = new Api30Impl();
private Api30Impl() {
}
@DoNotInline
public final void execPerConnectionSQL(SQLiteDatabase sQLiteDatabase, String sql, Object[] objArr) {
Intrinsics.checkNotNullParameter(sQLiteDatabase, "sQLiteDatabase");
Intrinsics.checkNotNullParameter(sql, "sql");
sQLiteDatabase.execPerConnectionSQL(sql, objArr);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,480 @@
package androidx.sqlite.db.framework;
import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import androidx.annotation.RequiresApi;
import androidx.sqlite.db.SupportSQLiteCompat;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper;
import androidx.sqlite.util.ProcessLock;
import java.io.File;
import java.util.UUID;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
/* loaded from: classes.dex */
public final class FrameworkSQLiteOpenHelper implements SupportSQLiteOpenHelper {
public static final Companion Companion = new Companion(null);
private static final String TAG = "SupportSQLite";
private final boolean allowDataLossOnRecovery;
private final SupportSQLiteOpenHelper.Callback callback;
private final Context context;
private final Lazy lazyDelegate;
private final String name;
private final boolean useNoBackupDirectory;
private boolean writeAheadLoggingEnabled;
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public FrameworkSQLiteOpenHelper(Context context, String str, SupportSQLiteOpenHelper.Callback callback) {
this(context, str, callback, false, false, 24, null);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(callback, "callback");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public FrameworkSQLiteOpenHelper(Context context, String str, SupportSQLiteOpenHelper.Callback callback, boolean z) {
this(context, str, callback, z, false, 16, null);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(callback, "callback");
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public String getDatabaseName() {
return this.name;
}
public FrameworkSQLiteOpenHelper(Context context, String str, SupportSQLiteOpenHelper.Callback callback, boolean z, boolean z2) {
Lazy lazy;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(callback, "callback");
this.context = context;
this.name = str;
this.callback = callback;
this.useNoBackupDirectory = z;
this.allowDataLossOnRecovery = z2;
lazy = LazyKt__LazyJVMKt.lazy(new Function0() { // from class: androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$lazyDelegate$1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final FrameworkSQLiteOpenHelper.OpenHelper invoke() {
String str2;
FrameworkSQLiteOpenHelper.OpenHelper openHelper;
Context context2;
String str3;
SupportSQLiteOpenHelper.Callback callback2;
boolean z3;
boolean z4;
boolean z5;
Context context3;
String str4;
Context context4;
SupportSQLiteOpenHelper.Callback callback3;
boolean z6;
str2 = FrameworkSQLiteOpenHelper.this.name;
if (str2 != null) {
z5 = FrameworkSQLiteOpenHelper.this.useNoBackupDirectory;
if (z5) {
context3 = FrameworkSQLiteOpenHelper.this.context;
File noBackupFilesDir = SupportSQLiteCompat.Api21Impl.getNoBackupFilesDir(context3);
str4 = FrameworkSQLiteOpenHelper.this.name;
File file = new File(noBackupFilesDir, str4);
context4 = FrameworkSQLiteOpenHelper.this.context;
String absolutePath = file.getAbsolutePath();
FrameworkSQLiteOpenHelper.DBRefHolder dBRefHolder = new FrameworkSQLiteOpenHelper.DBRefHolder(null);
callback3 = FrameworkSQLiteOpenHelper.this.callback;
z6 = FrameworkSQLiteOpenHelper.this.allowDataLossOnRecovery;
openHelper = new FrameworkSQLiteOpenHelper.OpenHelper(context4, absolutePath, dBRefHolder, callback3, z6);
z4 = FrameworkSQLiteOpenHelper.this.writeAheadLoggingEnabled;
SupportSQLiteCompat.Api16Impl.setWriteAheadLoggingEnabled(openHelper, z4);
return openHelper;
}
}
context2 = FrameworkSQLiteOpenHelper.this.context;
str3 = FrameworkSQLiteOpenHelper.this.name;
FrameworkSQLiteOpenHelper.DBRefHolder dBRefHolder2 = new FrameworkSQLiteOpenHelper.DBRefHolder(null);
callback2 = FrameworkSQLiteOpenHelper.this.callback;
z3 = FrameworkSQLiteOpenHelper.this.allowDataLossOnRecovery;
openHelper = new FrameworkSQLiteOpenHelper.OpenHelper(context2, str3, dBRefHolder2, callback2, z3);
z4 = FrameworkSQLiteOpenHelper.this.writeAheadLoggingEnabled;
SupportSQLiteCompat.Api16Impl.setWriteAheadLoggingEnabled(openHelper, z4);
return openHelper;
}
});
this.lazyDelegate = lazy;
}
public /* synthetic */ FrameworkSQLiteOpenHelper(Context context, String str, SupportSQLiteOpenHelper.Callback callback, boolean z, boolean z2, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(context, str, callback, (i & 8) != 0 ? false : z, (i & 16) != 0 ? false : z2);
}
private final OpenHelper getDelegate() {
return (OpenHelper) this.lazyDelegate.getValue();
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
@RequiresApi(api = 16)
public void setWriteAheadLoggingEnabled(boolean z) {
if (this.lazyDelegate.isInitialized()) {
SupportSQLiteCompat.Api16Impl.setWriteAheadLoggingEnabled(getDelegate(), z);
}
this.writeAheadLoggingEnabled = z;
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getWritableDatabase() {
return getDelegate().getSupportDatabase(true);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper
public SupportSQLiteDatabase getReadableDatabase() {
return getDelegate().getSupportDatabase(false);
}
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper, java.io.Closeable, java.lang.AutoCloseable
public void close() {
if (this.lazyDelegate.isInitialized()) {
getDelegate().close();
}
}
public static final class OpenHelper extends SQLiteOpenHelper {
public static final Companion Companion = new Companion(null);
private final boolean allowDataLossOnRecovery;
private final SupportSQLiteOpenHelper.Callback callback;
private final Context context;
private final DBRefHolder dbRef;
private final ProcessLock lock;
private boolean migrated;
private boolean opened;
public enum CallbackName {
ON_CONFIGURE,
ON_CREATE,
ON_UPGRADE,
ON_DOWNGRADE,
ON_OPEN
}
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[CallbackName.values().length];
try {
iArr[CallbackName.ON_CONFIGURE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[CallbackName.ON_CREATE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[CallbackName.ON_UPGRADE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[CallbackName.ON_DOWNGRADE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
iArr[CallbackName.ON_OPEN.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
$EnumSwitchMapping$0 = iArr;
}
}
public final boolean getAllowDataLossOnRecovery() {
return this.allowDataLossOnRecovery;
}
public final SupportSQLiteOpenHelper.Callback getCallback() {
return this.callback;
}
public final Context getContext() {
return this.context;
}
public final DBRefHolder getDbRef() {
return this.dbRef;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public OpenHelper(Context context, String str, final DBRefHolder dbRef, final SupportSQLiteOpenHelper.Callback callback, boolean z) {
super(context, str, null, callback.version, new DatabaseErrorHandler() { // from class: androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper$$ExternalSyntheticLambda0
@Override // android.database.DatabaseErrorHandler
public final void onCorruption(SQLiteDatabase sQLiteDatabase) {
FrameworkSQLiteOpenHelper.OpenHelper._init_$lambda$0(SupportSQLiteOpenHelper.Callback.this, dbRef, sQLiteDatabase);
}
});
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(dbRef, "dbRef");
Intrinsics.checkNotNullParameter(callback, "callback");
this.context = context;
this.dbRef = dbRef;
this.callback = callback;
this.allowDataLossOnRecovery = z;
if (str == null) {
str = UUID.randomUUID().toString();
Intrinsics.checkNotNullExpressionValue(str, "randomUUID().toString()");
}
this.lock = new ProcessLock(str, context.getCacheDir(), false);
}
/* JADX INFO: Access modifiers changed from: private */
public static final void _init_$lambda$0(SupportSQLiteOpenHelper.Callback callback, DBRefHolder dbRef, SQLiteDatabase dbObj) {
Intrinsics.checkNotNullParameter(callback, "$callback");
Intrinsics.checkNotNullParameter(dbRef, "$dbRef");
Companion companion = Companion;
Intrinsics.checkNotNullExpressionValue(dbObj, "dbObj");
callback.onCorruption(companion.getWrappedDb(dbRef, dbObj));
}
public final SupportSQLiteDatabase getSupportDatabase(boolean z) {
try {
this.lock.lock((this.opened || getDatabaseName() == null) ? false : true);
this.migrated = false;
SQLiteDatabase innerGetDatabase = innerGetDatabase(z);
if (this.migrated) {
close();
SupportSQLiteDatabase supportDatabase = getSupportDatabase(z);
this.lock.unlock();
return supportDatabase;
}
FrameworkSQLiteDatabase wrappedDb = getWrappedDb(innerGetDatabase);
this.lock.unlock();
return wrappedDb;
} catch (Throwable th) {
this.lock.unlock();
throw th;
}
}
private final SQLiteDatabase innerGetDatabase(boolean z) {
File parentFile;
String databaseName = getDatabaseName();
boolean z2 = this.opened;
if (databaseName != null && !z2 && (parentFile = this.context.getDatabasePath(databaseName).getParentFile()) != null) {
parentFile.mkdirs();
if (!parentFile.isDirectory()) {
Log.w(FrameworkSQLiteOpenHelper.TAG, "Invalid database parent file, not a directory: " + parentFile);
}
}
try {
return getWritableOrReadableDatabase(z);
} catch (Throwable unused) {
super.close();
try {
Thread.sleep(500L);
} catch (InterruptedException unused2) {
}
try {
return getWritableOrReadableDatabase(z);
} catch (Throwable th) {
super.close();
if (th instanceof CallbackException) {
CallbackException callbackException = th;
Throwable cause = callbackException.getCause();
int i = WhenMappings.$EnumSwitchMapping$0[callbackException.getCallbackName().ordinal()];
if (i == 1) {
throw cause;
}
if (i == 2) {
throw cause;
}
if (i == 3) {
throw cause;
}
if (i == 4) {
throw cause;
}
if (!(cause instanceof SQLiteException)) {
throw cause;
}
} else {
if (!(th instanceof SQLiteException)) {
throw th;
}
if (databaseName == null || !this.allowDataLossOnRecovery) {
throw th;
}
}
this.context.deleteDatabase(databaseName);
try {
return getWritableOrReadableDatabase(z);
} catch (CallbackException e) {
throw e.getCause();
}
}
}
}
private final SQLiteDatabase getWritableOrReadableDatabase(boolean z) {
if (z) {
SQLiteDatabase writableDatabase = super.getWritableDatabase();
Intrinsics.checkNotNullExpressionValue(writableDatabase, "{\n super.…eDatabase()\n }");
return writableDatabase;
}
SQLiteDatabase readableDatabase = super.getReadableDatabase();
Intrinsics.checkNotNullExpressionValue(readableDatabase, "{\n super.…eDatabase()\n }");
return readableDatabase;
}
public final FrameworkSQLiteDatabase getWrappedDb(SQLiteDatabase sqLiteDatabase) {
Intrinsics.checkNotNullParameter(sqLiteDatabase, "sqLiteDatabase");
return Companion.getWrappedDb(this.dbRef, sqLiteDatabase);
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onCreate(SQLiteDatabase sqLiteDatabase) {
Intrinsics.checkNotNullParameter(sqLiteDatabase, "sqLiteDatabase");
try {
this.callback.onCreate(getWrappedDb(sqLiteDatabase));
} catch (Throwable th) {
throw new CallbackException(CallbackName.ON_CREATE, th);
}
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i2) {
Intrinsics.checkNotNullParameter(sqLiteDatabase, "sqLiteDatabase");
this.migrated = true;
try {
this.callback.onUpgrade(getWrappedDb(sqLiteDatabase), i, i2);
} catch (Throwable th) {
throw new CallbackException(CallbackName.ON_UPGRADE, th);
}
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onConfigure(SQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
if (!this.migrated && this.callback.version != db.getVersion()) {
db.setMaxSqlCacheSize(1);
}
try {
this.callback.onConfigure(getWrappedDb(db));
} catch (Throwable th) {
throw new CallbackException(CallbackName.ON_CONFIGURE, th);
}
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onDowngrade(SQLiteDatabase db, int i, int i2) {
Intrinsics.checkNotNullParameter(db, "db");
this.migrated = true;
try {
this.callback.onDowngrade(getWrappedDb(db), i, i2);
} catch (Throwable th) {
throw new CallbackException(CallbackName.ON_DOWNGRADE, th);
}
}
@Override // android.database.sqlite.SQLiteOpenHelper
public void onOpen(SQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
if (!this.migrated) {
try {
this.callback.onOpen(getWrappedDb(db));
} catch (Throwable th) {
throw new CallbackException(CallbackName.ON_OPEN, th);
}
}
this.opened = true;
}
@Override // android.database.sqlite.SQLiteOpenHelper, java.lang.AutoCloseable
public void close() {
try {
ProcessLock.lock$default(this.lock, false, 1, null);
super.close();
this.dbRef.setDb(null);
this.opened = false;
} finally {
this.lock.unlock();
}
}
public static final class CallbackException extends RuntimeException {
private final CallbackName callbackName;
private final Throwable cause;
public final CallbackName getCallbackName() {
return this.callbackName;
}
@Override // java.lang.Throwable
public Throwable getCause() {
return this.cause;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CallbackException(CallbackName callbackName, Throwable cause) {
super(cause);
Intrinsics.checkNotNullParameter(callbackName, "callbackName");
Intrinsics.checkNotNullParameter(cause, "cause");
this.callbackName = callbackName;
this.cause = cause;
}
}
@SourceDebugExtension({"SMAP\nFrameworkSQLiteOpenHelper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FrameworkSQLiteOpenHelper.kt\nandroidx/sqlite/db/framework/FrameworkSQLiteOpenHelper$OpenHelper$Companion\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,342:1\n1#2:343\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final FrameworkSQLiteDatabase getWrappedDb(DBRefHolder refHolder, SQLiteDatabase sqLiteDatabase) {
Intrinsics.checkNotNullParameter(refHolder, "refHolder");
Intrinsics.checkNotNullParameter(sqLiteDatabase, "sqLiteDatabase");
FrameworkSQLiteDatabase db = refHolder.getDb();
if (db != null && db.isDelegate(sqLiteDatabase)) {
return db;
}
FrameworkSQLiteDatabase frameworkSQLiteDatabase = new FrameworkSQLiteDatabase(sqLiteDatabase);
refHolder.setDb(frameworkSQLiteDatabase);
return frameworkSQLiteDatabase;
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
public static final class DBRefHolder {
private FrameworkSQLiteDatabase db;
public final FrameworkSQLiteDatabase getDb() {
return this.db;
}
public final void setDb(FrameworkSQLiteDatabase frameworkSQLiteDatabase) {
this.db = frameworkSQLiteDatabase;
}
public DBRefHolder(FrameworkSQLiteDatabase frameworkSQLiteDatabase) {
this.db = frameworkSQLiteDatabase;
}
}
}

View File

@@ -0,0 +1,13 @@
package androidx.sqlite.db.framework;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class FrameworkSQLiteOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Factory
public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
return new FrameworkSQLiteOpenHelper(configuration.context, configuration.name, configuration.callback, configuration.useNoBackupDirectory, configuration.allowDataLossOnRecovery);
}
}

View File

@@ -0,0 +1,52 @@
package androidx.sqlite.db.framework;
import android.database.sqlite.SQLiteProgram;
import androidx.sqlite.db.SupportSQLiteProgram;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public class FrameworkSQLiteProgram implements SupportSQLiteProgram {
private final SQLiteProgram delegate;
public FrameworkSQLiteProgram(SQLiteProgram delegate) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.delegate = delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindNull(int i) {
this.delegate.bindNull(i);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindLong(int i, long j) {
this.delegate.bindLong(i, j);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindDouble(int i, double d) {
this.delegate.bindDouble(i, d);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindString(int i, String value) {
Intrinsics.checkNotNullParameter(value, "value");
this.delegate.bindString(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void bindBlob(int i, byte[] value) {
Intrinsics.checkNotNullParameter(value, "value");
this.delegate.bindBlob(i, value);
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public void clearBindings() {
this.delegate.clearBindings();
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
this.delegate.close();
}
}

View File

@@ -0,0 +1,42 @@
package androidx.sqlite.db.framework;
import android.database.sqlite.SQLiteStatement;
import androidx.sqlite.db.SupportSQLiteStatement;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class FrameworkSQLiteStatement extends FrameworkSQLiteProgram implements SupportSQLiteStatement {
private final SQLiteStatement delegate;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public FrameworkSQLiteStatement(SQLiteStatement delegate) {
super(delegate);
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.delegate = delegate;
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public void execute() {
this.delegate.execute();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public int executeUpdateDelete() {
return this.delegate.executeUpdateDelete();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long executeInsert() {
return this.delegate.executeInsert();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public long simpleQueryForLong() {
return this.delegate.simpleQueryForLong();
}
@Override // androidx.sqlite.db.SupportSQLiteStatement
public String simpleQueryForString() {
return this.delegate.simpleQueryForString();
}
}

View File

@@ -0,0 +1,7 @@
package androidx.sqlite.db.framework;
/* loaded from: classes.dex */
public final class R {
private R() {
}
}