package d7; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import f7.f; import f7.m; /* loaded from: classes2.dex */ public class a extends SQLiteOpenHelper { /* renamed from: a, reason: collision with root package name */ private final Context f9167a; public a(Context context) { super(context, "mobonsdk.db", (SQLiteDatabase.CursorFactory) null, 1); this.f9167a = context; } /* JADX WARN: Removed duplicated region for block: B:40:0x00a9 A[Catch: Exception -> 0x00b6, TRY_ENTER, TryCatch #6 {Exception -> 0x00b6, blocks: (B:28:0x0081, B:30:0x0087, B:31:0x008a, B:32:0x008d, B:40:0x00a9, B:42:0x00af, B:43:0x00b2), top: B:2:0x0017 }] */ /* JADX WARN: Removed duplicated region for block: B:45:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:50:0x00d3 A[Catch: Exception -> 0x00cf, TRY_LEAVE, TryCatch #1 {Exception -> 0x00cf, blocks: (B:57:0x00c2, B:59:0x00c8, B:60:0x00cb, B:50:0x00d3), top: B:56:0x00c2 }] */ /* JADX WARN: Removed duplicated region for block: B:56:0x00c2 A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void G(int r6) { /* r5 = this; java.lang.String r0 = "removeFirstIconInfo() :: close() Exception!" java.lang.StringBuilder r1 = new java.lang.StringBuilder r1.() java.lang.String r2 = "Call BaconDB removeFirstIconInfo() limitDay : " r1.append(r2) r1.append(r6) java.lang.String r1 = r1.toString() f7.f.a(r1) r1 = 0 android.database.sqlite.SQLiteDatabase r2 = r5.getWritableDatabase() // Catch: java.lang.Throwable -> L9d java.lang.Exception -> La0 java.lang.String r3 = "SELECT * FROM IconInfo ORDER BY DATE ASC;" android.database.Cursor r3 = r2.rawQuery(r3, r1) // Catch: java.lang.Throwable -> L95 java.lang.Exception -> L99 int r4 = r3.getCount() // Catch: java.lang.Throwable -> L91 java.lang.Exception -> L93 if (r4 <= 0) goto L7c r2.beginTransaction() // Catch: java.lang.Throwable -> L91 java.lang.Exception -> L93 r1 = r2 L2b: boolean r2 = r3.moveToNext() // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf if (r2 == 0) goto L76 java.lang.String r2 = "DATE" int r2 = r3.getColumnIndex(r2) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r2 = r3.getString(r2) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf boolean r4 = f7.m.e(r2, r6) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf boolean r2 = android.text.TextUtils.isEmpty(r2) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf if (r2 != 0) goto L2b if (r4 == 0) goto L2b android.database.sqlite.SQLiteDatabase r1 = r5.getWritableDatabase() // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf r2.() // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r4 = "DELETE FROM IconInfo WHERE URL = '" r2.append(r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r4 = "URL" int r4 = r3.getColumnIndex(r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r4 = r3.getString(r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf r2.append(r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r4 = "';" r2.append(r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r2 = r2.toString() // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf r4 = 0 java.lang.Object[] r4 = new java.lang.Object[r4] // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf java.lang.String r2 = java.lang.String.format(r2, r4) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf r1.execSQL(r2) // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf goto L2b L76: r1.setTransactionSuccessful() // Catch: java.lang.Exception -> L7a java.lang.Throwable -> Lbf goto L7f L7a: r6 = move-exception goto La2 L7c: r3.close() // Catch: java.lang.Throwable -> L91 java.lang.Exception -> L93 L7f: if (r1 == 0) goto L8d boolean r6 = r1.inTransaction() // Catch: java.lang.Exception -> Lb6 if (r6 == 0) goto L8a r1.endTransaction() // Catch: java.lang.Exception -> Lb6 L8a: r1.close() // Catch: java.lang.Exception -> Lb6 L8d: r3.close() // Catch: java.lang.Exception -> Lb6 goto Lbe L91: r6 = move-exception goto L97 L93: r6 = move-exception goto L9b L95: r6 = move-exception r3 = r1 L97: r1 = r2 goto Lc0 L99: r6 = move-exception r3 = r1 L9b: r1 = r2 goto La2 L9d: r6 = move-exception r3 = r1 goto Lc0 La0: r6 = move-exception r3 = r1 La2: java.lang.String r2 = "removeFirstIconInfo() Exception!" f7.f.c(r2, r6) // Catch: java.lang.Throwable -> Lbf if (r1 == 0) goto Lb8 boolean r6 = r1.inTransaction() // Catch: java.lang.Exception -> Lb6 if (r6 == 0) goto Lb2 r1.endTransaction() // Catch: java.lang.Exception -> Lb6 Lb2: r1.close() // Catch: java.lang.Exception -> Lb6 goto Lb8 Lb6: r6 = move-exception goto Lbb Lb8: if (r3 == 0) goto Lbe goto L8d Lbb: f7.f.c(r0, r6) Lbe: return Lbf: r6 = move-exception Lc0: if (r1 == 0) goto Ld1 boolean r2 = r1.inTransaction() // Catch: java.lang.Exception -> Lcf if (r2 == 0) goto Lcb r1.endTransaction() // Catch: java.lang.Exception -> Lcf Lcb: r1.close() // Catch: java.lang.Exception -> Lcf goto Ld1 Lcf: r1 = move-exception goto Ld7 Ld1: if (r3 == 0) goto Lda r3.close() // Catch: java.lang.Exception -> Lcf goto Lda Ld7: f7.f.c(r0, r1) Lda: throw r6 */ throw new UnsupportedOperationException("Method not decompiled: d7.a.G(int):void"); } public void c(String str, String str2) { f.a("Call baconDB insertInstallIcon()"); SQLiteDatabase sQLiteDatabase = null; try { } catch (Exception e10) { f.c("insertInstallIcon() - DB Close Exception!", e10); } try { try { SQLiteDatabase writableDatabase = getWritableDatabase(); try { ContentValues contentValues = new ContentValues(); contentValues.put("TITLE", str); contentValues.put("URL", str2); contentValues.put("DATE", m.c()); writableDatabase.beginTransaction(); writableDatabase.insert("IconInfo", null, contentValues); writableDatabase.setTransactionSuccessful(); if (writableDatabase.inTransaction()) { writableDatabase.endTransaction(); } writableDatabase.close(); } catch (Exception e11) { e = e11; sQLiteDatabase = writableDatabase; f.c("insertInstallIcon()", e); if (sQLiteDatabase != null) { if (sQLiteDatabase.inTransaction()) { sQLiteDatabase.endTransaction(); } sQLiteDatabase.close(); } } catch (Throwable th) { th = th; sQLiteDatabase = writableDatabase; if (sQLiteDatabase != null) { try { if (sQLiteDatabase.inTransaction()) { sQLiteDatabase.endTransaction(); } sQLiteDatabase.close(); } catch (Exception e12) { f.c("insertInstallIcon() - DB Close Exception!", e12); } } throw th; } } catch (Exception e13) { e = e13; } } catch (Throwable th2) { th = th2; } } @Override // android.database.sqlite.SQLiteOpenHelper public void onCreate(SQLiteDatabase sQLiteDatabase) { f.b("BaconDB Crete", "onCreate() was called!"); try { sQLiteDatabase.execSQL("create table IF NOT EXISTS IconInfo(SEQ integer primary key autoincrement, URL text default '', TITLE text default '', DATE text default '');"); } catch (Exception e10) { f.a("BaconDB : onCreate() - Exception" + e10.getMessage()); } } @Override // android.database.sqlite.SQLiteOpenHelper public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i10, int i11) { f.a("BaconDB :: onUpgrade() 실행"); f.b("BaconDB :: onUpgrade()", "oldVer: " + i10); f.b("BaconDB :: onUpgrade()", "newVer: " + i11); if (sQLiteDatabase == null || i11 <= i10) { return; } f.b("BaconDB :: onUpgrade()", "DROP 실행!"); } /* JADX WARN: Code restructure failed: missing block: B:32:0x0078, code lost: if (r2 != null) goto L20; */ /* JADX WARN: Removed duplicated region for block: B:37:0x0092 A[Catch: Exception -> 0x008e, TRY_LEAVE, TryCatch #1 {Exception -> 0x008e, blocks: (B:44:0x0081, B:46:0x0087, B:47:0x008a, B:37:0x0092), top: B:43:0x0081 }] */ /* JADX WARN: Removed duplicated region for block: B:43:0x0081 A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public boolean z(java.lang.String r7, java.lang.String r8) { /* r6 = this; java.lang.String r0 = "isInstallIconInfo() DB Close Exception!" r1 = 0 r2 = 0 android.database.sqlite.SQLiteDatabase r3 = r6.getWritableDatabase() // Catch: java.lang.Throwable -> L5d java.lang.Exception -> L60 boolean r4 = android.text.TextUtils.isEmpty(r8) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b java.lang.String r5 = "%'" if (r4 != 0) goto L2c java.lang.StringBuilder r7 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r7.() // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b java.lang.String r4 = "SELECT * FROM IconInfo WHERE URL LIKE '%" r7.append(r4) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r7.append(r8) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r7.append(r5) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b java.lang.String r7 = r7.toString() // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b L24: android.database.Cursor r7 = r3.rawQuery(r7, r2) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r2 = r7 goto L41 L2a: r7 = move-exception goto L62 L2c: java.lang.StringBuilder r8 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r8.() // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b java.lang.String r4 = "SELECT * FROM IconInfo WHERE TITLE LIKE '%" r8.append(r4) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r8.append(r7) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b r8.append(r5) // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b java.lang.String r7 = r8.toString() // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b goto L24 L41: int r7 = r2.getCount() // Catch: java.lang.Exception -> L2a java.lang.Throwable -> L5b if (r7 <= 0) goto L49 r7 = 1 r1 = 1 L49: if (r3 == 0) goto L57 boolean r7 = r3.inTransaction() // Catch: java.lang.Exception -> L76 if (r7 == 0) goto L54 r3.endTransaction() // Catch: java.lang.Exception -> L76 L54: r3.close() // Catch: java.lang.Exception -> L76 L57: r2.close() // Catch: java.lang.Exception -> L76 goto L7e L5b: r7 = move-exception goto L7f L5d: r7 = move-exception r3 = r2 goto L7f L60: r7 = move-exception r3 = r2 L62: java.lang.String r8 = "isInstallIconInfo() Exception!" f7.f.c(r8, r7) // Catch: java.lang.Throwable -> L5b if (r3 == 0) goto L78 boolean r7 = r3.inTransaction() // Catch: java.lang.Exception -> L76 if (r7 == 0) goto L72 r3.endTransaction() // Catch: java.lang.Exception -> L76 L72: r3.close() // Catch: java.lang.Exception -> L76 goto L78 L76: r7 = move-exception goto L7b L78: if (r2 == 0) goto L7e goto L57 L7b: f7.f.c(r0, r7) L7e: return r1 L7f: if (r3 == 0) goto L90 boolean r8 = r3.inTransaction() // Catch: java.lang.Exception -> L8e if (r8 == 0) goto L8a r3.endTransaction() // Catch: java.lang.Exception -> L8e L8a: r3.close() // Catch: java.lang.Exception -> L8e goto L90 L8e: r8 = move-exception goto L96 L90: if (r2 == 0) goto L99 r2.close() // Catch: java.lang.Exception -> L8e goto L99 L96: f7.f.c(r0, r8) L99: throw r7 */ throw new UnsupportedOperationException("Method not decompiled: d7.a.z(java.lang.String, java.lang.String):boolean"); } }