package com.ironsource.adqualitysdk.sdk.i; import android.graphics.Color; import android.os.Process; import android.os.SystemClock; import android.text.AndroidCharacter; import android.text.TextUtils; import android.util.TypedValue; import android.view.KeyEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes4.dex */ public final class jx { /* renamed from: ﻐ, reason: contains not printable characters */ private static int f2787 = 72; /* renamed from: ヌ, reason: contains not printable characters */ private static int f2788 = 0; /* renamed from: メ, reason: contains not printable characters */ private static int f2789 = 1; public interface d { /* renamed from: ヌ */ T mo1143(JSONArray jSONArray, int i); } public interface e { /* renamed from: k */ T mo1139(JSONObject jSONObject, String str); } /* renamed from: ﻛ, reason: contains not printable characters */ public static JSONObject m3324(JSONObject jSONObject) { int i = f2788 + 119; f2789 = i % 128; return m3325(jSONObject, i % 2 == 0); } /* renamed from: ﻛ, reason: contains not printable characters */ public static JSONObject m3325(JSONObject jSONObject, boolean z) { int i = f2789 + 105; f2788 = i % 128; if (i % 2 != 0) { throw null; } if (jSONObject != null) { try { JSONObject jSONObject2 = new JSONObject(jSONObject.toString()); if (z) { int i2 = f2788 + 57; f2789 = i2 % 128; int i3 = i2 % 2; jSONObject2.remove(ik.f2434); int i4 = f2789 + 73; f2788 = i4 % 128; int i5 = i4 % 2; } return jSONObject2; } catch (JSONException unused) { } } return new JSONObject(); } /* renamed from: ヌ, reason: contains not printable characters */ public static void m3335(JSONObject jSONObject, JSONObject jSONObject2) { int i = f2788 + 11; f2789 = i % 128; int i2 = i % 2; m3332(jSONObject, jSONObject2, false); int i3 = f2788 + 9; f2789 = i3 % 128; if (i3 % 2 == 0) { int i4 = 71 / 0; } } /* renamed from: k, reason: contains not printable characters */ public static void m3332(JSONObject jSONObject, JSONObject jSONObject2, boolean z) { if (jSONObject != null) { int i = f2788 + 17; f2789 = i % 128; if (i % 2 == 0) { throw null; } if (jSONObject2 != null) { Iterator keys = jSONObject2.keys(); while (keys.hasNext()) { String next = keys.next(); try { jSONObject.put(next, jSONObject2.opt(next)); } catch (JSONException unused) { } } if (z) { jSONObject.remove(ik.f2434); int i2 = f2788 + 91; f2789 = i2 % 128; int i3 = i2 % 2; } } } } /* renamed from: ヌ, reason: contains not printable characters */ public static List m3333(JSONArray jSONArray) { int i = f2789 + 3; f2788 = i % 128; if (i % 2 != 0) { throw null; } if (jSONArray == null) { return null; } List m3330 = m3330(jSONArray); int i2 = f2788 + 113; f2789 = i2 % 128; if (i2 % 2 == 0) { int i3 = 79 / 0; } return m3330; } /* renamed from: k, reason: contains not printable characters */ public static List m3330(JSONArray jSONArray) { List m3336 = m3336(jSONArray, new d() { // from class: com.ironsource.adqualitysdk.sdk.i.jx.4 @Override // com.ironsource.adqualitysdk.sdk.i.jx.d /* renamed from: ヌ */ public final T mo1143(JSONArray jSONArray2, int i) { return (T) jSONArray2.opt(i); } }); int i = f2789 + 55; f2788 = i % 128; if (i % 2 != 0) { int i2 = 22 / 0; } return m3336; } /* renamed from: メ, reason: contains not printable characters */ public static List m3336(JSONArray jSONArray, d dVar) { if (jSONArray == null) { return null; } ArrayList arrayList = new ArrayList(); int i = f2789 + 55; f2788 = i % 128; int i2 = i % 2; for (int i3 = 0; i3 < jSONArray.length(); i3++) { T mo1143 = dVar.mo1143(jSONArray, i3); if (mo1143 != null) { int i4 = f2788 + 11; f2789 = i4 % 128; int i5 = i4 % 2; arrayList.add(mo1143); } } return arrayList; } /* renamed from: k, reason: contains not printable characters */ public static List m3331(JSONObject jSONObject, String str, List list) { int i = f2789 + 125; f2788 = i % 128; if (i % 2 == 0) { JSONArray optJSONArray = jSONObject.optJSONArray(str); if (optJSONArray == null) { int i2 = f2789 + 67; f2788 = i2 % 128; if (i2 % 2 == 0) { return list; } throw null; } return m3333(optJSONArray); } jSONObject.optJSONArray(str); throw null; } /* renamed from: メ, reason: contains not printable characters */ private static void m3339(JSONObject jSONObject, int i) { int i2 = f2788 + 1; f2789 = i2 % 128; int i3 = i2 % 2; m3327(jSONObject, i, null); int i4 = f2788 + 35; f2789 = i4 % 128; if (i4 % 2 == 0) { int i5 = 69 / 0; } } /* renamed from: ﻛ, reason: contains not printable characters */ public static void m3327(JSONObject jSONObject, int i, List list) { int i2; int i3 = f2789 + 77; f2788 = i3 % 128; try { if (i3 % 2 == 0) { JSONArray names = jSONObject.names(); if (names != null) { for (0; i2 < names.length(); i2 + 1) { String optString = names.optString(i2); if (list != null) { int i4 = f2788 + 19; f2789 = i4 % 128; int i5 = i4 % 2; i2 = !(!list.contains(optString)) ? i2 + 1 : 0; } m3334(jSONObject, optString, i); } } int i6 = f2789 + 95; f2788 = i6 % 128; if (i6 % 2 != 0) { throw null; } return; } jSONObject.names(); throw null; } catch (JSONException e2) { l.m3428(m3329(false, "\ufff2\ufff1\ufff8\u0017\f\u000f\u0016■\ufff6", 164 - TextUtils.indexOf((CharSequence) "", '0', 0, 0), ((Process.getThreadPriority(0) + 20) >> 6) + 9, (Process.getElapsedCpuTime() > 0L ? 1 : (Process.getElapsedCpuTime() == 0L ? 0 : -1)) + 6).intern(), m3329(true, "ᄑ\u000f\f\u000f\u000f¬\u000b\f\u0010\u0007ᄑ\u0004\u000b\u0006\u0011\ufffe\u0001\u0006\t\ufffe\u0013", (ViewConfiguration.getScrollBarFadeDuration() >> 16) + 171, 21 - Color.green(0), 6 - View.MeasureSpec.getSize(0)).intern(), e2); } } /* JADX WARN: Code restructure failed: missing block: B:10:0x002d, code lost: r4 = com.ironsource.adqualitysdk.sdk.i.jx.f2788 + 31; com.ironsource.adqualitysdk.sdk.i.jx.f2789 = r4 % 128; */ /* JADX WARN: Code restructure failed: missing block: B:11:0x0038, code lost: if ((r4 % 2) != 0) goto L14; */ /* JADX WARN: Code restructure failed: missing block: B:12:0x003a, code lost: r4 = 68 / 0; */ /* JADX WARN: Code restructure failed: missing block: B:13:0x003e, code lost: r4 = null; */ /* JADX WARN: Code restructure failed: missing block: B:14:0x003f, code lost: r2.put(r3, r4); */ /* JADX WARN: Code restructure failed: missing block: B:16:0x0023, code lost: if (r4 != null) goto L9; */ /* JADX WARN: Code restructure failed: missing block: B:4:0x0018, code lost: if (r4 != null) goto L9; */ /* JADX WARN: Code restructure failed: missing block: B:9:0x002b, code lost: if (r4.equals("") == false) goto L15; */ /* renamed from: ヌ, reason: contains not printable characters */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void m3334(org.json.JSONObject r2, java.lang.String r3, int r4) throws org.json.JSONException { /* int r0 = com.ironsource.adqualitysdk.sdk.i.jx.f2788 int r0 = r0 + 79 int r1 = r0 % 128 com.ironsource.adqualitysdk.sdk.i.jx.f2789 = r1 int r0 = r0 % 2 if (r0 != 0) goto L1b java.lang.Object r0 = r2.opt(r3) java.lang.String r4 = m3328(r0, r4) r0 = 89 int r0 = r0 / 0 if (r4 == 0) goto L42 goto L25 L1b: java.lang.Object r0 = r2.opt(r3) java.lang.String r4 = m3328(r0, r4) if (r4 == 0) goto L42 L25: java.lang.String r0 = "" boolean r0 = r4.equals(r0) if (r0 == 0) goto L3f int r4 = com.ironsource.adqualitysdk.sdk.i.jx.f2788 int r4 = r4 + 31 int r0 = r4 % 128 com.ironsource.adqualitysdk.sdk.i.jx.f2789 = r0 int r4 = r4 % 2 r0 = 0 if (r4 != 0) goto L3e r4 = 68 int r4 = r4 / 0 L3e: r4 = r0 L3f: r2.put(r3, r4) L42: int r2 = com.ironsource.adqualitysdk.sdk.i.jx.f2788 int r2 = r2 + 43 int r3 = r2 % 128 com.ironsource.adqualitysdk.sdk.i.jx.f2789 = r3 int r2 = r2 % 2 return */ throw new UnsupportedOperationException("Method not decompiled: com.ironsource.adqualitysdk.sdk.i.jx.m3334(org.json.JSONObject, java.lang.String, int):void"); } /* renamed from: ﻛ, reason: contains not printable characters */ private static void m3326(JSONArray jSONArray, int i) throws JSONException { int i2 = f2788 + 21; f2789 = i2 % 128; for (int i3 = i2 % 2 == 0 ? 1 : 0; i3 < jSONArray.length(); i3++) { int i4 = f2788 + 91; f2789 = i4 % 128; int i5 = i4 % 2; m3323(jSONArray, i3, i); } } /* renamed from: ﻐ, reason: contains not printable characters */ private static void m3323(JSONArray jSONArray, int i, int i2) throws JSONException { String m3328 = m3328(jSONArray.opt(i), i2); if (m3328 != null) { int i3 = f2789 + 85; f2788 = i3 % 128; int i4 = i3 % 2; jSONArray.put(i, m3328); int i5 = f2788 + 47; f2789 = i5 % 128; int i6 = i5 % 2; } } /* renamed from: k, reason: contains not printable characters */ private static String m3328(Object obj, int i) throws JSONException { int i2 = f2789 + 51; int i3 = i2 % 128; f2788 = i3; if (i2 % 2 == 0) { if (obj instanceof JSONObject) { m3339((JSONObject) obj, i); } else if (obj instanceof JSONArray) { m3326((JSONArray) obj, i); } else if (obj instanceof String) { int i4 = i3 + 21; f2789 = i4 % 128; int i5 = i4 % 2; String str = (String) obj; if (str.length() <= i) { return str; } StringBuilder sb = new StringBuilder(); sb.append(str.substring(0, i)); sb.append(m3329(true, "ᅳᅳᅳᅰ\u0010\u0011 \r\u000f\u001a!\u001e ᅯ", TextUtils.getOffsetBefore("", 0) + 156, ExpandableListView.getPackedPositionChild(0L) + 15, View.MeasureSpec.getSize(0) + 3).intern()); String obj2 = sb.toString(); int i6 = f2788 + 25; f2789 = i6 % 128; int i7 = i6 % 2; return obj2; } return null; } boolean z = obj instanceof JSONObject; throw null; } /* renamed from: メ, reason: contains not printable characters */ public static Map m3337(JSONObject jSONObject) { Map m3322 = m3322(jSONObject, new e() { // from class: com.ironsource.adqualitysdk.sdk.i.jx.1 @Override // com.ironsource.adqualitysdk.sdk.i.jx.e /* renamed from: k */ public final /* synthetic */ String mo1139(JSONObject jSONObject2, String str) { return jSONObject2.optString(str, null); } }); int i = f2789 + 93; f2788 = i % 128; int i2 = i % 2; return m3322; } /* renamed from: ﻐ, reason: contains not printable characters */ public static Map m3322(JSONObject jSONObject, e eVar) { int i = f2788; int i2 = i + 43; f2789 = i2 % 128; int i3 = i2 % 2; if (jSONObject != null) { HashMap hashMap = new HashMap(); Iterator keys = jSONObject.keys(); int i4 = f2788 + 1; f2789 = i4 % 128; int i5 = i4 % 2; while (keys.hasNext()) { String next = keys.next(); hashMap.put(next, eVar.mo1139(jSONObject, next)); } return hashMap; } int i6 = i + 7; f2789 = i6 % 128; if (i6 % 2 == 0) { int i7 = 32 / 0; } return null; } /* renamed from: メ, reason: contains not printable characters */ public static JSONObject m3338(int i, int i2, long j, long j2) { JSONObject jSONObject = new JSONObject(); try { if (j <= -1) { jSONObject.put(m3329(true, "\u0000", 193 - (ViewConfiguration.getScrollFriction() > 0.0f ? 1 : (ViewConfiguration.getScrollFriction() == 0.0f ? 0 : -1)), (ViewConfiguration.getScrollFriction() > 0.0f ? 1 : (ViewConfiguration.getScrollFriction() == 0.0f ? 0 : -1)), 1 - (ViewConfiguration.getMaximumFlingVelocity() >> 16)).intern(), -1); jSONObject.put(m3329(true, "\u0000", 192 - TextUtils.indexOf((CharSequence) "", '0', 0, 0), 1 - (ViewConfiguration.getJumpTapTimeout() >> 16), -ExpandableListView.getPackedPositionChild(0L)).intern(), -1); jSONObject.put(m3329(true, "\u0000", ((byte) KeyEvent.getModifierMetaStateMask()) + 189, (SystemClock.currentThreadTimeMillis() > (-1L) ? 1 : (SystemClock.currentThreadTimeMillis() == (-1L) ? 0 : -1)), 1 - (ViewConfiguration.getTapTimeout() >> 16)).intern(), -1); jSONObject.put(m3329(false, "\u0000", (Process.myPid() >> 22) + PsExtractor.PRIVATE_STREAM_1, (SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1)), Color.alpha(0) + 1).intern(), -1); } else { int i3 = f2789 + 17; f2788 = i3 % 128; int i4 = i3 % 2; jSONObject.put(m3329(true, "\u0000", 192 - TextUtils.getOffsetBefore("", 0), -TextUtils.lastIndexOf("", '0', 0, 0), -TextUtils.lastIndexOf("", '0', 0)).intern(), i); jSONObject.put(m3329(true, "\u0000", 193 - (ViewConfiguration.getMaximumFlingVelocity() >> 16), AndroidCharacter.getMirror('0') - '/', KeyEvent.getDeadChar(0, 0) + 1).intern(), i2); jSONObject.put(m3329(true, "\u0000", 188 - View.combineMeasuredStates(0, 0), 1 - (ViewConfiguration.getTapTimeout() >> 16), 1 - View.resolveSize(0, 0)).intern(), j); jSONObject.put(m3329(false, "\u0000", (ViewConfiguration.getWindowTouchSlop() >> 8) + PsExtractor.PRIVATE_STREAM_1, -ExpandableListView.getPackedPositionChild(0L), (SystemClock.elapsedRealtime() > 0L ? 1 : (SystemClock.elapsedRealtime() == 0L ? 0 : -1))).intern(), j2); } } catch (JSONException e2) { l.m3428(m3329(false, "\ufff2\ufff1\ufff8\u0017\f\u000f\u0016■\ufff6", 165 - (Process.myPid() >> 22), 9 - (ExpandableListView.getPackedPositionForGroup(0) > 0L ? 1 : (ExpandableListView.getPackedPositionForGroup(0) == 0L ? 0 : -1)), Color.green(0) + 7).intern(), m3329(false, "\ufff2\r\u0013\u0001\u0006ᄒ\b\u0011\r\f ̄\u0010\u0010\r\u0010ᄒ\u0001\u0010\u0003\uffff\u0012\u0007\f\u0005ᄒ\n\uffff\u0011\u0012", View.MeasureSpec.getMode(0) + 170, KeyEvent.getDeadChar(0, 0) + 29, 10 - (TypedValue.complexToFloat(0) > 0.0f ? 1 : (TypedValue.complexToFloat(0) == 0.0f ? 0 : -1))).intern(), e2); } int i5 = f2788 + 111; f2789 = i5 % 128; int i6 = i5 % 2; return jSONObject; } /* renamed from: k, reason: contains not printable characters */ private static String m3329(boolean z, String str, int i, int i2, int i3) { String str2; char[] cArr = str; if (str != null) { cArr = str.toCharArray(); } char[] cArr2 = cArr; synchronized (a.f57) { try { char[] cArr3 = new char[i2]; a.f56 = 0; while (true) { int i4 = a.f56; if (i4 >= i2) { break; } a.f54 = cArr2[i4]; cArr3[a.f56] = (char) (a.f54 + i); int i5 = a.f56; cArr3[i5] = (char) (cArr3[i5] - f2787); a.f56 = i5 + 1; } if (i3 > 0) { a.f55 = i3; char[] cArr4 = new char[i2]; System.arraycopy(cArr3, 0, cArr4, 0, i2); int i6 = a.f55; System.arraycopy(cArr4, 0, cArr3, i2 - i6, i6); int i7 = a.f55; System.arraycopy(cArr4, i7, cArr3, 0, i2 - i7); } if (z) { char[] cArr5 = new char[i2]; a.f56 = 0; while (true) { int i8 = a.f56; if (i8 >= i2) { break; } cArr5[i8] = cArr3[(i2 - i8) - 1]; a.f56 = i8 + 1; } cArr3 = cArr5; } str2 = new String(cArr3); } catch (Throwable th) { throw th; } } return str2; } }