Ostrich VPN v1.19.0222版本的 MD5 值为:1b442e5f3dd93fd660d88d6f4b94ace3
以下内容为反编译后的 V2rayConfigHelper.java 源代码,内容仅作参考
package com.best.free.vpn.proxy.connect;
import com.best.free.vpn.proxy.connect.bean.ServerBean;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 \u00072\u00020\u0001:\u0001\u0007B\u0005¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006¨\u0006\b"}, d2 = {"Lcom/best/free/vpn/proxy/connect/V2rayConfigHelper;", "", "()V", "generateConfig", "", "server", "Lcom/best/free/vpn/proxy/connect/bean/ServerBean;", "Companion", "vpnkt-v1.19.0(222)_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class V2rayConfigHelper {
public static final Companion INSTANCE = new Companion(null);
private static final String DEFAULT_CONFIG_VMESS = "{\n \"outbounds\": [\n {\n \"protocol\": \"vmess\",\n \"settings\": {\n \"vnext\": [\n {\n \"address\": \"REPLACE_WITH_IP\",\n \"port\": REPLACE_WITH_PORT,\n \"users\": [\n {\n \"id\": \"REPLACE_WITH_UUID\"\n }\n ]\n }\n ]\n },\n \"streamSettings\": {\n \"network\": \"tcp\"\n },\n \"tag\": \"proxy\"\n },\n {\n \"protocol\": \"freedom\",\n \"settings\": {\n \"domainStrategy\": \"UseIP\"\n },\n \"streamSettings\": {},\n \"tag\": \"direct\"\n },\n {\n \"protocol\": \"blackhole\",\n \"settings\": {},\n \"tag\": \"block\"\n },\n {\n \"protocol\": \"dns\",\n \"tag\": \"dns-out\"\n }\n],\n\"dns\": {\n \"clientIp\": \"10.10.2.1\",\n \"hosts\": {\n \"localhost\": \"127.0.0.1\"\n },\n \"servers\": [\n \"114.114.114.114\",\n {\n \"address\": \"8.8.8.8\",\n \"domains\": [\n \"google\",\n \"android\",\n \"fbcdn\",\n \"facebook\",\n \"domain:fb.com\",\n \"instagram\",\n \"whatsapp\",\n \"akamai\",\n \"domain:line-scdn.net\",\n \"domain:line.me\",\n \"domain:naver.jp\"\n ],\n \"port\": 53\n }\n ]\n},\n\"log\": {\n \"loglevel\": \"error\"\n},\n\"policy\": {\n \"levels\": {\n \"0\": {\n \"bufferSize\": 4096,\n \"connIdle\": 30,\n \"downlinkOnly\": 0,\n \"handshake\": 4,\n \"uplinkOnly\": 0\n }\n }\n},\n\"routing\": {\n \"domainStrategy\": \"IPIfNonMatch\",\n \"rules\": [\n {\n \"inboundTag\": [\"tun2socks\"],\n \"network\": \"udp\",\n \"port\": 53,\n \"outboundTag\": \"dns-out\",\n \"type\": \"field\"\n },\n {\n \"domain\": [\n \"domain:setup.icloud.com\"\n ],\n \"outboundTag\": \"proxy\",\n \"type\": \"field\"\n },\n {\n \"ip\": [\n \"8.8.8.8/32\",\n \"8.8.4.4/32\",\n \"1.1.1.1/32\",\n \"1.0.0.1/32\",\n \"9.9.9.9/32\",\n \"149.112.112.112/32\",\n \"208.67.222.222/32\",\n \"208.67.220.220/32\"\n ],\n \"outboundTag\": \"proxy\",\n \"type\": \"field\"\n },\n {\n \"outboundTag\": \"direct\",\n \"port\": \"123\",\n \"type\": \"field\"\n }\n ],\n \"strategy\": \"rules\"\n }\n}";
private static final String DEFAULT_CONFIG_WEBSOCKET = "{\n \"outbounds\": [\n {\n \"mux\": {\n \"enabled\": false,\n \"concurrency\": 8\n },\n \"protocol\": \"vmess\",\n \"streamSettings\": {\n \"wsSettings\": {\n \"path\": \"REPLACE_WITH_PATH\",\n \"headers\": {\n \"host\": \"REPLACE_WITH_DOMAIN\"\n }\n },\n \"tlsSettings\": {\n \"serverName\": \"REPLACE_WITH_DOMAIN\",\n \"allowInsecure\": false\n },\n \"security\": \"tls\",\n \"network\": \"ws\"\n },\n \"tag\": \"proxy\",\n \"settings\": {\n \"vnext\": [\n {\n \"address\": \"REPLACE_WITH_IP\",\n \"users\": [\n {\n \"id\": \"REPLACE_WITH_UUID\",\n \"alterId\": 1,\n \"level\": 0,\n \"security\": \"aes-128-gcm\"\n }\n ],\n \"port\": REPLACE_WITH_PORT\n }\n ]\n }\n },\n {\n \"protocol\": \"freedom\",\n \"settings\": {\n \"domainStrategy\": \"UseIP\"\n },\n \"streamSettings\": {},\n \"tag\": \"direct\"\n },\n {\n \"protocol\": \"blackhole\",\n \"settings\": {},\n \"tag\": \"block\"\n },\n {\n \"protocol\": \"dns\",\n \"tag\": \"dns-out\"\n }\n ],\n \"dns\": {\n \"clientIp\": \"10.10.4.1\",\n \"hosts\": {\n \"localhost\": \"127.0.0.1\"\n },\n \"servers\": [\n \"114.114.114.114\",\n {\n \"address\": \"8.8.8.8\",\n \"domains\": [\n \"google\",\n \"android\",\n \"fbcdn\",\n \"facebook\",\n \"domain:fb.com\",\n \"instagram\",\n \"whatsapp\",\n \"akamai\",\n \"domain:line-scdn.net\",\n \"domain:line.me\",\n \"domain:naver.jp\"\n ],\n \"port\": 53\n }\n ]\n },\n \"log\": {\n \"loglevel\": \"error\"\n },\n \"policy\": {\n \"levels\": {\n \"0\": {\n \"bufferSize\": 4096,\n \"connIdle\": 30,\n \"downlinkOnly\": 0,\n \"handshake\": 4,\n \"uplinkOnly\": 0\n }\n }\n },\n \"routing\": {\n \"domainStrategy\": \"IPIfNonMatch\",\n \"rules\": [\n {\n \"inboundTag\": [\"tun2socks\"],\n \"network\": \"udp\",\n \"port\": 53,\n \"outboundTag\": \"dns-out\",\n \"type\": \"field\"\n },\n {\n \"ip\": [\n \"8.8.8.8/32\",\n \"8.8.4.4/32\",\n \"1.1.1.1/32\",\n \"1.0.0.1/32\",\n \"9.9.9.9/32\",\n \"149.112.112.112/32\",\n \"208.67.222.222/32\",\n \"208.67.220.220/32\"\n ],\n \"outboundTag\": \"proxy\",\n \"type\": \"field\"\n }\n ],\n \"strategy\": \"rules\"\n }\n}";
public final String generateConfig(ServerBean server) {
Intrinsics.checkNotNullParameter(server, "server");
if (server.getProtocolType() == 2) {
return StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(DEFAULT_CONFIG_VMESS, "REPLACE_WITH_IP", server.getIp(), false, 4, (Object) null), "REPLACE_WITH_PORT", server.getPortString(), false, 4, (Object) null), "REPLACE_WITH_UUID", server.getUserName(), false, 4, (Object) null);
}
return server.getProtocolType() == 4 ? StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(DEFAULT_CONFIG_WEBSOCKET, "REPLACE_WITH_IP", server.getIp(), false, 4, (Object) null), "REPLACE_WITH_PORT", server.getPortString(), false, 4, (Object) null), "REPLACE_WITH_UUID", server.getUserName(), false, 4, (Object) null), "REPLACE_WITH_PATH", server.getPasswordOrPath(), false, 4, (Object) null), "REPLACE_WITH_DOMAIN", server.getRidOrDomain(), false, 4, (Object) null) : "";
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006R\u0011\u0010\u0007\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0006¨\u0006\t"}, d2 = {"Lcom/best/free/vpn/proxy/connect/V2rayConfigHelper$Companion;", "", "()V", "DEFAULT_CONFIG_VMESS", "", "getDEFAULT_CONFIG_VMESS", "()Ljava/lang/String;", "DEFAULT_CONFIG_WEBSOCKET", "getDEFAULT_CONFIG_WEBSOCKET", "vpnkt-v1.19.0(222)_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final String getDEFAULT_CONFIG_VMESS() {
return V2rayConfigHelper.DEFAULT_CONFIG_VMESS;
}
public final String getDEFAULT_CONFIG_WEBSOCKET() {
return V2rayConfigHelper.DEFAULT_CONFIG_WEBSOCKET;
}
}
}