Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158
以下内容为反编译后的 xx4.java 源代码,内容仅作参考
package com.free.vpn.proxy.hotspot;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.preference.PreferenceManager;
import android.security.KeyChain;
import android.security.KeyChainException;
import android.text.TextUtils;
import androidx.core.google.shortcuts.utils.ShortcutUtils;
import androidx.core.os.EnvironmentCompat;
import androidx.exifinterface.media.ExifInterface;
import com.free.vpn.proxy.hotspot.data.model.billing.xiguapay.XiguapayCreateRequest;
import de.blinkt.openvpn.core.NativeUtils;
import de.blinkt.openvpn.core.OpenVPNService;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
import java.security.PrivateKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.UUID;
import java.util.Vector;
import web.accelerator.p003new.util.R;
public final class xx4 implements Serializable, Cloneable {
public String D;
public boolean a0;
public String b0;
public String c;
public String d;
public x50[] d0;
public String h0;
public String i0;
public int k0;
public String n0;
public String q;
public String r;
public transient PrivateKey r0;
public String s;
public String u;
public String y;
public int a = 2;
public String e = "";
public boolean t = true;
public boolean v = false;
public String w = "8.8.8.8";
public String x = "8.8.4.4";
public boolean z = false;
public String A = "blinkt.de";
public boolean B = true;
public boolean C = true;
public boolean E = true;
public boolean F = false;
public String G = "";
public String H = "";
public String I = "";
public boolean J = false;
public boolean K = false;
public boolean L = false;
public boolean M = false;
public String N = "";
public String O = "";
public boolean P = true;
public boolean Q = true;
public String R = "";
public boolean S = false;
public String T = "-1";
public String U = ExifInterface.GPS_MEASUREMENT_2D;
public String V = "300";
public boolean W = true;
public String X = "";
public int Y = 3;
public String Z = null;
public int c0 = 0;
public boolean e0 = false;
public HashSet f0 = new HashSet();
public boolean g0 = true;
public int j0 = 0;
public boolean l0 = false;
public int m0 = 0;
public String o0 = "openvpn.example.com";
public final String p0 = "1194";
public final boolean q0 = true;
public boolean u0 = true;
public UUID s0 = UUID.randomUUID();
public String b = "converted Profile";
public int t0 = 8;
public xx4() {
this.d0 = new x50[0];
this.d0 = r0;
x50[] x50VarArr = {new x50()};
System.currentTimeMillis();
}
public static String e(String str) {
String[] split = str.split(ShortcutUtils.CAPABILITY_PARAM_SEPARATOR);
if (split.length == 1) {
split = str.concat("/32").split(ShortcutUtils.CAPABILITY_PARAM_SEPARATOR);
}
if (split.length != 2) {
return null;
}
try {
int parseInt = Integer.parseInt(split[1]);
if (parseInt >= 0 && parseInt <= 32) {
long j = (4294967295 << (32 - parseInt)) & 4294967295L;
return pl0.s(new StringBuilder(), split[0], " ", String.format(Locale.ENGLISH, "%d.%d.%d.%d", Long.valueOf(((-16777216) & j) >> 24), Long.valueOf((16711680 & j) >> 16), Long.valueOf((65280 & j) >> 8), Long.valueOf(j & 255)));
}
} catch (NumberFormatException unused) {
}
return null;
}
public static Vector f(String str) {
Vector vector = new Vector();
if (str == null) {
return vector;
}
for (String str2 : str.split("[\n \t]")) {
if (!str2.equals("")) {
String e = e(str2);
if (e == null) {
return vector;
}
vector.add(e);
}
}
return vector;
}
public static String g(String str) {
return !str.contains("[[INLINE]]") ? str : str.substring(str.indexOf("[[INLINE]]") + 10);
}
public static void h() {
throw new KeyChainException("Alias or external auth provider name not set");
}
public static String l(Context context) {
String str;
try {
str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
fy4.j(e);
str = EnvironmentCompat.MEDIA_UNKNOWN;
}
return String.format(Locale.US, "%s %s", context.getPackageName(), str);
}
public static String m(String str, String str2) {
if (str2 == null) {
return String.format("%s %s\n", str, "file missing in config profile");
}
if (!n(str2)) {
return String.format(Locale.ENGLISH, "%s %s\n", str, o(str2));
}
return String.format(Locale.ENGLISH, "<%s>\n%s\n</%s>\n", str, g(str2), str);
}
public static boolean n(String str) {
if (str == null) {
return false;
}
return str.startsWith("[[INLINE]]") || str.startsWith("[[NAME]]");
}
public static String o(String str) {
if (str == null) {
return null;
}
String replace = str.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n");
if (replace.equals(str) && !replace.contains(" ") && !replace.contains("#") && !replace.contains(";") && !replace.equals("")) {
return str;
}
return "\"" + replace + '\"';
}
public final int a(Context context) {
String str;
u93.F(context).getBoolean("ovpn3", false);
int i = this.a;
if (i != 2 && i != 7 && i != 8) {
if ((i == 0 || i == 5) && TextUtils.isEmpty(this.s)) {
return R.string.no_ca_cert_selected;
}
} else if (this.c == null) {
return R.string.no_keystore_cert_selected;
}
if (this.E && this.Y == 0) {
return R.string.deprecated_tls_remote;
}
if ((this.C && this.a != 4) || ((str = this.y) != null && e(str) != null)) {
if (!this.B && ((!TextUtils.isEmpty(this.D) && f(this.D).size() == 0) || (!TextUtils.isEmpty(this.b0) && f(this.b0).size() == 0))) {
return R.string.custom_route_format_error;
}
if (this.v && TextUtils.isEmpty(this.q)) {
return R.string.missing_tlsauth;
}
int i2 = this.a;
if ((i2 != 5 && i2 != 0) || (!TextUtils.isEmpty(this.d) && !TextUtils.isEmpty(this.r))) {
int i3 = this.a;
if ((i3 == 0 || i3 == 5) && TextUtils.isEmpty(this.s)) {
return R.string.missing_ca_certificate;
}
boolean z = true;
for (x50 x50Var : this.d0) {
if (x50Var.q) {
z = false;
}
}
if (z) {
return R.string.remote_no_server_selected;
}
for (x50 x50Var2 : this.d0) {
if (x50Var2.s == 4) {
if (q()) {
return R.string.error_orbot_and_proxy_options;
}
if (!ut2.a(context)) {
return R.string.no_orbotfound;
}
}
}
return R.string.no_error_found;
}
return R.string.missing_certificates;
}
return R.string.ipv4_format_error;
}
public final Object clone() {
xx4 xx4Var = (xx4) super.clone();
xx4Var.s0 = UUID.randomUUID();
xx4Var.d0 = new x50[this.d0.length];
x50[] x50VarArr = this.d0;
int length = x50VarArr.length;
int i = 0;
int i2 = 0;
while (i < length) {
xx4Var.d0[i2] = x50VarArr[i].clone();
i++;
i2++;
}
xx4Var.f0 = (HashSet) this.f0.clone();
return xx4Var;
}
public final boolean equals(Object obj) {
if (obj instanceof xx4) {
return this.s0.equals(((xx4) obj).s0);
}
return false;
}
public final String getName() {
return TextUtils.isEmpty(this.b) ? "No profile name" : this.b;
}
public final synchronized String[] i(int i, Context context) {
String stringWriter;
String stringWriter2;
String str;
Context applicationContext = context.getApplicationContext();
try {
try {
if (this.a != 8) {
X509Certificate[] j = j(applicationContext);
if (j != null) {
if (j.length <= 1 && TextUtils.isEmpty(this.s)) {
fy4.p(applicationContext.getString(R.string.keychain_nocacert));
stringWriter = null;
} else {
StringWriter stringWriter3 = new StringWriter();
yx2 yx2Var = new yx2(stringWriter3);
for (int i2 = 1; i2 < j.length; i2++) {
yx2Var.b(new xx2(j[i2].getEncoded()));
}
yx2Var.close();
stringWriter = stringWriter3.toString();
}
if (!TextUtils.isEmpty(this.s)) {
try {
Certificate[] t = an1.t(this.s);
StringWriter stringWriter4 = new StringWriter();
yx2 yx2Var2 = new yx2(stringWriter4);
for (Certificate certificate : t) {
yx2Var2.b(new xx2(certificate.getEncoded()));
}
yx2Var2.close();
stringWriter2 = stringWriter4.toString();
} catch (Exception e) {
fy4.i("Could not read CA certificate" + e.getLocalizedMessage());
}
StringWriter stringWriter5 = new StringWriter();
if (j.length >= 1) {
X509Certificate x509Certificate = j[0];
yx2 yx2Var3 = new yx2(stringWriter5);
yx2Var3.b(new xx2(x509Certificate.getEncoded()));
yx2Var3.close();
}
String stringWriter6 = stringWriter5.toString();
if (stringWriter2 != null) {
str = null;
} else {
String str2 = stringWriter2;
str = stringWriter;
stringWriter = str2;
}
return new String[]{stringWriter, str, stringWriter6};
}
stringWriter2 = null;
StringWriter stringWriter52 = new StringWriter();
if (j.length >= 1) {
}
String stringWriter62 = stringWriter52.toString();
if (stringWriter2 != null) {
}
return new String[]{stringWriter, str, stringWriter62};
}
throw new wx4();
}
h();
throw null;
} catch (AssertionError e2) {
if (i == 0) {
return null;
}
fy4.i(String.format("Failure getting Keystore Keys (%s), retrying", e2.getLocalizedMessage()));
try {
Thread.sleep(3000L);
} catch (InterruptedException e3) {
fy4.k(null, e3);
}
return i(i - 1, applicationContext);
}
} catch (KeyChainException e4) {
e = e4;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
} catch (wx4 e5) {
e = e5;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
} catch (IOException e6) {
e = e6;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
} catch (IllegalArgumentException e7) {
e = e7;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
} catch (InterruptedException e8) {
e = e8;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
} catch (CertificateException e9) {
e = e9;
e.printStackTrace();
fy4.h(R.string.keyChainAccessError, e.getLocalizedMessage());
fy4.g(R.string.keychain_access);
return null;
}
}
public final X509Certificate[] j(Context context) {
this.r0 = KeyChain.getPrivateKey(context, this.c);
return KeyChain.getCertificateChain(context, this.c);
}
public final String k() {
return this.s0.toString().toLowerCase(Locale.ENGLISH);
}
public final void p() {
switch (this.t0) {
case 0:
case 1:
this.a0 = false;
case 2:
case 3:
this.d0 = r0;
x50 x50Var = new x50();
x50Var.a = this.o0;
x50Var.b = this.p0;
x50Var.c = this.q0;
x50Var.d = "";
x50[] x50VarArr = {x50Var};
this.g0 = true;
if (this.f0 == null) {
this.f0 = new HashSet();
}
if (this.d0 == null) {
this.d0 = new x50[0];
}
case 4:
case 5:
if (TextUtils.isEmpty(this.i0)) {
this.W = true;
}
case 6:
for (x50 x50Var2 : this.d0) {
if (x50Var2.s == 0) {
x50Var2.s = 1;
}
}
break;
}
this.t0 = 8;
}
public final boolean q() {
String str;
if (this.M && (str = this.N) != null && str.contains("http-proxy-option ")) {
return true;
}
for (x50 x50Var : this.d0) {
if (x50Var.f()) {
return true;
}
}
return false;
}
public final void r(OpenVPNService openVPNService) {
boolean z;
String str;
x50[] x50VarArr;
boolean z2;
boolean z3;
int i;
boolean z4;
String str2;
int i2;
int i3;
String str3;
String str4;
String str5;
String m;
String m2;
String[] i4;
FileWriter fileWriter = new FileWriter(openVPNService.getCacheDir().getAbsolutePath() + "/android.conf");
File cacheDir = openVPNService.getCacheDir();
StringBuilder sb = new StringBuilder("# Config for OpenVPN 2.x\n# Enables connection to GUI\nmanagement ");
sb.append(cacheDir.getAbsolutePath());
sb.append("/mgmtsocket unix\nmanagement-client\nmanagement-query-passwords\nmanagement-hold\n\n");
sb.append(String.format("setenv IV_GUI_VER %s \n", o(l(openVPNService))));
sb.append("setenv IV_SSO openurl,crtext\n");
sb.append(String.format("setenv IV_PLAT_VER %s\n", o(String.format(Locale.US, "%d %s %s %s %s %s", Integer.valueOf(Build.VERSION.SDK_INT), Build.VERSION.RELEASE, NativeUtils.a(), Build.BRAND, Build.BOARD, Build.MODEL))));
sb.append("machine-readable-output\nallow-recursive-routing\nifconfig-nowarn\n");
if (this.a != 4) {
z = true;
} else {
z = false;
}
if (z && this.C) {
str = "client\n";
} else if (this.C) {
str = "pull\n";
} else {
if (z) {
str = "tls-client\n";
}
sb.append("verb 4\n");
if (this.T == null) {
this.T = "-1";
}
if (!this.T.equals("-1")) {
sb.append("connect-retry-max ");
sb.append(this.T);
sb.append("\n");
}
if (TextUtils.isEmpty(this.U)) {
this.U = ExifInterface.GPS_MEASUREMENT_2D;
}
if (TextUtils.isEmpty(this.V)) {
this.V = "300";
}
sb.append("connect-retry ");
sb.append(this.U);
sb.append(" ");
sb.append(this.V);
sb.append("\nresolv-retry 60\ndev tun\n");
x50VarArr = this.d0;
if (x50VarArr.length != 1) {
sb.append(x50VarArr[0].e());
z2 = true;
} else {
z2 = true;
for (x50 x50Var : x50VarArr) {
if (z2) {
if (!TextUtils.isEmpty(x50Var.d) && x50Var.e) {
z3 = false;
} else {
z3 = true;
}
if (z3) {
z2 = true;
}
}
z2 = false;
}
if (this.e0) {
sb.append("remote-random\n");
}
if (z2) {
for (x50 x50Var2 : this.d0) {
if (x50Var2.q) {
sb.append(x50Var2.e());
}
}
}
}
switch (this.a) {
case 0:
sb.append(m("ca", this.s));
sb.append(m(XiguapayCreateRequest.K_TOKEN, this.r));
m2 = m("cert", this.d);
sb.append(m2);
break;
case 1:
sb.append(m("pkcs12", this.u));
break;
case 2:
case 8:
i4 = i(5, openVPNService);
sb.append("### From Keystore/ext auth app ####\n");
if (i4 == null) {
sb.append("<ca>\n");
sb.append(i4[0]);
sb.append("\n</ca>\n");
if (!TextUtils.isEmpty(i4[1])) {
sb.append("<extra-certs>\n");
sb.append(i4[1]);
sb.append("\n</extra-certs>\n");
}
sb.append("<cert>\n");
sb.append(i4[2]);
m2 = "\n</cert>\nmanagement-external-key nopadding\n";
sb.append(m2);
break;
} else {
sb.append(openVPNService.getString(R.string.keychain_access));
sb.append("\n");
break;
}
case 3:
sb.append("auth-user-pass\n");
m2 = m("ca", this.s);
sb.append(m2);
break;
case 5:
sb.append("auth-user-pass\n");
sb.append(m("ca", this.s));
sb.append(m(XiguapayCreateRequest.K_TOKEN, this.r));
m2 = m("cert", this.d);
sb.append(m2);
break;
case 6:
sb.append("auth-user-pass\n");
sb.append(m("pkcs12", this.u));
break;
case 7:
sb.append("auth-user-pass\n");
i4 = i(5, openVPNService);
sb.append("### From Keystore/ext auth app ####\n");
if (i4 == null) {
}
break;
}
i = this.a;
if (i == 3 && i != 5 && i != 6 && i != 7) {
z4 = false;
} else {
z4 = true;
}
if (z4 && this.j0 == 2) {
sb.append("auth-retry nointeract\n");
}
if (!TextUtils.isEmpty(this.h0)) {
sb.append(m("crl-verify", this.h0));
}
if (this.t) {
sb.append("comp-lzo\n");
}
if (this.v) {
String str6 = "tls-crypt";
boolean equals = this.e.equals("tls-crypt");
boolean equals2 = this.e.equals("tls-crypt-v2");
if (this.a == 4) {
str6 = "secret";
} else if (!equals) {
if (equals2) {
m = m("tls-crypt-v2", this.q);
sb.append(m);
if (!TextUtils.isEmpty(this.e) && !equals) {
sb.append("key-direction ");
sb.append(this.e);
sb.append("\n");
}
} else {
str6 = "tls-auth";
}
}
m = m(str6, this.q);
sb.append(m);
if (!TextUtils.isEmpty(this.e)) {
sb.append("key-direction ");
sb.append(this.e);
sb.append("\n");
}
}
if (!this.C) {
if (!TextUtils.isEmpty(this.y)) {
sb.append("ifconfig ");
sb.append(e(this.y));
sb.append("\n");
}
if (!TextUtils.isEmpty(null)) {
throw null;
}
}
if (this.C && this.J) {
sb.append("route-nopull\n");
}
if (!this.B) {
str2 = "route 0.0.0.0 0.0.0.0 vpn_gateway\n";
} else {
Iterator it = f(this.D).iterator();
String str7 = "";
while (it.hasNext()) {
str7 = hj.m(str7, "route ", (String) it.next(), " vpn_gateway\n");
}
Iterator it2 = f(this.b0).iterator();
while (it2.hasNext()) {
str7 = hj.m(str7, "route ", (String) it2.next(), " net_gateway\n");
}
str2 = str7;
}
if (!this.Q) {
sb.append("route-ipv6 ::/0\n");
} else {
String str8 = this.R;
Vector vector = new Vector();
if (str8 != null) {
for (String str9 : str8.split("[\n \t]")) {
if (!str9.equals("")) {
vector.add(str9);
}
}
}
Iterator it3 = vector.iterator();
while (it3.hasNext()) {
str2 = hj.m(str2, "route-ipv6 ", (String) it3.next(), "\n");
}
}
sb.append(str2);
if (!this.z || !this.C) {
if (!TextUtils.isEmpty(this.w)) {
sb.append("dhcp-option DNS ");
sb.append(this.w);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.x)) {
sb.append("dhcp-option DNS ");
sb.append(this.x);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.A)) {
sb.append("dhcp-option DOMAIN ");
sb.append(this.A);
sb.append("\n");
}
}
i2 = this.c0;
if (i2 != 0) {
if (i2 != 1450) {
str5 = String.format(Locale.US, "mssfix %d\n", Integer.valueOf(i2));
} else {
str5 = "mssfix\n";
}
sb.append(str5);
}
i3 = this.k0;
if (i3 >= 48 && i3 != 1500) {
sb.append(String.format(Locale.US, "tun-mtu %d\n", Integer.valueOf(i3)));
}
if (this.P) {
sb.append("nobind\n");
}
if (this.a != 4) {
if (this.E) {
String str10 = this.G;
if (str10 != null && !str10.equals("")) {
int i5 = this.Y;
if (i5 != 0) {
if (i5 != 1) {
if (i5 != 2) {
if (i5 != 3) {
if (i5 == 4) {
sb.append("verify-x509-name ");
sb.append(o(this.G));
str4 = " name-prefix\n";
sb.append(str4);
}
if (!TextUtils.isEmpty(this.Z)) {
sb.append("x509-username-field ");
sb.append(o(this.Z));
sb.append("\n");
}
} else {
sb.append("verify-x509-name ");
str3 = this.G;
}
} else {
sb.append("verify-x509-name ");
sb.append(o(this.G));
sb.append("\n");
if (!TextUtils.isEmpty(this.Z)) {
}
}
} else {
sb.append("compat-names no-remapping\n");
}
}
sb.append("tls-remote ");
sb.append(o(this.G));
sb.append("\n");
if (!TextUtils.isEmpty(this.Z)) {
}
} else {
sb.append("verify-x509-name ");
str3 = this.d0[0].a;
}
sb.append(o(str3));
str4 = " name\n";
sb.append(str4);
if (!TextUtils.isEmpty(this.Z)) {
}
}
if (this.F) {
sb.append("remote-cert-tls server\n");
}
}
if (!TextUtils.isEmpty(this.O)) {
sb.append("cipher ");
sb.append(this.O);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.X)) {
sb.append("auth ");
sb.append(this.X);
sb.append("\n");
}
if (this.K) {
sb.append("#my favorite options :)\nremote-random-hostname\n");
}
if (this.L) {
sb.append("float\n");
}
if (this.S) {
sb.append("persist-tun\n# persist-tun also enables pre resolving to avoid DNS resolve problem\npreresolve\n");
}
if (this.l0) {
sb.append("push-peer-info\n");
}
if (PreferenceManager.getDefaultSharedPreferences(openVPNService).getBoolean("usesystemproxy", true) && !q()) {
sb.append("# Use system proxy setting\nmanagement-query-proxy\n");
}
if (this.M) {
sb.append("# Custom configuration options\n# You are on your on own here :)\n");
sb.append(this.N);
sb.append("\n");
}
if (!z2) {
sb.append("# Connection Options are at the end to allow global options (and global custom options) to influence connection blocks\n");
for (x50 x50Var3 : this.d0) {
if (x50Var3.q) {
sb.append("<connection>\n");
sb.append(x50Var3.e());
sb.append("</connection>\n");
}
}
}
fileWriter.write(sb.toString());
fileWriter.flush();
fileWriter.close();
}
sb.append(str);
sb.append("verb 4\n");
if (this.T == null) {
}
if (!this.T.equals("-1")) {
}
if (TextUtils.isEmpty(this.U)) {
}
if (TextUtils.isEmpty(this.V)) {
}
sb.append("connect-retry ");
sb.append(this.U);
sb.append(" ");
sb.append(this.V);
sb.append("\nresolv-retry 60\ndev tun\n");
x50VarArr = this.d0;
if (x50VarArr.length != 1) {
}
switch (this.a) {
}
i = this.a;
if (i == 3) {
}
z4 = true;
if (z4) {
sb.append("auth-retry nointeract\n");
}
if (!TextUtils.isEmpty(this.h0)) {
}
if (this.t) {
}
if (this.v) {
}
if (!this.C) {
}
if (this.C) {
sb.append("route-nopull\n");
}
if (!this.B) {
}
if (!this.Q) {
}
sb.append(str2);
if (!this.z) {
}
if (!TextUtils.isEmpty(this.w)) {
}
if (!TextUtils.isEmpty(this.x)) {
}
if (!TextUtils.isEmpty(this.A)) {
}
i2 = this.c0;
if (i2 != 0) {
}
i3 = this.k0;
if (i3 >= 48) {
sb.append(String.format(Locale.US, "tun-mtu %d\n", Integer.valueOf(i3)));
}
if (this.P) {
}
if (this.a != 4) {
}
if (!TextUtils.isEmpty(this.O)) {
}
if (!TextUtils.isEmpty(this.X)) {
}
if (this.K) {
}
if (this.L) {
}
if (this.S) {
}
if (this.l0) {
}
if (PreferenceManager.getDefaultSharedPreferences(openVPNService).getBoolean("usesystemproxy", true)) {
sb.append("# Use system proxy setting\nmanagement-query-proxy\n");
}
if (this.M) {
}
if (!z2) {
}
fileWriter.write(sb.toString());
fileWriter.flush();
fileWriter.close();
}
public final String toString() {
return this.b;
}
}