2021-08-09 22:50:52 +00:00
|
|
|
package c.f.d.m;
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
/* compiled from: WebpSupportStatus */
|
|
|
|
public class c {
|
|
|
|
public static b a = null;
|
|
|
|
public static boolean b = false;
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-08-18 07:29:27 +00:00
|
|
|
public static final byte[] f362c = a("RIFF");
|
2021-08-09 22:50:52 +00:00
|
|
|
public static final byte[] d = a("WEBP");
|
|
|
|
public static final byte[] e = a("VP8 ");
|
|
|
|
public static final byte[] f = a("VP8L");
|
|
|
|
public static final byte[] g = a("VP8X");
|
|
|
|
|
|
|
|
public static byte[] a(String str) {
|
|
|
|
try {
|
|
|
|
return str.getBytes("ASCII");
|
|
|
|
} catch (UnsupportedEncodingException e2) {
|
|
|
|
throw new RuntimeException("ASCII not found!", e2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean b(byte[] bArr, int i, int i2) {
|
2021-08-18 07:29:27 +00:00
|
|
|
return i2 >= 20 && d(bArr, i, f362c) && d(bArr, i + 8, d);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static b c() {
|
|
|
|
if (b) {
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
b bVar = null;
|
|
|
|
try {
|
|
|
|
bVar = (b) Class.forName("com.facebook.webpsupport.WebpBitmapFactoryImpl").newInstance();
|
|
|
|
} catch (Throwable unused) {
|
|
|
|
}
|
|
|
|
b = true;
|
|
|
|
return bVar;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean d(byte[] bArr, int i, byte[] bArr2) {
|
|
|
|
if (bArr2 == null || bArr == null || bArr2.length + i > bArr.length) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (int i2 = 0; i2 < bArr2.length; i2++) {
|
|
|
|
if (bArr[i2 + i] != bArr2[i2]) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|