CrackMe.apk
Download file
package com.google.android.material.floatingactionbutton;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.LinearGradient;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import androidx.core.graphics.ColorUtils;
import com.google.android.material.shape.ShapeAppearanceModel;
import com.google.android.material.shape.ShapeAppearancePathProvider;
class BorderDrawable extends Drawable {
private static final float DRAW_STROKE_WIDTH_MULTIPLE = 1.3333f;
private ColorStateList borderTint;
float borderWidth;
private int bottomInnerStrokeColor;
private int bottomOuterStrokeColor;
private final RectF boundsRectF = new RectF();
private int currentBorderTintColor;
private boolean invalidateShader = true;
private final Paint paint;
private final ShapeAppearancePathProvider pathProvider = new ShapeAppearancePathProvider();
private final Rect rect = new Rect();
private final RectF rectF = new RectF();
private ShapeAppearanceModel shapeAppearanceModel;
private final Path shapePath = new Path();
private final BorderState state = new BorderState();
private int topInnerStrokeColor;
private int topOuterStrokeColor;
BorderDrawable(ShapeAppearanceModel shapeAppearanceModel2) {
this.shapeAppearanceModel = shapeAppearanceModel2;
Paint paint2 = new Paint(1);
this.paint = paint2;
paint2.setStyle(Paint.Style.STROKE);
}
public void setBorderWidth(float f) {
if (this.borderWidth != f) {
this.borderWidth = f;
this.paint.setStrokeWidth(f * DRAW_STROKE_WIDTH_MULTIPLE);
this.invalidateShader = true;
invalidateSelf();
}
}
/* access modifiers changed from: package-private */
public void setBorderTint(ColorStateList colorStateList) {
if (colorStateList != null) {
this.currentBorderTintColor = colorStateList.getColorForState(getState(), this.currentBorderTintColor);
}
this.borderTint = colorStateList;
this.invalidateShader = true;
invalidateSelf();
}
public void setColorFilter(ColorFilter colorFilter) {
this.paint.setColorFilter(colorFilter);
invalidateSelf();
}
/* access modifiers changed from: package-private */
public void setGradientColors(int i, int i2, int i3, int i4) {
this.topOuterStrokeColor = i;
this.topInnerStrokeColor = i2;
this.bottomOuterStrokeColor = i3;
this.bottomInnerStrokeColor = i4;
}
public void draw(Canvas canvas) {
if (this.invalidateShader) {
this.paint.setShader(createGradientShader());
this.invalidateShader = false;
}
float strokeWidth = this.paint.getStrokeWidth() / 2.0f;
copyBounds(this.rect);
this.rectF.set(this.rect);
float min = Math.min(this.shapeAppearanceModel.getTopLeftCornerSize().getCornerSize(getBoundsAsRectF()), this.rectF.width() / 2.0f);
if (this.shapeAppearanceModel.isRoundRect(getBoundsAsRectF())) {
this.rectF.inset(strokeWidth, strokeWidth);
canvas.drawRoundRect(this.rectF, min, min, this.paint);
}
}
public void getOutline(Outline outline) {
if (this.shapeAppearanceModel.isRoundRect(getBoundsAsRectF())) {
outline.setRoundRect(getBounds(), this.shapeAppearanceModel.getTopLeftCornerSize().getCornerSize(getBoundsAsRectF()));
return;
}
copyBounds(this.rect);
this.rectF.set(this.rect);
this.pathProvider.calculatePath(this.shapeAppearanceModel, 1.0f, this.rectF, this.shapePath);
if (this.shapePath.isConvex()) {
outline.setConvexPath(this.shapePath);
}
}
public boolean getPadding(Rect rect2) {
if (!this.shapeAppearanceModel.isRoundRect(getBoundsAsRectF())) {
return true;
}
int round = Math.round(this.borderWidth);
rect2.set(round, round, round, round);
return true;
}
/* access modifiers changed from: protected */
public RectF getBoundsAsRectF() {
this.boundsRectF.set(getBounds());
return this.boundsRectF;
}
public ShapeAppearanceModel getShapeAppearanceModel() {
return this.shapeAppearanceModel;
}
public void setShapeAppearanceModel(ShapeAppearanceModel shapeAppearanceModel2) {
this.shapeAppearanceModel = shapeAppearanceModel2;
invalidateSelf();
}
public void setAlpha(int i) {
this.paint.setAlpha(i);
invalidateSelf();
}
public int getOpacity() {
return this.borderWidth > 0.0f ? -3 : -2;
}
/* access modifiers changed from: protected */
public void onBoundsChange(Rect rect2) {
this.invalidateShader = true;
}
public boolean isStateful() {
ColorStateList colorStateList = this.borderTint;
return (colorStateList != null && colorStateList.isStateful()) || super.isStateful();
}
/* access modifiers changed from: protected */
public boolean onStateChange(int[] iArr) {
int colorForState;
ColorStateList colorStateList = this.borderTint;
if (!(colorStateList == null || (colorForState = colorStateList.getColorForState(iArr, this.currentBorderTintColor)) == this.currentBorderTintColor)) {
this.invalidateShader = true;
this.currentBorderTintColor = colorForState;
}
if (this.invalidateShader) {
invalidateSelf();
}
return this.invalidateShader;
}
private Shader createGradientShader() {
Rect rect2 = this.rect;
copyBounds(rect2);
float height = this.borderWidth / ((float) rect2.height());
return new LinearGradient(0.0f, (float) rect2.top, 0.0f, (float) rect2.bottom, new int[]{ColorUtils.compositeColors(this.topOuterStrokeColor, this.currentBorderTintColor), ColorUtils.compositeColors(this.topInnerStrokeColor, this.currentBorderTintColor), ColorUtils.compositeColors(ColorUtils.setAlphaComponent(this.topInnerStrokeColor, 0), this.currentBorderTintColor), ColorUtils.compositeColors(ColorUtils.setAlphaComponent(this.bottomInnerStrokeColor, 0), this.currentBorderTintColor), ColorUtils.compositeColors(this.bottomInnerStrokeColor, this.currentBorderTintColor), ColorUtils.compositeColors(this.bottomOuterStrokeColor, this.currentBorderTintColor)}, new float[]{0.0f, height, 0.5f, 0.5f, 1.0f - height, 1.0f}, Shader.TileMode.CLAMP);
}
public Drawable.ConstantState getConstantState() {
return this.state;
}
private class BorderState extends Drawable.ConstantState {
public int getChangingConfigurations() {
return 0;
}
private BorderState() {
}
public Drawable newDrawable() {
return BorderDrawable.this;
}
}
}
Download file