CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03
以下内容为反编译后的 a.java 源代码,内容仅作参考
package g.a.a;
import android.content.Context;
import android.content.Intent;
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 android.util.Base64;
import com.facebook.ads.ExtraHints;
import com.iptvsmarters.cciptv.R;
import de.blinkt.openvpn.core.NativeUtils;
import de.blinkt.openvpn.core.OpenVPNService;
import g.a.a.c.d;
import g.a.a.c.g;
import g.a.a.c.r;
import g.a.a.c.s;
import g.a.a.c.t;
import g.a.a.c.x;
import g.a.a.c.y;
import g.a.a.c.z;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.SignatureException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.UUID;
import java.util.Vector;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import org.spongycastle.util.io.pem.PemObject;
import org.spongycastle.util.io.pem.PemWriter;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
public class a implements Serializable, Cloneable {
public static final long serialVersionUID = 7085688938959334563L;
public static String t0 = "8.8.8.8";
public static String u0 = "8.8.4.4";
public boolean U;
public String V;
public d[] X;
public String c0;
public String f10574d;
public String d0;
public String f10575e;
public String e0;
public String f10576f;
public int g0;
public String f10578h;
public String f10579i;
public String f10580j;
public long j0;
public String f10582l;
public String f10583m;
public boolean n0;
public transient PrivateKey o0;
public String f10587q;
public String r;
public String w;
public transient boolean b = false;
public int c = 2;
public String f10577g = "";
public boolean f10581k = true;
public boolean f10584n = false;
public String f10585o = t0;
public String f10586p = u0;
public boolean s = false;
public String t = "blinkt.de";
public boolean u = true;
public boolean v = true;
public boolean x = true;
public boolean y = false;
public String z = "";
public String A = "";
public String B = "";
public boolean C = false;
public boolean D = false;
public boolean E = false;
public boolean F = false;
public String G = "";
public String H = "";
public boolean I = true;
public boolean J = true;
public String K = "";
public String L = "";
public boolean M = false;
public String N = "-1";
public String O = "2";
public String P = "300";
public boolean Q = true;
public String R = "";
public int S = 3;
public String T = null;
public int W = 0;
public boolean Y = false;
public HashSet<String> Z = new HashSet<>();
public boolean a0 = true;
public boolean b0 = false;
public int f0 = 0;
public boolean h0 = false;
public int i0 = 0;
public String k0 = "openvpn.example.com";
public String l0 = "1194";
public boolean m0 = true;
public String r0 = "";
public boolean s0 = true;
public UUID p0 = UUID.randomUUID();
public int q0 = 9;
public class RunnableC0288a implements Runnable {
public final Context b;
public RunnableC0288a(Context context) {
this.b = context;
}
@Override
public void run() {
a.this.o(this.b);
}
}
public class b extends Exception {
public b(a aVar, String str) {
super(str);
}
}
public a(String str) {
this.X = new d[0];
this.f10574d = str;
this.X = r5;
d[] dVarArr = {new d()};
System.currentTimeMillis();
}
public static String J(Context context) {
String str;
try {
str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e2) {
y.r(e2);
str = IjkMediaMeta.IJKM_VAL_TYPE__UNKNOWN;
}
return String.format(Locale.US, "%s %s", context.getPackageName(), str);
}
public static String K(String str, String str2) {
if (str2 == null) {
return String.format("%s %s\n", str, "file missing in config profile");
}
if (L(str2)) {
return String.format(Locale.ENGLISH, "<%s>\n%s\n</%s>\n", str, l(str2), str);
}
return String.format(Locale.ENGLISH, "%s %s\n", str, Q(str2));
}
public static boolean L(String str) {
if (str == null) {
return false;
}
return str.startsWith("[[INLINE]]") || str.startsWith("[[NAME]]");
}
public static String Q(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(ExtraHints.KEYWORD_SEPARATOR) || replace.equals("")) {
return '\"' + replace + '\"';
}
return str;
}
public static boolean h(Context context) {
return t.a(context).getBoolean("ovpn3", false);
}
public static String l(String str) {
return !str.contains("[[INLINE]]") ? str : str.substring(str.indexOf("[[INLINE]]") + 10);
}
public String C(Context context, String str, boolean z) {
byte[] decode = Base64.decode(str, 0);
byte[] n2 = this.c == 8 ? n(context, decode) : r(decode, z);
if (n2 != null) {
return Base64.encodeToString(n2, 2);
}
return null;
}
public Intent E(Context context) {
String packageName = context.getPackageName();
Intent intent = new Intent(context, OpenVPNService.class);
intent.putExtra(packageName + ".profileUUID", this.p0.toString());
intent.putExtra(packageName + ".profileVersion", this.i0);
return intent;
}
public UUID F() {
return this.p0;
}
public String H() {
return this.p0.toString().toLowerCase(Locale.ENGLISH);
}
public boolean M() {
int i2 = this.c;
return i2 == 3 || i2 == 5 || i2 == 6 || i2 == 7;
}
public final void O() {
this.X = new d[1];
d dVar = new d();
dVar.b = this.k0;
dVar.c = this.l0;
dVar.f10597d = this.m0;
dVar.f10598e = "";
this.X[0] = dVar;
}
public int P(String str, String str2) {
String str3;
int i2 = this.c;
if ((i2 == 1 || i2 == 6) && (((str3 = this.f10583m) == null || str3.equals("")) && str == null)) {
return R.string.pkcs12_file_encryption_key;
}
int i3 = this.c;
if ((i3 == 0 || i3 == 5) && T() && TextUtils.isEmpty(this.L) && str == null) {
return R.string.private_key_password;
}
if (M()) {
if (TextUtils.isEmpty(this.B)) {
return R.string.password;
}
if (TextUtils.isEmpty(this.A) && str2 == null) {
return R.string.password;
}
return 0;
}
return 0;
}
public Intent R(Context context) {
return E(context);
}
public final byte[] S(PrivateKey privateKey, byte[] bArr, boolean z) {
try {
Method declaredMethod = privateKey.getClass().getSuperclass().getDeclaredMethod("getOpenSSLKey", new Class[0]);
declaredMethod.setAccessible(true);
Object invoke = declaredMethod.invoke(privateKey, new Object[0]);
declaredMethod.setAccessible(false);
Method declaredMethod2 = invoke.getClass().getDeclaredMethod("getPkeyContext", new Class[0]);
declaredMethod2.setAccessible(true);
int intValue = ((Integer) declaredMethod2.invoke(invoke, new Object[0])).intValue();
declaredMethod2.setAccessible(false);
return NativeUtils.rsasign(bArr, intValue, z);
} catch (IllegalAccessException | IllegalArgumentException | NoSuchMethodException | InvocationTargetException | InvalidKeyException e2) {
y.o(R.string.error_rsa_sign, e2.getClass().toString(), e2.getLocalizedMessage());
return null;
}
}
public boolean T() {
String str;
if (TextUtils.isEmpty(this.f10579i)) {
return false;
}
if (L(this.f10579i)) {
str = this.f10579i;
} else {
char[] cArr = new char[IjkMediaMeta.FF_PROFILE_H264_INTRA];
try {
FileReader fileReader = new FileReader(this.f10579i);
String str2 = "";
for (int read = fileReader.read(cArr); read > 0; read = fileReader.read(cArr)) {
str2 = str2 + new String(cArr, 0, read);
}
fileReader.close();
str = str2;
} catch (FileNotFoundException | IOException unused) {
}
}
return str.contains("Proc-Type: 4,ENCRYPTED") || str.contains("-----BEGIN ENCRYPTED PRIVATE KEY-----");
}
public void U() {
d[] dVarArr;
switch (this.q0) {
case 0:
case 1:
this.U = Build.VERSION.SDK_INT < 19;
case 2:
case 3:
O();
this.a0 = true;
if (this.Z == null) {
this.Z = new HashSet<>();
}
if (this.X == null) {
this.X = new d[0];
}
case 4:
case 5:
if (TextUtils.isEmpty(this.d0)) {
this.Q = true;
}
case 6:
for (d dVar : this.X) {
if (dVar.f10602i == null) {
dVar.f10602i = d.a.NONE;
}
}
case 7:
boolean z = this.b0;
if (z) {
this.s0 = !z;
}
case 8:
if (!TextUtils.isEmpty(this.H) && !this.H.equals("AES-256-GCM") && !this.H.equals("AES-128-GCM")) {
this.r0 = "AES-256-GCM:AES-128-GCM:" + this.H;
break;
}
break;
}
this.q0 = 9;
}
public final boolean V() {
String str;
if (this.F && (str = this.G) != null && str.contains("http-proxy-option ")) {
return true;
}
for (d dVar : this.X) {
if (dVar.d()) {
return true;
}
}
return false;
}
public void W(Context context) {
FileWriter fileWriter = new FileWriter(x.b(context));
fileWriter.write(i(context, false));
fileWriter.flush();
fileWriter.close();
}
public void a(Context context) {
int i2 = this.c;
if ((i2 == 2 || i2 == 7) && this.o0 == null) {
new Thread(new RunnableC0288a(context)).start();
}
}
public int b(Context context) {
return c(context, h(context));
}
public int c(Context context, boolean z) {
String str;
int i2 = this.c;
if (i2 == 2 || i2 == 7 || i2 == 8) {
if (this.f10575e == null) {
return R.string.no_keystore_cert_selected;
}
} else if ((i2 == 0 || i2 == 5) && TextUtils.isEmpty(this.f10580j)) {
return R.string.no_ca_cert_selected;
}
if (this.x && this.S == 0) {
return R.string.deprecated_tls_remote;
}
if ((!this.v || this.c == 4) && ((str = this.f10587q) == null || d(str) == null)) {
return R.string.ipv4_format_error;
}
if (!this.u) {
if (!TextUtils.isEmpty(this.w) && j(this.w).size() == 0) {
return R.string.custom_route_format_error;
}
if (!TextUtils.isEmpty(this.V) && j(this.V).size() == 0) {
return R.string.custom_route_format_error;
}
}
if (this.f10584n && TextUtils.isEmpty(this.f10578h)) {
return R.string.missing_tlsauth;
}
int i3 = this.c;
if ((i3 == 5 || i3 == 0) && (TextUtils.isEmpty(this.f10576f) || TextUtils.isEmpty(this.f10579i))) {
return R.string.missing_certificates;
}
int i4 = this.c;
if ((i4 == 0 || i4 == 5) && TextUtils.isEmpty(this.f10580j)) {
return R.string.missing_ca_certificate;
}
boolean z2 = true;
for (d dVar : this.X) {
if (dVar.f10600g) {
z2 = false;
}
}
if (z2) {
return R.string.remote_no_server_selected;
}
if (z) {
int i5 = this.c;
if (i5 == 4) {
return R.string.openvpn3_nostatickeys;
}
if (i5 == 1 || i5 == 6) {
return R.string.openvpn3_pkcs12;
}
for (d dVar2 : this.X) {
d.a aVar = dVar2.f10602i;
if (aVar == d.a.ORBOT || aVar == d.a.SOCKS5) {
return R.string.openvpn3_socksproxy;
}
}
}
for (d dVar3 : this.X) {
if (dVar3.f10602i == d.a.ORBOT) {
if (V()) {
return R.string.error_orbot_and_proxy_options;
}
if (!r.c(context)) {
return R.string.no_orbotfound;
}
}
}
return R.string.no_error_found;
}
public final String d(String str) {
String[] split = str.split("/");
if (split.length == 1) {
split = (str + "/32").split("/");
}
if (split.length != 2) {
return null;
}
try {
int parseInt = Integer.parseInt(split[1]);
if (parseInt >= 0 && parseInt <= 32) {
long j2 = 4294967295L & (4294967295 << (32 - parseInt));
String format = String.format(Locale.ENGLISH, "%d.%d.%d.%d", Long.valueOf(((-16777216) & j2) >> 24), Long.valueOf((16711680 & j2) >> 16), Long.valueOf((65280 & j2) >> 8), Long.valueOf(255 & j2));
return split[0] + " " + format;
}
} catch (NumberFormatException unused) {
}
return null;
}
public void e() {
this.k0 = IjkMediaMeta.IJKM_VAL_TYPE__UNKNOWN;
this.v = false;
this.f10581k = false;
this.u = false;
this.J = false;
this.y = false;
this.x = false;
this.M = false;
this.U = true;
this.h0 = false;
this.W = 0;
this.I = false;
}
public boolean equals(Object obj) {
if (obj instanceof a) {
return this.p0.equals(((a) obj).p0);
}
return false;
}
public a clone() {
a aVar = (a) super.clone();
aVar.p0 = UUID.randomUUID();
aVar.X = new d[this.X.length];
d[] dVarArr = this.X;
int length = dVarArr.length;
int i2 = 0;
int i3 = 0;
while (i2 < length) {
aVar.X[i3] = dVarArr[i2].clone();
i2++;
i3++;
}
aVar.Z = (HashSet) this.Z.clone();
return aVar;
}
public String i(Context context, boolean z) {
String str;
String str2;
d[] dVarArr;
boolean z2;
d[] dVarArr2;
Iterator<String> it;
Iterator<String> it2;
String str3;
Iterator<String> it3;
int i2;
int i3;
d[] dVarArr3;
String str4;
String str5;
String K;
String str6;
String K2;
File cacheDir = context.getCacheDir();
StringBuilder sb = new StringBuilder();
if (z) {
str = "# Config for OpenVPN 3 C++\n";
} else {
sb.append("# Config for OpenVPN 2.x\n");
sb.append("# Enables connection to GUI\n");
sb.append("management ");
sb.append(cacheDir.getAbsolutePath());
sb.append("/");
sb.append("mgmtsocket");
sb.append(" unix\n");
sb.append("management-client\n");
sb.append("management-query-passwords\n");
sb.append("management-hold\n\n");
sb.append(String.format("setenv IV_GUI_VER %s \n", Q(J(context))));
sb.append("setenv IV_SSO openurl,crtext\n");
str = String.format("setenv IV_PLAT_VER %s\n", Q(y()));
}
sb.append(str);
if (!z) {
sb.append("machine-readable-output\n");
sb.append("allow-recursive-routing\n");
sb.append("ifconfig-nowarn\n");
}
boolean z3 = this.c != 4;
if (z3 && this.v) {
str2 = "client\n";
} else if (!this.v) {
if (z3) {
str2 = "tls-client\n";
}
sb.append("verb 4\n");
if (this.N == null) {
this.N = "-1";
}
if (!this.N.equals("-1")) {
sb.append("connect-retry-max ");
sb.append(this.N);
sb.append("\n");
}
if (TextUtils.isEmpty(this.O)) {
this.O = "2";
}
if (TextUtils.isEmpty(this.P)) {
this.P = "300";
}
sb.append("connect-retry ");
sb.append(this.O);
sb.append(" ");
sb.append(this.P);
sb.append("\n");
sb.append("resolv-retry 60\n");
sb.append("dev tun\n");
dVarArr = this.X;
if (dVarArr.length != 1) {
sb.append(dVarArr[0].b(z));
z2 = true;
} else {
z2 = true;
for (d dVar : dVarArr) {
z2 = z2 && dVar.c();
}
if (this.Y) {
sb.append("remote-random\n");
}
if (z2) {
for (d dVar2 : this.X) {
if (dVar2.f10600g) {
sb.append(dVar2.b(z));
}
}
}
}
String str7 = "ca";
switch (this.c) {
case 0:
sb.append(K("ca", this.f10580j));
sb.append(K("key", this.f10579i));
str6 = this.f10576f;
str7 = "cert";
K2 = K(str7, str6);
sb.append(K2);
break;
case 1:
sb.append(K("pkcs12", this.f10582l));
if (!TextUtils.isEmpty(this.f10580j)) {
str6 = this.f10580j;
K2 = K(str7, str6);
sb.append(K2);
break;
}
break;
case 2:
case 8:
if (!z) {
String[] o2 = o(context);
sb.append("### From Keystore/ext auth app ####\n");
if (o2 != null) {
sb.append("<ca>\n");
sb.append(o2[0]);
sb.append("\n</ca>\n");
if (!TextUtils.isEmpty(o2[1])) {
sb.append("<extra-certs>\n");
sb.append(o2[1]);
sb.append("\n</extra-certs>\n");
}
sb.append("<cert>\n");
sb.append(o2[2]);
sb.append("\n</cert>\n");
K2 = "management-external-key nopadding\n";
sb.append(K2);
break;
} else {
sb.append(context.getString(R.string.keychain_access));
sb.append("\n");
if (Build.VERSION.SDK_INT == 16 && !this.f10575e.matches("^[a-zA-Z0-9]$")) {
sb.append(context.getString(R.string.jelly_keystore_alphanumeric_bug));
sb.append("\n");
break;
}
}
}
break;
case 3:
sb.append("auth-user-pass\n");
sb.append(K("ca", this.f10580j));
if (z) {
K2 = "client-cert-not-required\n";
sb.append(K2);
break;
}
break;
case 5:
sb.append("auth-user-pass\n");
sb.append(K("ca", this.f10580j));
sb.append(K("key", this.f10579i));
str6 = this.f10576f;
str7 = "cert";
K2 = K(str7, str6);
sb.append(K2);
break;
case 6:
sb.append("auth-user-pass\n");
sb.append(K("pkcs12", this.f10582l));
if (!TextUtils.isEmpty(this.f10580j)) {
}
break;
case 7:
sb.append("auth-user-pass\n");
if (!z) {
}
break;
}
if (M() && this.f0 == 2) {
sb.append("auth-retry nointeract\n");
}
if (!TextUtils.isEmpty(this.c0)) {
sb.append(K("crl-verify", this.c0));
}
if (this.f10581k) {
sb.append("comp-lzo\n");
}
if (this.f10584n) {
String str8 = "tls-crypt";
boolean equals = this.f10577g.equals("tls-crypt");
boolean equals2 = this.f10577g.equals("tls-crypt-v2");
if (this.c == 4) {
str5 = this.f10578h;
str8 = "secret";
} else {
str5 = this.f10578h;
if (!equals) {
if (equals2) {
K = K("tls-crypt-v2", str5);
sb.append(K);
if (!TextUtils.isEmpty(this.f10577g) && !equals && !equals2) {
sb.append("key-direction ");
sb.append(this.f10577g);
sb.append("\n");
}
} else {
str8 = "tls-auth";
}
}
}
K = K(str8, str5);
sb.append(K);
if (!TextUtils.isEmpty(this.f10577g)) {
sb.append("key-direction ");
sb.append(this.f10577g);
sb.append("\n");
}
}
if (!this.v) {
if (!TextUtils.isEmpty(this.f10587q)) {
sb.append("ifconfig ");
sb.append(d(this.f10587q));
sb.append("\n");
}
if (!TextUtils.isEmpty(this.r)) {
String str9 = this.r.split("/", 2)[0];
sb.append("ifconfig-ipv6 ");
sb.append(this.r);
sb.append(" ");
sb.append(str9);
sb.append("\n");
}
}
if (this.v && this.C) {
sb.append("route-nopull\n");
}
if (this.u) {
String str10 = "";
while (j(this.w).iterator().hasNext()) {
str10 = str10 + "route " + it.next() + " vpn_gateway\n";
}
while (j(this.V).iterator().hasNext()) {
str10 = str10 + "route " + it2.next() + " net_gateway\n";
}
str3 = str10;
} else {
str3 = "route 0.0.0.0 0.0.0.0 vpn_gateway\n";
}
if (this.J) {
while (k(this.K).iterator().hasNext()) {
str3 = str3 + "route-ipv6 " + it3.next() + "\n";
}
} else {
sb.append("route-ipv6 ::/0\n");
}
sb.append(str3);
if (!this.s || !this.v) {
if (!TextUtils.isEmpty(this.f10585o)) {
sb.append("dhcp-option DNS ");
sb.append(this.f10585o);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.f10586p)) {
sb.append("dhcp-option DNS ");
sb.append(this.f10586p);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.t)) {
sb.append("dhcp-option DOMAIN ");
sb.append(this.t);
sb.append("\n");
}
}
i2 = this.W;
if (i2 != 0) {
sb.append(i2 != 1450 ? z ? String.format(Locale.US, "mssfix %d mtu\n", Integer.valueOf(i2)) : String.format(Locale.US, "mssfix %d\n", Integer.valueOf(i2)) : "mssfix\n");
}
i3 = this.g0;
if (i3 >= 48 && i3 != 1500) {
sb.append(String.format(Locale.US, "tun-mtu %d\n", Integer.valueOf(i3)));
}
if (this.I) {
sb.append("nobind\n");
}
if (this.c != 4) {
if (this.x) {
String str11 = this.z;
if (str11 == null || str11.equals("")) {
sb.append("verify-x509-name ");
str4 = this.X[0].b;
} else {
int i4 = this.S;
if (i4 != 0) {
if (i4 == 1) {
sb.append("compat-names no-remapping\n");
} else if (i4 == 2) {
sb.append("verify-x509-name ");
sb.append(Q(this.z));
sb.append("\n");
if (!TextUtils.isEmpty(this.T)) {
}
} else if (i4 != 3) {
if (i4 == 4) {
sb.append("verify-x509-name ");
sb.append(Q(this.z));
sb.append(" name-prefix\n");
}
if (!TextUtils.isEmpty(this.T)) {
sb.append("x509-username-field ");
sb.append(Q(this.T));
sb.append("\n");
}
} else {
sb.append("verify-x509-name ");
str4 = this.z;
}
}
sb.append("tls-remote ");
sb.append(Q(this.z));
sb.append("\n");
if (!TextUtils.isEmpty(this.T)) {
}
}
sb.append(Q(str4));
sb.append(" name\n");
if (!TextUtils.isEmpty(this.T)) {
}
}
if (this.y) {
sb.append("remote-cert-tls server\n");
}
}
if (!TextUtils.isEmpty(this.r0)) {
sb.append("data-ciphers ");
sb.append(this.r0);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.H)) {
sb.append("cipher ");
sb.append(this.H);
sb.append("\n");
}
if (!TextUtils.isEmpty(this.R)) {
sb.append("auth ");
sb.append(this.R);
sb.append("\n");
}
if (this.D) {
sb.append("#my favorite options :)\nremote-random-hostname\n");
}
if (this.E) {
sb.append("float\n");
}
if (this.M) {
sb.append("persist-tun\n");
sb.append("# persist-tun also enables pre resolving to avoid DNS resolve problem\n");
sb.append("preresolve\n");
}
if (this.h0) {
sb.append("push-peer-info\n");
}
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("usesystemproxy", true) && !z && !V()) {
sb.append("# Use system proxy setting\n");
sb.append("management-query-proxy\n");
}
if (this.F) {
sb.append("# Custom configuration options\n");
sb.append("# You are on your on own here :)\n");
sb.append(this.G);
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 (d dVar3 : this.X) {
if (dVar3.f10600g) {
sb.append("<connection>\n");
sb.append(dVar3.b(z));
sb.append("</connection>\n");
}
}
}
return sb.toString();
} else {
str2 = "pull\n";
}
sb.append(str2);
sb.append("verb 4\n");
if (this.N == null) {
}
if (!this.N.equals("-1")) {
}
if (TextUtils.isEmpty(this.O)) {
}
if (TextUtils.isEmpty(this.P)) {
}
sb.append("connect-retry ");
sb.append(this.O);
sb.append(" ");
sb.append(this.P);
sb.append("\n");
sb.append("resolv-retry 60\n");
sb.append("dev tun\n");
dVarArr = this.X;
if (dVarArr.length != 1) {
}
String str72 = "ca";
switch (this.c) {
}
if (M()) {
sb.append("auth-retry nointeract\n");
}
if (!TextUtils.isEmpty(this.c0)) {
}
if (this.f10581k) {
}
if (this.f10584n) {
}
if (!this.v) {
}
if (this.v) {
sb.append("route-nopull\n");
}
if (this.u) {
}
if (this.J) {
}
sb.append(str3);
if (!this.s) {
}
if (!TextUtils.isEmpty(this.f10585o)) {
}
if (!TextUtils.isEmpty(this.f10586p)) {
}
if (!TextUtils.isEmpty(this.t)) {
}
i2 = this.W;
if (i2 != 0) {
}
i3 = this.g0;
if (i3 >= 48) {
sb.append(String.format(Locale.US, "tun-mtu %d\n", Integer.valueOf(i3)));
}
if (this.I) {
}
if (this.c != 4) {
}
if (!TextUtils.isEmpty(this.r0)) {
}
if (!TextUtils.isEmpty(this.H)) {
}
if (!TextUtils.isEmpty(this.R)) {
}
if (this.D) {
}
if (this.E) {
}
if (this.M) {
}
if (this.h0) {
}
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("usesystemproxy", true)) {
sb.append("# Use system proxy setting\n");
sb.append("management-query-proxy\n");
}
if (this.F) {
}
if (!z2) {
}
return sb.toString();
}
public final Collection<String> j(String str) {
String[] split;
Vector vector = new Vector();
if (str == null) {
return vector;
}
for (String str2 : str.split("[\n \t]")) {
if (!str2.equals("")) {
String d2 = d(str2);
if (d2 == null) {
return vector;
}
vector.add(d2);
}
}
return vector;
}
public final Collection<String> k(String str) {
String[] split;
Vector vector = new Vector();
if (str == null) {
return vector;
}
for (String str2 : str.split("[\n \t]")) {
if (!str2.equals("")) {
vector.add(str2);
}
}
return vector;
}
public final X509Certificate[] m(Context context) {
String str;
String str2 = this.e0;
if (str2 == null || (str = this.f10575e) == null) {
throw new KeyChainException("Alias or external auth provider name not set");
}
return g.c(context, str2, str);
}
public final byte[] n(Context context, byte[] bArr) {
if (TextUtils.isEmpty(this.e0)) {
return null;
}
try {
return g.d(context, this.e0, this.f10575e, bArr);
} catch (KeyChainException | InterruptedException e2) {
y.o(R.string.error_extapp_sign, this.e0, e2.getClass().toString(), e2.getLocalizedMessage());
return null;
}
}
public String[] o(Context context) {
return q(context, 5);
}
public synchronized String[] q(Context context, int i2) {
String stringWriter;
String stringWriter2;
String str;
Context applicationContext = context.getApplicationContext();
try {
try {
X509Certificate[] m2 = this.c == 8 ? m(applicationContext) : s(applicationContext);
if (m2 != null) {
if (m2.length > 1 || !TextUtils.isEmpty(this.f10580j)) {
StringWriter stringWriter3 = new StringWriter();
PemWriter pemWriter = new PemWriter(stringWriter3);
for (int i3 = 1; i3 < m2.length; i3++) {
pemWriter.writeObject(new PemObject("CERTIFICATE", m2[i3].getEncoded()));
}
pemWriter.close();
stringWriter = stringWriter3.toString();
} else {
y.w(y.c.ERROR, "", applicationContext.getString(R.string.keychain_nocacert));
stringWriter = null;
}
if (!TextUtils.isEmpty(this.f10580j)) {
try {
Certificate[] a = z.a(this.f10580j);
StringWriter stringWriter4 = new StringWriter();
PemWriter pemWriter2 = new PemWriter(stringWriter4);
for (Certificate certificate : a) {
pemWriter2.writeObject(new PemObject("CERTIFICATE", certificate.getEncoded()));
}
pemWriter2.close();
stringWriter2 = stringWriter4.toString();
} catch (Exception e2) {
y.p("Could not read CA certificate" + e2.getLocalizedMessage());
}
StringWriter stringWriter5 = new StringWriter();
if (m2.length >= 1) {
X509Certificate x509Certificate = m2[0];
PemWriter pemWriter3 = new PemWriter(stringWriter5);
pemWriter3.writeObject(new PemObject("CERTIFICATE", x509Certificate.getEncoded()));
pemWriter3.close();
}
String stringWriter6 = stringWriter5.toString();
if (stringWriter2 != null) {
str = null;
} else {
String str2 = stringWriter;
stringWriter = stringWriter2;
str = str2;
}
return new String[]{stringWriter, str, stringWriter6};
}
stringWriter2 = null;
StringWriter stringWriter52 = new StringWriter();
if (m2.length >= 1) {
}
String stringWriter62 = stringWriter52.toString();
if (stringWriter2 != null) {
}
return new String[]{stringWriter, str, stringWriter62};
}
throw new b(this, "No certificate returned from Keystore");
} catch (AssertionError e3) {
if (i2 == 0) {
return null;
}
y.p(String.format("Failure getting Keystore Keys (%s), retrying", e3.getLocalizedMessage()));
try {
Thread.sleep(3000L);
} catch (InterruptedException e4) {
y.r(e4);
}
return q(applicationContext, i2 - 1);
}
} catch (KeyChainException | b | IOException | IllegalArgumentException | InterruptedException | CertificateException e5) {
e5.printStackTrace();
y.o(R.string.keyChainAccessError, e5.getLocalizedMessage());
y.n(R.string.keychain_access);
if (Build.VERSION.SDK_INT == 16 && !this.f10575e.matches("^[a-zA-Z0-9]$")) {
y.n(R.string.jelly_keystore_alphanumeric_bug);
}
return null;
}
}
public final byte[] r(byte[] bArr, boolean z) {
PrivateKey t = t();
if (Build.VERSION.SDK_INT == 16) {
return S(t, bArr, z);
}
try {
if (!t.getAlgorithm().equals("EC")) {
Cipher cipher = Cipher.getInstance(z ? "RSA/ECB/PKCS1PADDING" : "RSA/ECB/NoPadding");
cipher.init(1, t);
return cipher.doFinal(bArr);
}
Signature signature = Signature.getInstance("NONEwithECDSA");
signature.initSign(t);
signature.update(bArr);
return signature.sign();
} catch (InvalidKeyException | NoSuchAlgorithmException | SignatureException | BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException e2) {
y.o(R.string.error_rsa_sign, e2.getClass().toString(), e2.getLocalizedMessage());
return null;
}
}
public final X509Certificate[] s(Context context) {
this.o0 = KeyChain.getPrivateKey(context, this.f10575e);
return KeyChain.getCertificateChain(context, this.f10575e);
}
public PrivateKey t() {
return this.o0;
}
public String toString() {
return this.f10574d;
}
public String v() {
return TextUtils.isEmpty(this.f10574d) ? "No profile name" : this.f10574d;
}
public String w() {
String a = s.a(this.p0, true);
return a != null ? a : this.A;
}
public String x() {
String c = s.c(this.p0, true);
if (c != null) {
return c;
}
int i2 = this.c;
if (i2 != 0) {
if (i2 != 1) {
if (i2 != 5) {
if (i2 != 6) {
return null;
}
}
}
return this.f10583m;
}
return this.L;
}
public String y() {
return 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);
}
}