CrackMe.apk
Download file
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;
import javax.annotation.CheckForNull;
@ElementTypesAreNonnullByDefault
public final class ObjectArrays {
private ObjectArrays() {
}
public static <T> T[] newArray(Class<T> cls, int i) {
return (Object[]) Array.newInstance(cls, i);
}
public static <T> T[] newArray(T[] tArr, int i) {
return Platform.newArray(tArr, i);
}
public static <T> T[] concat(T[] tArr, T[] tArr2, Class<T> cls) {
T[] newArray = newArray(cls, tArr.length + tArr2.length);
System.arraycopy(tArr, 0, newArray, 0, tArr.length);
System.arraycopy(tArr2, 0, newArray, tArr.length, tArr2.length);
return newArray;
}
public static <T> T[] concat(@ParametricNullness T t, T[] tArr) {
T[] newArray = newArray(tArr, tArr.length + 1);
newArray[0] = t;
System.arraycopy(tArr, 0, newArray, 1, tArr.length);
return newArray;
}
public static <T> T[] concat(T[] tArr, @ParametricNullness T t) {
T[] copyOf = Arrays.copyOf(tArr, tArr.length + 1);
copyOf[tArr.length] = t;
return copyOf;
}
static <T> T[] toArrayImpl(Collection<?> collection, T[] tArr) {
int size = collection.size();
if (tArr.length < size) {
tArr = newArray(tArr, size);
}
fillArray(collection, tArr);
if (tArr.length > size) {
tArr[size] = null;
}
return tArr;
}
static <T> T[] toArrayImpl(Object[] objArr, int i, int i2, T[] tArr) {
Preconditions.checkPositionIndexes(i, i + i2, objArr.length);
if (tArr.length < i2) {
tArr = newArray(tArr, i2);
} else if (tArr.length > i2) {
tArr[i2] = null;
}
System.arraycopy(objArr, i, tArr, 0, i2);
return tArr;
}
static Object[] toArrayImpl(Collection<?> collection) {
return fillArray(collection, new Object[collection.size()]);
}
static Object[] copyAsObjectArray(Object[] objArr, int i, int i2) {
Preconditions.checkPositionIndexes(i, i + i2, objArr.length);
if (i2 == 0) {
return new Object[0];
}
Object[] objArr2 = new Object[i2];
System.arraycopy(objArr, i, objArr2, 0, i2);
return objArr2;
}
private static Object[] fillArray(Iterable<?> iterable, Object[] objArr) {
int i = 0;
for (Object obj : iterable) {
objArr[i] = obj;
i++;
}
return objArr;
}
static void swap(Object[] objArr, int i, int i2) {
Object obj = objArr[i];
objArr[i] = objArr[i2];
objArr[i2] = obj;
}
static Object[] checkElementsNotNull(Object... objArr) {
checkElementsNotNull(objArr, objArr.length);
return objArr;
}
static Object[] checkElementsNotNull(Object[] objArr, int i) {
for (int i2 = 0; i2 < i; i2++) {
checkElementNotNull(objArr[i2], i2);
}
return objArr;
}
static Object checkElementNotNull(@CheckForNull Object obj, int i) {
if (obj != null) {
return obj;
}
StringBuilder sb = new StringBuilder(20);
sb.append("at index ");
sb.append(i);
throw new NullPointerException(sb.toString());
}
}
Download file