- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
89 lines
2.3 KiB
Java
89 lines
2.3 KiB
Java
package csdk.glucustomersupport.util;
|
|
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import csdk.glucustomersupport.util.log.YLogger;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.concurrent.Callable;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class GluUtil {
|
|
private static Handler mainHandler = new Handler(Looper.getMainLooper());
|
|
|
|
public static void require(boolean z) {
|
|
if (!z) {
|
|
throw new IllegalArgumentException();
|
|
}
|
|
}
|
|
|
|
public static void require(boolean z, String str) {
|
|
if (z) {
|
|
return;
|
|
}
|
|
if (str != null) {
|
|
throw new IllegalArgumentException(str);
|
|
}
|
|
throw new IllegalArgumentException();
|
|
}
|
|
|
|
public static RuntimeException propagate(Throwable th) {
|
|
if (th instanceof Error) {
|
|
throw ((Error) th);
|
|
}
|
|
if (th instanceof RuntimeException) {
|
|
throw ((RuntimeException) th);
|
|
}
|
|
throw new RuntimeException(th);
|
|
}
|
|
|
|
public static String emptyToNull(String str) {
|
|
if (str == null || str.length() > 0) {
|
|
return str;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static <T> T call(Callable<T> callable) {
|
|
try {
|
|
return callable.call();
|
|
} catch (Exception e) {
|
|
throw propagate(e);
|
|
}
|
|
}
|
|
|
|
public static <K, V> Map<K, V> createMap() {
|
|
return new HashMap();
|
|
}
|
|
|
|
public static <K, V> Map<K, V> shallowClone(Map<K, V> map) {
|
|
if (map == null) {
|
|
return null;
|
|
}
|
|
Map<K, V> createMap = createMap();
|
|
createMap.putAll(map);
|
|
return createMap;
|
|
}
|
|
|
|
public static void runOnUIThread(Runnable runnable) {
|
|
require(runnable != null, "runnable == null");
|
|
if (!mainHandler.post(runnable)) {
|
|
throw new IllegalStateException("Failed to post runnable");
|
|
}
|
|
}
|
|
|
|
public static void runOnUIThreadDelayed(Runnable runnable, long j) {
|
|
require(runnable != null, "runnable == null");
|
|
if (!mainHandler.postDelayed(runnable, j)) {
|
|
throw new IllegalStateException("Failed to post runnable");
|
|
}
|
|
}
|
|
|
|
public static void log(boolean z, String str, Object... objArr) {
|
|
if (z) {
|
|
YLogger.format(str, objArr);
|
|
YLogger.findThrowable(objArr);
|
|
}
|
|
}
|
|
}
|