package o; import android.graphics.PointF; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Process; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ExpandableListView; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.measurement.api.AppMeasurementSdk; import com.google.common.base.Ascii; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.util.Map; import java.util.Objects; import net.sf.scuba.smartcards.ISOFileInfo; import o.RcS; /* loaded from: classes3.dex */ public final class RcS implements MethodChannel.MethodCallHandler, FlutterPlugin { private MethodChannel a; private HandlerThread c; private Handler d; private Fwm e; @Override // io.flutter.embedding.engine.plugins.FlutterPlugin public final void onAttachedToEngine(FlutterPlugin.FlutterPluginBinding flutterPluginBinding) { BinaryMessenger binaryMessenger = flutterPluginBinding.getBinaryMessenger(); try { this.e = new Fwm(flutterPluginBinding.getApplicationContext()); HandlerThread handlerThread = new HandlerThread("com.it_nomads.fluttersecurestorage.worker"); this.c = handlerThread; handlerThread.start(); this.d = new Handler(this.c.getLooper()); MethodChannel methodChannel = new MethodChannel(binaryMessenger, "plugins.it_nomads.com/flutter_secure_storage"); this.a = methodChannel; methodChannel.setMethodCallHandler(this); } catch (Exception unused) { } } @Override // io.flutter.embedding.engine.plugins.FlutterPlugin public final void onDetachedFromEngine(FlutterPlugin.FlutterPluginBinding flutterPluginBinding) { if (this.a != null) { this.c.quitSafely(); this.c = null; this.a.setMethodCallHandler(null); this.a = null; } this.e = null; } @Override // io.flutter.plugin.common.MethodChannel.MethodCallHandler public final void onMethodCall(MethodCall methodCall, MethodChannel.Result result) { this.d.post(new IeS(this, methodCall, new RVV(result))); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public static class RVV implements MethodChannel.Result { private final Handler d = new Handler(Looper.getMainLooper()); final MethodChannel.Result e; RVV(MethodChannel.Result result) { this.e = result; } @Override // io.flutter.plugin.common.MethodChannel.Result public final void success(final Object obj) { this.d.post(new Runnable(this, obj) { // from class: o.InB private RcS.RVV c; private Object e; @Override // java.lang.Runnable public final void run() { RcS.RVV rvv = this.c; rvv.e.success(this.e); } { this.c = this; this.e = obj; } }); } @Override // io.flutter.plugin.common.MethodChannel.Result public final void error(final String str, final String str2, final Object obj) { this.d.post(new Runnable(this, str, str2, obj) { // from class: o.iCf private String a; private RcS.RVV c; private Object d; private String e; @Override // java.lang.Runnable public final void run() { RcS.RVV rvv = this.c; rvv.e.error(this.a, this.e, this.d); } { this.c = this; this.a = str; this.e = str2; this.d = obj; } }); } @Override // io.flutter.plugin.common.MethodChannel.Result public final void notImplemented() { Handler handler = this.d; final MethodChannel.Result result = this.e; Objects.requireNonNull(result); handler.post(new Runnable(result) { // from class: o.GpB private MethodChannel.Result c; @Override // java.lang.Runnable public final void run() { this.c.notImplemented(); } { this.c = result; } }); } } /* loaded from: classes3.dex */ class IeS implements Runnable { private RcS a; private final MethodChannel.Result d; private final MethodCall e; private static final byte[] $$a = {Ascii.DEL, ISOFileInfo.CHANNEL_SECURITY, -122, -31}; private static final int $$b = 114; private static int $10 = 0; private static int $11 = 1; private static int c = 0; private static int i = 1; private static int[] b = {-1320234564, 1062469873, -1466766328, -261582317, 1522209142, -2079311204, 2113051480, -1540876116, 1554979618, 158912129, 589884440, 1040795851, -1399077496, 254244546, 166495827, 1331799710, -240855113, 2051744954}; /* JADX WARN: Removed duplicated region for block: B:10:0x0024 */ /* JADX WARN: Removed duplicated region for block: B:7:0x001c */ /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0024 -> B:4:0x002c). Please report as a decompilation issue!!! */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void g(int r6, int r7, byte r8, java.lang.Object[] r9) { /* int r8 = r8 * 4 int r0 = r8 + 1 int r6 = r6 * 2 int r6 = 104 - r6 byte[] r1 = o.RcS.IeS.$$a int r7 = r7 + 4 byte[] r0 = new byte[r0] r2 = 0 if (r1 != 0) goto L14 r3 = r7 r4 = r2 goto L2c L14: r3 = r2 L15: int r7 = r7 + 1 byte r4 = (byte) r6 r0[r3] = r4 if (r3 != r8) goto L24 java.lang.String r6 = new java.lang.String r6.(r0, r2) r9[r2] = r6 return L24: int r3 = r3 + 1 r4 = r1[r7] r5 = r3 r3 = r7 r7 = r4 r4 = r5 L2c: int r7 = -r7 int r6 = r6 + r7 r7 = r3 r3 = r4 goto L15 */ throw new UnsupportedOperationException("Method not decompiled: o.RcS.IeS.g(int, int, byte, java.lang.Object[]):void"); } IeS(RcS rcS, MethodCall methodCall, MethodChannel.Result result) { this.a = rcS; this.e = methodCall; this.d = result; } private static void f(int[] iArr, int i2, Object[] objArr) { int i3; int i4 = 2; int i5 = 2 % 2; C4403bZM c4403bZM = new C4403bZM(); char[] cArr = new char[4]; char[] cArr2 = new char[iArr.length * 2]; int[] iArr2 = b; int i6 = 729798706; int i7 = 1; int i8 = 0; if (iArr2 != null) { int length = iArr2.length; int[] iArr3 = new int[length]; int i9 = 0; while (i9 < length) { int i10 = $11 + 49; $10 = i10 % 128; if (i10 % i4 != 0) { try { Object[] objArr2 = new Object[1]; objArr2[i8] = Integer.valueOf(iArr2[i9]); Object obj = xzZ.y.get(Integer.valueOf(i6)); if (obj == null) { Class cls = (Class) xzZ.c(((Process.getThreadPriority(i8) + 20) >> 6) + 15, 4 - TextUtils.lastIndexOf("", '0', i8, i8), (char) ((ExpandableListView.getPackedPositionForChild(i8, i8) > 0L ? 1 : (ExpandableListView.getPackedPositionForChild(i8, i8) == 0L ? 0 : -1)) + 58135)); Class[] clsArr = new Class[1]; clsArr[i8] = Integer.TYPE; obj = cls.getMethod("i", clsArr); xzZ.y.put(729798706, obj); } iArr3[i9] = ((Integer) ((Method) obj).invoke(null, objArr2)).intValue(); i9--; } catch (Throwable th) { Throwable cause = th.getCause(); if (cause == null) { throw th; } throw cause; } } else { try { Object[] objArr3 = {Integer.valueOf(iArr2[i9])}; Object obj2 = xzZ.y.get(729798706); if (obj2 == null) { obj2 = ((Class) xzZ.c(15 - View.resolveSizeAndState(0, 0, 0), 5 - View.MeasureSpec.makeMeasureSpec(0, 0), (char) (58134 - TextUtils.indexOf("", "", 0)))).getMethod("i", Integer.TYPE); xzZ.y.put(729798706, obj2); } iArr3[i9] = ((Integer) ((Method) obj2).invoke(null, objArr3)).intValue(); i9++; } catch (Throwable th2) { Throwable cause2 = th2.getCause(); if (cause2 == null) { throw th2; } throw cause2; } } int i11 = $10 + 61; $11 = i11 % 128; int i12 = i11 % 2; i4 = 2; i8 = 0; i6 = 729798706; } iArr2 = iArr3; } int length2 = iArr2.length; int[] iArr4 = new int[length2]; int[] iArr5 = b; if (iArr5 != null) { int length3 = iArr5.length; int[] iArr6 = new int[length3]; int i13 = 0; while (i13 < length3) { int i14 = $10 + 109; $11 = i14 % 128; if (i14 % 2 == 0) { Object[] objArr4 = new Object[i7]; objArr4[0] = Integer.valueOf(iArr5[i13]); Object obj3 = xzZ.y.get(729798706); if (obj3 != null) { i3 = length3; } else { i3 = length3; obj3 = ((Class) xzZ.c(14 - TextUtils.lastIndexOf("", '0'), 5 - ExpandableListView.getPackedPositionType(0L), (char) (TextUtils.lastIndexOf("", '0', 0, 0) + 58135))).getMethod("i", Integer.TYPE); xzZ.y.put(729798706, obj3); } iArr6[i13] = ((Integer) ((Method) obj3).invoke(null, objArr4)).intValue(); i13--; } else { i3 = length3; Object[] objArr5 = {Integer.valueOf(iArr5[i13])}; Object obj4 = xzZ.y.get(729798706); if (obj4 == null) { obj4 = ((Class) xzZ.c(ExpandableListView.getPackedPositionType(0L) + 15, TextUtils.getCapsMode("", 0, 0) + 5, (char) (KeyEvent.normalizeMetaState(0) + 58134))).getMethod("i", Integer.TYPE); xzZ.y.put(729798706, obj4); } iArr6[i13] = ((Integer) ((Method) obj4).invoke(null, objArr5)).intValue(); i13++; } length3 = i3; i7 = 1; } iArr5 = iArr6; } char c2 = 0; System.arraycopy(iArr5, 0, iArr4, 0, length2); c4403bZM.b = 0; while (c4403bZM.b < iArr.length) { cArr[c2] = (char) (iArr[c4403bZM.b] >> 16); cArr[1] = (char) iArr[c4403bZM.b]; cArr[2] = (char) (iArr[c4403bZM.b + 1] >> 16); cArr[3] = (char) iArr[c4403bZM.b + 1]; c4403bZM.e = (cArr[0] << 16) + cArr[1]; c4403bZM.a = (cArr[2] << 16) + cArr[3]; C4403bZM.d(iArr4); int i15 = 0; for (int i16 = 16; i15 < i16; i16 = 16) { int i17 = $10 + 73; $11 = i17 % 128; if (i17 % 2 == 0) { c4403bZM.e ^= iArr4[i15]; Object[] objArr6 = {c4403bZM, Integer.valueOf(C4403bZM.d(c4403bZM.e)), c4403bZM, c4403bZM}; Object obj5 = xzZ.y.get(-1196964548); if (obj5 == null) { Class cls2 = (Class) xzZ.c(118 - ((Process.getThreadPriority(0) + 20) >> 6), 5 - (ViewConfiguration.getJumpTapTimeout() >> i16), (char) View.MeasureSpec.getMode(0)); byte b2 = (byte) 0; byte b3 = (byte) (b2 - 1); Object[] objArr7 = new Object[1]; g(b2, b3, (byte) (b3 + 1), objArr7); obj5 = cls2.getMethod((String) objArr7[0], Object.class, Integer.TYPE, Object.class, Object.class); xzZ.y.put(-1196964548, obj5); } int intValue = ((Integer) ((Method) obj5).invoke(null, objArr6)).intValue(); c4403bZM.e = c4403bZM.a; c4403bZM.a = intValue; i15 += 6; } else { c4403bZM.e ^= iArr4[i15]; Object[] objArr8 = {c4403bZM, Integer.valueOf(C4403bZM.d(c4403bZM.e)), c4403bZM, c4403bZM}; Object obj6 = xzZ.y.get(-1196964548); if (obj6 == null) { Class cls3 = (Class) xzZ.c((PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 118, 4 - TextUtils.lastIndexOf("", '0', 0, 0), (char) (PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) > BitmapDescriptorFactory.HUE_RED ? 1 : (PointF.length(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED) == BitmapDescriptorFactory.HUE_RED ? 0 : -1))); byte b4 = (byte) 0; byte b5 = (byte) (b4 - 1); Object[] objArr9 = new Object[1]; g(b4, b5, (byte) (b5 + 1), objArr9); obj6 = cls3.getMethod((String) objArr9[0], Object.class, Integer.TYPE, Object.class, Object.class); xzZ.y.put(-1196964548, obj6); } int intValue2 = ((Integer) ((Method) obj6).invoke(null, objArr8)).intValue(); c4403bZM.e = c4403bZM.a; c4403bZM.a = intValue2; i15++; } int i18 = $10 + 93; $11 = i18 % 128; int i19 = i18 % 2; } int i20 = c4403bZM.e; c4403bZM.e = c4403bZM.a; c4403bZM.a = i20; c4403bZM.a ^= iArr4[16]; c4403bZM.e ^= iArr4[17]; int i21 = c4403bZM.e; int i22 = c4403bZM.a; cArr[0] = (char) (c4403bZM.e >>> 16); cArr[1] = (char) c4403bZM.e; cArr[2] = (char) (c4403bZM.a >>> 16); cArr[3] = (char) c4403bZM.a; C4403bZM.d(iArr4); cArr2[c4403bZM.b * 2] = cArr[0]; cArr2[(c4403bZM.b * 2) + 1] = cArr[1]; cArr2[(c4403bZM.b * 2) + 2] = cArr[2]; cArr2[(c4403bZM.b * 2) + 3] = cArr[3]; Object[] objArr10 = {c4403bZM, c4403bZM}; Object obj7 = xzZ.y.get(1914371176); if (obj7 == null) { Class cls4 = (Class) xzZ.c(View.getDefaultSize(0, 0) + 98, TextUtils.getOffsetAfter("", 0) + 5, (char) Drawable.resolveOpacity(0, 0)); byte b6 = (byte) 1; byte b7 = (byte) (-b6); Object[] objArr11 = new Object[1]; g(b6, b7, (byte) (b7 + 1), objArr11); obj7 = cls4.getMethod((String) objArr11[0], Object.class, Object.class); xzZ.y.put(1914371176, obj7); } ((Method) obj7).invoke(null, objArr10); int i23 = $10 + 47; $11 = i23 % 128; int i24 = i23 % 2; c2 = 0; } objArr[0] = new String(cArr2, 0, i2); } @Override // java.lang.Runnable public final void run() { char c2; int i2 = 2 % 2; boolean z = false; try { try { this.a.e.a = (Map) ((Map) this.e.arguments).get("options"); } catch (Exception e) { e = e; } try { String str = this.e.method; switch (str.hashCode()) { case -1335458389: if (str.equals("delete")) { c2 = 4; break; } c2 = 65535; break; case -358737930: if (str.equals("deleteAll")) { int i3 = c + 63; i = i3 % 128; int i4 = i3 % 2; c2 = 5; break; } c2 = 65535; break; case 3496342: if (str.equals("read")) { c2 = 1; break; } c2 = 65535; break; case 113399775: if (str.equals("write")) { c2 = 0; break; } c2 = 65535; break; case 208013248: if (str.equals("containsKey")) { c2 = 3; break; } c2 = 65535; break; case 1080375339: if (str.equals("readAll")) { c2 = 2; break; } c2 = 65535; break; default: c2 = 65535; break; } if (c2 == 0) { String c3 = RcS.c(this.a, this.e); String b2 = RcS.b(this.e); if (b2 != null) { int i5 = i + 67; c = i5 % 128; int i6 = i5 % 2; this.a.e.e(c3, b2); this.d.success(null); return; } MethodChannel.Result result = this.d; Object[] objArr = new Object[1]; f(new int[]{-814688946, 956715429}, 4 - (ViewConfiguration.getTapTimeout() >> 16), objArr); result.error(((String) objArr[0]).intern(), null, null); return; } int i7 = i + 1; int i8 = i7 % 128; c = i8; int i9 = i7 % 2; if (c2 == 1) { String c4 = RcS.c(this.a, this.e); if (!this.a.e.e(c4)) { this.d.success(null); return; } else { this.d.success(this.a.e.b(c4)); return; } } int i10 = i8 + 101; i = i10 % 128; if (i10 % 2 != 0 ? c2 == 2 : c2 == 2) { this.d.success(this.a.e.a()); return; } if (c2 == 3) { this.d.success(Boolean.valueOf(this.a.e.e(RcS.c(this.a, this.e)))); } else if (c2 == 4) { this.a.e.c(RcS.c(this.a, this.e)); this.d.success(null); } else if (c2 != 5) { this.d.notImplemented(); } else { this.a.e.b(); this.d.success(null); } } catch (Exception e2) { e = e2; z = RcS.d(this.e); if (z) { this.a.e.b(); this.d.success("Data has been reset"); } else { StringWriter stringWriter = new StringWriter(); e.printStackTrace(new PrintWriter(stringWriter)); this.d.error("Exception encountered", this.e.method, stringWriter.toString()); } } } catch (FileNotFoundException e3) { e3.getLocalizedMessage(); } } } static /* synthetic */ boolean d(MethodCall methodCall) { Map map = (Map) methodCall.arguments; return map.containsKey("resetOnError") && map.get("resetOnError").equals("true"); } static /* synthetic */ String c(RcS rcS, MethodCall methodCall) { String str = (String) ((Map) methodCall.arguments).get("key"); StringBuilder sb = new StringBuilder(); sb.append(rcS.e.e); sb.append("_"); sb.append(str); return sb.toString(); } static /* synthetic */ String b(MethodCall methodCall) { return (String) ((Map) methodCall.arguments).get(AppMeasurementSdk.ConditionalUserProperty.VALUE); } }