Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158
以下内容为反编译后的 NaiveFmtKt.java 源代码,内容仅作参考
package com.github.shadowsocks.fmt.naive;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.free.vpn.proxy.hotspot.br1;
import com.free.vpn.proxy.hotspot.jf2;
import com.free.vpn.proxy.hotspot.pl0;
import com.free.vpn.proxy.hotspot.t00;
import com.free.vpn.proxy.hotspot.v74;
import com.free.vpn.proxy.hotspot.x74;
import com.free.vpn.proxy.hotspot.zs4;
import com.github.shadowsocks.Key;
import com.github.shadowsocks.database.DataStore;
import com.github.shadowsocks.ktx.NetsKt;
import com.github.shadowsocks.ktx.UtilsKt;
import fr.bmartel.protocol.http.constants.HttpConstants;
import kotlin.Metadata;
import libcore.Libcore;
import libcore.URL;
import org.slf4j.Marker;
@Metadata(d1 = {"\u0000\u001e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\u001a\u000e\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003\u001a\u0012\u0010\u0004\u001a\u00020\u0003*\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u0006\u001a\u0014\u0010\u0007\u001a\u00020\u0003*\u00020\u00012\b\b\u0002\u0010\b\u001a\u00020\t¨\u0006\n"}, d2 = {"parseNaive", "Lcom/github/shadowsocks/fmt/naive/NaiveBean;", "link", "", "buildNaiveConfig", "port", "", "toUri", "proxyOnly", "", "shadowsocks_release"}, k = 2, mv = {1, 8, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public final class NaiveFmtKt {
public static final String buildNaiveConfig(NaiveBean naiveBean, int i) {
zs4.o(naiveBean, "<this>");
br1 br1Var = new br1();
br1Var.m("socks://127.0.0.1:" + i, "listen");
br1Var.m(toUri(naiveBean, true), "proxy");
if (true ^ x74.a1(naiveBean.getExtraHeaders())) {
br1Var.m(t00.h1(x74.p1(naiveBean.getExtraHeaders(), new String[]{"\n"}), HttpConstants.HEADER_DELEMITER, null, null, null, 62), "extra-headers");
}
String str = naiveBean.serverAddress;
zs4.n(str, Key.SERVER_ADDRESS);
if (!NetsKt.isIpAddress(str) && zs4.h(naiveBean.finalAddress, "127.0.0.1")) {
br1Var.m("MAP " + naiveBean.serverAddress + " 127.0.0.1", "host-resolver-rules");
}
if (DataStore.INSTANCE.getEnableLog()) {
br1Var.m("", "log");
}
if (naiveBean.getInsecureConcurrency() > 0) {
br1Var.m(Integer.valueOf(naiveBean.getInsecureConcurrency()), "insecure-concurrency");
}
String c = pl0.c(br1Var, 4);
zs4.n(c, "JSONObject().also {\n … }\n }.toStringPretty()");
return c;
}
public static final NaiveBean parseNaive(String str) {
String str2;
int i;
Integer J0;
String unUrlSafe;
zs4.o(str, "link");
String A1 = x74.A1(x74.v1(str, Marker.ANY_NON_NULL_MARKER, str), ":");
URL parseURL = Libcore.parseURL(str);
NaiveBean naiveBean = new NaiveBean();
naiveBean.setProto(A1);
naiveBean.serverAddress = parseURL.getHost();
naiveBean.serverPort = Integer.valueOf(parseURL.getPort());
String username = parseURL.getUsername();
zs4.n(username, "url.username");
naiveBean.setUsername(username);
String password = parseURL.getPassword();
zs4.n(password, "url.password");
naiveBean.setPassword(password);
String queryParameter = NetsKt.queryParameter(parseURL, "extra-headers");
if (queryParameter != null && (unUrlSafe = UtilsKt.unUrlSafe(queryParameter)) != null) {
str2 = x74.l1(unUrlSafe, HttpConstants.HEADER_DELEMITER, "\n");
} else {
str2 = "";
}
naiveBean.setExtraHeaders(str2);
String queryParameter2 = NetsKt.queryParameter(parseURL, "insecure-concurrency");
if (queryParameter2 != null && (J0 = v74.J0(queryParameter2)) != null) {
i = J0.intValue();
} else {
i = 0;
}
naiveBean.setInsecureConcurrency(i);
naiveBean.setUot(zs4.h(NetsKt.queryParameter(parseURL, "udp-over-tcp"), "true"));
naiveBean.name = parseURL.getFragment();
naiveBean.initializeDefaultValues();
return naiveBean;
}
public static final String toUri(NaiveBean naiveBean, boolean z) {
zs4.o(naiveBean, "<this>");
String proto = naiveBean.getProto();
if (!z) {
proto = jf2.o("naive+", proto);
}
URL newURL = Libcore.newURL(proto);
newURL.setHost(naiveBean.serverAddress);
newURL.setPort(naiveBean.finalPort);
if (!x74.a1(naiveBean.getUsername())) {
newURL.setUsername(naiveBean.getUsername());
if (!x74.a1(naiveBean.getPassword())) {
newURL.setPassword(naiveBean.getPassword());
}
}
if (!z) {
if (!x74.a1(naiveBean.getExtraHeaders())) {
newURL.addQueryParameter("extra-headers", naiveBean.getExtraHeaders());
}
zs4.n(naiveBean.name, "name");
if (!x74.a1(r3)) {
String str = naiveBean.name;
zs4.n(str, "name");
newURL.setRawFragment(UtilsKt.urlSafe(str));
}
if (naiveBean.getInsecureConcurrency() > 0) {
newURL.addQueryParameter("insecure-concurrency", String.valueOf(naiveBean.getInsecureConcurrency()));
}
if (naiveBean.getUot()) {
newURL.addQueryParameter("udp-over-tcp", "true");
}
}
String string = newURL.getString();
zs4.n(string, "builder.string");
return string;
}
public static String toUri$default(NaiveBean naiveBean, boolean z, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
return toUri(naiveBean, z);
}
}