2021-11-08 18:25:28 +00:00
package i0 ;
2021-06-27 20:44:35 +00:00
2021-11-08 18:25:28 +00:00
import d0.z.d.m ;
import f0.b0 ;
import g0.e ;
2021-08-04 22:02:59 +00:00
import java.io.IOException ;
2021-06-27 20:44:35 +00:00
import java.lang.annotation.Annotation ;
2021-08-04 22:02:59 +00:00
import java.lang.reflect.Array ;
import java.lang.reflect.GenericArrayType ;
import java.lang.reflect.GenericDeclaration ;
import java.lang.reflect.Method ;
import java.lang.reflect.ParameterizedType ;
import java.lang.reflect.Type ;
import java.lang.reflect.TypeVariable ;
import java.lang.reflect.WildcardType ;
import java.util.Arrays ;
import java.util.NoSuchElementException ;
import java.util.Objects ;
import okhttp3.MediaType ;
import okhttp3.ResponseBody ;
2022-03-02 20:59:20 +00:00
/* compiled from: Utils.java */
/* loaded from: classes3.dex */
2021-08-04 22:02:59 +00:00
public final class c0 {
public static final Type [ ] a = new Type [ 0 ] ;
2021-06-27 20:44:35 +00:00
2022-03-02 20:59:20 +00:00
/* compiled from: Utils.java */
/* loaded from: classes3.dex */
2021-08-04 22:02:59 +00:00
public static final class a implements GenericArrayType {
2021-12-17 22:03:14 +00:00
public final Type j ;
2021-08-04 22:02:59 +00:00
public a ( Type type ) {
2021-12-17 22:03:14 +00:00
this . j = type ;
2021-08-04 22:02:59 +00:00
}
public boolean equals ( Object obj ) {
return ( obj instanceof GenericArrayType ) & & c0 . c ( this , ( GenericArrayType ) obj ) ;
}
@Override // java.lang.reflect.GenericArrayType
public Type getGenericComponentType ( ) {
2021-12-17 22:03:14 +00:00
return this . j ;
2021-08-04 22:02:59 +00:00
}
public int hashCode ( ) {
2021-12-17 22:03:14 +00:00
return this . j . hashCode ( ) ;
2021-08-04 22:02:59 +00:00
}
public String toString ( ) {
2021-12-17 22:03:14 +00:00
return c0 . p ( this . j ) + " [] " ;
2021-08-04 22:02:59 +00:00
}
}
2022-03-02 20:59:20 +00:00
/* compiled from: Utils.java */
/* loaded from: classes3.dex */
2021-08-04 22:02:59 +00:00
public static final class b implements ParameterizedType {
public final Type j ;
2021-12-17 22:03:14 +00:00
public final Type k ;
public final Type [ ] l ;
2021-08-04 22:02:59 +00:00
public b ( Type type , Type type2 , Type . . . typeArr ) {
if ( type2 instanceof Class ) {
if ( ( type = = null ) ! = ( ( ( Class ) type2 ) . getEnclosingClass ( ) ! = null ? false : true ) ) {
throw new IllegalArgumentException ( ) ;
}
}
for ( Type type3 : typeArr ) {
Objects . requireNonNull ( type3 , " typeArgument == null " ) ;
c0 . b ( type3 ) ;
}
2021-12-17 22:03:14 +00:00
this . j = type ;
this . k = type2 ;
this . l = ( Type [ ] ) typeArr . clone ( ) ;
2021-08-04 22:02:59 +00:00
}
public boolean equals ( Object obj ) {
return ( obj instanceof ParameterizedType ) & & c0 . c ( this , ( ParameterizedType ) obj ) ;
}
@Override // java.lang.reflect.ParameterizedType
public Type [ ] getActualTypeArguments ( ) {
2021-12-17 22:03:14 +00:00
return ( Type [ ] ) this . l . clone ( ) ;
2021-08-04 22:02:59 +00:00
}
@Override // java.lang.reflect.ParameterizedType
public Type getOwnerType ( ) {
2021-12-17 22:03:14 +00:00
return this . j ;
2021-08-04 22:02:59 +00:00
}
@Override // java.lang.reflect.ParameterizedType
public Type getRawType ( ) {
2021-12-17 22:03:14 +00:00
return this . k ;
2021-08-04 22:02:59 +00:00
}
public int hashCode ( ) {
2021-12-17 22:03:14 +00:00
int hashCode = Arrays . hashCode ( this . l ) ^ this . k . hashCode ( ) ;
Type type = this . j ;
2021-08-04 22:02:59 +00:00
return hashCode ^ ( type ! = null ? type . hashCode ( ) : 0 ) ;
}
public String toString ( ) {
2021-12-17 22:03:14 +00:00
Type [ ] typeArr = this . l ;
2021-08-04 22:02:59 +00:00
if ( typeArr . length = = 0 ) {
2021-12-17 22:03:14 +00:00
return c0 . p ( this . k ) ;
2021-08-04 22:02:59 +00:00
}
StringBuilder sb = new StringBuilder ( ( typeArr . length + 1 ) * 30 ) ;
2021-12-17 22:03:14 +00:00
sb . append ( c0 . p ( this . k ) ) ;
2021-08-04 22:02:59 +00:00
sb . append ( " < " ) ;
2021-12-17 22:03:14 +00:00
sb . append ( c0 . p ( this . l [ 0 ] ) ) ;
for ( int i = 1 ; i < this . l . length ; i + + ) {
2021-08-04 22:02:59 +00:00
sb . append ( " , " ) ;
2021-12-17 22:03:14 +00:00
sb . append ( c0 . p ( this . l [ i ] ) ) ;
2021-08-04 22:02:59 +00:00
}
sb . append ( " > " ) ;
return sb . toString ( ) ;
}
}
2022-03-02 20:59:20 +00:00
/* compiled from: Utils.java */
/* loaded from: classes3.dex */
2021-08-04 22:02:59 +00:00
public static final class c implements WildcardType {
public final Type j ;
2021-12-17 22:03:14 +00:00
public final Type k ;
2021-08-04 22:02:59 +00:00
public c ( Type [ ] typeArr , Type [ ] typeArr2 ) {
if ( typeArr2 . length > 1 ) {
throw new IllegalArgumentException ( ) ;
} else if ( typeArr . length ! = 1 ) {
throw new IllegalArgumentException ( ) ;
} else if ( typeArr2 . length = = 1 ) {
Objects . requireNonNull ( typeArr2 [ 0 ] ) ;
c0 . b ( typeArr2 [ 0 ] ) ;
if ( typeArr [ 0 ] = = Object . class ) {
2021-12-17 22:03:14 +00:00
this . k = typeArr2 [ 0 ] ;
this . j = Object . class ;
2021-08-04 22:02:59 +00:00
return ;
}
throw new IllegalArgumentException ( ) ;
} else {
Objects . requireNonNull ( typeArr [ 0 ] ) ;
c0 . b ( typeArr [ 0 ] ) ;
2021-12-17 22:03:14 +00:00
this . k = null ;
this . j = typeArr [ 0 ] ;
2021-08-04 22:02:59 +00:00
}
}
public boolean equals ( Object obj ) {
return ( obj instanceof WildcardType ) & & c0 . c ( this , ( WildcardType ) obj ) ;
}
@Override // java.lang.reflect.WildcardType
public Type [ ] getLowerBounds ( ) {
2021-12-17 22:03:14 +00:00
Type type = this . k ;
2021-08-04 22:02:59 +00:00
return type ! = null ? new Type [ ] { type } : c0 . a ;
}
@Override // java.lang.reflect.WildcardType
public Type [ ] getUpperBounds ( ) {
2021-12-17 22:03:14 +00:00
return new Type [ ] { this . j } ;
2021-08-04 22:02:59 +00:00
}
public int hashCode ( ) {
2021-12-17 22:03:14 +00:00
Type type = this . k ;
return ( type ! = null ? type . hashCode ( ) + 31 : 1 ) ^ ( this . j . hashCode ( ) + 31 ) ;
2021-08-04 22:02:59 +00:00
}
public String toString ( ) {
2021-12-17 22:03:14 +00:00
if ( this . k ! = null ) {
2022-03-30 16:43:10 +00:00
StringBuilder R = b . d . b . a . a . R ( " ? super " ) ;
R . append ( c0 . p ( this . k ) ) ;
return R . toString ( ) ;
2021-12-17 22:03:14 +00:00
} else if ( this . j = = Object . class ) {
2021-08-04 22:02:59 +00:00
return " ? " ;
} else {
2022-03-30 16:43:10 +00:00
StringBuilder R2 = b . d . b . a . a . R ( " ? extends " ) ;
R2 . append ( c0 . p ( this . j ) ) ;
return R2 . toString ( ) ;
2021-08-04 22:02:59 +00:00
}
}
}
public static ResponseBody a ( ResponseBody responseBody ) throws IOException {
e eVar = new e ( ) ;
2021-11-08 18:25:28 +00:00
responseBody . c ( ) . k0 ( eVar ) ;
2021-08-04 22:02:59 +00:00
MediaType b2 = responseBody . b ( ) ;
long a2 = responseBody . a ( ) ;
m . checkParameterIsNotNull ( eVar , " content " ) ;
m . checkParameterIsNotNull ( eVar , " $this$asResponseBody " ) ;
2021-08-24 17:45:16 +00:00
return new b0 ( eVar , b2 , a2 ) ;
2021-08-04 22:02:59 +00:00
}
public static void b ( Type type ) {
if ( ( type instanceof Class ) & & ( ( Class ) type ) . isPrimitive ( ) ) {
throw new IllegalArgumentException ( ) ;
}
}
public static boolean c ( Type type , Type type2 ) {
if ( type = = type2 ) {
return true ;
}
if ( type instanceof Class ) {
return type . equals ( type2 ) ;
}
if ( type instanceof ParameterizedType ) {
if ( ! ( type2 instanceof ParameterizedType ) ) {
return false ;
}
ParameterizedType parameterizedType = ( ParameterizedType ) type ;
ParameterizedType parameterizedType2 = ( ParameterizedType ) type2 ;
Type ownerType = parameterizedType . getOwnerType ( ) ;
Type ownerType2 = parameterizedType2 . getOwnerType ( ) ;
return ( ownerType = = ownerType2 | | ( ownerType ! = null & & ownerType . equals ( ownerType2 ) ) ) & & parameterizedType . getRawType ( ) . equals ( parameterizedType2 . getRawType ( ) ) & & Arrays . equals ( parameterizedType . getActualTypeArguments ( ) , parameterizedType2 . getActualTypeArguments ( ) ) ;
} else if ( type instanceof GenericArrayType ) {
if ( ! ( type2 instanceof GenericArrayType ) ) {
return false ;
}
return c ( ( ( GenericArrayType ) type ) . getGenericComponentType ( ) , ( ( GenericArrayType ) type2 ) . getGenericComponentType ( ) ) ;
} else if ( type instanceof WildcardType ) {
if ( ! ( type2 instanceof WildcardType ) ) {
return false ;
}
WildcardType wildcardType = ( WildcardType ) type ;
WildcardType wildcardType2 = ( WildcardType ) type2 ;
return Arrays . equals ( wildcardType . getUpperBounds ( ) , wildcardType2 . getUpperBounds ( ) ) & & Arrays . equals ( wildcardType . getLowerBounds ( ) , wildcardType2 . getLowerBounds ( ) ) ;
} else if ( ! ( type instanceof TypeVariable ) | | ! ( type2 instanceof TypeVariable ) ) {
return false ;
} else {
TypeVariable typeVariable = ( TypeVariable ) type ;
TypeVariable typeVariable2 = ( TypeVariable ) type2 ;
return typeVariable . getGenericDeclaration ( ) = = typeVariable2 . getGenericDeclaration ( ) & & typeVariable . getName ( ) . equals ( typeVariable2 . getName ( ) ) ;
}
}
public static Type d ( Type type , Class < ? > cls , Class < ? > cls2 ) {
if ( cls2 = = cls ) {
return type ;
}
if ( cls2 . isInterface ( ) ) {
Class < ? > [ ] interfaces = cls . getInterfaces ( ) ;
int length = interfaces . length ;
for ( int i = 0 ; i < length ; i + + ) {
if ( interfaces [ i ] = = cls2 ) {
return cls . getGenericInterfaces ( ) [ i ] ;
}
if ( cls2 . isAssignableFrom ( interfaces [ i ] ) ) {
return d ( cls . getGenericInterfaces ( ) [ i ] , interfaces [ i ] , cls2 ) ;
}
}
}
if ( ! cls . isInterface ( ) ) {
while ( cls ! = Object . class ) {
Class < ? super Object > superclass = cls . getSuperclass ( ) ;
if ( superclass = = cls2 ) {
return cls . getGenericSuperclass ( ) ;
}
if ( cls2 . isAssignableFrom ( superclass ) ) {
return d ( cls . getGenericSuperclass ( ) , superclass , cls2 ) ;
}
cls = superclass ;
}
}
return cls2 ;
}
public static Type e ( int i , ParameterizedType parameterizedType ) {
Type [ ] actualTypeArguments = parameterizedType . getActualTypeArguments ( ) ;
if ( i < 0 | | i > = actualTypeArguments . length ) {
2022-03-30 16:43:10 +00:00
StringBuilder S = b . d . b . a . a . S ( " Index " , i , " not in range [0, " ) ;
S . append ( actualTypeArguments . length ) ;
S . append ( " ) for " ) ;
S . append ( parameterizedType ) ;
throw new IllegalArgumentException ( S . toString ( ) ) ;
2021-08-04 22:02:59 +00:00
}
Type type = actualTypeArguments [ i ] ;
return type instanceof WildcardType ? ( ( WildcardType ) type ) . getUpperBounds ( ) [ 0 ] : type ;
}
public static Class < ? > f ( Type type ) {
Objects . requireNonNull ( type , " type == null " ) ;
if ( type instanceof Class ) {
return ( Class ) type ;
}
if ( type instanceof ParameterizedType ) {
Type rawType = ( ( ParameterizedType ) type ) . getRawType ( ) ;
if ( rawType instanceof Class ) {
return ( Class ) rawType ;
}
throw new IllegalArgumentException ( ) ;
} else if ( type instanceof GenericArrayType ) {
return Array . newInstance ( f ( ( ( GenericArrayType ) type ) . getGenericComponentType ( ) ) , 0 ) . getClass ( ) ;
} else {
if ( type instanceof TypeVariable ) {
return Object . class ;
}
if ( type instanceof WildcardType ) {
return f ( ( ( WildcardType ) type ) . getUpperBounds ( ) [ 0 ] ) ;
}
throw new IllegalArgumentException ( " Expected a Class, ParameterizedType, or GenericArrayType, but < " + type + " > is of type " + type . getClass ( ) . getName ( ) ) ;
}
}
public static Type g ( Type type , Class < ? > cls , Class < ? > cls2 ) {
if ( cls2 . isAssignableFrom ( cls ) ) {
return n ( type , cls , d ( type , cls , cls2 ) ) ;
}
throw new IllegalArgumentException ( ) ;
}
public static boolean h ( Type type ) {
if ( type instanceof Class ) {
return false ;
}
if ( type instanceof ParameterizedType ) {
for ( Type type2 : ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ) {
if ( h ( type2 ) ) {
return true ;
}
}
return false ;
} else if ( type instanceof GenericArrayType ) {
return h ( ( ( GenericArrayType ) type ) . getGenericComponentType ( ) ) ;
} else {
if ( ( type instanceof TypeVariable ) | | ( type instanceof WildcardType ) ) {
return true ;
}
throw new IllegalArgumentException ( " Expected a Class, ParameterizedType, or GenericArrayType, but < " + type + " > is of type " + ( type = = null ? " null " : type . getClass ( ) . getName ( ) ) ) ;
}
}
public static boolean i ( Annotation [ ] annotationArr , Class < ? extends Annotation > cls ) {
for ( Annotation annotation : annotationArr ) {
if ( cls . isInstance ( annotation ) ) {
return true ;
}
}
return false ;
}
public static RuntimeException j ( Method method , String str , Object . . . objArr ) {
return k ( method , null , str , objArr ) ;
}
public static RuntimeException k ( Method method , Throwable th , String str , Object . . . objArr ) {
2022-03-30 16:43:10 +00:00
StringBuilder V = b . d . b . a . a . V ( String . format ( str , objArr ) , " \ n for method " ) ;
V . append ( method . getDeclaringClass ( ) . getSimpleName ( ) ) ;
V . append ( " . " ) ;
V . append ( method . getName ( ) ) ;
return new IllegalArgumentException ( V . toString ( ) , th ) ;
2021-08-04 22:02:59 +00:00
}
public static RuntimeException l ( Method method , int i , String str , Object . . . objArr ) {
2022-03-30 16:43:10 +00:00
StringBuilder V = b . d . b . a . a . V ( str , " (parameter # " ) ;
V . append ( i + 1 ) ;
V . append ( " ) " ) ;
return j ( method , V . toString ( ) , objArr ) ;
2021-08-04 22:02:59 +00:00
}
public static RuntimeException m ( Method method , Throwable th , int i , String str , Object . . . objArr ) {
2022-03-30 16:43:10 +00:00
StringBuilder V = b . d . b . a . a . V ( str , " (parameter # " ) ;
V . append ( i + 1 ) ;
V . append ( " ) " ) ;
return k ( method , th , V . toString ( ) , objArr ) ;
2021-06-27 20:44:35 +00:00
}
2022-03-02 20:59:20 +00:00
/ * JADX WARN : Code restructure failed : missing block : B : 0 : ? , code lost :
r10 = r10 ;
* /
/* JADX WARN: Removed duplicated region for block: B:23:0x0043 A[LOOP:0: B:2:0x0000->B:23:0x0043, LOOP_END] */
/* JADX WARN: Removed duplicated region for block: B:76:0x0042 A[SYNTHETIC] */
/ *
Code decompiled incorrectly , please refer to instructions dump .
* /
2021-08-04 22:02:59 +00:00
public static Type n ( Type type , Class < ? > cls , Type type2 ) {
TypeVariable typeVariable ;
2022-03-02 20:59:20 +00:00
TypeVariable typeVariable2 ;
2021-08-04 22:02:59 +00:00
while ( true ) {
int i = 0 ;
2022-03-02 20:59:20 +00:00
if ( typeVariable instanceof TypeVariable ) {
TypeVariable typeVariable3 = ( TypeVariable ) typeVariable ;
GenericDeclaration genericDeclaration = typeVariable3 . getGenericDeclaration ( ) ;
2021-08-04 22:02:59 +00:00
Class cls2 = genericDeclaration instanceof Class ? ( Class ) genericDeclaration : null ;
if ( cls2 ! = null ) {
Type d = d ( type , cls , cls2 ) ;
if ( d instanceof ParameterizedType ) {
TypeVariable [ ] typeParameters = cls2 . getTypeParameters ( ) ;
while ( i < typeParameters . length ) {
2022-03-02 20:59:20 +00:00
if ( typeVariable3 . equals ( typeParameters [ i ] ) ) {
typeVariable2 = ( ( ParameterizedType ) d ) . getActualTypeArguments ( ) [ i ] ;
if ( typeVariable2 ! = typeVariable3 ) {
return typeVariable2 ;
2021-08-04 22:02:59 +00:00
}
2022-03-02 20:59:20 +00:00
typeVariable = typeVariable2 ;
2021-08-04 22:02:59 +00:00
} else {
i + + ;
}
}
throw new NoSuchElementException ( ) ;
}
}
2022-03-02 20:59:20 +00:00
typeVariable2 = typeVariable3 ;
if ( typeVariable2 ! = typeVariable3 ) {
2021-08-04 22:02:59 +00:00
}
} else {
2022-03-02 20:59:20 +00:00
if ( typeVariable instanceof Class ) {
Class cls3 = ( Class ) typeVariable ;
2021-08-04 22:02:59 +00:00
if ( cls3 . isArray ( ) ) {
Class < ? > componentType = cls3 . getComponentType ( ) ;
Type n = n ( type , cls , componentType ) ;
return componentType = = n ? cls3 : new a ( n ) ;
}
}
2022-03-02 20:59:20 +00:00
if ( typeVariable instanceof GenericArrayType ) {
GenericArrayType genericArrayType = ( GenericArrayType ) typeVariable ;
2021-08-04 22:02:59 +00:00
Type genericComponentType = genericArrayType . getGenericComponentType ( ) ;
Type n2 = n ( type , cls , genericComponentType ) ;
return genericComponentType = = n2 ? genericArrayType : new a ( n2 ) ;
2022-03-02 20:59:20 +00:00
} else if ( typeVariable instanceof ParameterizedType ) {
ParameterizedType parameterizedType = ( ParameterizedType ) typeVariable ;
2021-08-04 22:02:59 +00:00
Type ownerType = parameterizedType . getOwnerType ( ) ;
Type n3 = n ( type , cls , ownerType ) ;
boolean z2 = n3 ! = ownerType ;
Type [ ] actualTypeArguments = parameterizedType . getActualTypeArguments ( ) ;
int length = actualTypeArguments . length ;
while ( i < length ) {
Type n4 = n ( type , cls , actualTypeArguments [ i ] ) ;
if ( n4 ! = actualTypeArguments [ i ] ) {
if ( ! z2 ) {
actualTypeArguments = ( Type [ ] ) actualTypeArguments . clone ( ) ;
z2 = true ;
}
actualTypeArguments [ i ] = n4 ;
}
i + + ;
}
return z2 ? new b ( n3 , parameterizedType . getRawType ( ) , actualTypeArguments ) : parameterizedType ;
} else {
2022-03-02 20:59:20 +00:00
boolean z3 = typeVariable instanceof WildcardType ;
WildcardType wildcardType = typeVariable ;
2021-08-04 22:02:59 +00:00
if ( z3 ) {
2022-03-02 20:59:20 +00:00
WildcardType wildcardType2 = ( WildcardType ) typeVariable ;
2021-08-04 22:02:59 +00:00
Type [ ] lowerBounds = wildcardType2 . getLowerBounds ( ) ;
Type [ ] upperBounds = wildcardType2 . getUpperBounds ( ) ;
if ( lowerBounds . length = = 1 ) {
Type n5 = n ( type , cls , lowerBounds [ 0 ] ) ;
wildcardType = wildcardType2 ;
if ( n5 ! = lowerBounds [ 0 ] ) {
return new c ( new Type [ ] { Object . class } , new Type [ ] { n5 } ) ;
}
} else {
wildcardType = wildcardType2 ;
if ( upperBounds . length = = 1 ) {
Type n6 = n ( type , cls , upperBounds [ 0 ] ) ;
wildcardType = wildcardType2 ;
if ( n6 ! = upperBounds [ 0 ] ) {
return new c ( new Type [ ] { n6 } , a ) ;
}
}
}
}
return wildcardType ;
}
}
}
2021-06-27 20:44:35 +00:00
}
2021-08-04 22:02:59 +00:00
public static void o ( Throwable th ) {
if ( th instanceof VirtualMachineError ) {
throw ( ( VirtualMachineError ) th ) ;
} else if ( th instanceof ThreadDeath ) {
throw ( ( ThreadDeath ) th ) ;
} else if ( th instanceof LinkageError ) {
throw ( ( LinkageError ) th ) ;
}
2021-06-27 20:44:35 +00:00
}
2021-08-04 22:02:59 +00:00
public static String p ( Type type ) {
return type instanceof Class ? ( ( Class ) type ) . getName ( ) : type . toString ( ) ;
2021-06-27 20:44:35 +00:00
}
}