154 lines
5.2 KiB
Java
154 lines
5.2 KiB
Java
|
package o;
|
||
|
|
||
|
import android.graphics.Insets;
|
||
|
import android.graphics.PorterDuff;
|
||
|
import android.graphics.Rect;
|
||
|
import android.graphics.drawable.Drawable;
|
||
|
import android.os.Build;
|
||
|
import java.lang.reflect.Field;
|
||
|
import java.lang.reflect.InvocationTargetException;
|
||
|
import java.lang.reflect.Method;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class FIj {
|
||
|
private static final int[] c = {android.R.attr.state_checked};
|
||
|
private static final int[] a = new int[0];
|
||
|
public static final Rect d = new Rect();
|
||
|
|
||
|
public static boolean b() {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public static Rect hY_(Drawable drawable) {
|
||
|
if (Build.VERSION.SDK_INT >= 29) {
|
||
|
Insets ib_ = Sts.ib_(drawable);
|
||
|
return new Rect(ib_.left, ib_.top, ib_.right, ib_.bottom);
|
||
|
}
|
||
|
return IeS.ia_(Tlu.pH_(drawable));
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static void hX_(Drawable drawable) {
|
||
|
String name = drawable.getClass().getName();
|
||
|
if (Build.VERSION.SDK_INT < 29 || Build.VERSION.SDK_INT >= 31 || !"android.graphics.drawable.ColorStateListDrawable".equals(name)) {
|
||
|
return;
|
||
|
}
|
||
|
int[] state = drawable.getState();
|
||
|
if (state == null || state.length == 0) {
|
||
|
drawable.setState(c);
|
||
|
} else {
|
||
|
drawable.setState(a);
|
||
|
}
|
||
|
drawable.setState(state);
|
||
|
}
|
||
|
|
||
|
public static PorterDuff.Mode hZ_(int i, PorterDuff.Mode mode) {
|
||
|
if (i == 3) {
|
||
|
return PorterDuff.Mode.SRC_OVER;
|
||
|
}
|
||
|
if (i == 5) {
|
||
|
return PorterDuff.Mode.SRC_IN;
|
||
|
}
|
||
|
if (i == 9) {
|
||
|
return PorterDuff.Mode.SRC_ATOP;
|
||
|
}
|
||
|
switch (i) {
|
||
|
case 14:
|
||
|
return PorterDuff.Mode.MULTIPLY;
|
||
|
case 15:
|
||
|
return PorterDuff.Mode.SCREEN;
|
||
|
case 16:
|
||
|
return PorterDuff.Mode.ADD;
|
||
|
default:
|
||
|
return mode;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static class IeS {
|
||
|
private static final Field a;
|
||
|
private static final Method b;
|
||
|
private static final boolean c;
|
||
|
private static final Field d;
|
||
|
private static final Field e;
|
||
|
private static final Field h;
|
||
|
|
||
|
/* JADX WARN: Removed duplicated region for block: B:17:0x0037 */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:20:0x0044 */
|
||
|
static {
|
||
|
/*
|
||
|
r0 = 1
|
||
|
r1 = 0
|
||
|
r2 = 0
|
||
|
java.lang.String r3 = "android.graphics.Insets"
|
||
|
java.lang.Class r3 = java.lang.Class.forName(r3) // Catch: java.lang.Throwable -> L2f
|
||
|
java.lang.Class<android.graphics.drawable.Drawable> r4 = android.graphics.drawable.Drawable.class
|
||
|
java.lang.String r5 = "getOpticalInsets"
|
||
|
java.lang.Class[] r6 = new java.lang.Class[r1] // Catch: java.lang.Throwable -> L2f
|
||
|
java.lang.reflect.Method r4 = r4.getMethod(r5, r6) // Catch: java.lang.Throwable -> L2f
|
||
|
java.lang.String r5 = "left"
|
||
|
java.lang.reflect.Field r5 = r3.getField(r5) // Catch: java.lang.Throwable -> L30
|
||
|
java.lang.String r6 = "top"
|
||
|
java.lang.reflect.Field r6 = r3.getField(r6) // Catch: java.lang.Throwable -> L31
|
||
|
java.lang.String r7 = "right"
|
||
|
java.lang.reflect.Field r7 = r3.getField(r7) // Catch: java.lang.Throwable -> L2d
|
||
|
java.lang.String r8 = "bottom"
|
||
|
java.lang.reflect.Field r3 = r3.getField(r8) // Catch: java.lang.Throwable -> L33
|
||
|
r8 = r0
|
||
|
goto L35
|
||
|
L2d:
|
||
|
r7 = r2
|
||
|
goto L33
|
||
|
L2f:
|
||
|
r4 = r2
|
||
|
L30:
|
||
|
r5 = r2
|
||
|
L31:
|
||
|
r6 = r2
|
||
|
r7 = r6
|
||
|
L33:
|
||
|
r8 = r1
|
||
|
r3 = r2
|
||
|
L35:
|
||
|
if (r8 == 0) goto L44
|
||
|
o.FIj.IeS.b = r4
|
||
|
o.FIj.IeS.e = r5
|
||
|
o.FIj.IeS.h = r6
|
||
|
o.FIj.IeS.d = r7
|
||
|
o.FIj.IeS.a = r3
|
||
|
o.FIj.IeS.c = r0
|
||
|
return
|
||
|
L44:
|
||
|
o.FIj.IeS.b = r2
|
||
|
o.FIj.IeS.e = r2
|
||
|
o.FIj.IeS.h = r2
|
||
|
o.FIj.IeS.d = r2
|
||
|
o.FIj.IeS.a = r2
|
||
|
o.FIj.IeS.c = r1
|
||
|
return
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: o.FIj.IeS.<clinit>():void");
|
||
|
}
|
||
|
|
||
|
static Rect ia_(Drawable drawable) {
|
||
|
if (Build.VERSION.SDK_INT < 29 && c) {
|
||
|
try {
|
||
|
Object invoke = b.invoke(drawable, new Object[0]);
|
||
|
if (invoke != null) {
|
||
|
return new Rect(e.getInt(invoke), h.getInt(invoke), d.getInt(invoke), a.getInt(invoke));
|
||
|
}
|
||
|
} catch (IllegalAccessException | InvocationTargetException unused) {
|
||
|
}
|
||
|
}
|
||
|
return FIj.d;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
static class Sts {
|
||
|
static Insets ib_(Drawable drawable) {
|
||
|
return drawable.getOpticalInsets();
|
||
|
}
|
||
|
}
|
||
|
}
|