CrackMe.apk
Download file
package androidx.core.os;
import android.os.Build;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Locale;
final class LocaleListCompatWrapper implements LocaleListInterface {
private static final Locale EN_LATN = LocaleListCompat.forLanguageTagCompat("en-Latn");
private static final Locale LOCALE_AR_XB = new Locale("ar", "XB");
private static final Locale LOCALE_EN_XA = new Locale("en", "XA");
private static final Locale[] sEmptyList = new Locale[0];
private final Locale[] mList;
private final String mStringRepresentation;
public Object getLocaleList() {
return null;
}
public Locale get(int i) {
if (i >= 0) {
Locale[] localeArr = this.mList;
if (i < localeArr.length) {
return localeArr[i];
}
}
return null;
}
public boolean isEmpty() {
return this.mList.length == 0;
}
public int size() {
return this.mList.length;
}
public int indexOf(Locale locale) {
int i = 0;
while (true) {
Locale[] localeArr = this.mList;
if (i >= localeArr.length) {
return -1;
}
if (localeArr[i].equals(locale)) {
return i;
}
i++;
}
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof LocaleListCompatWrapper)) {
return false;
}
Locale[] localeArr = ((LocaleListCompatWrapper) obj).mList;
if (this.mList.length != localeArr.length) {
return false;
}
int i = 0;
while (true) {
Locale[] localeArr2 = this.mList;
if (i >= localeArr2.length) {
return true;
}
if (!localeArr2[i].equals(localeArr[i])) {
return false;
}
i++;
}
}
public int hashCode() {
int i = 1;
int i2 = 0;
while (true) {
Locale[] localeArr = this.mList;
if (i2 >= localeArr.length) {
return i;
}
i = (i * 31) + localeArr[i2].hashCode();
i2++;
}
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
int i = 0;
while (true) {
Locale[] localeArr = this.mList;
if (i < localeArr.length) {
sb.append(localeArr[i]);
if (i < this.mList.length - 1) {
sb.append(',');
}
i++;
} else {
sb.append("]");
return sb.toString();
}
}
}
public String toLanguageTags() {
return this.mStringRepresentation;
}
LocaleListCompatWrapper(Locale... localeArr) {
if (localeArr.length == 0) {
this.mList = sEmptyList;
this.mStringRepresentation = "";
return;
}
ArrayList arrayList = new ArrayList();
HashSet hashSet = new HashSet();
StringBuilder sb = new StringBuilder();
int i = 0;
while (i < localeArr.length) {
Locale locale = localeArr[i];
if (locale != null) {
if (!hashSet.contains(locale)) {
Locale locale2 = (Locale) locale.clone();
arrayList.add(locale2);
toLanguageTag(sb, locale2);
if (i < localeArr.length - 1) {
sb.append(',');
}
hashSet.add(locale2);
}
i++;
} else {
throw new NullPointerException("list[" + i + "] is null");
}
}
this.mList = (Locale[]) arrayList.toArray(new Locale[arrayList.size()]);
this.mStringRepresentation = sb.toString();
}
static void toLanguageTag(StringBuilder sb, Locale locale) {
sb.append(locale.getLanguage());
String country = locale.getCountry();
if (country != null && !country.isEmpty()) {
sb.append('-');
sb.append(locale.getCountry());
}
}
private static String getLikelyScript(Locale locale) {
if (Build.VERSION.SDK_INT >= 21) {
String script = locale.getScript();
if (!script.isEmpty()) {
return script;
}
}
return "";
}
private static boolean isPseudoLocale(Locale locale) {
return LOCALE_EN_XA.equals(locale) || LOCALE_AR_XB.equals(locale);
}
private static int matchScore(Locale locale, Locale locale2) {
if (locale.equals(locale2)) {
return 1;
}
if (!locale.getLanguage().equals(locale2.getLanguage()) || isPseudoLocale(locale) || isPseudoLocale(locale2)) {
return 0;
}
String likelyScript = getLikelyScript(locale);
if (!likelyScript.isEmpty()) {
return likelyScript.equals(getLikelyScript(locale2)) ? 1 : 0;
}
String country = locale.getCountry();
if (country.isEmpty() || country.equals(locale2.getCountry())) {
return 1;
}
return 0;
}
private int findFirstMatchIndex(Locale locale) {
int i = 0;
while (true) {
Locale[] localeArr = this.mList;
if (i >= localeArr.length) {
return Integer.MAX_VALUE;
}
if (matchScore(locale, localeArr[i]) > 0) {
return i;
}
i++;
}
}
/* JADX WARNING: Code restructure failed: missing block: B:11:0x001b, code lost:
if (r6 < Integer.MAX_VALUE) goto L_0x0021;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
private int computeFirstMatchIndex(java.util.Collection<java.lang.String> r5, boolean r6) {
/*
r4 = this;
java.util.Locale[] r0 = r4.mList
int r1 = r0.length
r2 = 0
r3 = 1
if (r1 != r3) goto L_0x0008
return r2
L_0x0008:
int r0 = r0.length
if (r0 != 0) goto L_0x000d
r5 = -1
return r5
L_0x000d:
r0 = 2147483647(0x7fffffff, float:NaN)
if (r6 == 0) goto L_0x001e
java.util.Locale r6 = EN_LATN
int r6 = r4.findFirstMatchIndex(r6)
if (r6 != 0) goto L_0x001b
return r2
L_0x001b:
if (r6 >= r0) goto L_0x001e
goto L_0x0021
L_0x001e:
r6 = 2147483647(0x7fffffff, float:NaN)
L_0x0021:
java.util.Iterator r5 = r5.iterator()
L_0x0025:
boolean r1 = r5.hasNext()
if (r1 == 0) goto L_0x0040
java.lang.Object r1 = r5.next()
java.lang.String r1 = (java.lang.String) r1
java.util.Locale r1 = androidx.core.os.LocaleListCompat.forLanguageTagCompat(r1)
int r1 = r4.findFirstMatchIndex(r1)
if (r1 != 0) goto L_0x003c
return r2
L_0x003c:
if (r1 >= r6) goto L_0x0025
r6 = r1
goto L_0x0025
L_0x0040:
if (r6 != r0) goto L_0x0043
return r2
L_0x0043:
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.os.LocaleListCompatWrapper.computeFirstMatchIndex(java.util.Collection, boolean):int");
}
private Locale computeFirstMatch(Collection<String> collection, boolean z) {
int computeFirstMatchIndex = computeFirstMatchIndex(collection, z);
if (computeFirstMatchIndex == -1) {
return null;
}
return this.mList[computeFirstMatchIndex];
}
public Locale getFirstMatch(String[] strArr) {
return computeFirstMatch(Arrays.asList(strArr), false);
}
}
Download file