what-the-bank/sources/o/nFt.java

121 lines
3.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.drew.imaging.png.PngProcessingException;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/* loaded from: classes.dex */
public final class nFt {
public static final nFt a;
public static final nFt b;
public static final nFt c;
public static final nFt d;
public static final nFt e;
public static final nFt f;
public static final nFt g;
public static final nFt h;
public static final nFt i;
public static final nFt j;
public static final nFt k;
public static final nFt l;
public static final nFt m;
public static final nFt n;
/* renamed from: o, reason: collision with root package name */
public static final nFt f9221o;
private static final Set<String> r = new HashSet(Arrays.asList("IDAT", "sPLT", "iTXt", "tEXt", "zTXt"));
public static final nFt s;
final boolean q;
private final byte[] t;
private static boolean d(byte b2) {
return (b2 >= 65 && b2 <= 90) || (b2 >= 97 && b2 <= 122);
}
static {
try {
b = new nFt("IHDR");
a = new nFt("PLTE");
new nFt("IDAT", true);
c = new nFt("IEND");
e = new nFt("cHRM");
i = new nFt("gAMA");
h = new nFt("iCCP");
m = new nFt("sBIT");
k = new nFt("sRGB");
d = new nFt("bKGD");
new nFt("hIST");
n = new nFt("tRNS");
j = new nFt("pHYs");
new nFt("sPLT", true);
l = new nFt("tIME");
f = new nFt("iTXt", true);
f9221o = new nFt("tEXt", true);
s = new nFt("zTXt", true);
g = new nFt("eXIf");
} catch (PngProcessingException e2) {
throw new IllegalArgumentException(e2);
}
}
private nFt(String str) throws PngProcessingException {
this(str, false);
}
private nFt(String str, boolean z) throws PngProcessingException {
this.q = z;
try {
byte[] bytes = str.getBytes("ASCII");
e(bytes);
this.t = bytes;
} catch (UnsupportedEncodingException unused) {
throw new IllegalArgumentException("Unable to convert string code to bytes.");
}
}
public nFt(byte[] bArr) throws PngProcessingException {
e(bArr);
this.t = bArr;
this.q = r.contains(a());
}
private static void e(byte[] bArr) throws PngProcessingException {
if (bArr.length != 4) {
throw new PngProcessingException("PNG chunk type identifier must be four bytes in length");
}
for (byte b2 : bArr) {
if (!d(b2)) {
throw new PngProcessingException("PNG chunk type identifier may only contain alphabet characters");
}
}
}
public final String a() {
try {
return new String(this.t, "ASCII");
} catch (UnsupportedEncodingException unused) {
return "Invalid object instance";
}
}
public final String toString() {
return a();
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return Arrays.equals(this.t, ((nFt) obj).t);
}
public final int hashCode() {
return Arrays.hashCode(this.t);
}
}