alexandroid/decompiled/jadx/sources/androidx/webkit/ProxyConfig.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

145 lines
4.5 KiB
Java

package androidx.webkit;
import androidx.annotation.RestrictTo;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes14.dex */
public final class ProxyConfig {
private static final String BYPASS_RULE_REMOVE_IMPLICIT = "<-loopback>";
private static final String BYPASS_RULE_SIMPLE_NAMES = "<local>";
private static final String DIRECT = "direct://";
public static final String MATCH_ALL_SCHEMES = "*";
public static final String MATCH_HTTP = "http";
public static final String MATCH_HTTPS = "https";
private final List<String> mBypassRules;
private final List<ProxyRule> mProxyRules;
private final boolean mReverseBypass;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({RestrictTo.Scope.LIBRARY})
public @interface ProxyScheme {
}
@RestrictTo({RestrictTo.Scope.LIBRARY})
public ProxyConfig(List<ProxyRule> list, List<String> list2, boolean z) {
this.mProxyRules = list;
this.mBypassRules = list2;
this.mReverseBypass = z;
}
public List<String> getBypassRules() {
return Collections.unmodifiableList(this.mBypassRules);
}
public List<ProxyRule> getProxyRules() {
return Collections.unmodifiableList(this.mProxyRules);
}
public boolean isReverseBypassEnabled() {
return this.mReverseBypass;
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class ProxyRule {
private final String mSchemeFilter;
private final String mUrl;
@RestrictTo({RestrictTo.Scope.LIBRARY})
public ProxyRule(String str, String str2) {
this.mSchemeFilter = str;
this.mUrl = str2;
}
public String getSchemeFilter() {
return this.mSchemeFilter;
}
public String getUrl() {
return this.mUrl;
}
@RestrictTo({RestrictTo.Scope.LIBRARY})
public ProxyRule(String str) {
this("*", str);
}
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class Builder {
private final List<String> mBypassRules;
private final List<ProxyRule> mProxyRules;
private boolean mReverseBypass;
public Builder(ProxyConfig proxyConfig) {
this.mReverseBypass = false;
this.mProxyRules = proxyConfig.getProxyRules();
this.mBypassRules = proxyConfig.getBypassRules();
this.mReverseBypass = proxyConfig.isReverseBypassEnabled();
}
private List<String> bypassRules() {
return this.mBypassRules;
}
private List<ProxyRule> proxyRules() {
return this.mProxyRules;
}
private boolean reverseBypass() {
return this.mReverseBypass;
}
public Builder addBypassRule(String str) {
this.mBypassRules.add(str);
return this;
}
public Builder addDirect(String str) {
this.mProxyRules.add(new ProxyRule(str, ProxyConfig.DIRECT));
return this;
}
public Builder addProxyRule(String str) {
this.mProxyRules.add(new ProxyRule(str));
return this;
}
public ProxyConfig build() {
return new ProxyConfig(proxyRules(), bypassRules(), reverseBypass());
}
public Builder bypassSimpleHostnames() {
return addBypassRule(ProxyConfig.BYPASS_RULE_SIMPLE_NAMES);
}
public Builder removeImplicitRules() {
return addBypassRule(ProxyConfig.BYPASS_RULE_REMOVE_IMPLICIT);
}
public Builder setReverseBypassEnabled(boolean z) {
this.mReverseBypass = z;
return this;
}
public Builder addProxyRule(String str, String str2) {
this.mProxyRules.add(new ProxyRule(str2, str));
return this;
}
public Builder addDirect() {
return addDirect("*");
}
public Builder() {
this.mReverseBypass = false;
this.mProxyRules = new ArrayList();
this.mBypassRules = new ArrayList();
}
}
}