CrackMe.apk
Download file
package com.google.android.material.internal;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.R;
public class ScrimInsetsFrameLayout extends FrameLayout {
private boolean drawBottomInsetForeground;
private boolean drawTopInsetForeground;
Drawable insetForeground;
Rect insets;
private Rect tempRect;
/* access modifiers changed from: protected */
public void onInsetsChanged(WindowInsetsCompat windowInsetsCompat) {
}
public ScrimInsetsFrameLayout(Context context) {
this(context, (AttributeSet) null);
}
public ScrimInsetsFrameLayout(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public ScrimInsetsFrameLayout(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.tempRect = new Rect();
this.drawTopInsetForeground = true;
this.drawBottomInsetForeground = true;
TypedArray obtainStyledAttributes = ThemeEnforcement.obtainStyledAttributes(context, attributeSet, R.styleable.ScrimInsetsFrameLayout, i, R.style.Widget_Design_ScrimInsetsFrameLayout, new int[0]);
this.insetForeground = obtainStyledAttributes.getDrawable(R.styleable.ScrimInsetsFrameLayout_insetForeground);
obtainStyledAttributes.recycle();
setWillNotDraw(true);
ViewCompat.setOnApplyWindowInsetsListener(this, new OnApplyWindowInsetsListener() {
public WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat windowInsetsCompat) {
if (ScrimInsetsFrameLayout.this.insets == null) {
ScrimInsetsFrameLayout.this.insets = new Rect();
}
ScrimInsetsFrameLayout.this.insets.set(windowInsetsCompat.getSystemWindowInsetLeft(), windowInsetsCompat.getSystemWindowInsetTop(), windowInsetsCompat.getSystemWindowInsetRight(), windowInsetsCompat.getSystemWindowInsetBottom());
ScrimInsetsFrameLayout.this.onInsetsChanged(windowInsetsCompat);
ScrimInsetsFrameLayout.this.setWillNotDraw(!windowInsetsCompat.hasSystemWindowInsets() || ScrimInsetsFrameLayout.this.insetForeground == null);
ViewCompat.postInvalidateOnAnimation(ScrimInsetsFrameLayout.this);
return windowInsetsCompat.consumeSystemWindowInsets();
}
});
}
public void setScrimInsetForeground(Drawable drawable) {
this.insetForeground = drawable;
}
public void setDrawTopInsetForeground(boolean z) {
this.drawTopInsetForeground = z;
}
public void setDrawBottomInsetForeground(boolean z) {
this.drawBottomInsetForeground = z;
}
public void draw(Canvas canvas) {
super.draw(canvas);
int width = getWidth();
int height = getHeight();
if (this.insets != null && this.insetForeground != null) {
int save = canvas.save();
canvas.translate((float) getScrollX(), (float) getScrollY());
if (this.drawTopInsetForeground) {
this.tempRect.set(0, 0, width, this.insets.top);
this.insetForeground.setBounds(this.tempRect);
this.insetForeground.draw(canvas);
}
if (this.drawBottomInsetForeground) {
this.tempRect.set(0, height - this.insets.bottom, width, height);
this.insetForeground.setBounds(this.tempRect);
this.insetForeground.draw(canvas);
}
this.tempRect.set(0, this.insets.top, this.insets.left, height - this.insets.bottom);
this.insetForeground.setBounds(this.tempRect);
this.insetForeground.draw(canvas);
this.tempRect.set(width - this.insets.right, this.insets.top, width, height - this.insets.bottom);
this.insetForeground.setBounds(this.tempRect);
this.insetForeground.draw(canvas);
canvas.restoreToCount(save);
}
}
/* access modifiers changed from: protected */
public void onAttachedToWindow() {
super.onAttachedToWindow();
Drawable drawable = this.insetForeground;
if (drawable != null) {
drawable.setCallback(this);
}
}
/* access modifiers changed from: protected */
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Drawable drawable = this.insetForeground;
if (drawable != null) {
drawable.setCallback((Drawable.Callback) null);
}
}
}
Download file