discord-jadx/app/src/main/java/c/i/a/f/i/b/p3.java

63 lines
2.4 KiB
Java

package c.i.a.f.i.b;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabaseLockedException;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.WorkerThread;
import c.i.a.f.e.o.f;
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class p3 extends SQLiteOpenHelper {
public final /* synthetic */ m3 i;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public p3(m3 m3Var, Context context, String str) {
super(context, str, (SQLiteDatabase.CursorFactory) null, 1);
this.i = m3Var;
}
@Override // android.database.sqlite.SQLiteOpenHelper
@WorkerThread
public final SQLiteDatabase getWritableDatabase() throws SQLiteException {
try {
return super.getWritableDatabase();
} catch (SQLiteDatabaseLockedException e) {
throw e;
} catch (SQLiteException unused) {
this.i.g().f.a("Opening the local database failed, dropping and recreating it");
if (!this.i.a.b.getDatabasePath("google_app_measurement_local.db").delete()) {
this.i.g().f.b("Failed to delete corrupted local db file", "google_app_measurement_local.db");
}
try {
return super.getWritableDatabase();
} catch (SQLiteException e2) {
this.i.g().f.b("Failed to open local database. Events will bypass local storage", e2);
return null;
}
}
}
@Override // android.database.sqlite.SQLiteOpenHelper
@WorkerThread
public final void onCreate(SQLiteDatabase sQLiteDatabase) {
f.N1(this.i.g(), sQLiteDatabase);
}
@Override // android.database.sqlite.SQLiteOpenHelper
@WorkerThread
public final void onDowngrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
}
@Override // android.database.sqlite.SQLiteOpenHelper
@WorkerThread
public final void onOpen(SQLiteDatabase sQLiteDatabase) {
f.O1(this.i.g(), sQLiteDatabase, "messages", "create table if not exists messages ( type INTEGER NOT NULL, entry BLOB NOT NULL)", "type,entry", null);
}
@Override // android.database.sqlite.SQLiteOpenHelper
@WorkerThread
public final void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
}
}