Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158
以下内容为反编译后的 HysteriaFmtKt.java 源代码,内容仅作参考
package com.github.shadowsocks.fmt.hysteria;
import com.free.vpn.proxy.hotspot.an1;
import com.free.vpn.proxy.hotspot.br1;
import com.free.vpn.proxy.hotspot.pl0;
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 java.io.File;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.jvm.functions.Function0;
import libcore.Libcore;
import libcore.URL;
@Metadata(d1 = {"\u0000$\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u000e\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000\u001a\n\u0010\u0004\u001a\u00020\u0000*\u00020\u0002\u001a\n\u0010\u0003\u001a\u00020\u0002*\u00020\u0005\u001a\"\u0010\u000b\u001a\u00020\u0000*\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u00062\u000e\u0010\n\u001a\n\u0012\u0004\u0012\u00020\t\u0018\u00010\b¨\u0006\f"}, d2 = {"", "url", "Lcom/github/shadowsocks/fmt/hysteria/HysteriaBean;", "parseHysteria", "toUri", "Lcom/free/vpn/proxy/hotspot/br1;", "", "port", "Lkotlin/Function0;", "Ljava/io/File;", "cacheFile", "buildHysteriaConfig", "shadowsocks_release"}, k = 2, mv = {1, 8, 0})
public final class HysteriaFmtKt {
public static final String buildHysteriaConfig(HysteriaBean hysteriaBean, int i, Function0 function0) {
String str;
int authPayloadType;
String str2;
String str3;
zs4.o(hysteriaBean, "<this>");
br1 br1Var = new br1();
br1Var.m(NetsKt.wrapUri(hysteriaBean), "server");
int protocol = hysteriaBean.getProtocol();
if (protocol != 1) {
if (protocol == 2) {
str = "wechat-video";
}
br1Var.m(Integer.valueOf(hysteriaBean.getUploadMbps()), "up_mbps");
br1Var.m(Integer.valueOf(hysteriaBean.getDownloadMbps()), "down_mbps");
br1Var.m(new br1(an1.K(TuplesKt.to("listen", "127.0.0.1:" + i))), "socks5");
br1Var.m(hysteriaBean.getObfuscation(), "obfs");
authPayloadType = hysteriaBean.getAuthPayloadType();
if (authPayloadType == 1) {
if (authPayloadType == 2) {
str2 = "auth";
}
if (x74.a1(hysteriaBean.getSni()) && zs4.h(hysteriaBean.finalAddress, "127.0.0.1")) {
str3 = hysteriaBean.serverAddress;
zs4.n(str3, Key.SERVER_ADDRESS);
if (!NetsKt.isIpAddress(str3)) {
String str4 = hysteriaBean.serverAddress;
zs4.n(str4, Key.SERVER_ADDRESS);
hysteriaBean.setSni(str4);
}
}
if (!x74.a1(hysteriaBean.getSni())) {
br1Var.m(hysteriaBean.getSni(), "server_name");
}
if (!x74.a1(hysteriaBean.getAlpn())) {
br1Var.m(hysteriaBean.getAlpn(), "alpn");
}
if ((!x74.a1(hysteriaBean.getCaText())) && function0 != null) {
File file = (File) function0.invoke();
an1.a0(file, hysteriaBean.getCaText());
br1Var.m(file.getAbsolutePath(), "ca");
}
if (hysteriaBean.getAllowInsecure()) {
br1Var.m(Boolean.TRUE, "insecure");
}
if (hysteriaBean.getStreamReceiveWindow() > 0) {
br1Var.m(Integer.valueOf(hysteriaBean.getStreamReceiveWindow()), "recv_window_conn");
}
if (hysteriaBean.getConnectionReceiveWindow() > 0) {
br1Var.m(Integer.valueOf(hysteriaBean.getConnectionReceiveWindow()), "recv_window");
}
if (hysteriaBean.getDisableMtuDiscovery()) {
br1Var.m(Boolean.TRUE, "disable_mtu_discovery");
}
br1Var.m("127.0.0.1:" + DataStore.INSTANCE.getLocalDNSPort(), "resolver");
String c = pl0.c(br1Var, 4);
zs4.n(c, "JSONObject().also {\n …rt\n }.toStringPretty()");
return c;
}
str2 = "auth_str";
br1Var.m(hysteriaBean.getAuthPayload(), str2);
if (x74.a1(hysteriaBean.getSni())) {
str3 = hysteriaBean.serverAddress;
zs4.n(str3, Key.SERVER_ADDRESS);
if (!NetsKt.isIpAddress(str3)) {
}
}
if (!x74.a1(hysteriaBean.getSni())) {
}
if (!x74.a1(hysteriaBean.getAlpn())) {
}
if (!x74.a1(hysteriaBean.getCaText())) {
File file2 = (File) function0.invoke();
an1.a0(file2, hysteriaBean.getCaText());
br1Var.m(file2.getAbsolutePath(), "ca");
}
if (hysteriaBean.getAllowInsecure()) {
}
if (hysteriaBean.getStreamReceiveWindow() > 0) {
}
if (hysteriaBean.getConnectionReceiveWindow() > 0) {
}
if (hysteriaBean.getDisableMtuDiscovery()) {
}
br1Var.m("127.0.0.1:" + DataStore.INSTANCE.getLocalDNSPort(), "resolver");
String c2 = pl0.c(br1Var, 4);
zs4.n(c2, "JSONObject().also {\n …rt\n }.toStringPretty()");
return c2;
}
str = "faketcp";
br1Var.m(str, "protocol");
br1Var.m(Integer.valueOf(hysteriaBean.getUploadMbps()), "up_mbps");
br1Var.m(Integer.valueOf(hysteriaBean.getDownloadMbps()), "down_mbps");
br1Var.m(new br1(an1.K(TuplesKt.to("listen", "127.0.0.1:" + i))), "socks5");
br1Var.m(hysteriaBean.getObfuscation(), "obfs");
authPayloadType = hysteriaBean.getAuthPayloadType();
if (authPayloadType == 1) {
}
br1Var.m(hysteriaBean.getAuthPayload(), str2);
if (x74.a1(hysteriaBean.getSni())) {
}
if (!x74.a1(hysteriaBean.getSni())) {
}
if (!x74.a1(hysteriaBean.getAlpn())) {
}
if (!x74.a1(hysteriaBean.getCaText())) {
}
if (hysteriaBean.getAllowInsecure()) {
}
if (hysteriaBean.getStreamReceiveWindow() > 0) {
}
if (hysteriaBean.getConnectionReceiveWindow() > 0) {
}
if (hysteriaBean.getDisableMtuDiscovery()) {
}
br1Var.m("127.0.0.1:" + DataStore.INSTANCE.getLocalDNSPort(), "resolver");
String c22 = pl0.c(br1Var, 4);
zs4.n(c22, "JSONObject().also {\n …rt\n }.toStringPretty()");
return c22;
}
public static final HysteriaBean parseHysteria(br1 br1Var) {
boolean z;
zs4.o(br1Var, "<this>");
HysteriaBean hysteriaBean = new HysteriaBean();
String k = br1Var.k("server");
zs4.n(k, "getStr(\"server\")");
hysteriaBean.serverAddress = x74.B1(k, ":", k);
String k2 = br1Var.k("server");
zs4.n(k2, "getStr(\"server\")");
String y1 = x74.y1(k2, ":");
try {
Integer.parseInt(y1);
z = true;
} catch (NumberFormatException unused) {
z = false;
}
if (!Boolean.valueOf(z).booleanValue()) {
y1 = null;
}
hysteriaBean.serverPort = Integer.valueOf(y1 != null ? Integer.parseInt(y1) : 443);
Integer i = br1Var.i("up_mbps");
zs4.n(i, "getInt(\"up_mbps\")");
hysteriaBean.setUploadMbps(i.intValue());
Integer i2 = br1Var.i("down_mbps");
zs4.n(i2, "getInt(\"down_mbps\")");
hysteriaBean.setDownloadMbps(i2.intValue());
String k3 = br1Var.k("obfs");
zs4.n(k3, "getStr(\"obfs\")");
hysteriaBean.setObfuscation(k3);
String k4 = br1Var.k("auth");
if (k4 != null) {
hysteriaBean.setAuthPayloadType(2);
hysteriaBean.setAuthPayload(k4);
}
String k5 = br1Var.k("auth_str");
if (k5 != null) {
hysteriaBean.setAuthPayloadType(1);
hysteriaBean.setAuthPayload(k5);
}
String k6 = br1Var.k("protocol");
if (k6 != null) {
if (zs4.h(k6, "faketcp")) {
hysteriaBean.setProtocol(1);
} else if (zs4.h(k6, "wechat-video")) {
hysteriaBean.setProtocol(2);
}
}
String k7 = br1Var.k("server_name");
zs4.n(k7, "getStr(\"server_name\")");
hysteriaBean.setSni(k7);
String k8 = br1Var.k("alpn");
zs4.n(k8, "getStr(\"alpn\")");
hysteriaBean.setAlpn(k8);
Boolean h = br1Var.h("insecure");
zs4.n(h, "getBool(\"insecure\")");
hysteriaBean.setAllowInsecure(h.booleanValue());
Integer i3 = br1Var.i("recv_window_conn");
zs4.n(i3, "getInt(\"recv_window_conn\")");
hysteriaBean.setStreamReceiveWindow(i3.intValue());
Integer i4 = br1Var.i("recv_window");
zs4.n(i4, "getInt(\"recv_window\")");
hysteriaBean.setConnectionReceiveWindow(i4.intValue());
Boolean h2 = br1Var.h("disable_mtu_discovery");
zs4.n(h2, "getBool(\"disable_mtu_discovery\")");
hysteriaBean.setDisableMtuDiscovery(h2.booleanValue());
return hysteriaBean;
}
public static final String toUri(HysteriaBean hysteriaBean) {
zs4.o(hysteriaBean, "<this>");
URL newURL = Libcore.newURL("hysteria");
newURL.setHost(hysteriaBean.serverAddress);
Integer num = hysteriaBean.serverPort;
zs4.n(num, Key.SERVER_PORT);
newURL.setPort(num.intValue());
if (!x74.a1(hysteriaBean.getSni())) {
newURL.addQueryParameter("peer", hysteriaBean.getSni());
}
if (!x74.a1(hysteriaBean.getAuthPayload())) {
newURL.addQueryParameter("auth", hysteriaBean.getAuthPayload());
}
if (hysteriaBean.getUploadMbps() != 10) {
newURL.addQueryParameter("upmbps", String.valueOf(hysteriaBean.getUploadMbps()));
}
if (hysteriaBean.getDownloadMbps() != 50) {
newURL.addQueryParameter("downmbps", String.valueOf(hysteriaBean.getDownloadMbps()));
}
if (!x74.a1(hysteriaBean.getAlpn())) {
newURL.addQueryParameter("alpn", hysteriaBean.getAlpn());
}
if (!x74.a1(hysteriaBean.getObfuscation())) {
newURL.addQueryParameter("obfs", "xplus");
newURL.addQueryParameter("obfsParam", hysteriaBean.getObfuscation());
}
int protocol = hysteriaBean.getProtocol();
if (protocol == 1) {
newURL.addQueryParameter("protocol", "faketcp");
} else if (protocol == 2) {
newURL.addQueryParameter("protocol", "wechat-video");
}
if (hysteriaBean.getProtocol() == 1) {
newURL.addQueryParameter("protocol", "faketcp");
}
zs4.n(hysteriaBean.name, "name");
if (!x74.a1(r1)) {
String str = hysteriaBean.name;
zs4.n(str, "name");
newURL.setRawFragment(UtilsKt.urlSafe(str));
}
String string = newURL.getString();
zs4.n(string, "builder.string");
return string;
}
public static final HysteriaBean parseHysteria(String str) {
zs4.o(str, "url");
URL parseURL = Libcore.parseURL(str);
HysteriaBean hysteriaBean = new HysteriaBean();
hysteriaBean.serverAddress = parseURL.getHost();
hysteriaBean.serverPort = Integer.valueOf(parseURL.getPort());
hysteriaBean.name = parseURL.getFragment();
String queryParameter = NetsKt.queryParameter(parseURL, "peer");
if (queryParameter != null) {
hysteriaBean.setSni(queryParameter);
}
String queryParameter2 = NetsKt.queryParameter(parseURL, "auth");
if (queryParameter2 != null) {
if (!(!x74.a1(queryParameter2))) {
queryParameter2 = null;
}
if (queryParameter2 != null) {
hysteriaBean.setAuthPayloadType(1);
hysteriaBean.setAuthPayload(queryParameter2);
}
}
String queryParameter3 = NetsKt.queryParameter(parseURL, "insecure");
if (queryParameter3 != null) {
hysteriaBean.setAllowInsecure(zs4.h(queryParameter3, "1"));
}
String queryParameter4 = NetsKt.queryParameter(parseURL, "upmbps");
if (queryParameter4 != null) {
Integer J0 = v74.J0(queryParameter4);
hysteriaBean.setUploadMbps(J0 != null ? J0.intValue() : hysteriaBean.getUploadMbps());
}
String queryParameter5 = NetsKt.queryParameter(parseURL, "downmbps");
if (queryParameter5 != null) {
Integer J02 = v74.J0(queryParameter5);
hysteriaBean.setDownloadMbps(J02 != null ? J02.intValue() : hysteriaBean.getDownloadMbps());
}
String queryParameter6 = NetsKt.queryParameter(parseURL, "alpn");
if (queryParameter6 != null) {
hysteriaBean.setAlpn(queryParameter6);
}
String queryParameter7 = NetsKt.queryParameter(parseURL, "obfsParam");
if (queryParameter7 != null) {
hysteriaBean.setObfuscation(queryParameter7);
}
String queryParameter8 = NetsKt.queryParameter(parseURL, "protocol");
if (queryParameter8 != null) {
if (zs4.h(queryParameter8, "faketcp")) {
hysteriaBean.setProtocol(1);
} else if (zs4.h(queryParameter8, "wechat-video")) {
hysteriaBean.setProtocol(2);
}
}
return hysteriaBean;
}
}