package com.ironsource.adqualitysdk.sdk.i; import android.graphics.Color; import android.graphics.ImageFormat; import android.graphics.PointF; import android.media.AudioTrack; import android.os.Handler; import android.os.Process; import android.os.SystemClock; import android.text.TextUtils; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.ironsource.adqualitysdk.sdk.ISAdQualityAdListener; import com.ironsource.adqualitysdk.sdk.ISAdQualityAdType; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes4.dex */ public final class ay { /* renamed from: ﭖ, reason: contains not printable characters */ private static int f577 = 1; /* renamed from: ﭸ, reason: contains not printable characters */ private static int f578; /* renamed from: ﻐ, reason: contains not printable characters */ private ISAdQualityAdListener f585; /* renamed from: k, reason: contains not printable characters */ private Handler f587; /* renamed from: ヌ, reason: contains not printable characters */ private af f588; /* renamed from: ﱟ, reason: contains not printable characters */ private static char[] f581 = {'a', 37966, 10286, 48344, 20695, 58515, 31083, 3418, 41244, 13808, 51622, 25792, 61679, 19599, 55417, 13414, 32820, 7630, 27112, 50621, 20817, 44295, 'a', 37966, 10286, 48344, 20678, 58500, 31101, 3406, 41221, 13808, 51622, 'a', 37966, 10286, 48344, 20676, 58496, 31099, 3400, 41229, 13809, 'a', 37966, 10286, 48344, 20679, 58517, 31073, 3403, 41240, 13808, 51622, 2880, 40768, 9005, 47072, 23505, 61335, 29294, 1622, 43522, 16118, 49894, 22175, 63848, 36114, 4375, 42453, 18854, 56726, 24668, 62579, 39141, 11459, 45247, 23393, 61256, 29505, 1979, 43931, 16268, 49780, 22054, 64025, 36483, 4797, 42718, 18771, 56625, 25078, 62937, 39423, 11384, 45145, 17428, 59630, 31947, 133, 43901, 16171, 49936}; /* renamed from: ﺙ, reason: contains not printable characters */ private static long f583 = 1867551253058917421L; /* renamed from: ﻏ, reason: contains not printable characters */ private static char f584 = 37600; /* renamed from: ﮐ, reason: contains not printable characters */ private static char f580 = 47617; /* renamed from: ﮌ, reason: contains not printable characters */ private static char f579 = 26094; /* renamed from: ﱡ, reason: contains not printable characters */ private static char f582 = 40014; /* renamed from: メ, reason: contains not printable characters */ private Set f589 = new HashSet(); /* renamed from: ﻛ, reason: contains not printable characters */ private Set f586 = new HashSet(); /* renamed from: ﻐ, reason: contains not printable characters */ public static /* synthetic */ void m1290(ay ayVar, String str, JSONObject jSONObject) { int i = f577 + 117; f578 = i % 128; int i2 = i % 2; ayVar.m1292(str, jSONObject); if (i2 != 0) { int i3 = 51 / 0; } int i4 = f577 + 55; f578 = i4 % 128; int i5 = i4 % 2; } public ay(Handler handler, af afVar) { this.f588 = afVar; this.f587 = handler; } /* renamed from: メ, reason: contains not printable characters */ public final void m1306(ISAdQualityAdListener iSAdQualityAdListener) { int i = f578 + 37; int i2 = i % 128; f577 = i2; int i3 = i % 2; this.f585 = iSAdQualityAdListener; int i4 = i2 + 81; f578 = i4 % 128; if (i4 % 2 != 0) { throw null; } } /* renamed from: ヌ, reason: contains not printable characters */ public final void m1305(JSONObject jSONObject) { int optInt = jSONObject.optInt(ik.f2439); ISAdQualityAdListener iSAdQualityAdListener = this.f585; if (iSAdQualityAdListener != null) { int i = f577 + 15; f578 = i % 128; int i2 = i % 2; iSAdQualityAdListener.adDisplayed(jSONObject.optString(ik.f2437), ISAdQualityAdType.fromInt(optInt)); int i3 = f578 + 35; f577 = i3 % 128; int i4 = i3 % 2; } } /* renamed from: ﻐ, reason: contains not printable characters */ public final void m1301(JSONObject jSONObject) { ISAdQualityAdListener iSAdQualityAdListener = this.f585; if (iSAdQualityAdListener != null) { int i = f578 + 33; f577 = i % 128; int i2 = i % 2; iSAdQualityAdListener.adClosed(jSONObject.optString(ik.f2437), ISAdQualityAdType.fromInt(jSONObject.optInt(ik.f2439))); } int i3 = f578 + 75; f577 = i3 % 128; int i4 = i3 % 2; } /* renamed from: メ, reason: contains not printable characters */ public final void m1308(JSONObject jSONObject) { int i = f578 + 61; f577 = i % 128; m1307((i % 2 == 0 ? m1294((char) (TextUtils.lastIndexOf("", (char) 22) - 1), 22 - ImageFormat.getBitsPerPixel(1), ViewConfiguration.getPressedStateDuration() >>> 87) : m1294((char) ((-1) - TextUtils.lastIndexOf("", '0')), ImageFormat.getBitsPerPixel(0) + 12, ViewConfiguration.getPressedStateDuration() >> 16)).intern(), jSONObject); } /* renamed from: k, reason: contains not printable characters */ public final void m1304(JSONObject jSONObject) { int i = f577 + 15; f578 = i % 128; int i2 = i % 2; m1307(m1294((char) (TextUtils.indexOf((CharSequence) "", '0', 0, 0) + 25762), Process.getGidForName("") + 12, 11 - TextUtils.indexOf("", "")).intern(), jSONObject); int i3 = f578 + 15; f577 = i3 % 128; if (i3 % 2 == 0) { throw null; } } /* renamed from: ﻛ, reason: contains not printable characters */ public final void m1303(JSONObject jSONObject) { int i = f578 + 3; f577 = i % 128; m1307((i % 2 == 0 ? m1294((char) View.MeasureSpec.makeMeasureSpec(1, 0), 16777227 >>> Color.rgb(1, 0, 0), 91 >> TextUtils.lastIndexOf("", '\b', 1, 0)) : m1294((char) View.MeasureSpec.makeMeasureSpec(0, 0), Color.rgb(0, 0, 0) + 16777227, TextUtils.lastIndexOf("", '0', 0, 0) + 23)).intern(), jSONObject); } /* renamed from: ﱡ, reason: contains not printable characters */ public final void m1297(JSONObject jSONObject) { int i = f578 + 89; f577 = i % 128; int i2 = i % 2; m1307(m1294((char) ((ExpandableListView.getPackedPositionForChild(0, 0) > 0L ? 1 : (ExpandableListView.getPackedPositionForChild(0, 0) == 0L ? 0 : -1)) + 1), 11 - (SystemClock.currentThreadTimeMillis() > (-1L) ? 1 : (SystemClock.currentThreadTimeMillis() == (-1L) ? 0 : -1)), 32 - TextUtils.indexOf((CharSequence) "", '0', 0)).intern(), jSONObject); int i3 = f578 + 61; f577 = i3 % 128; if (i3 % 2 == 0) { throw null; } } /* renamed from: ﮐ, reason: contains not printable characters */ public final void m1295(JSONObject jSONObject) { int i = f577 + 71; f578 = i % 128; int i2 = i % 2; m1307(m1294((char) (ViewConfiguration.getTapTimeout() >> 16), (AudioTrack.getMinVolume() > 0.0f ? 1 : (AudioTrack.getMinVolume() == 0.0f ? 0 : -1)) + 11, Gravity.getAbsoluteGravity(0, 0) + 43).intern(), jSONObject); int i3 = f577 + 7; f578 = i3 % 128; int i4 = i3 % 2; } /* renamed from: ﱟ, reason: contains not printable characters */ public final void m1296(JSONObject jSONObject) { int i = f577 + 1; f578 = i % 128; int i2 = i % 2; m1307(m1293("\u2e67駃\uf08d굵侩ⰳ䡋ꁈ゙⤒ᙵ駛\uf031ᨫ噐ᢘ", 15 - View.combineMeasuredStates(0, 0)).intern(), jSONObject); int i3 = f578 + 51; f577 = i3 % 128; if (i3 % 2 == 0) { int i4 = 18 / 0; } } /* renamed from: ﺙ, reason: contains not printable characters */ public final void m1298(JSONObject jSONObject) { int i = f578 + 25; f577 = i % 128; int i2 = i % 2; m1307(m1293("\u2e67駃\uf08d굵細尖ᙵ駛⸈袺\uea6a罇怂\ue980", (PointF.length(0.0f, 0.0f) > 0.0f ? 1 : (PointF.length(0.0f, 0.0f) == 0.0f ? 0 : -1)) + 13).intern(), jSONObject); int i3 = f578 + 121; f577 = i3 % 128; int i4 = i3 % 2; } /* renamed from: メ, reason: contains not printable characters */ public final void m1307(final String str, final JSONObject jSONObject) { this.f587.post(new io() { // from class: com.ironsource.adqualitysdk.sdk.i.ay.5 @Override // com.ironsource.adqualitysdk.sdk.i.io /* renamed from: k */ public final void mo933() { ay.m1290(ay.this, str, jSONObject); } }); int i = f577 + 97; f578 = i % 128; int i2 = i % 2; } /* renamed from: k, reason: contains not printable characters */ private void m1292(String str, JSONObject jSONObject) { m1291(str, jSONObject); JSONObject jSONObject2 = new JSONObject(); try { String str2 = ik.f2437; jSONObject2.put(str2, jSONObject.remove(str2)); String str3 = ik.f2395; jSONObject2.put(str3, jSONObject.remove(str3)); int i = f577 + 53; f578 = i % 128; int i2 = i % 2; } catch (JSONException unused) { } this.f588.m986(str, jSONObject, jSONObject2); } /* renamed from: ﻛ, reason: contains not printable characters */ public final void m1302(String str, String str2, String str3, String str4) { int i = f578 + 25; f577 = i % 128; int i2 = i % 2; m1300(str, str2, str3, str4, null, false); int i3 = f578 + 35; f577 = i3 % 128; if (i3 % 2 == 0) { int i4 = 11 / 0; } } /* renamed from: ﻐ, reason: contains not printable characters */ public final void m1300(String str, String str2, String str3, String str4, JSONObject jSONObject, boolean z) { synchronized (this.f586) { try { StringBuilder sb = new StringBuilder(); sb.append(str3); sb.append(m1293("㪑\uf3a4", (KeyEvent.getMaxKeyCode() >> 16) + 1).intern()); sb.append(str2); String obj = sb.toString(); if (!this.f586.contains(obj) || z || ao.m1084().mo1106()) { this.f586.add(obj); if (Math.random() * 100.0d < m1289()) { JSONObject m960 = af.m960(str, str2, str3, str4, jSONObject); m1291(m1293("袹腊\uda70籘Ⓠꠋ┖髉", View.combineMeasuredStates(0, 0) + 8).intern(), m960); this.f588.m982(m1293("袹腊\uda70籘Ⓠꠋ┖髉", 9 - (ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1))).intern(), m960); return; } l.m3417(m1293("滱\uf123蠋膵\udcb4ሷ蠋膵細尖㻀솒", 11 - View.MeasureSpec.getSize(0)).intern(), m1294((char) (2820 - Color.red(0)), 48 - TextUtils.indexOf((CharSequence) "", '0'), 55 - (ViewConfiguration.getZoomControlsTimeout() > 0L ? 1 : (ViewConfiguration.getZoomControlsTimeout() == 0L ? 0 : -1))).intern()); } } catch (Throwable th) { throw th; } } } /* renamed from: ﻐ, reason: contains not printable characters */ private void m1291(String str, JSONObject jSONObject) { Iterator it = new HashSet(this.f589).iterator(); while (it.hasNext()) { JSONObject mo1245 = ((ii) it.next()).mo1245(str, jSONObject); if (mo1245 != null) { int i = f577 + 57; f578 = i % 128; int i2 = i % 2; jx.m3335(jSONObject, mo1245); if (i2 != 0) { throw null; } } int i3 = f577 + 81; f578 = i3 % 128; int i4 = i3 % 2; } } /* renamed from: ﻐ, reason: contains not printable characters */ public final void m1299(ii iiVar) { int i = f578 + 5; f577 = i % 128; int i2 = i % 2; this.f589.add(iiVar); int i3 = f578 + 119; f577 = i3 % 128; if (i3 % 2 == 0) { throw null; } } /* renamed from: ﻐ, reason: contains not printable characters */ private static double m1289() { int i = f578 + 67; f577 = i % 128; int i2 = i % 2; if (ao.m1084().mo1100()) { return 100.0d; } int i3 = f577 + 59; f578 = i3 % 128; if (i3 % 2 == 0) { return ao.m1084().mo1102(); } int i4 = 20 / 0; return ao.m1084().mo1102(); } /* renamed from: メ, reason: contains not printable characters */ private static String m1294(char c, int i, int i2) { String str; synchronized (d.f1568) { try { char[] cArr = new char[i]; d.f1567 = 0; while (true) { int i3 = d.f1567; if (i3 < i) { cArr[i3] = (char) ((f581[i2 + i3] ^ (i3 * f583)) ^ c); d.f1567 = i3 + 1; } else { str = new String(cArr); } } } catch (Throwable th) { throw th; } } return str; } /* renamed from: ヌ, reason: contains not printable characters */ private static String m1293(String str, int i) { String str2; char[] cArr = str; if (str != null) { cArr = str.toCharArray(); } char[] cArr2 = cArr; synchronized (k.f2799) { try { char[] cArr3 = new char[cArr2.length]; k.f2798 = 0; char[] cArr4 = new char[2]; while (true) { int i2 = k.f2798; if (i2 < cArr2.length) { cArr4[0] = cArr2[i2]; cArr4[1] = cArr2[i2 + 1]; int i3 = 58224; for (int i4 = 0; i4 < 16; i4++) { char c = cArr4[1]; char c2 = cArr4[0]; char c3 = (char) (c - (((c2 + i3) ^ ((c2 << 4) + f584)) ^ ((c2 >>> 5) + f579))); cArr4[1] = c3; cArr4[0] = (char) (c2 - (((c3 >>> 5) + f580) ^ ((c3 + i3) ^ ((c3 << 4) + f582)))); i3 -= 40503; } int i5 = k.f2798; cArr3[i5] = cArr4[0]; cArr3[i5 + 1] = cArr4[1]; k.f2798 = i5 + 2; } else { str2 = new String(cArr3, 0, i); } } } catch (Throwable th) { throw th; } } return str2; } }