CrackMe.apk
Download file
package kotlin.reflect.jvm.internal.impl.resolve;
import kotlin.jvm.internal.Intrinsics;
import kotlin.reflect.jvm.internal.impl.descriptors.CallableDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassifierDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.DeclarationDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.InlineClassRepresentation;
import kotlin.reflect.jvm.internal.impl.descriptors.PropertyDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.PropertyGetterDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.VariableDescriptor;
import kotlin.reflect.jvm.internal.impl.name.FqName;
import kotlin.reflect.jvm.internal.impl.name.Name;
import kotlin.reflect.jvm.internal.impl.types.KotlinType;
import kotlin.reflect.jvm.internal.impl.types.SimpleType;
import kotlin.reflect.jvm.internal.impl.types.TypeSubstitutor;
import kotlin.reflect.jvm.internal.impl.types.Variance;
/* compiled from: inlineClassesUtils.kt */
public final class InlineClassesUtilsKt {
private static final FqName JVM_INLINE_ANNOTATION_FQ_NAME = new FqName("kotlin.jvm.JvmInline");
public static final boolean isInlineClass(DeclarationDescriptor declarationDescriptor) {
Intrinsics.checkNotNullParameter(declarationDescriptor, "<this>");
if (declarationDescriptor instanceof ClassDescriptor) {
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
if (classDescriptor.isInline() || classDescriptor.isValue()) {
return true;
}
}
return false;
}
public static final KotlinType unsubstitutedUnderlyingType(KotlinType kotlinType) {
InlineClassRepresentation<SimpleType> inlineClassRepresentation;
Intrinsics.checkNotNullParameter(kotlinType, "<this>");
ClassifierDescriptor declarationDescriptor = kotlinType.getConstructor().getDeclarationDescriptor();
SimpleType simpleType = null;
if (!(declarationDescriptor instanceof ClassDescriptor)) {
declarationDescriptor = null;
}
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
if (!(classDescriptor == null || (inlineClassRepresentation = classDescriptor.getInlineClassRepresentation()) == null)) {
simpleType = inlineClassRepresentation.getUnderlyingType();
}
return simpleType;
}
public static final boolean isInlineClassType(KotlinType kotlinType) {
Intrinsics.checkNotNullParameter(kotlinType, "<this>");
ClassifierDescriptor declarationDescriptor = kotlinType.getConstructor().getDeclarationDescriptor();
if (declarationDescriptor == null) {
return false;
}
return isInlineClass(declarationDescriptor);
}
public static final KotlinType substitutedUnderlyingType(KotlinType kotlinType) {
Intrinsics.checkNotNullParameter(kotlinType, "<this>");
KotlinType unsubstitutedUnderlyingType = unsubstitutedUnderlyingType(kotlinType);
if (unsubstitutedUnderlyingType == null) {
return null;
}
return TypeSubstitutor.create(kotlinType).substitute(unsubstitutedUnderlyingType, Variance.INVARIANT);
}
public static final boolean isGetterOfUnderlyingPropertyOfInlineClass(CallableDescriptor callableDescriptor) {
Intrinsics.checkNotNullParameter(callableDescriptor, "<this>");
if (callableDescriptor instanceof PropertyGetterDescriptor) {
PropertyDescriptor correspondingProperty = ((PropertyGetterDescriptor) callableDescriptor).getCorrespondingProperty();
Intrinsics.checkNotNullExpressionValue(correspondingProperty, "correspondingProperty");
if (isUnderlyingPropertyOfInlineClass(correspondingProperty)) {
return true;
}
}
return false;
}
public static final boolean isUnderlyingPropertyOfInlineClass(VariableDescriptor variableDescriptor) {
InlineClassRepresentation<SimpleType> inlineClassRepresentation;
Intrinsics.checkNotNullParameter(variableDescriptor, "<this>");
if (variableDescriptor.getExtensionReceiverParameter() == null) {
DeclarationDescriptor containingDeclaration = variableDescriptor.getContainingDeclaration();
Name name = null;
ClassDescriptor classDescriptor = containingDeclaration instanceof ClassDescriptor ? (ClassDescriptor) containingDeclaration : null;
if (!(classDescriptor == null || (inlineClassRepresentation = classDescriptor.getInlineClassRepresentation()) == null)) {
name = inlineClassRepresentation.getUnderlyingPropertyName();
}
if (Intrinsics.areEqual((Object) name, (Object) variableDescriptor.getName())) {
return true;
}
}
return false;
}
}
Download file