CheetahGram v8.5.4版本的 MD5 值为:3d14e79cc242c314d3933620ff3ab030
以下内容为反编译后的 xa4.java 源代码,内容仅作参考
package org.telegram.messenger.p110;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.transition.ChangeBounds;
import android.transition.Fade;
import android.transition.Transition;
import android.transition.TransitionManager;
import android.transition.TransitionSet;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import co.cheetah.gram.R;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.Utilities;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.ui.ActionBar.a;
import org.telegram.ui.ActionBar.a0;
import org.telegram.ui.Components.EditTextBoldCursor;
import uk.co.chrisjenx.calligraphy.BuildConfig;
public class xa4 extends org.telegram.ui.ActionBar.k {
private pe4[] A;
private int B;
private int G;
private String H;
private String[] I;
private float J;
private float[] Q;
private boolean R;
private ValueAnimator S;
private ClipboardManager T;
private boolean U;
private SharedConfig.ProxyInfo V;
private boolean W;
private ClipboardManager.OnPrimaryClipChangedListener X;
private EditTextBoldCursor[] q;
private ScrollView r;
private LinearLayout s;
private LinearLayout t;
private rr1 u;
private iv4[] v;
private i77[] w;
private o87 x;
private o87 y;
private org.telegram.ui.ActionBar.d z;
class a extends a.h {
a() {
}
@Override
public void b(int i) {
SharedConfig.ProxyInfo proxyInfo;
boolean z;
if (i != -1) {
if (i != 1 || xa4.this.c0() == null) {
return;
}
xa4.this.V.address = xa4.this.q[0].getText().toString();
xa4.this.V.port = Utilities.parseInt(xa4.this.q[1].getText().toString()).intValue();
int i2 = xa4.this.B;
String str = BuildConfig.FLAVOR;
if (i2 == 0) {
xa4.this.V.secret = BuildConfig.FLAVOR;
xa4.this.V.username = xa4.this.q[2].getText().toString();
proxyInfo = xa4.this.V;
str = xa4.this.q[3].getText().toString();
} else {
xa4.this.V.secret = xa4.this.q[4].getText().toString();
xa4.this.V.username = BuildConfig.FLAVOR;
proxyInfo = xa4.this.V;
}
proxyInfo.password = str;
SharedPreferences globalMainSettings = MessagesController.getGlobalMainSettings();
SharedPreferences.Editor edit = globalMainSettings.edit();
if (xa4.this.U) {
SharedConfig.addProxy(xa4.this.V);
SharedConfig.currentProxy = xa4.this.V;
edit.putBoolean("proxy_enabled", true);
z = true;
} else {
boolean z2 = globalMainSettings.getBoolean("proxy_enabled", false);
SharedConfig.saveProxyList();
z = z2;
}
if (xa4.this.U || SharedConfig.currentProxy == xa4.this.V) {
edit.putString("proxy_ip", xa4.this.V.address);
edit.putString("proxy_pass", xa4.this.V.password);
edit.putString("proxy_user", xa4.this.V.username);
edit.putInt("proxy_port", xa4.this.V.port);
edit.putString("proxy_secret", xa4.this.V.secret);
ConnectionsManager.setProxySettings(z, xa4.this.V.address, xa4.this.V.port, xa4.this.V.username, xa4.this.V.password, xa4.this.V.secret);
}
edit.commit();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.proxySettingsChanged, new Object[0]);
}
xa4.this.D();
}
}
class b implements TextWatcher {
b() {
}
@Override
public void afterTextChanged(Editable editable) {
xa4.this.H1(true);
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
}
class c implements TextWatcher {
c() {
}
@Override
public void afterTextChanged(Editable editable) {
if (xa4.this.W) {
return;
}
EditTextBoldCursor editTextBoldCursor = xa4.this.q[1];
int selectionStart = editTextBoldCursor.getSelectionStart();
String obj = editTextBoldCursor.getText().toString();
StringBuilder sb = new StringBuilder(obj.length());
int i = 0;
while (i < obj.length()) {
int i2 = i + 1;
String substring = obj.substring(i, i2);
if ("0123456789".contains(substring)) {
sb.append(substring);
}
i = i2;
}
xa4.this.W = true;
int intValue = Utilities.parseInt(sb.toString()).intValue();
if (intValue < 0 || intValue > 65535 || !obj.equals(sb.toString())) {
editTextBoldCursor.setText(intValue < 0 ? "0" : intValue > 65535 ? "65535" : sb.toString());
} else if (selectionStart >= 0) {
editTextBoldCursor.setSelection(Math.min(selectionStart, editTextBoldCursor.length()));
}
xa4.this.W = false;
xa4.this.H1(true);
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
}
public class d implements Transition.TransitionListener {
final Runnable a;
d(xa4 xa4Var, Runnable runnable) {
this.a = runnable;
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
this.a.run();
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
@Override
public void onTransitionStart(Transition transition) {
}
}
public xa4() {
this.v = new iv4[3];
this.w = new i77[2];
this.A = new pe4[2];
this.B = -1;
this.G = -1;
this.J = 1.0f;
this.Q = new float[2];
this.R = true;
this.X = new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public final void onPrimaryClipChanged() {
xa4.this.S1();
}
};
this.V = new SharedConfig.ProxyInfo(BuildConfig.FLAVOR, 1080, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR);
this.U = true;
}
public xa4(SharedConfig.ProxyInfo proxyInfo) {
this.v = new iv4[3];
this.w = new i77[2];
this.A = new pe4[2];
this.B = -1;
this.G = -1;
this.J = 1.0f;
this.Q = new float[2];
this.R = true;
this.X = new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public final void onPrimaryClipChanged() {
xa4.this.S1();
}
};
this.V = proxyInfo;
}
public void H1(boolean z) {
if (this.x == null || this.z == null) {
return;
}
EditTextBoldCursor[] editTextBoldCursorArr = this.q;
boolean z2 = false;
if (editTextBoldCursorArr[0] == null || editTextBoldCursorArr[1] == null) {
return;
}
if (editTextBoldCursorArr[0].length() != 0 && Utilities.parseInt(this.q[1].getText().toString()).intValue() != 0) {
z2 = true;
}
R1(z2, z);
}
public void I1(View view) {
P1(((Integer) view.getTag()).intValue(), true);
}
public boolean J1(TextView textView, int i, KeyEvent keyEvent) {
if (i != 5) {
if (i != 6) {
return false;
}
D();
return true;
}
int intValue = ((Integer) textView.getTag()).intValue() + 1;
EditTextBoldCursor[] editTextBoldCursorArr = this.q;
if (intValue < editTextBoldCursorArr.length) {
editTextBoldCursorArr[intValue].requestFocus();
}
return true;
}
public void K1() {
AndroidUtilities.hideKeyboard(this.t.findFocus());
for (int i = 0; i < this.I.length; i++) {
int i2 = this.G;
if ((i2 != 0 || i == 4) && (i2 != 1 || i == 2 || i == 3)) {
this.q[i].setText((CharSequence) null);
}
}
}
public void L1(View view) {
EditTextBoldCursor editTextBoldCursor;
String str;
if (this.G == -1) {
return;
}
int i = 0;
while (true) {
String[] strArr = this.I;
if (i >= strArr.length) {
EditTextBoldCursor[] editTextBoldCursorArr = this.q;
editTextBoldCursorArr[0].setSelection(editTextBoldCursorArr[0].length());
Q1(this.G, true, new Runnable() {
@Override
public final void run() {
xa4.this.K1();
}
});
return;
}
int i2 = this.G;
if ((i2 != 0 || i != 4) && (i2 != 1 || (i != 2 && i != 3))) {
if (strArr[i] != null) {
try {
this.q[i].setText(URLDecoder.decode(strArr[i], com.batch.android.core.a.a));
} catch (UnsupportedEncodingException unused) {
editTextBoldCursor = this.q[i];
str = this.I[i];
}
} else {
editTextBoldCursor = this.q[i];
str = null;
}
editTextBoldCursor.setText(str);
}
i++;
}
}
public void M1(View view) {
String str;
String encode;
StringBuilder sb = new StringBuilder();
String obj = this.q[0].getText().toString();
String obj2 = this.q[3].getText().toString();
String obj3 = this.q[2].getText().toString();
String obj4 = this.q[1].getText().toString();
String obj5 = this.q[4].getText().toString();
try {
if (!TextUtils.isEmpty(obj)) {
sb.append("server=");
sb.append(URLEncoder.encode(obj, com.batch.android.core.a.a));
}
if (!TextUtils.isEmpty(obj4)) {
if (sb.length() != 0) {
sb.append("&");
}
sb.append("port=");
sb.append(URLEncoder.encode(obj4, com.batch.android.core.a.a));
}
if (this.B != 1) {
str = "https://t.me/socks?";
if (!TextUtils.isEmpty(obj3)) {
if (sb.length() != 0) {
sb.append("&");
}
sb.append("user=");
sb.append(URLEncoder.encode(obj3, com.batch.android.core.a.a));
}
if (!TextUtils.isEmpty(obj2)) {
if (sb.length() != 0) {
sb.append("&");
}
sb.append("pass=");
encode = URLEncoder.encode(obj2, com.batch.android.core.a.a);
}
if (sb.length() != 0) {
return;
}
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.putExtra("android.intent.extra.TEXT", str + sb.toString());
Intent createChooser = Intent.createChooser(intent, LocaleController.getString("ShareLink", R.string.ShareLink));
createChooser.setFlags(268435456);
c0().startActivity(createChooser);
return;
}
str = "https://t.me/proxy?";
if (sb.length() != 0) {
sb.append("&");
}
sb.append("secret=");
encode = URLEncoder.encode(obj5, com.batch.android.core.a.a);
sb.append(encode);
if (sb.length() != 0) {
}
} catch (Exception unused) {
}
}
public void N1() {
ValueAnimator valueAnimator;
if (this.x != null && ((valueAnimator = this.S) == null || !valueAnimator.isRunning())) {
this.x.setTextColor(org.telegram.ui.ActionBar.w.r1(this.R ? "windowBackgroundWhiteBlueText4" : "windowBackgroundWhiteGrayText2"));
}
if (this.q == null) {
return;
}
int i = 0;
while (true) {
EditTextBoldCursor[] editTextBoldCursorArr = this.q;
if (i >= editTextBoldCursorArr.length) {
return;
}
editTextBoldCursorArr[i].H(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteInputField"), org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteInputFieldActivated"), org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteRedText3"));
i++;
}
}
public void O1(ValueAnimator valueAnimator) {
this.J = AndroidUtilities.lerp(this.Q, valueAnimator.getAnimatedFraction());
this.x.setTextColor(hj0.c(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteGrayText2"), org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlueText4"), this.J));
this.z.setAlpha((this.J / 2.0f) + 0.5f);
}
private void P1(int i, boolean z) {
Q1(i, z, null);
}
private void Q1(int i, boolean z, Runnable runnable) {
if (this.B != i) {
this.B = i;
int i2 = Build.VERSION.SDK_INT;
if (i2 >= 23) {
TransitionManager.endTransitions(this.s);
}
if (z && i2 >= 21) {
TransitionSet duration = new TransitionSet().addTransition(new Fade(2)).addTransition(new ChangeBounds()).addTransition(new Fade(1)).setInterpolator((TimeInterpolator) zq0.f).setDuration(250L);
if (runnable != null) {
duration.addListener((Transition.TransitionListener) new d(this, runnable));
}
TransitionManager.beginDelayedTransition(this.s, duration);
}
int i3 = this.B;
if (i3 == 0) {
this.w[0].setVisibility(0);
this.w[1].setVisibility(8);
((View) this.q[4].getParent()).setVisibility(8);
((View) this.q[3].getParent()).setVisibility(0);
((View) this.q[2].getParent()).setVisibility(0);
} else if (i3 == 1) {
this.w[0].setVisibility(8);
this.w[1].setVisibility(0);
((View) this.q[4].getParent()).setVisibility(0);
((View) this.q[3].getParent()).setVisibility(8);
((View) this.q[2].getParent()).setVisibility(8);
}
this.A[0].b(this.B == 0, z);
this.A[1].b(this.B == 1, z);
}
}
private void R1(boolean z, boolean z2) {
if (this.R != z) {
ValueAnimator valueAnimator = this.S;
if (valueAnimator != null) {
valueAnimator.cancel();
} else if (z2) {
ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
this.S = ofFloat;
ofFloat.setDuration(200L);
this.S.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public final void onAnimationUpdate(ValueAnimator valueAnimator2) {
xa4.this.O1(valueAnimator2);
}
});
}
if (z2) {
float[] fArr = this.Q;
fArr[0] = this.J;
fArr[1] = z ? 1.0f : 0.0f;
this.S.start();
} else {
this.J = z ? 1.0f : 0.0f;
this.x.setTextColor(org.telegram.ui.ActionBar.w.r1(z ? "windowBackgroundWhiteBlueText4" : "windowBackgroundWhiteGrayText2"));
this.z.setAlpha(z ? 1.0f : 0.5f);
}
this.x.setEnabled(z);
this.z.setEnabled(z);
this.R = z;
}
}
public void S1() {
String str;
char c2;
ClipData primaryClip = this.T.getPrimaryClip();
String[] strArr = null;
if (primaryClip != null && primaryClip.getItemCount() > 0) {
try {
str = primaryClip.getItemAt(0).coerceToText(this.e.getContext()).toString();
} catch (Exception unused) {
}
if (TextUtils.equals(str, this.H)) {
this.G = -1;
this.H = str;
this.I = new String[this.q.length];
if (str != null) {
String[] strArr2 = {"t.me/socks?", "tg://socks?"};
int i = 0;
while (true) {
if (i >= 2) {
break;
}
int indexOf = str.indexOf(strArr2[i]);
if (indexOf >= 0) {
this.G = 0;
strArr = str.substring(indexOf + strArr2[i].length()).split("&");
break;
}
i++;
}
if (strArr == null) {
String[] strArr3 = {"t.me/proxy?", "tg://proxy?"};
int i2 = 0;
while (true) {
if (i2 >= 2) {
break;
}
int indexOf2 = str.indexOf(strArr3[i2]);
if (indexOf2 >= 0) {
this.G = 1;
strArr = str.substring(indexOf2 + strArr3[i2].length()).split("&");
break;
}
i2++;
}
}
if (strArr != null) {
for (String str2 : strArr) {
String[] split = str2.split("=");
if (split.length == 2) {
String lowerCase = split[0].toLowerCase();
lowerCase.hashCode();
switch (lowerCase.hashCode()) {
case -906277200:
if (lowerCase.equals("secret")) {
c2 = 0;
break;
}
break;
case -905826493:
if (lowerCase.equals("server")) {
c2 = 1;
break;
}
break;
case 3433489:
if (lowerCase.equals("pass")) {
c2 = 2;
break;
}
break;
case 3446913:
if (lowerCase.equals("port")) {
c2 = 3;
break;
}
break;
case 3599307:
if (lowerCase.equals("user")) {
c2 = 4;
break;
}
break;
}
c2 = 65535;
switch (c2) {
case 0:
if (this.G == 1) {
this.I[4] = split[1];
break;
} else {
break;
}
case 1:
this.I[0] = split[1];
break;
case 2:
if (this.G == 0) {
this.I[3] = split[1];
break;
} else {
break;
}
case 3:
this.I[1] = split[1];
break;
case 4:
if (this.G == 0) {
this.I[2] = split[1];
break;
} else {
break;
}
}
}
}
}
}
if (this.G != -1) {
if (this.y.getVisibility() != 0) {
this.y.setVisibility(0);
this.v[2].setVisibility(0);
return;
}
return;
}
if (this.y.getVisibility() != 8) {
this.y.setVisibility(8);
this.v[2].setVisibility(8);
return;
}
return;
}
return;
}
str = null;
if (TextUtils.equals(str, this.H)) {
}
}
@Override
public void H0() {
super.H0();
this.T.removePrimaryClipChangedListener(this.X);
}
@Override
public void M0() {
super.M0();
AndroidUtilities.requestAdjustResize(c0(), this.k);
this.T.addPrimaryClipChangedListener(this.X);
S1();
}
@Override
public void O0(boolean z, boolean z2) {
if (z && !z2 && this.U) {
this.q[0].requestFocus();
AndroidUtilities.showKeyboard(this.q[0]);
}
}
@Override
public ArrayList<org.telegram.ui.ActionBar.a0> i0() {
a0.a aVar = new a0.a() {
@Override
public void a(float f) {
aa7.a(this, f);
}
@Override
public final void b() {
xa4.this.N1();
}
};
ArrayList<org.telegram.ui.ActionBar.a0> arrayList = new ArrayList<>();
arrayList.add(new org.telegram.ui.ActionBar.a0(this.e, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "windowBackgroundGray"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.r, org.telegram.ui.ActionBar.a0.F, null, null, null, null, "actionBarDefault"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.w, null, null, null, null, "actionBarDefaultIcon"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.x, null, null, null, null, "actionBarDefaultTitle"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.y, null, null, null, null, "actionBarDefaultSelector"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.R, null, null, null, null, "actionBarDefaultSearch"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.g, org.telegram.ui.ActionBar.a0.Q, null, null, null, null, "actionBarDefaultSearchPlaceholder"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.t, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.s, 0, new Class[]{View.class}, org.telegram.ui.ActionBar.w.l0, null, null, "divider"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.x, org.telegram.ui.ActionBar.a0.S, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.x, org.telegram.ui.ActionBar.a0.S, null, null, null, null, "listSelectorSDK21"));
arrayList.add(new org.telegram.ui.ActionBar.a0((View) null, 0, (Class[]) null, (String[]) null, (Paint[]) null, (Drawable[]) null, aVar, "windowBackgroundWhiteBlueText4"));
arrayList.add(new org.telegram.ui.ActionBar.a0((View) null, 0, (Class[]) null, (String[]) null, (Paint[]) null, (Drawable[]) null, aVar, "windowBackgroundWhiteGrayText2"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.y, org.telegram.ui.ActionBar.a0.S, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.y, org.telegram.ui.ActionBar.a0.S, null, null, null, null, "listSelectorSDK21"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.y, 0, new Class[]{o87.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueText4"));
for (int i = 0; i < this.A.length; i++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.A[i], org.telegram.ui.ActionBar.a0.S, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.A[i], org.telegram.ui.ActionBar.a0.S, null, null, null, null, "listSelectorSDK21"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.A[i], 0, new Class[]{pe4.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlackText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.A[i], org.telegram.ui.ActionBar.a0.D, new Class[]{pe4.class}, new String[]{"radioButton"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "radioBackground"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.A[i], org.telegram.ui.ActionBar.a0.E, new Class[]{pe4.class}, new String[]{"radioButton"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "radioBackgroundChecked"));
}
if (this.q != null) {
for (int i2 = 0; i2 < this.q.length; i2++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.q[i2], org.telegram.ui.ActionBar.a0.s, null, null, null, null, "windowBackgroundWhiteBlackText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.q[i2], org.telegram.ui.ActionBar.a0.N, null, null, null, null, "windowBackgroundWhiteHintText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.q[i2], org.telegram.ui.ActionBar.a0.N | org.telegram.ui.ActionBar.a0.B, null, null, null, null, "windowBackgroundWhiteBlueHeader"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.q[i2], org.telegram.ui.ActionBar.a0.O, null, null, null, null, "windowBackgroundWhiteBlackText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "windowBackgroundWhiteInputField"));
arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "windowBackgroundWhiteInputFieldActivated"));
arrayList.add(new org.telegram.ui.ActionBar.a0(null, 0, null, null, null, aVar, "windowBackgroundWhiteRedText3"));
}
} else {
arrayList.add(new org.telegram.ui.ActionBar.a0(null, org.telegram.ui.ActionBar.a0.s, null, null, null, null, "windowBackgroundWhiteBlackText"));
arrayList.add(new org.telegram.ui.ActionBar.a0(null, org.telegram.ui.ActionBar.a0.N, null, null, null, null, "windowBackgroundWhiteHintText"));
}
arrayList.add(new org.telegram.ui.ActionBar.a0(this.u, org.telegram.ui.ActionBar.a0.q, null, null, null, null, "windowBackgroundWhite"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.u, 0, new Class[]{rr1.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteBlueHeader"));
int i3 = 0;
while (true) {
iv4[] iv4VarArr = this.v;
if (i3 >= iv4VarArr.length) {
break;
}
if (iv4VarArr[i3] != null) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.v[i3], org.telegram.ui.ActionBar.a0.v, new Class[]{iv4.class}, null, null, null, "windowBackgroundGrayShadow"));
}
i3++;
}
for (int i4 = 0; i4 < this.w.length; i4++) {
arrayList.add(new org.telegram.ui.ActionBar.a0(this.w[i4], org.telegram.ui.ActionBar.a0.v, new Class[]{i77.class}, null, null, null, "windowBackgroundGrayShadow"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.w[i4], 0, new Class[]{i77.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteGrayText4"));
arrayList.add(new org.telegram.ui.ActionBar.a0(this.w[i4], org.telegram.ui.ActionBar.a0.r, new Class[]{i77.class}, new String[]{"textView"}, (Paint[]) null, (Drawable[]) null, (a0.a) null, "windowBackgroundWhiteLinkText"));
}
return arrayList;
}
@Override
public View z(Context context) {
EditTextBoldCursor editTextBoldCursor;
TextWatcher cVar;
EditTextBoldCursor editTextBoldCursor2;
String str;
this.g.setTitle(LocaleController.getString("ProxyDetails", R.string.ProxyDetails));
this.g.setBackButtonImage(org.telegram.messenger.R.drawable.ic_ab_back);
this.g.setAllowOverlayTitle(false);
if (AndroidUtilities.isTablet()) {
this.g.setOccupyStatusBar(false);
}
this.g.setActionBarMenuOnItemClick(new a());
org.telegram.ui.ActionBar.d i = this.g.z().i(1, org.telegram.messenger.R.drawable.ic_done, AndroidUtilities.dp(56.0f));
this.z = i;
i.setContentDescription(LocaleController.getString("Done", R.string.Done));
FrameLayout frameLayout = new FrameLayout(context);
this.e = frameLayout;
FrameLayout frameLayout2 = frameLayout;
frameLayout.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundGray"));
ScrollView scrollView = new ScrollView(context);
this.r = scrollView;
scrollView.setFillViewport(true);
AndroidUtilities.setScrollViewEdgeEffectColor(this.r, org.telegram.ui.ActionBar.w.r1("actionBarDefault"));
frameLayout2.addView(this.r, g52.a(-1, -1.0f));
LinearLayout linearLayout = new LinearLayout(context);
this.s = linearLayout;
linearLayout.setOrientation(1);
this.r.addView(this.s, new FrameLayout.LayoutParams(-1, -2));
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public final void onClick(View view) {
xa4.this.I1(view);
}
};
int i2 = 0;
while (i2 < 2) {
this.A[i2] = new pe4(context);
this.A[i2].setBackground(org.telegram.ui.ActionBar.w.T1(true));
this.A[i2].setTag(Integer.valueOf(i2));
pe4[] pe4VarArr = this.A;
if (i2 == 0) {
pe4VarArr[i2].d(LocaleController.getString("UseProxySocks5", R.string.UseProxySocks5), i2 == this.B, true);
} else {
pe4VarArr[i2].d(LocaleController.getString("UseProxyTelegram", R.string.UseProxyTelegram), i2 == this.B, false);
}
this.s.addView(this.A[i2], g52.f(-1, 50));
this.A[i2].setOnClickListener(onClickListener);
i2++;
}
this.v[0] = new iv4(context);
this.s.addView(this.v[0], g52.f(-1, -2));
LinearLayout linearLayout2 = new LinearLayout(context);
this.t = linearLayout2;
linearLayout2.setOrientation(1);
this.t.setBackgroundColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhite"));
if (Build.VERSION.SDK_INT >= 21) {
this.t.setElevation(AndroidUtilities.dp(1.0f));
this.t.setOutlineProvider(null);
}
this.s.addView(this.t, g52.f(-1, -2));
this.q = new EditTextBoldCursor[5];
int i3 = 0;
for (int i4 = 5; i3 < i4; i4 = 5) {
FrameLayout frameLayout3 = new FrameLayout(context);
this.t.addView(frameLayout3, g52.f(-1, 64));
this.q[i3] = new EditTextBoldCursor(context);
this.q[i3].setTag(Integer.valueOf(i3));
this.q[i3].setTextSize(1, 16.0f);
this.q[i3].setHintColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteHintText"));
this.q[i3].setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlackText"));
this.q[i3].setBackground(null);
this.q[i3].setCursorColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlackText"));
this.q[i3].setCursorSize(AndroidUtilities.dp(20.0f));
this.q[i3].setCursorWidth(1.5f);
this.q[i3].setSingleLine(true);
this.q[i3].setGravity((LocaleController.isRTL ? 5 : 3) | 16);
this.q[i3].setHeaderHintColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlueHeader"));
this.q[i3].setTransformHintToHeader(true);
this.q[i3].H(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteInputField"), org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteInputFieldActivated"), org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteRedText3"));
if (i3 == 0) {
this.q[i3].setInputType(524305);
editTextBoldCursor = this.q[i3];
cVar = new b();
} else {
EditTextBoldCursor[] editTextBoldCursorArr = this.q;
if (i3 == 1) {
editTextBoldCursorArr[i3].setInputType(2);
editTextBoldCursor = this.q[i3];
cVar = new c();
} else {
if (i3 == 3) {
editTextBoldCursorArr[i3].setInputType(129);
this.q[i3].setTypeface(Typeface.DEFAULT);
this.q[i3].setTransformationMethod(PasswordTransformationMethod.getInstance());
} else {
editTextBoldCursorArr[i3].setInputType(524289);
}
this.q[i3].setImeOptions(268435461);
if (i3 != 0) {
this.q[i3].setHintText(LocaleController.getString("UseProxyAddress", R.string.UseProxyAddress));
editTextBoldCursor2 = this.q[i3];
str = this.V.address;
} else if (i3 == 1) {
this.q[i3].setHintText(LocaleController.getString("UseProxyPort", R.string.UseProxyPort));
editTextBoldCursor2 = this.q[i3];
str = BuildConfig.FLAVOR + this.V.port;
} else if (i3 == 2) {
this.q[i3].setHintText(LocaleController.getString("UseProxyUsername", R.string.UseProxyUsername));
editTextBoldCursor2 = this.q[i3];
str = this.V.username;
} else if (i3 != 3) {
if (i3 == 4) {
this.q[i3].setHintText(LocaleController.getString("UseProxySecret", R.string.UseProxySecret));
editTextBoldCursor2 = this.q[i3];
str = this.V.secret;
}
EditTextBoldCursor[] editTextBoldCursorArr2 = this.q;
editTextBoldCursorArr2[i3].setSelection(editTextBoldCursorArr2[i3].length());
this.q[i3].setPadding(0, 0, 0, 0);
frameLayout3.addView(this.q[i3], g52.b(-1, -1.0f, 51, 17.0f, i3 == 0 ? 12.0f : 0.0f, 17.0f, 0.0f));
this.q[i3].setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i5, KeyEvent keyEvent) {
boolean J1;
J1 = xa4.this.J1(textView, i5, keyEvent);
return J1;
}
});
i3++;
} else {
this.q[i3].setHintText(LocaleController.getString("UseProxyPassword", R.string.UseProxyPassword));
editTextBoldCursor2 = this.q[i3];
str = this.V.password;
}
editTextBoldCursor2.setText(str);
EditTextBoldCursor[] editTextBoldCursorArr22 = this.q;
editTextBoldCursorArr22[i3].setSelection(editTextBoldCursorArr22[i3].length());
this.q[i3].setPadding(0, 0, 0, 0);
frameLayout3.addView(this.q[i3], g52.b(-1, -1.0f, 51, 17.0f, i3 == 0 ? 12.0f : 0.0f, 17.0f, 0.0f));
this.q[i3].setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i5, KeyEvent keyEvent) {
boolean J1;
J1 = xa4.this.J1(textView, i5, keyEvent);
return J1;
}
});
i3++;
}
}
editTextBoldCursor.addTextChangedListener(cVar);
this.q[i3].setImeOptions(268435461);
if (i3 != 0) {
}
editTextBoldCursor2.setText(str);
EditTextBoldCursor[] editTextBoldCursorArr222 = this.q;
editTextBoldCursorArr222[i3].setSelection(editTextBoldCursorArr222[i3].length());
this.q[i3].setPadding(0, 0, 0, 0);
frameLayout3.addView(this.q[i3], g52.b(-1, -1.0f, 51, 17.0f, i3 == 0 ? 12.0f : 0.0f, 17.0f, 0.0f));
this.q[i3].setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i5, KeyEvent keyEvent) {
boolean J1;
J1 = xa4.this.J1(textView, i5, keyEvent);
return J1;
}
});
i3++;
}
for (int i5 = 0; i5 < 2; i5++) {
this.w[i5] = new i77(context);
this.w[i5].setBackground(org.telegram.ui.ActionBar.w.h2(context, org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundGrayShadow"));
i77[] i77VarArr = this.w;
if (i5 == 0) {
i77VarArr[i5].setText(LocaleController.getString("UseProxyInfo", R.string.UseProxyInfo));
} else {
i77VarArr[i5].setText(LocaleController.getString("UseProxyTelegramInfo", R.string.UseProxyTelegramInfo) + "\n\n" + LocaleController.getString("UseProxyTelegramInfo2", R.string.UseProxyTelegramInfo2));
this.w[i5].setVisibility(8);
}
this.s.addView(this.w[i5], g52.f(-1, -2));
}
o87 o87Var = new o87(this.e.getContext());
this.y = o87Var;
o87Var.setBackground(org.telegram.ui.ActionBar.w.T1(true));
this.y.c(LocaleController.getString("PasteFromClipboard", R.string.PasteFromClipboard), false);
this.y.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlueText4"));
this.y.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
xa4.this.L1(view);
}
});
this.s.addView(this.y, 0, g52.f(-1, -2));
this.y.setVisibility(8);
this.v[2] = new iv4(this.e.getContext());
this.v[2].setBackground(org.telegram.ui.ActionBar.w.h2(this.e.getContext(), org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundGrayShadow"));
this.s.addView(this.v[2], 1, g52.f(-1, -2));
this.v[2].setVisibility(8);
o87 o87Var2 = new o87(context);
this.x = o87Var2;
o87Var2.setBackgroundDrawable(org.telegram.ui.ActionBar.w.T1(true));
this.x.c(LocaleController.getString("ShareFile", R.string.ShareFile), false);
this.x.setTextColor(org.telegram.ui.ActionBar.w.r1("windowBackgroundWhiteBlueText4"));
this.s.addView(this.x, g52.f(-1, -2));
this.x.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
xa4.this.M1(view);
}
});
this.v[1] = new iv4(context);
this.v[1].setBackgroundDrawable(org.telegram.ui.ActionBar.w.h2(context, org.telegram.messenger.R.drawable.greydivider_bottom, "windowBackgroundGrayShadow"));
this.s.addView(this.v[1], g52.f(-1, -2));
this.T = (ClipboardManager) context.getSystemService("clipboard");
this.R = true;
this.J = 1.0f;
H1(false);
this.B = -1;
P1(!TextUtils.isEmpty(this.V.secret) ? 1 : 0, false);
this.G = -1;
this.H = null;
S1();
return this.e;
}
}