CrackMe.apk
Download file
package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.InputFilter;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inspector.InspectionCompanion;
import android.view.inspector.PropertyMapper;
import android.view.inspector.PropertyReader;
import android.view.textclassifier.TextClassifier;
import android.widget.TextView;
import androidx.appcompat.R;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.TypefaceCompat;
import androidx.core.text.PrecomputedTextCompat;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.AutoSizeableTextView;
import androidx.core.widget.TextViewCompat;
import androidx.core.widget.TintableCompoundDrawablesView;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.function.IntFunction;
public class AppCompatTextView extends TextView implements TintableBackgroundView, TintableCompoundDrawablesView, AutoSizeableTextView, EmojiCompatConfigurationView {
private final AppCompatBackgroundHelper mBackgroundTintHelper;
private AppCompatEmojiTextHelper mEmojiTextViewHelper;
private boolean mIsSetTypefaceProcessing;
private Future<PrecomputedTextCompat> mPrecomputedTextFuture;
private final AppCompatTextClassifierHelper mTextClassifierHelper;
private final AppCompatTextHelper mTextHelper;
public final class InspectionCompanion implements android.view.inspector.InspectionCompanion<AppCompatTextView> {
private int mAutoSizeMaxTextSizeId;
private int mAutoSizeMinTextSizeId;
private int mAutoSizeStepGranularityId;
private int mAutoSizeTextTypeId;
private int mBackgroundTintId;
private int mBackgroundTintModeId;
private int mDrawableTintId;
private int mDrawableTintModeId;
private boolean mPropertiesMapped = false;
public void mapProperties(PropertyMapper propertyMapper) {
this.mAutoSizeMaxTextSizeId = propertyMapper.mapInt("autoSizeMaxTextSize", R.attr.autoSizeMaxTextSize);
this.mAutoSizeMinTextSizeId = propertyMapper.mapInt("autoSizeMinTextSize", R.attr.autoSizeMinTextSize);
this.mAutoSizeStepGranularityId = propertyMapper.mapInt("autoSizeStepGranularity", R.attr.autoSizeStepGranularity);
this.mAutoSizeTextTypeId = propertyMapper.mapIntEnum("autoSizeTextType", R.attr.autoSizeTextType, new IntFunction<String>() {
public String apply(int i) {
if (i != 0) {
return i != 1 ? String.valueOf(i) : "uniform";
}
return "none";
}
});
this.mBackgroundTintId = propertyMapper.mapObject("backgroundTint", R.attr.backgroundTint);
this.mBackgroundTintModeId = propertyMapper.mapObject("backgroundTintMode", R.attr.backgroundTintMode);
this.mDrawableTintId = propertyMapper.mapObject("drawableTint", R.attr.drawableTint);
this.mDrawableTintModeId = propertyMapper.mapObject("drawableTintMode", R.attr.drawableTintMode);
this.mPropertiesMapped = true;
}
public void readProperties(AppCompatTextView appCompatTextView, PropertyReader propertyReader) {
if (this.mPropertiesMapped) {
propertyReader.readInt(this.mAutoSizeMaxTextSizeId, appCompatTextView.getAutoSizeMaxTextSize());
propertyReader.readInt(this.mAutoSizeMinTextSizeId, appCompatTextView.getAutoSizeMinTextSize());
propertyReader.readInt(this.mAutoSizeStepGranularityId, appCompatTextView.getAutoSizeStepGranularity());
propertyReader.readIntEnum(this.mAutoSizeTextTypeId, appCompatTextView.getAutoSizeTextType());
propertyReader.readObject(this.mBackgroundTintId, appCompatTextView.getBackgroundTintList());
propertyReader.readObject(this.mBackgroundTintModeId, appCompatTextView.getBackgroundTintMode());
propertyReader.readObject(this.mDrawableTintId, appCompatTextView.getCompoundDrawableTintList());
propertyReader.readObject(this.mDrawableTintModeId, appCompatTextView.getCompoundDrawableTintMode());
return;
}
throw new InspectionCompanion.UninitializedPropertyMapException();
}
}
public AppCompatTextView(Context context) {
this(context, (AttributeSet) null);
}
public AppCompatTextView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 16842884);
}
public AppCompatTextView(Context context, AttributeSet attributeSet, int i) {
super(TintContextWrapper.wrap(context), attributeSet, i);
this.mIsSetTypefaceProcessing = false;
ThemeUtils.checkAppCompatTheme(this, getContext());
AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
this.mBackgroundTintHelper = appCompatBackgroundHelper;
appCompatBackgroundHelper.loadFromAttributes(attributeSet, i);
AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
this.mTextHelper = appCompatTextHelper;
appCompatTextHelper.loadFromAttributes(attributeSet, i);
appCompatTextHelper.applyCompoundDrawablesTints();
this.mTextClassifierHelper = new AppCompatTextClassifierHelper(this);
getEmojiTextViewHelper().loadFromAttributes(attributeSet, i);
}
private AppCompatEmojiTextHelper getEmojiTextViewHelper() {
if (this.mEmojiTextViewHelper == null) {
this.mEmojiTextViewHelper = new AppCompatEmojiTextHelper(this);
}
return this.mEmojiTextViewHelper;
}
public void setBackgroundResource(int i) {
super.setBackgroundResource(i);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.onSetBackgroundResource(i);
}
}
public void setBackgroundDrawable(Drawable drawable) {
super.setBackgroundDrawable(drawable);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.onSetBackgroundDrawable(drawable);
}
}
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.setSupportBackgroundTintList(colorStateList);
}
}
public ColorStateList getSupportBackgroundTintList() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.getSupportBackgroundTintList();
}
return null;
}
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.setSupportBackgroundTintMode(mode);
}
}
public PorterDuff.Mode getSupportBackgroundTintMode() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.getSupportBackgroundTintMode();
}
return null;
}
public void setTextAppearance(Context context, int i) {
super.setTextAppearance(context, i);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetTextAppearance(context, i);
}
}
public void setFilters(InputFilter[] inputFilterArr) {
super.setFilters(getEmojiTextViewHelper().getFilters(inputFilterArr));
}
public void setAllCaps(boolean z) {
super.setAllCaps(z);
getEmojiTextViewHelper().setAllCaps(z);
}
public void setEmojiCompatEnabled(boolean z) {
getEmojiTextViewHelper().setEnabled(z);
}
public boolean isEmojiCompatEnabled() {
return getEmojiTextViewHelper().isEnabled();
}
/* access modifiers changed from: protected */
public void drawableStateChanged() {
super.drawableStateChanged();
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.applySupportBackgroundTint();
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.applyCompoundDrawablesTints();
}
}
/* access modifiers changed from: protected */
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onLayout(z, i, i2, i3, i4);
}
}
public void setTextSize(int i, float f) {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
super.setTextSize(i, f);
return;
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.setTextSize(i, f);
}
}
/* access modifiers changed from: protected */
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
super.onTextChanged(charSequence, i, i2, i3);
if (this.mTextHelper != null && !PLATFORM_SUPPORTS_AUTOSIZE && this.mTextHelper.isAutoSizeEnabled()) {
this.mTextHelper.autoSizeText();
}
}
public void setAutoSizeTextTypeWithDefaults(int i) {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
super.setAutoSizeTextTypeWithDefaults(i);
return;
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.setAutoSizeTextTypeWithDefaults(i);
}
}
public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
return;
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
}
}
public void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) throws IllegalArgumentException {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
return;
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
}
}
public int getAutoSizeTextType() {
if (!PLATFORM_SUPPORTS_AUTOSIZE) {
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
return appCompatTextHelper.getAutoSizeTextType();
}
return 0;
} else if (super.getAutoSizeTextType() == 1) {
return 1;
} else {
return 0;
}
}
public int getAutoSizeStepGranularity() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
return super.getAutoSizeStepGranularity();
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
return appCompatTextHelper.getAutoSizeStepGranularity();
}
return -1;
}
public int getAutoSizeMinTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
return super.getAutoSizeMinTextSize();
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
return appCompatTextHelper.getAutoSizeMinTextSize();
}
return -1;
}
public int getAutoSizeMaxTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
return super.getAutoSizeMaxTextSize();
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
return appCompatTextHelper.getAutoSizeMaxTextSize();
}
return -1;
}
public int[] getAutoSizeTextAvailableSizes() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
return super.getAutoSizeTextAvailableSizes();
}
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
return appCompatTextHelper != null ? appCompatTextHelper.getAutoSizeTextAvailableSizes() : new int[0];
}
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
this.mTextHelper.populateSurroundingTextIfNeeded(this, onCreateInputConnection, editorInfo);
return AppCompatHintHelper.onCreateInputConnection(onCreateInputConnection, editorInfo, this);
}
public void setFirstBaselineToTopHeight(int i) {
if (Build.VERSION.SDK_INT >= 28) {
super.setFirstBaselineToTopHeight(i);
} else {
TextViewCompat.setFirstBaselineToTopHeight(this, i);
}
}
public void setLastBaselineToBottomHeight(int i) {
if (Build.VERSION.SDK_INT >= 28) {
super.setLastBaselineToBottomHeight(i);
} else {
TextViewCompat.setLastBaselineToBottomHeight(this, i);
}
}
public int getFirstBaselineToTopHeight() {
return TextViewCompat.getFirstBaselineToTopHeight(this);
}
public int getLastBaselineToBottomHeight() {
return TextViewCompat.getLastBaselineToBottomHeight(this);
}
public void setLineHeight(int i) {
TextViewCompat.setLineHeight(this, i);
}
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
super.setCustomSelectionActionModeCallback(TextViewCompat.wrapCustomSelectionActionModeCallback(this, callback));
}
public ActionMode.Callback getCustomSelectionActionModeCallback() {
return TextViewCompat.unwrapCustomSelectionActionModeCallback(super.getCustomSelectionActionModeCallback());
}
public PrecomputedTextCompat.Params getTextMetricsParamsCompat() {
return TextViewCompat.getTextMetricsParams(this);
}
public void setTextMetricsParamsCompat(PrecomputedTextCompat.Params params) {
TextViewCompat.setTextMetricsParams(this, params);
}
public void setPrecomputedText(PrecomputedTextCompat precomputedTextCompat) {
TextViewCompat.setPrecomputedText(this, precomputedTextCompat);
}
private void consumeTextFutureAndSetBlocking() {
Future<PrecomputedTextCompat> future = this.mPrecomputedTextFuture;
if (future != null) {
try {
this.mPrecomputedTextFuture = null;
TextViewCompat.setPrecomputedText(this, future.get());
} catch (InterruptedException | ExecutionException unused) {
}
}
}
public CharSequence getText() {
consumeTextFutureAndSetBlocking();
return super.getText();
}
public void setTextClassifier(TextClassifier textClassifier) {
AppCompatTextClassifierHelper appCompatTextClassifierHelper;
if (Build.VERSION.SDK_INT >= 28 || (appCompatTextClassifierHelper = this.mTextClassifierHelper) == null) {
super.setTextClassifier(textClassifier);
} else {
appCompatTextClassifierHelper.setTextClassifier(textClassifier);
}
}
public TextClassifier getTextClassifier() {
AppCompatTextClassifierHelper appCompatTextClassifierHelper;
if (Build.VERSION.SDK_INT >= 28 || (appCompatTextClassifierHelper = this.mTextClassifierHelper) == null) {
return super.getTextClassifier();
}
return appCompatTextClassifierHelper.getTextClassifier();
}
public void setTextFuture(Future<PrecomputedTextCompat> future) {
this.mPrecomputedTextFuture = future;
if (future != null) {
requestLayout();
}
}
/* access modifiers changed from: protected */
public void onMeasure(int i, int i2) {
consumeTextFutureAndSetBlocking();
super.onMeasure(i, i2);
}
public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public void setCompoundDrawablesWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public void setCompoundDrawablesWithIntrinsicBounds(int i, int i2, int i3, int i4) {
Context context = getContext();
Drawable drawable = null;
Drawable drawable2 = i != 0 ? AppCompatResources.getDrawable(context, i) : null;
Drawable drawable3 = i2 != 0 ? AppCompatResources.getDrawable(context, i2) : null;
Drawable drawable4 = i3 != 0 ? AppCompatResources.getDrawable(context, i3) : null;
if (i4 != 0) {
drawable = AppCompatResources.getDrawable(context, i4);
}
setCompoundDrawablesWithIntrinsicBounds(drawable2, drawable3, drawable4, drawable);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i, int i2, int i3, int i4) {
Context context = getContext();
Drawable drawable = null;
Drawable drawable2 = i != 0 ? AppCompatResources.getDrawable(context, i) : null;
Drawable drawable3 = i2 != 0 ? AppCompatResources.getDrawable(context, i2) : null;
Drawable drawable4 = i3 != 0 ? AppCompatResources.getDrawable(context, i3) : null;
if (i4 != 0) {
drawable = AppCompatResources.getDrawable(context, i4);
}
setCompoundDrawablesRelativeWithIntrinsicBounds(drawable2, drawable3, drawable4, drawable);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
public ColorStateList getSupportCompoundDrawablesTintList() {
return this.mTextHelper.getCompoundDrawableTintList();
}
public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
this.mTextHelper.setCompoundDrawableTintList(colorStateList);
this.mTextHelper.applyCompoundDrawablesTints();
}
public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
return this.mTextHelper.getCompoundDrawableTintMode();
}
public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
this.mTextHelper.setCompoundDrawableTintMode(mode);
this.mTextHelper.applyCompoundDrawablesTints();
}
public void setTypeface(Typeface typeface, int i) {
if (!this.mIsSetTypefaceProcessing) {
Typeface typeface2 = null;
if (typeface != null && i > 0) {
typeface2 = TypefaceCompat.create(getContext(), typeface, i);
}
this.mIsSetTypefaceProcessing = true;
if (typeface2 != null) {
typeface = typeface2;
}
try {
super.setTypeface(typeface, i);
} finally {
this.mIsSetTypefaceProcessing = false;
}
}
}
}
Download file