Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158
以下内容为反编译后的 TrojanFmtKt.java 源代码,内容仅作参考
package com.github.shadowsocks.fmt.trojan;
import androidx.autofill.HintConstants;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.free.vpn.proxy.hotspot.br1;
import com.free.vpn.proxy.hotspot.pl0;
import com.free.vpn.proxy.hotspot.uq1;
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.fmt.v2ray.StandardV2RayBean;
import com.github.shadowsocks.ktx.NetsKt;
import com.github.shadowsocks.ktx.UtilsKt;
import com.google.android.gms.appindex.ThingPropertyKeys;
import kotlin.Metadata;
import kotlin.Unit;
import libcore.Libcore;
import libcore.URL;
@Metadata(d1 = {"\u0000 \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\u0002\b\u0002\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\u001a\u0010\u0007\u001a\u00020\u0003*\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\t\u001a\n\u0010\n\u001a\u00020\u0003*\u00020\u0001¨\u0006\u000b"}, d2 = {"parseTrojan", "Lcom/github/shadowsocks/fmt/trojan/TrojanBean;", "server", "", "buildTrojanConfig", "port", "", "buildTrojanGoConfig", "mux", "", "toUri", "shadowsocks_release"}, k = 2, mv = {1, 8, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public final class TrojanFmtKt {
public static final String buildTrojanConfig(TrojanBean trojanBean, int i) {
int i2;
zs4.o(trojanBean, "<this>");
br1 br1Var = new br1();
br1Var.m("client", "run_type");
br1Var.m("127.0.0.1", "local_addr");
br1Var.m(Integer.valueOf(i), "local_port");
br1Var.m(trojanBean.finalAddress, "remote_addr");
br1Var.m(Integer.valueOf(trojanBean.finalPort), "remote_port");
uq1 uq1Var = new uq1();
uq1Var.add(trojanBean.getPassword());
Unit unit = Unit.INSTANCE;
br1Var.m(uq1Var, HintConstants.AUTOFILL_HINT_PASSWORD);
if (DataStore.INSTANCE.getEnableLog()) {
i2 = 0;
} else {
i2 = 2;
}
br1Var.m(Integer.valueOf(i2), "log_level");
br1 br1Var2 = new br1();
if (trojanBean.getAllowInsecure()) {
br1Var2.m(Boolean.FALSE, "verify");
}
if (x74.a1(trojanBean.getSni()) && zs4.h(trojanBean.finalAddress, "127.0.0.1")) {
String str = trojanBean.serverAddress;
zs4.n(str, Key.SERVER_ADDRESS);
if (!NetsKt.isIpAddress(str)) {
String str2 = trojanBean.serverAddress;
zs4.n(str2, Key.SERVER_ADDRESS);
trojanBean.setSni(str2);
}
}
if (!x74.a1(trojanBean.getSni())) {
br1Var2.m(trojanBean.getSni(), "sni");
}
if (!x74.a1(trojanBean.getAlpn())) {
br1Var2.m(new uq1(x74.p1(trojanBean.getAlpn(), new String[]{"\n"})), "alpn");
}
br1Var.m(br1Var2, "ssl");
String c = pl0.c(br1Var, 4);
zs4.n(c, "JSONObject().also { conf… }\n }.toStringPretty()");
return c;
}
public static final String buildTrojanGoConfig(TrojanBean trojanBean, int i, boolean z) {
int i2;
zs4.o(trojanBean, "<this>");
br1 br1Var = new br1();
br1Var.m("client", "run_type");
br1Var.m("127.0.0.1", "local_addr");
br1Var.m(Integer.valueOf(i), "local_port");
br1Var.m(trojanBean.finalAddress, "remote_addr");
br1Var.m(Integer.valueOf(trojanBean.finalPort), "remote_port");
uq1 uq1Var = new uq1();
uq1Var.add(trojanBean.getPassword());
Unit unit = Unit.INSTANCE;
br1Var.m(uq1Var, HintConstants.AUTOFILL_HINT_PASSWORD);
DataStore dataStore = DataStore.INSTANCE;
boolean z2 = false;
if (dataStore.getEnableLog()) {
i2 = 0;
} else {
i2 = 2;
}
br1Var.m(Integer.valueOf(i2), "log_level");
if (z && dataStore.getEnableMuxForAll()) {
br1 br1Var2 = new br1();
br1Var2.m(Boolean.TRUE, ThingPropertyKeys.ENABLED);
br1Var2.m(Integer.valueOf(dataStore.getMuxConcurrency()), "concurrency");
br1Var.m(br1Var2, "mux");
}
br1 br1Var3 = new br1();
if (dataStore.getIpv6Mode() <= 1) {
z2 = true;
}
br1Var3.m(Boolean.valueOf(z2), "prefer_ipv4");
br1Var.m(br1Var3, StandardV2RayBean.TYPE_TCP);
br1 br1Var4 = new br1();
if (trojanBean.getAllowInsecure()) {
br1Var4.m(Boolean.FALSE, "verify");
}
if (x74.a1(trojanBean.getSni()) && zs4.h(trojanBean.finalAddress, "127.0.0.1")) {
String str = trojanBean.serverAddress;
zs4.n(str, Key.SERVER_ADDRESS);
if (!NetsKt.isIpAddress(str)) {
String str2 = trojanBean.serverAddress;
zs4.n(str2, Key.SERVER_ADDRESS);
trojanBean.setSni(str2);
}
}
if (!x74.a1(trojanBean.getSni())) {
br1Var4.m(trojanBean.getSni(), "sni");
}
if (!x74.a1(trojanBean.getAlpn())) {
br1Var4.m(new uq1(x74.p1(trojanBean.getAlpn(), new String[]{"\n"})), "alpn");
}
br1Var.m(br1Var4, "ssl");
String c = pl0.c(br1Var, 4);
zs4.n(c, "JSONObject().also { conf… }\n }.toStringPretty()");
return c;
}
public static final TrojanBean parseTrojan(String str) {
zs4.o(str, "server");
URL parseURL = Libcore.parseURL(str);
TrojanBean trojanBean = new TrojanBean();
trojanBean.serverAddress = parseURL.getHost();
trojanBean.serverPort = Integer.valueOf(parseURL.getPort());
String username = parseURL.getUsername();
zs4.n(username, "link.username");
trojanBean.setPassword(username);
zs4.n(parseURL.getPassword(), "link.password");
if (!x74.a1(r1)) {
trojanBean.setPassword(trojanBean.getPassword() + ":" + parseURL.getPassword());
}
String queryParameter = NetsKt.queryParameter(parseURL, "security");
if (queryParameter == null) {
queryParameter = StandardV2RayBean.SECURITY_TLS;
}
trojanBean.setSecurity(queryParameter);
String queryParameter2 = NetsKt.queryParameter(parseURL, "sni");
if (queryParameter2 == null && (queryParameter2 = NetsKt.queryParameter(parseURL, "peer")) == null) {
queryParameter2 = "";
}
trojanBean.setSni(queryParameter2);
String queryParameter3 = NetsKt.queryParameter(parseURL, "alpn");
trojanBean.setAlpn(queryParameter3 != null ? queryParameter3 : "");
trojanBean.name = parseURL.getFragment();
return trojanBean;
}
public static final String toUri(TrojanBean trojanBean) {
zs4.o(trojanBean, "<this>");
URL newURL = Libcore.newURL("trojan");
newURL.setHost(trojanBean.serverAddress);
Integer num = trojanBean.serverPort;
zs4.n(num, Key.SERVER_PORT);
newURL.setPort(num.intValue());
newURL.setUsername(trojanBean.getPassword());
if (!x74.a1(trojanBean.getSni())) {
newURL.addQueryParameter("sni", trojanBean.getSni());
}
if (!x74.a1(trojanBean.getAlpn())) {
newURL.addQueryParameter("alpn", trojanBean.getAlpn());
}
if (trojanBean.getAllowInsecure()) {
newURL.addQueryParameter("allowInsecure", "1");
}
String security = trojanBean.getSecurity();
if (!zs4.h(security, StandardV2RayBean.SECURITY_TLS) && zs4.h(security, StandardV2RayBean.SECURITY_XTLS)) {
newURL.addQueryParameter("security", trojanBean.getSecurity());
newURL.addQueryParameter("flow", trojanBean.getFlow());
}
zs4.n(trojanBean.name, "name");
if (!x74.a1(r1)) {
String str = trojanBean.name;
zs4.n(str, "name");
newURL.setRawFragment(UtilsKt.urlSafe(str));
}
String string = newURL.getString();
zs4.n(string, "builder.string");
return string;
}
}