package com.mbridge.msdk.foundation.db; import android.content.ContentValues; import android.text.TextUtils; import com.ironsource.mediationsdk.utils.IronSourceConstants; import com.ironsource.nb; import com.mbridge.msdk.foundation.entity.CampaignEx; import com.mbridge.msdk.foundation.tools.af; import com.mbridge.msdk.foundation.tools.ap; import com.vungle.ads.internal.presenter.MRAIDPresenter; import java.net.URLEncoder; /* loaded from: classes4.dex */ public class o extends a { private static final String a = "com.mbridge.msdk.foundation.db.o"; private static o b; private o(f fVar) { super(fVar); } public static o a(f fVar) { if (b == null) { synchronized (o.class) { try { if (b == null) { b = new o(fVar); } } finally { } } } return b; } /* JADX WARN: Code restructure failed: missing block: B:10:0x001e, code lost: if (r1 != null) goto L31; */ /* JADX WARN: Code restructure failed: missing block: B:15:0x0020, code lost: r1.close(); */ /* JADX WARN: Code restructure failed: missing block: B:22:0x0029, code lost: if (r1 == null) goto L22; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final synchronized int a() { /* r4 = this; monitor-enter(r4) r0 = 0 r1 = 0 java.lang.String r2 = "select count(*) from reward_report" android.database.sqlite.SQLiteDatabase r3 = r4.getReadableDatabase() // Catch: java.lang.Throwable -> L1a java.lang.Exception -> L1c android.database.Cursor r1 = r3.rawQuery(r2, r1) // Catch: java.lang.Throwable -> L1a java.lang.Exception -> L1c if (r1 == 0) goto L1e boolean r2 = r1.moveToFirst() // Catch: java.lang.Throwable -> L1a java.lang.Exception -> L1c if (r2 == 0) goto L1e int r0 = r1.getInt(r0) // Catch: java.lang.Throwable -> L1a java.lang.Exception -> L1c goto L1e L1a: r0 = move-exception goto L2e L1c: r2 = move-exception goto L26 L1e: if (r1 == 0) goto L2c L20: r1.close() // Catch: java.lang.Throwable -> L24 java.lang.Exception -> L2c goto L2c L24: r0 = move-exception goto L34 L26: r2.printStackTrace() // Catch: java.lang.Throwable -> L1a if (r1 == 0) goto L2c goto L20 L2c: monitor-exit(r4) return r0 L2e: if (r1 == 0) goto L33 r1.close() // Catch: java.lang.Throwable -> L24 java.lang.Exception -> L33 L33: throw r0 // Catch: java.lang.Throwable -> L24 L34: monitor-exit(r4) throw r0 */ throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.db.o.a():int"); } /* JADX WARN: Removed duplicated region for block: B:44:0x0361 A[Catch: all -> 0x0343, Exception -> 0x036b, TRY_ENTER, TRY_LEAVE, TryCatch #3 {, blocks: (B:4:0x0003, B:51:0x0367, B:49:0x036a, B:44:0x0361, B:137:0x033f, B:15:0x034a), top: B:3:0x0003 }] */ /* JADX WARN: Removed duplicated region for block: B:50:0x0367 A[EXC_TOP_SPLITTER, SYNTHETIC] */ /* JADX WARN: Unreachable blocks removed: 2, instructions: 2 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final synchronized java.util.List a(java.lang.String r25) { /* Method dump skipped, instructions count: 880 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.db.o.a(java.lang.String):java.util.List"); } public final synchronized long a(com.mbridge.msdk.foundation.entity.n nVar) { try { if (nVar != null) { try { ContentValues contentValues = new ContentValues(); contentValues.put("key", nVar.a()); contentValues.put("networkType", Integer.valueOf(nVar.k())); contentValues.put("network_str", nVar.l()); contentValues.put("isCompleteView", Integer.valueOf(nVar.z())); contentValues.put("watchedMillis", Integer.valueOf(nVar.A())); contentValues.put(MRAIDPresenter.VIDEO_LENGTH, Integer.valueOf(nVar.p())); if (!TextUtils.isEmpty(nVar.r())) { contentValues.put("offerUrl", nVar.r()); } if (!TextUtils.isEmpty(nVar.h())) { contentValues.put("reason", URLEncoder.encode(nVar.h(), nb.N)); } contentValues.put("result", Integer.valueOf(nVar.m())); contentValues.put(IronSourceConstants.EVENTS_DURATION, nVar.n()); contentValues.put("videoSize", Long.valueOf(nVar.o())); contentValues.put("type", nVar.t()); String s = nVar.s(); if (!TextUtils.isEmpty(s)) { contentValues.put(CampaignEx.ENDCARD_URL, s); } String q = nVar.q(); if (!TextUtils.isEmpty(q)) { contentValues.put("video_url", q); } String f = nVar.f(); if (!TextUtils.isEmpty(f)) { contentValues.put("rid", f); } String g = nVar.g(); if (!TextUtils.isEmpty(g)) { contentValues.put("rid_n", g); } String D = nVar.D(); if (!TextUtils.isEmpty(D)) { contentValues.put("template_url", D); } String y = nVar.y(); if (!TextUtils.isEmpty(y)) { contentValues.put(CampaignEx.JSON_KEY_IMAGE_URL, y); } String d = nVar.d(); if (!TextUtils.isEmpty(d)) { contentValues.put("ad_type", URLEncoder.encode(d, nb.N)); } contentValues.put("unitId", nVar.c()); contentValues.put("campaignId", nVar.e()); if ("2000039".equals(nVar.a())) { String a2 = com.mbridge.msdk.foundation.same.report.n.a(nVar); if (ap.b(a2)) { contentValues.put("h5_click_data", a2); } } String b2 = nVar.b(); if (!TextUtils.isEmpty(b2)) { contentValues.put("resource_type", URLEncoder.encode(b2, nb.N)); } String j = nVar.j(); if (!TextUtils.isEmpty(j)) { contentValues.put("device_id", URLEncoder.encode(j, nb.N)); } String i = nVar.i(); if (!TextUtils.isEmpty(i)) { contentValues.put("creative", URLEncoder.encode(i, nb.N)); } contentValues.put(CampaignEx.JSON_KEY_NEW_INTERSTITIAL_AD_SPACE_T, Integer.valueOf(nVar.u())); return getWritableDatabase().insert("reward_report", null, contentValues); } catch (Exception e) { af.b(a, e.getMessage()); } } return -1L; } catch (Throwable th) { throw th; } } }