- 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
108 lines
4.3 KiB
Java
108 lines
4.3 KiB
Java
package org.chromium.net;
|
|
|
|
import android.content.Context;
|
|
import android.util.Log;
|
|
import com.amazonaws.handlers.HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Comparator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class CronetEngine {
|
|
|
|
public static class Builder {
|
|
public final ICronetEngineBuilder mBuilderDelegate;
|
|
|
|
public Builder(Context context) {
|
|
this(createBuilderDelegate(context));
|
|
}
|
|
|
|
public Builder(ICronetEngineBuilder iCronetEngineBuilder) {
|
|
if (iCronetEngineBuilder instanceof ExperimentalOptionsTranslatingCronetEngineBuilder) {
|
|
this.mBuilderDelegate = iCronetEngineBuilder;
|
|
} else {
|
|
this.mBuilderDelegate = new ExperimentalOptionsTranslatingCronetEngineBuilder(iCronetEngineBuilder);
|
|
}
|
|
}
|
|
|
|
public Builder setStoragePath(String str) {
|
|
this.mBuilderDelegate.setStoragePath(str);
|
|
return this;
|
|
}
|
|
|
|
public Builder enableQuic(boolean z) {
|
|
this.mBuilderDelegate.enableQuic(z);
|
|
return this;
|
|
}
|
|
|
|
public Builder enableHttpCache(int i, long j) {
|
|
this.mBuilderDelegate.enableHttpCache(i, j);
|
|
return this;
|
|
}
|
|
|
|
public Builder addQuicHint(String str, int i, int i2) {
|
|
this.mBuilderDelegate.addQuicHint(str, i, i2);
|
|
return this;
|
|
}
|
|
|
|
public CronetEngine build() {
|
|
int implementationApiLevel = getImplementationApiLevel();
|
|
if (implementationApiLevel != -1 && implementationApiLevel < getMaximumApiLevel()) {
|
|
Log.w("CronetEngine.Builder", "The implementation version is lower than the API version. Calls to methods added in API " + (implementationApiLevel + 1) + " and newer will likely have no effect.");
|
|
}
|
|
this.mBuilderDelegate.build();
|
|
return null;
|
|
}
|
|
|
|
public static ICronetEngineBuilder createBuilderDelegate(Context context) {
|
|
HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(getEnabledCronetProviders(context, new ArrayList(CronetProvider.getAllProviders(context))).get(0));
|
|
if (Log.isLoggable("CronetEngine.Builder", 3)) {
|
|
String.format("Using '%s' provider for creating CronetEngine.Builder.", null);
|
|
throw null;
|
|
}
|
|
throw null;
|
|
}
|
|
|
|
public static List getEnabledCronetProviders(Context context, List list) {
|
|
if (list.isEmpty()) {
|
|
throw new RuntimeException("Unable to find any Cronet provider. Have you included all necessary jars?");
|
|
}
|
|
Iterator it = list.iterator();
|
|
if (it.hasNext()) {
|
|
HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(it.next());
|
|
throw null;
|
|
}
|
|
if (list.isEmpty()) {
|
|
throw new RuntimeException("All available Cronet providers are disabled. A provider should be enabled before it can be used.");
|
|
}
|
|
Collections.sort(list, new Comparator() { // from class: org.chromium.net.CronetEngine.Builder.1
|
|
@Override // java.util.Comparator
|
|
public /* bridge */ /* synthetic */ int compare(Object obj, Object obj2) {
|
|
HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(obj);
|
|
HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(obj2);
|
|
return compare((CronetProvider) null, (CronetProvider) null);
|
|
}
|
|
|
|
public int compare(CronetProvider cronetProvider, CronetProvider cronetProvider2) {
|
|
throw null;
|
|
}
|
|
});
|
|
return list;
|
|
}
|
|
|
|
public final int getMaximumApiLevel() {
|
|
return ApiVersion.getMaximumAvailableApiLevel();
|
|
}
|
|
|
|
public final int getImplementationApiLevel() {
|
|
try {
|
|
return ((Integer) this.mBuilderDelegate.getClass().getClassLoader().loadClass("org.chromium.net.impl.ImplVersion").getMethod("getApiLevel", new Class[0]).invoke(null, new Object[0])).intValue();
|
|
} catch (Exception unused) {
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
}
|