CrackMe.apk
Download file
package androidx.cardview.widget;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
class RoundRectDrawable extends Drawable {
private ColorStateList mBackground;
private final RectF mBoundsF;
private final Rect mBoundsI;
private boolean mInsetForPadding = false;
private boolean mInsetForRadius = true;
private float mPadding;
private final Paint mPaint;
private float mRadius;
private ColorStateList mTint;
private PorterDuffColorFilter mTintFilter;
private PorterDuff.Mode mTintMode = PorterDuff.Mode.SRC_IN;
public int getOpacity() {
return -3;
}
RoundRectDrawable(ColorStateList colorStateList, float f) {
this.mRadius = f;
this.mPaint = new Paint(5);
setBackground(colorStateList);
this.mBoundsF = new RectF();
this.mBoundsI = new Rect();
}
private void setBackground(ColorStateList colorStateList) {
if (colorStateList == null) {
colorStateList = ColorStateList.valueOf(0);
}
this.mBackground = colorStateList;
this.mPaint.setColor(colorStateList.getColorForState(getState(), this.mBackground.getDefaultColor()));
}
/* access modifiers changed from: package-private */
public void setPadding(float f, boolean z, boolean z2) {
if (f != this.mPadding || this.mInsetForPadding != z || this.mInsetForRadius != z2) {
this.mPadding = f;
this.mInsetForPadding = z;
this.mInsetForRadius = z2;
updateBounds((Rect) null);
invalidateSelf();
}
}
/* access modifiers changed from: package-private */
public float getPadding() {
return this.mPadding;
}
public void draw(Canvas canvas) {
boolean z;
Paint paint = this.mPaint;
if (this.mTintFilter == null || paint.getColorFilter() != null) {
z = false;
} else {
paint.setColorFilter(this.mTintFilter);
z = true;
}
RectF rectF = this.mBoundsF;
float f = this.mRadius;
canvas.drawRoundRect(rectF, f, f, paint);
if (z) {
paint.setColorFilter((ColorFilter) null);
}
}
private void updateBounds(Rect rect) {
if (rect == null) {
rect = getBounds();
}
this.mBoundsF.set((float) rect.left, (float) rect.top, (float) rect.right, (float) rect.bottom);
this.mBoundsI.set(rect);
if (this.mInsetForPadding) {
float calculateVerticalPadding = RoundRectDrawableWithShadow.calculateVerticalPadding(this.mPadding, this.mRadius, this.mInsetForRadius);
this.mBoundsI.inset((int) Math.ceil((double) RoundRectDrawableWithShadow.calculateHorizontalPadding(this.mPadding, this.mRadius, this.mInsetForRadius)), (int) Math.ceil((double) calculateVerticalPadding));
this.mBoundsF.set(this.mBoundsI);
}
}
/* access modifiers changed from: protected */
public void onBoundsChange(Rect rect) {
super.onBoundsChange(rect);
updateBounds(rect);
}
public void getOutline(Outline outline) {
outline.setRoundRect(this.mBoundsI, this.mRadius);
}
/* access modifiers changed from: package-private */
public void setRadius(float f) {
if (f != this.mRadius) {
this.mRadius = f;
updateBounds((Rect) null);
invalidateSelf();
}
}
public void setAlpha(int i) {
this.mPaint.setAlpha(i);
}
public void setColorFilter(ColorFilter colorFilter) {
this.mPaint.setColorFilter(colorFilter);
}
public float getRadius() {
return this.mRadius;
}
public void setColor(ColorStateList colorStateList) {
setBackground(colorStateList);
invalidateSelf();
}
public ColorStateList getColor() {
return this.mBackground;
}
public void setTintList(ColorStateList colorStateList) {
this.mTint = colorStateList;
this.mTintFilter = createTintFilter(colorStateList, this.mTintMode);
invalidateSelf();
}
public void setTintMode(PorterDuff.Mode mode) {
this.mTintMode = mode;
this.mTintFilter = createTintFilter(this.mTint, mode);
invalidateSelf();
}
/* access modifiers changed from: protected */
public boolean onStateChange(int[] iArr) {
PorterDuff.Mode mode;
ColorStateList colorStateList = this.mBackground;
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
boolean z = colorForState != this.mPaint.getColor();
if (z) {
this.mPaint.setColor(colorForState);
}
ColorStateList colorStateList2 = this.mTint;
if (colorStateList2 == null || (mode = this.mTintMode) == null) {
return z;
}
this.mTintFilter = createTintFilter(colorStateList2, mode);
return true;
}
/* JADX WARNING: Code restructure failed: missing block: B:4:0x000a, code lost:
r0 = r1.mBackground;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
public boolean isStateful() {
/*
r1 = this;
android.content.res.ColorStateList r0 = r1.mTint
if (r0 == 0) goto L_0x000a
boolean r0 = r0.isStateful()
if (r0 != 0) goto L_0x001a
L_0x000a:
android.content.res.ColorStateList r0 = r1.mBackground
if (r0 == 0) goto L_0x0014
boolean r0 = r0.isStateful()
if (r0 != 0) goto L_0x001a
L_0x0014:
boolean r0 = super.isStateful()
if (r0 == 0) goto L_0x001c
L_0x001a:
r0 = 1
goto L_0x001d
L_0x001c:
r0 = 0
L_0x001d:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.cardview.widget.RoundRectDrawable.isStateful():boolean");
}
private PorterDuffColorFilter createTintFilter(ColorStateList colorStateList, PorterDuff.Mode mode) {
if (colorStateList == null || mode == null) {
return null;
}
return new PorterDuffColorFilter(colorStateList.getColorForState(getState(), 0), mode);
}
}
Download file