package com.ironsource.adqualitysdk.sdk.i; import com.ironsource.adqualitysdk.sdk.i.hj; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; /* loaded from: classes4.dex */ public class ho { /* renamed from: ﻛ, reason: contains not printable characters */ private a f2257; /* renamed from: k, reason: contains not printable characters */ private hj f2258; /* renamed from: ヌ, reason: contains not printable characters */ private List f2259; /* renamed from: メ, reason: contains not printable characters */ public final Field m2870(Class cls, final String str) { a aVar = new a(this) { // from class: com.ironsource.adqualitysdk.sdk.i.ho.4 /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(this); } @Override // com.ironsource.adqualitysdk.sdk.i.ho.a /* renamed from: k, reason: contains not printable characters */ public final boolean mo2871(Field field) { return field.getType().getName().toLowerCase().startsWith(str.toLowerCase()); } }; synchronized (ho.class) { try { if (this.f2259 == null) { this.f2259 = new ArrayList(); } this.f2259.clear(); m2864(cls, aVar, this.f2259); if (this.f2259.isEmpty()) { return null; } return this.f2259.get(0); } catch (Throwable th) { throw th; } } } /* renamed from: ﻐ, reason: contains not printable characters */ public final Field m2867(Class cls, Class cls2) { Field m2869; synchronized (jp.class) { try { if (this.f2258 == null) { this.f2258 = new hj(); } this.f2258.m2801(cls2); m2869 = m2869(cls, this.f2258); } catch (Throwable th) { throw th; } } return m2869; } /* renamed from: k, reason: contains not printable characters */ public final Field m2869(Class cls, hj hjVar) { synchronized (jp.class) { try { if (this.f2259 == null) { this.f2259 = new ArrayList(); } this.f2259.clear(); m2863(cls, hjVar, this.f2259); if (this.f2259.isEmpty()) { return null; } return this.f2259.get(0); } catch (Throwable th) { throw th; } } } /* renamed from: ﻛ, reason: contains not printable characters */ public final List m2868(Class cls, hj hjVar) { ArrayList arrayList = new ArrayList(); m2863(cls, hjVar, arrayList); return arrayList; } /* renamed from: ﻐ, reason: contains not printable characters */ private void m2863(Class cls, hj hjVar, List list) { synchronized (ho.class) { try { if (this.f2257 == null) { this.f2257 = new a(this); } this.f2257.m2873(hjVar); m2864(cls, this.f2257, list); } catch (Throwable th) { throw th; } } } /* renamed from: ﻐ, reason: contains not printable characters */ public static hj.b m2862() { return new hj.b(); } /* renamed from: ﻛ, reason: contains not printable characters */ public static Field[] m2865(Class cls, boolean z, int i, List list) { while (cls != null && !ka.m3360(cls, list)) { cls = cls.getSuperclass(); } Field[] fieldArr = new Field[0]; if (cls != null) { Field[] fieldArr2 = new Field[0]; Field[] fieldArr3 = new Field[0]; try { fieldArr2 = cls.getDeclaredFields(); } catch (Error unused) { } try { fieldArr3 = cls.getFields(); } catch (Error unused2) { } fieldArr = ka.m3364(fieldArr2, fieldArr3); if (!z) { return fieldArr; } Class superclass = cls.getSuperclass(); for (int i2 = 0; superclass != null && i2 != i; i2++) { try { fieldArr = ka.m3364(fieldArr, superclass.getDeclaredFields()); } catch (Error unused3) { } try { fieldArr = ka.m3364(fieldArr, superclass.getFields()); } catch (Error unused4) { } superclass = superclass.getSuperclass(); } } return fieldArr; } /* renamed from: ﻛ, reason: contains not printable characters */ private void m2864(Class cls, a aVar, List list) { for (Field field : m2866(cls, aVar.m2872())) { if (aVar.mo2871(field)) { field.setAccessible(true); list.add(field); } } } /* renamed from: メ, reason: contains not printable characters */ private static Field[] m2866(Class cls, hj hjVar) { if (hjVar != null && hjVar.m2784()) { return m2865(cls, hjVar.m2784(), hjVar.m2787(), null); } try { return cls.getDeclaredFields(); } catch (Error unused) { return cls.getFields(); } } public class a { /* renamed from: k, reason: contains not printable characters */ private int f2261; /* renamed from: メ, reason: contains not printable characters */ private hj f2262; private a() { } /* renamed from: メ, reason: contains not printable characters */ public final hj m2872() { return this.f2262; } public /* synthetic */ a(ho hoVar) { this(); } /* renamed from: メ, reason: contains not printable characters */ public final void m2873(hj hjVar) { this.f2262 = hjVar; this.f2261 = hjVar.m2797(); } /* renamed from: k */ public boolean mo2871(Field field) { boolean isAssignableFrom; if (this.f2262 == null || (field.getModifiers() & this.f2262.m2788()) != this.f2262.m2788() || (field.getModifiers() & this.f2262.m2785()) != 0 || this.f2262.m2799().contains(field.getType())) { return false; } if (this.f2262.m2798()) { isAssignableFrom = field.getType().equals(this.f2262.m2800()); } else { isAssignableFrom = this.f2262.m2800().isAssignableFrom(field.getType()); } if (isAssignableFrom) { int i = this.f2261; if (i == 0) { return true; } this.f2261 = i - 1; } return false; } } }