package o; import com.drew.imaging.ImageProcessingException; import com.google.android.gms.auth.api.credentials.CredentialsApi; import com.google.common.primitives.UnsignedBytes; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; /* loaded from: classes.dex */ public final class EKY implements yYF { @Override // o.yYF public final Iterable c() { return Collections.singletonList(EnumC2874amo.APPD); } @Override // o.yYF public final void d(Iterable iterable, C16613piz c16613piz, EnumC2874amo enumC2874amo) { for (byte[] bArr : iterable) { if (bArr.length >= 14 && "Photoshop 3.0".equals(new String(bArr, 0, 13))) { b(new C0629LEh(bArr, 14), bArr.length - 14, c16613piz); } } } public static void b(Eaa eaa, int i, C16613piz c16613piz) { int i2; ErN erN = new ErN(); c16613piz.c.add(erN); int i3 = 0; int i4 = 0; while (i3 < i) { try { String str = new String(eaa.a(4)); int h = eaa.h(); short b = (short) (eaa.b() & UnsignedBytes.MAX_VALUE); int i5 = i3 + 7; if (b < 0 || (i2 = b + i5) > i) { throw new ImageProcessingException("Invalid string length"); } StringBuilder sb = new StringBuilder(); while (i5 < i2) { sb.append((char) (eaa.b() & UnsignedBytes.MAX_VALUE)); i5++; } if (i5 % 2 != 0) { eaa.b(1L); i5++; } int a = eaa.a(); byte[] a2 = eaa.a(a); i3 = i5 + 4 + a; if (i3 % 2 != 0) { eaa.b(1L); i3++; } if (str.equals("8BIM")) { if (h == 1028) { new KCy(); KCy.d(new C0629LEh(a2), c16613piz, a2.length); } else if (h == 1039) { new GXv(); GXv.a(new C0925RrQ(a2), c16613piz); } else if (h == 1058 || h == 1059) { new C5178boD(); C5178boD.b(new C0925RrQ(a2), c16613piz, 0, erN); } else if (h == 1060) { new RKF(); RKF.a(a2, 0, a2.length, c16613piz); } else if (h >= 2000 && h <= 2998) { int i6 = i4 + 1; byte[] copyOf = Arrays.copyOf(a2, a2.length + sb.length() + 1); for (int length = (copyOf.length - sb.length()) - 1; length < copyOf.length; length++) { if (length % (((copyOf.length - sb.length()) - 1) + sb.length()) == 0) { copyOf[length] = (byte) sb.length(); } else { copyOf[length] = (byte) sb.charAt(length - ((copyOf.length - sb.length()) - 1)); } } HashMap hashMap = ErN.e; int i7 = i4 + CredentialsApi.CREDENTIAL_PICKER_REQUEST_CODE; StringBuilder sb2 = new StringBuilder(); Integer valueOf = Integer.valueOf(i7); sb2.append("Path Info "); sb2.append(i6); hashMap.put(valueOf, sb2.toString()); erN.c(i7, copyOf); i4 = i6; } else { erN.c(h, a2); } if (h >= 4000 && h <= 4999) { ErN.e.put(Integer.valueOf(h), String.format("Plug-in %d Data", Integer.valueOf(h - 3999))); } } } catch (Exception e) { BrP.b(new Object[]{erN, e.getMessage()}, -1786863991, 1786863992, System.identityHashCode(erN)); return; } } } }