CheetahGram v8.5.4版本的 MD5 值为:3d14e79cc242c314d3933620ff3ab030
以下内容为反编译后的 w.java 源代码,内容仅作参考
package org.telegram.ui.ActionBar;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.CornerPathEffect;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.NinePatchDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.graphics.drawable.shapes.RoundRectShape;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.net.Uri;
import android.os.Build;
import android.os.SystemClock;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.Base64;
import android.util.LongSparseArray;
import android.util.SparseArray;
import android.util.StateSet;
import android.view.View;
import co.cheetah.gram.R;
import com.viewbadger.helperlib.NatHelper;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import org.json.JSONArray;
import org.json.JSONObject;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.Bitmaps;
import org.telegram.messenger.BuildVars;
import org.telegram.messenger.ChatThemeController;
import org.telegram.messenger.DispatchQueue;
import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaController;
import org.telegram.messenger.MessageObject;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.SvgHelper;
import org.telegram.messenger.UserConfig;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.p110.a27;
import org.telegram.messenger.p110.ai5;
import org.telegram.messenger.p110.b36;
import org.telegram.messenger.p110.bi5;
import org.telegram.messenger.p110.cu6;
import org.telegram.messenger.p110.d17;
import org.telegram.messenger.p110.dh3;
import org.telegram.messenger.p110.dj1;
import org.telegram.messenger.p110.e17;
import org.telegram.messenger.p110.eg4;
import org.telegram.messenger.p110.ga5;
import org.telegram.messenger.p110.ge5;
import org.telegram.messenger.p110.hj0;
import org.telegram.messenger.p110.i95;
import org.telegram.messenger.p110.j27;
import org.telegram.messenger.p110.j72;
import org.telegram.messenger.p110.jj0;
import org.telegram.messenger.p110.k9;
import org.telegram.messenger.p110.k95;
import org.telegram.messenger.p110.kz2;
import org.telegram.messenger.p110.le5;
import org.telegram.messenger.p110.m27;
import org.telegram.messenger.p110.m85;
import org.telegram.messenger.p110.me5;
import org.telegram.messenger.p110.n27;
import org.telegram.messenger.p110.nd;
import org.telegram.messenger.p110.o9;
import org.telegram.messenger.p110.oe5;
import org.telegram.messenger.p110.ov5;
import org.telegram.messenger.p110.qt4;
import org.telegram.messenger.p110.s26;
import org.telegram.messenger.p110.sg3;
import org.telegram.messenger.p110.st4;
import org.telegram.messenger.p110.t34;
import org.telegram.messenger.p110.ug0;
import org.telegram.messenger.p110.uj4;
import org.telegram.messenger.p110.v35;
import org.telegram.messenger.p110.vs3;
import org.telegram.messenger.p110.wj4;
import org.telegram.messenger.p110.xa5;
import org.telegram.messenger.p110.xf5;
import org.telegram.messenger.p110.xh5;
import org.telegram.messenger.p110.xk7;
import org.telegram.messenger.p110.xl4;
import org.telegram.messenger.p110.yh5;
import org.telegram.messenger.p110.z17;
import org.telegram.messenger.p110.zh5;
import org.telegram.messenger.time.SunDate;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.ui.ActionBar.w;
import org.telegram.ui.Components.RLottieDrawable;
import org.telegram.ui.Components.ThemeEditorView;
import org.telegram.ui.Components.o;
import org.telegram.ui.Components.p1;
import uk.co.chrisjenx.calligraphy.BuildConfig;
public class w {
public static Paint A0 = null;
public static RLottieDrawable A1 = null;
public static TextPaint A2 = null;
public static Drawable A3 = null;
public static Drawable A4 = null;
public static Paint B0 = null;
public static RLottieDrawable B1 = null;
public static TextPaint B2 = null;
public static Drawable B3 = null;
public static Drawable B4 = null;
public static TextPaint[] C0 = null;
public static RLottieDrawable C1 = null;
public static TextPaint C2 = null;
public static Drawable C3 = null;
private static nd C4 = null;
public static ArrayList<v> D = null;
public static TextPaint[] D0 = null;
public static TextPaint D1 = null;
public static TextPaint D2 = null;
public static Drawable D3 = null;
private static HashMap<MessageObject, nd> D4 = null;
public static TextPaint E0 = null;
public static Drawable E1 = null;
public static TextPaint E2 = null;
public static Drawable E3 = null;
private static ArrayList<v> F = null;
public static TextPaint F0 = null;
public static Drawable F1 = null;
public static TextPaint F2 = null;
public static Drawable F3 = null;
private static HashMap<String, v> G = null;
public static TextPaint[] G0 = null;
public static Paint G1 = null;
public static Drawable G2 = null;
public static Drawable G3 = null;
private static v H = null;
public static TextPaint H0 = null;
public static Paint H1 = null;
public static Drawable H2 = null;
public static Drawable H3 = null;
private static v I = null;
public static TextPaint[] I0 = null;
public static Paint I1 = null;
public static Drawable I2 = null;
public static Drawable I3 = null;
private static v J = null;
public static TextPaint J0 = null;
public static Paint J1 = null;
public static Drawable J2 = null;
public static Drawable J3 = null;
private static v K = null;
public static TextPaint K0 = null;
public static Paint K1 = null;
public static p K2 = null;
public static Drawable K3 = null;
private static v L = null;
public static TextPaint L0 = null;
public static Paint L1 = null;
public static p L2 = null;
public static Drawable L3 = null;
private static boolean M = false;
public static TextPaint M0 = null;
public static Paint M1 = null;
public static p M2 = null;
public static Drawable M3 = null;
private static HashMap<String, Integer> M4 = null;
private static boolean N = false;
public static TextPaint N0 = null;
public static Paint N1 = null;
public static p N2 = null;
public static Drawable N3 = null;
private static HashMap<String, String> N4 = null;
private static boolean O = false;
public static TextPaint O0 = null;
public static Paint O1 = null;
public static p O2 = null;
public static Drawable O3 = null;
private static HashSet<String> O4 = null;
private static boolean P = false;
public static Drawable P0 = null;
public static Paint P1 = null;
public static p P2 = null;
public static Drawable P3 = null;
private static HashMap<String, Integer> P4 = null;
private static boolean Q = false;
public static Drawable Q0 = null;
public static Paint Q1 = null;
public static p Q2 = null;
public static Drawable Q3 = null;
private static HashMap<String, Integer> Q4 = null;
private static int R = 0;
public static Drawable R0 = null;
public static Paint R1 = null;
public static p R2 = null;
public static Drawable R3 = null;
private static HashMap<String, Integer> R4 = null;
private static int S = 0;
public static Drawable S0 = null;
public static Paint S1 = null;
public static Drawable S3 = null;
private static boolean S4 = false;
private static long T = 0;
public static Drawable T0 = null;
public static Paint T1 = null;
public static vs3 T2 = null;
public static Drawable T3 = null;
private static ThreadLocal<float[]> T4 = null;
private static o.c U = null;
public static Drawable U0 = null;
public static Paint U1 = null;
public static Drawable U2 = null;
public static Drawable U3 = null;
private static ThreadLocal<float[]> U4 = null;
private static boolean V = false;
public static Drawable V0 = null;
public static Paint V1 = null;
public static Drawable V2 = null;
public static Drawable V3 = null;
private static ThreadLocal<float[]> V4 = null;
private static int W = 0;
public static Drawable W0 = null;
public static Paint W1 = null;
public static Drawable W2 = null;
public static Drawable W3 = null;
private static ThreadLocal<float[]> W4 = null;
private static Bitmap X = null;
public static Drawable X0 = null;
public static Paint X1 = null;
public static Drawable X2 = null;
public static Drawable X3 = null;
private static ThreadLocal<float[]> X4 = null;
public static BitmapShader Y = null;
public static Drawable Y0 = null;
public static Paint Y1 = null;
public static Drawable Y2 = null;
public static Drawable Y3 = null;
private static dj1 Y4 = null;
private static Matrix Z = null;
public static Drawable Z0 = null;
public static Paint Z1 = null;
public static Drawable Z2 = null;
public static Drawable Z3 = null;
private static wj4 Z4 = null;
private static int a0 = 0;
public static Drawable a1 = null;
public static Paint a2 = null;
public static dh3 a3 = null;
public static Drawable a4 = null;
private static Method a5 = null;
private static Runnable b = null;
public static int b0 = 0;
public static Drawable b1 = null;
public static TextPaint b2 = null;
public static Drawable b3 = null;
private static SensorEventListener b5 = null;
private static SensorManager c = null;
public static int c0 = 0;
public static xl4 c1 = null;
public static TextPaint c2 = null;
public static Drawable c3 = null;
private static int[] c5 = null;
private static Sensor d = null;
private static int d0 = 0;
public static xl4 d1 = null;
public static TextPaint d2 = null;
public static Drawable d3 = null;
private static boolean e = false;
private static int e0 = 0;
public static Drawable e1 = null;
public static TextPaint e2 = null;
public static Drawable e3 = null;
private static float f = 1.0f;
private static Drawable f0;
public static Drawable f1;
public static TextPaint f2;
public static Drawable f3;
private static long g;
private static Drawable g0;
public static Drawable g1;
public static TextPaint g2;
public static Drawable g3;
private static boolean h;
private static int h0;
public static Drawable h1;
public static TextPaint h2;
public static Drawable h3;
private static boolean i;
private static String i0;
public static Drawable i1;
public static TextPaint i2;
public static Drawable i3;
private static boolean j0;
public static RLottieDrawable j1;
public static TextPaint j2;
public static Drawable j3;
public static Drawable j4;
private static boolean k0;
public static RLottieDrawable k1;
public static TextPaint k2;
public static Drawable k3;
public static Drawable k4;
public static Paint l0;
public static RLottieDrawable l1;
public static TextPaint l2;
public static Drawable l3;
public static Drawable l4;
public static int m;
public static Paint m0;
public static RLottieDrawable m1;
public static TextPaint m2;
public static Drawable m3;
public static Drawable m4;
public static boolean n;
public static Paint n0;
public static RLottieDrawable n1;
public static TextPaint n2;
public static Drawable n3;
public static Drawable n4;
public static float o;
public static Paint o0;
public static RLottieDrawable o1;
public static TextPaint o2;
public static Drawable o3;
public static int p;
public static Paint p0;
public static boolean p1;
public static TextPaint p2;
public static Drawable p3;
public static int q;
public static Paint q0;
public static boolean q1;
public static TextPaint q2;
public static Drawable q3;
public static int r;
public static Paint r0;
public static boolean r1;
public static TextPaint r2;
public static Drawable r3;
public static int s;
private static int s1;
public static TextPaint s2;
public static Drawable s3;
public static int t;
public static Drawable t0;
private static int t1;
public static TextPaint t2;
public static Drawable t3;
public static String u;
public static Paint u0;
private static long u1;
public static TextPaint u2;
public static Drawable u3;
public static Drawable u4;
public static double v;
public static Paint v0;
private static boolean v1;
public static TextPaint v2;
public static Drawable v3;
public static Drawable v4;
public static double w;
public static Paint w0;
public static RLottieDrawable w1;
public static TextPaint w2;
public static Drawable w3;
public static Drawable w4;
public static Paint x0;
public static RLottieDrawable x1;
public static TextPaint x2;
public static Drawable x3;
public static Drawable x4;
private static int y;
public static Paint y0;
public static RLottieDrawable y1;
public static TextPaint y2;
public static Drawable y3;
private static int z;
public static Paint z0;
public static RLottieDrawable z1;
public static TextPaint z2;
public static Drawable z3;
private static final Object a = new Object();
private static Runnable j = new g();
private static Runnable k = new h();
public static int l = 99;
private static Paint x = new Paint(1);
private static boolean[] A = new boolean[3];
private static int[] B = new int[3];
private static long[] C = new long[3];
public static final ArrayList<p1.i> E = new ArrayList<>();
public static Drawable[] s0 = new Drawable[12];
private static v35[] S2 = new v35[6];
public static Drawable[] b4 = new Drawable[2];
public static Drawable[] c4 = new Drawable[2];
public static Drawable[] d4 = new Drawable[2];
public static Drawable[] e4 = new Drawable[2];
public static Drawable[] f4 = new Drawable[2];
public static Drawable[] g4 = new Drawable[2];
public static Drawable[] h4 = new Drawable[2];
public static Drawable[] i4 = new Drawable[2];
public static RLottieDrawable[] o4 = new RLottieDrawable[6];
public static Drawable[] p4 = new Drawable[2];
public static Drawable[] q4 = new Drawable[2];
public static Drawable[][] r4 = (Drawable[][]) Array.newInstance((Class<?>) Drawable.class, 10, 2);
public static jj0[][] s4 = (jj0[][]) Array.newInstance((Class<?>) jj0.class, 6, 2);
public static Drawable[][] t4 = (Drawable[][]) Array.newInstance((Class<?>) Drawable.class, 13, 2);
public static Path[] y4 = new Path[2];
public static Path[] z4 = new Path[3];
public static String[] E4 = {"avatar_backgroundRed", "avatar_backgroundOrange", "avatar_backgroundViolet", "avatar_backgroundGreen", "avatar_backgroundCyan", "avatar_backgroundBlue", "avatar_backgroundPink"};
public static String[] F4 = {"avatar_nameInMessageRed", "avatar_nameInMessageOrange", "avatar_nameInMessageViolet", "avatar_nameInMessageGreen", "avatar_nameInMessageCyan", "avatar_nameInMessageBlue", "avatar_nameInMessagePink"};
private static final HashMap<String, Drawable> G4 = new HashMap<>();
private static final HashMap<String, String> H4 = new HashMap<>();
private static final HashMap<String, Paint> I4 = new HashMap<>();
private static final HashMap<String, String> J4 = new HashMap<>();
private static HashSet<String> K4 = new HashSet<>();
private static HashSet<String> L4 = new HashSet<>();
class a implements SensorEventListener {
a() {
}
@Override
public void onAccuracyChanged(Sensor sensor, int i) {
}
@Override
public void onSensorChanged(SensorEvent sensorEvent) {
Runnable runnable;
float f = sensorEvent.values[0];
if (f <= 0.0f) {
f = 0.1f;
}
if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) {
return;
}
float unused = w.f = f > 500.0f ? 1.0f : ((float) Math.ceil((Math.log(f) * 9.932299613952637d) + 27.05900001525879d)) / 100.0f;
if (w.f > w.o) {
if (w.i) {
boolean unused2 = w.i = false;
AndroidUtilities.cancelRunOnUIThread(w.k);
}
if (w.h) {
return;
}
boolean unused3 = w.h = true;
runnable = w.j;
} else {
if (MediaController.getInstance().isRecordingOrListeningByProximity()) {
return;
}
if (w.h) {
boolean unused4 = w.h = false;
AndroidUtilities.cancelRunOnUIThread(w.j);
}
if (w.i) {
return;
}
boolean unused5 = w.i = true;
runnable = w.k;
}
AndroidUtilities.runOnUIThread(runnable, w.H());
}
}
public class b implements Runnable {
final ArrayList a;
final int b;
b(ArrayList arrayList, int i) {
this.a = arrayList;
this.b = i;
}
public static void b(ArrayList arrayList) {
ArrayList<p1.i> arrayList2 = w.E;
arrayList2.clear();
arrayList2.addAll(arrayList);
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.emojiPreviewThemesChanged, new Object[0]);
}
@Override
public void run() {
for (int i = 0; i < this.a.size(); i++) {
((p1.i) this.a.get(i)).a.A(this.b);
}
final ArrayList arrayList = this.a;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
w.b.b(arrayList);
}
});
}
}
public class c extends p {
final HashMap O;
c(int i, boolean z, boolean z2, HashMap hashMap) {
super(i, z, z2);
this.O = hashMap;
}
@Override
protected int g(String str) {
Integer num = (Integer) this.O.get(str);
if (num == null) {
num = (Integer) w.M4.get(str);
}
return num.intValue();
}
@Override
protected Integer h(String str) {
return (Integer) this.O.get(str);
}
}
public class d extends o.e {
d() {
}
@Override
public void b(int i, int i2) {
Point point = AndroidUtilities.displaySize;
if ((point.x <= point.y) == (i <= i2)) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
}
}
}
public class e extends o.e {
e() {
}
@Override
public void b(int i, int i2) {
Point point = AndroidUtilities.displaySize;
if ((point.x <= point.y) == (i <= i2)) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
}
}
}
class f extends o.e {
final boolean a;
final View b;
f(boolean z, View view) {
this.a = z;
this.b = view;
}
@Override
public void b(int i, int i2) {
if (!this.a) {
Point point = AndroidUtilities.displaySize;
if ((point.x <= point.y) != (i <= i2)) {
return;
}
}
this.b.invalidate();
}
}
public class g implements Runnable {
g() {
}
@Override
public void run() {
boolean unused = w.h = false;
w.U(false);
}
}
class h implements Runnable {
h() {
}
@Override
public void run() {
boolean unused = w.i = false;
w.U(true);
}
}
class i implements Runnable {
final ArrayList a;
i(ArrayList arrayList) {
this.a = arrayList;
}
public static void b(ArrayList arrayList) {
ArrayList<p1.i> arrayList2 = w.E;
arrayList2.clear();
arrayList2.addAll(arrayList);
}
@Override
public void run() {
for (int i = 0; i < this.a.size(); i++) {
((p1.i) this.a.get(i)).a.A(0);
}
final ArrayList arrayList = this.a;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
w.i.b(arrayList);
}
});
}
}
class j extends StateListDrawable {
j() {
}
@Override
public boolean selectDrawable(int i) {
Paint paint;
if (Build.VERSION.SDK_INT >= 21) {
return super.selectDrawable(i);
}
Drawable V1 = w.V1(this, i);
ColorFilter colorFilter = null;
if (!(V1 instanceof BitmapDrawable)) {
if (V1 instanceof NinePatchDrawable) {
paint = ((NinePatchDrawable) V1).getPaint();
}
boolean selectDrawable = super.selectDrawable(i);
if (colorFilter != null) {
V1.setColorFilter(colorFilter);
}
return selectDrawable;
}
paint = ((BitmapDrawable) V1).getPaint();
colorFilter = paint.getColorFilter();
boolean selectDrawable2 = super.selectDrawable(i);
if (colorFilter != null) {
}
return selectDrawable2;
}
}
public class k extends StateListDrawable {
k() {
}
@Override
public boolean selectDrawable(int i) {
Paint paint;
if (Build.VERSION.SDK_INT >= 21) {
return super.selectDrawable(i);
}
Drawable V1 = w.V1(this, i);
ColorFilter colorFilter = null;
if (!(V1 instanceof BitmapDrawable)) {
if (V1 instanceof NinePatchDrawable) {
paint = ((NinePatchDrawable) V1).getPaint();
}
boolean selectDrawable = super.selectDrawable(i);
if (colorFilter != null) {
V1.setColorFilter(colorFilter);
}
return selectDrawable;
}
paint = ((BitmapDrawable) V1).getPaint();
colorFilter = paint.getColorFilter();
boolean selectDrawable2 = super.selectDrawable(i);
if (colorFilter != null) {
}
return selectDrawable2;
}
}
public class l extends Drawable {
private RectF a = new RectF();
final View b;
final View c;
final int d;
final Paint e;
l(View view, View view2, int i, Paint paint) {
this.b = view;
this.c = view2;
this.d = i;
this.e = paint;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
this.a.set(bounds.left, bounds.top, bounds.right, bounds.bottom);
w.a0(this.b, this.c);
RectF rectF = this.a;
int i = this.d;
canvas.drawRoundRect(rectF, i, i, this.e);
if (w.m2()) {
RectF rectF2 = this.a;
int i2 = this.d;
canvas.drawRoundRect(rectF2, i2, i2, w.V1);
}
}
@Override
public int getOpacity() {
return -2;
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
}
public class m extends Drawable {
RectF a;
final int b;
m(int i) {
this.b = i;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
int i = this.b;
if (i != 7) {
canvas.drawCircle(bounds.centerX(), bounds.centerY(), (i == 1 || i == 6) ? AndroidUtilities.dp(20.0f) : i == 3 ? Math.max(bounds.width(), bounds.height()) / 2 : (int) Math.ceil(Math.sqrt(((bounds.left - bounds.centerX()) * (bounds.left - bounds.centerX())) + ((bounds.top - bounds.centerY()) * (bounds.top - bounds.centerY())))), w.x);
return;
}
if (this.a == null) {
this.a = new RectF();
}
this.a.set(bounds);
canvas.drawRoundRect(this.a, AndroidUtilities.dp(6.0f), AndroidUtilities.dp(6.0f), w.x);
}
@Override
public int getOpacity() {
return 0;
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
}
class n extends Drawable {
final int a;
final int b;
n(int i, int i2) {
this.a = i;
this.b = i2;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
canvas.drawCircle((bounds.centerX() - this.a) + this.b, bounds.centerY(), (Math.max(bounds.width(), bounds.height()) / 2) + this.a + this.b, w.x);
}
@Override
public int getOpacity() {
return 0;
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
}
public static class o {
public Drawable a;
public Boolean b;
public Boolean c;
public Boolean d;
}
public static class p extends Drawable {
public static sg3[] N = new sg3[3];
private int[][] A;
Drawable B;
int C;
private int D;
private boolean E;
public p F;
public float G;
public boolean H;
public boolean I;
private Bitmap J;
private Shader K;
a L;
private int M;
private Shader a;
private int b;
private Paint c;
private Paint d;
private int e;
private int f;
private int g;
private int h;
private boolean i;
private RectF j;
private Matrix k;
private int l;
private boolean m;
private Path n;
private Rect o;
private final s p;
private final boolean q;
private int r;
private boolean s;
private boolean t;
public boolean u;
private int[] v;
private Drawable[] w;
private int[] x;
private int[][] y;
private Drawable[][] z;
public static class a {
Path a = new Path();
Rect b = new Rect();
boolean c;
boolean d;
public boolean a(Rect rect, boolean z, boolean z2) {
boolean z3;
if (!this.b.isEmpty()) {
Rect rect2 = this.b;
if (rect2.top == rect.top && rect2.bottom == rect.bottom && rect2.right == rect.right && rect2.left == rect.left && this.c == z2 && this.d == z && z2 && z) {
z3 = false;
this.c = z2;
this.d = z;
this.b.set(rect);
return z3;
}
}
z3 = true;
this.c = z2;
this.d = z;
this.b.set(rect);
return z3;
}
}
public p(int i, boolean z, boolean z2) {
this(i, z, z2, null);
}
public p(int i, boolean z, boolean z2, s sVar) {
this.c = new Paint(1);
this.j = new RectF();
this.k = new Matrix();
this.o = new Rect();
this.v = new int[]{-1, -1, -1, -1};
this.w = new Drawable[4];
this.x = new int[]{-1, -1, -1, -1};
this.y = new int[][]{new int[]{-1, -1, -1, -1}, new int[]{-1, -1, -1, -1}};
this.z = (Drawable[][]) Array.newInstance((Class<?>) Drawable.class, 2, 4);
this.A = new int[][]{new int[]{-1, -1, -1, -1}, new int[]{-1, -1, -1, -1}};
this.p = sVar;
this.q = z;
this.l = i;
this.m = z2;
this.n = new Path();
this.d = new Paint(1);
this.D = 255;
}
private int b(float f) {
return this.l == 2 ? (int) Math.ceil(f * 3.0f) : AndroidUtilities.dp(f);
}
private static ByteBuffer f(int i, int i2, int i3, int i4) {
ByteBuffer order = ByteBuffer.allocate(84).order(ByteOrder.nativeOrder());
order.put((byte) 1);
order.put((byte) 2);
order.put((byte) 2);
order.put((byte) 9);
order.putInt(0);
order.putInt(0);
order.putInt(0);
order.putInt(0);
order.putInt(0);
order.putInt(0);
order.putInt(0);
order.putInt(i);
order.putInt(i2);
order.putInt(i3);
order.putInt(i4);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
order.putInt(1);
return order;
}
public void a() {
float min;
Bitmap bitmap;
if (this.a instanceof BitmapShader) {
char c = 2;
if (!this.H || (bitmap = this.J) == null) {
if (!this.u) {
c = this.l != 2 ? (char) 0 : (char) 1;
}
Bitmap f = N[c].f();
min = Math.min(f.getWidth() / N[c].getBounds().width(), f.getHeight() / N[c].getBounds().height());
} else {
char c2 = this.l != 2 ? (char) 0 : (char) 1;
min = Math.min(bitmap.getWidth() / N[c2].getBounds().width(), this.J.getHeight() / N[c2].getBounds().height());
}
float f2 = 1.0f / min;
this.k.postScale(f2, f2);
}
}
public void c(Canvas canvas, Paint paint) {
int b;
boolean z;
boolean z2;
a aVar;
Path path;
boolean z3;
RectF rectF;
float f;
float f2;
int i;
int i2;
RectF rectF2;
float f3;
float f4;
int i3;
int i4;
Drawable e;
Rect bounds = getBounds();
if (paint == null && this.a == null && (e = e()) != null) {
e.setBounds(bounds);
e.draw(canvas);
return;
}
int b2 = b(2.0f);
int i5 = this.M;
if (i5 != 0) {
b = i5;
} else if (this.l == 2) {
i5 = b(6.0f);
b = b(6.0f);
} else {
i5 = b(SharedConfig.bubbleRadius);
b = b(Math.min(5, SharedConfig.bubbleRadius));
}
int b3 = b(6.0f);
Paint paint2 = paint == null ? this.c : paint;
if (paint == null && this.a != null) {
this.k.reset();
a();
this.k.postTranslate(0.0f, -this.r);
this.a.setLocalMatrix(this.k);
}
int max = Math.max(bounds.top, 0);
if (this.L == null || bounds.height() >= this.b) {
z = this.l != 1 ? (this.r + bounds.bottom) - i5 < this.b : (this.r + bounds.bottom) - (b3 * 2) < this.b;
if (this.r + (i5 * 2) < 0) {
z2 = false;
aVar = this.L;
if (aVar == null) {
path = aVar.a;
z3 = aVar.a(bounds, z, z2);
} else {
path = this.n;
z3 = true;
}
if (z3) {
path.reset();
if (this.q) {
if (this.E || this.l == 2 || paint != null || z) {
path.moveTo(this.l == 1 ? (bounds.right - b(8.0f)) - i5 : bounds.right - b(2.6f), bounds.bottom - b2);
path.lineTo(bounds.left + b2 + i5, bounds.bottom - b2);
RectF rectF3 = this.j;
int i6 = bounds.left;
int i7 = bounds.bottom;
int i8 = i5 * 2;
i3 = b;
rectF3.set(i6 + b2, (i7 - b2) - i8, i6 + b2 + i8, i7 - b2);
path.arcTo(this.j, 90.0f, 90.0f, false);
} else {
path.moveTo(bounds.right - b(8.0f), (max - this.r) + this.b);
path.lineTo(bounds.left + b2, (max - this.r) + this.b);
i3 = b;
}
if (this.E || this.l == 2 || paint != null || z2) {
path.lineTo(bounds.left + b2, bounds.top + b2 + i5);
RectF rectF4 = this.j;
int i9 = bounds.left;
int i10 = bounds.top;
int i11 = i5 * 2;
rectF4.set(i9 + b2, i10 + b2, i9 + b2 + i11, i10 + b2 + i11);
path.arcTo(this.j, 180.0f, 90.0f, false);
int i12 = this.s ? i3 : i5;
if (this.l == 1) {
path.lineTo((bounds.right - b2) - i12, bounds.top + b2);
RectF rectF5 = this.j;
int i13 = bounds.right;
int i14 = i12 * 2;
int i15 = bounds.top;
rectF5.set((i13 - b2) - i14, i15 + b2, i13 - b2, i15 + b2 + i14);
} else {
path.lineTo((bounds.right - b(8.0f)) - i12, bounds.top + b2);
int i16 = i12 * 2;
this.j.set((bounds.right - b(8.0f)) - i16, bounds.top + b2, bounds.right - b(8.0f), bounds.top + b2 + i16);
}
path.arcTo(this.j, 270.0f, 90.0f, false);
} else {
path.lineTo(bounds.left + b2, (max - this.r) - b(2.0f));
path.lineTo(this.l == 1 ? bounds.right - b2 : bounds.right - b(8.0f), (max - this.r) - b(2.0f));
}
int i17 = this.l;
if (i17 == 1) {
if (paint != null || z) {
if (this.t) {
i5 = i3;
}
path.lineTo(bounds.right - b2, (bounds.bottom - b2) - i5);
RectF rectF6 = this.j;
int i18 = bounds.right;
int i19 = i5 * 2;
int i20 = bounds.bottom;
rectF6.set((i18 - b2) - i19, (i20 - b2) - i19, i18 - b2, i20 - b2);
rectF2 = this.j;
f3 = 0.0f;
f4 = 90.0f;
path.arcTo(rectF2, f3, f4, false);
} else {
i4 = bounds.right;
}
} else if (this.E || i17 == 2 || paint != null || z) {
path.lineTo(bounds.right - b(8.0f), ((bounds.bottom - b2) - b3) - b(3.0f));
int i21 = b3 * 2;
this.j.set(bounds.right - b(8.0f), ((bounds.bottom - b2) - i21) - b(9.0f), (bounds.right - b(7.0f)) + i21, (bounds.bottom - b2) - b(1.0f));
rectF = this.j;
f = -83.0f;
f2 = 180.0f;
path.arcTo(rectF, f2, f, false);
} else {
i4 = bounds.right;
b2 = b(8.0f);
}
i2 = i4 - b2;
path.lineTo(i2, (max - this.r) + this.b);
} else {
int i22 = b;
if (this.E || this.l == 2 || paint != null || z) {
path.moveTo(this.l == 1 ? bounds.left + b(8.0f) + i5 : bounds.left + b(2.6f), bounds.bottom - b2);
path.lineTo((bounds.right - b2) - i5, bounds.bottom - b2);
RectF rectF7 = this.j;
int i23 = bounds.right;
int i24 = i5 * 2;
int i25 = bounds.bottom;
rectF7.set((i23 - b2) - i24, (i25 - b2) - i24, i23 - b2, i25 - b2);
path.arcTo(this.j, 90.0f, -90.0f, false);
} else {
path.moveTo(bounds.left + b(8.0f), (max - this.r) + this.b);
path.lineTo(bounds.right - b2, (max - this.r) + this.b);
}
if (this.E || this.l == 2 || paint != null || z2) {
path.lineTo(bounds.right - b2, bounds.top + b2 + i5);
RectF rectF8 = this.j;
int i26 = bounds.right;
int i27 = i5 * 2;
int i28 = bounds.top;
rectF8.set((i26 - b2) - i27, i28 + b2, i26 - b2, i28 + b2 + i27);
path.arcTo(this.j, 0.0f, -90.0f, false);
int i29 = this.s ? i22 : i5;
if (this.l == 1) {
path.lineTo(bounds.left + b2 + i29, bounds.top + b2);
RectF rectF9 = this.j;
int i30 = bounds.left;
int i31 = bounds.top;
int i32 = i29 * 2;
rectF9.set(i30 + b2, i31 + b2, i30 + b2 + i32, i31 + b2 + i32);
} else {
path.lineTo(bounds.left + b(8.0f) + i29, bounds.top + b2);
int i33 = i29 * 2;
this.j.set(bounds.left + b(8.0f), bounds.top + b2, bounds.left + b(8.0f) + i33, bounds.top + b2 + i33);
}
path.arcTo(this.j, 270.0f, -90.0f, false);
} else {
path.lineTo(bounds.right - b2, (max - this.r) - b(2.0f));
path.lineTo(this.l == 1 ? bounds.left + b2 : bounds.left + b(8.0f), (max - this.r) - b(2.0f));
}
int i34 = this.l;
if (i34 == 1) {
if (paint != null || z) {
if (this.t) {
i5 = i22;
}
path.lineTo(bounds.left + b2, (bounds.bottom - b2) - i5);
RectF rectF10 = this.j;
int i35 = bounds.left;
int i36 = bounds.bottom;
int i37 = i5 * 2;
rectF10.set(i35 + b2, (i36 - b2) - i37, i35 + b2 + i37, i36 - b2);
rectF2 = this.j;
f3 = 180.0f;
f4 = -90.0f;
path.arcTo(rectF2, f3, f4, false);
} else {
i = bounds.left;
}
} else if (this.E || i34 == 2 || paint != null || z) {
path.lineTo(bounds.left + b(8.0f), ((bounds.bottom - b2) - b3) - b(3.0f));
int i38 = b3 * 2;
this.j.set((bounds.left + b(7.0f)) - i38, ((bounds.bottom - b2) - i38) - b(9.0f), bounds.left + b(8.0f), (bounds.bottom - b2) - b(1.0f));
rectF = this.j;
f = 83.0f;
f2 = 0.0f;
path.arcTo(rectF, f2, f, false);
} else {
i = bounds.left;
b2 = b(8.0f);
}
i2 = i + b2;
path.lineTo(i2, (max - this.r) + this.b);
}
path.close();
}
canvas.drawPath(path, paint2);
if (this.a == null && this.m && paint == null) {
this.d.setColor(hj0.n(g("chat_outBubbleGradientSelectedOverlay"), (int) ((Color.alpha(r2) * this.D) / 255.0f)));
canvas.drawPath(path, this.d);
return;
}
return;
}
} else {
z = true;
}
z2 = true;
aVar = this.L;
if (aVar == null) {
}
if (z3) {
}
canvas.drawPath(path, paint2);
if (this.a == null) {
}
}
public void d(Canvas canvas, a aVar) {
this.L = aVar;
p pVar = this.F;
if (pVar != null) {
pVar.L = aVar;
}
draw(canvas);
this.L = null;
p pVar2 = this.F;
if (pVar2 != null) {
pVar2.L = null;
}
}
@Override
public void draw(Canvas canvas) {
p pVar = this.F;
if (pVar == null) {
c(canvas, null);
return;
}
pVar.draw(canvas);
setAlpha((int) (this.G * 255.0f));
c(canvas, null);
setAlpha(255);
}
public Drawable e() {
int g;
Drawable[][] drawableArr;
int dp = AndroidUtilities.dp(SharedConfig.bubbleRadius);
boolean z = this.s;
boolean z2 = true;
char c = (z && this.t) ? (char) 3 : z ? (char) 2 : this.t ? (char) 1 : (char) 0;
boolean z3 = this.m;
boolean z4 = (this.a != null || z3 || this.H) ? false : true;
int g2 = g(this.q ? "chat_outBubbleShadow" : "chat_inBubbleShadow");
if (this.I != z4 || this.y[z3 ? 1 : 0][c] != dp || (z4 && this.x[c] != g2)) {
this.y[z3 ? 1 : 0][c] = dp;
try {
Bitmap createBitmap = Bitmap.createBitmap(b(50.0f), b(40.0f), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
this.o.set(getBounds());
if (z4) {
this.x[c] = g2;
Paint paint = new Paint(1);
paint.setShader(new LinearGradient(0.0f, 0.0f, 0.0f, b(40.0f), new int[]{358573417, 694117737}, (float[]) null, Shader.TileMode.CLAMP));
paint.setColorFilter(new PorterDuffColorFilter(g2, PorterDuff.Mode.MULTIPLY));
paint.setShadowLayer(2.0f, 0.0f, 1.0f, -1);
if (AndroidUtilities.density > 1.0f) {
setBounds(-1, -1, createBitmap.getWidth() + 1, createBitmap.getHeight() + 1);
} else {
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
}
c(canvas, paint);
if (AndroidUtilities.density > 1.0f) {
paint.setColor(0);
paint.setShadowLayer(0.0f, 0.0f, 0.0f, 0);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
c(canvas, paint);
}
}
Paint paint2 = new Paint(1);
paint2.setColor(-1);
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
c(canvas, paint2);
this.z[z3 ? 1 : 0][c] = new NinePatchDrawable(createBitmap, f((createBitmap.getWidth() / 2) - 1, (createBitmap.getWidth() / 2) + 1, (createBitmap.getHeight() / 2) - 1, (createBitmap.getHeight() / 2) + 1).array(), new Rect(), null);
try {
setBounds(this.o);
} catch (Throwable unused) {
}
} catch (Throwable unused2) {
}
this.I = z4;
g = g(!this.m ? this.q ? "chat_outBubbleSelected" : "chat_inBubbleSelected" : this.q ? "chat_outBubble" : "chat_inBubble");
drawableArr = this.z;
if (drawableArr[z3 ? 1 : 0][c] != null && (this.A[z3 ? 1 : 0][c] != g || z2)) {
drawableArr[z3 ? 1 : 0][c].setColorFilter(new PorterDuffColorFilter(g, PorterDuff.Mode.MULTIPLY));
this.A[z3 ? 1 : 0][c] = g;
}
return this.z[z3 ? 1 : 0][c];
}
z2 = false;
this.I = z4;
g = g(!this.m ? this.q ? "chat_outBubbleSelected" : "chat_inBubbleSelected" : this.q ? "chat_outBubble" : "chat_inBubble");
drawableArr = this.z;
if (drawableArr[z3 ? 1 : 0][c] != null) {
drawableArr[z3 ? 1 : 0][c].setColorFilter(new PorterDuffColorFilter(g, PorterDuff.Mode.MULTIPLY));
this.A[z3 ? 1 : 0][c] = g;
}
return this.z[z3 ? 1 : 0][c];
}
protected int g(String str) {
if (this.l == 2) {
return w.r1(str);
}
s sVar = this.p;
Integer h = sVar != null ? sVar.h(str) : null;
return h != null ? h.intValue() : w.r1(str);
}
@Override
public int getOpacity() {
return -2;
}
protected Integer h(String str) {
if (this.l == 2) {
return Integer.valueOf(w.r1(str));
}
s sVar = this.p;
return sVar != null ? sVar.i(str) : (Integer) w.Q4.get(str);
}
public Shader i() {
return this.a;
}
public Matrix j() {
return this.k;
}
public sg3 k() {
if (this.u) {
return N[2];
}
return N[this.l == 2 ? (char) 1 : (char) 0];
}
public Paint l() {
return this.c;
}
public Drawable m() {
if (this.H) {
return null;
}
if (this.a == null && !this.m && this.F == null) {
return null;
}
int dp = AndroidUtilities.dp(SharedConfig.bubbleRadius);
boolean z = this.s;
boolean z2 = false;
char c = (z && this.t) ? (char) 3 : z ? (char) 2 : this.t ? (char) 1 : (char) 0;
int[] iArr = this.v;
if (iArr[c] != dp) {
iArr[c] = dp;
try {
Bitmap createBitmap = Bitmap.createBitmap(b(50.0f), b(40.0f), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
Paint paint = new Paint(1);
paint.setShader(new LinearGradient(0.0f, 0.0f, 0.0f, b(40.0f), new int[]{358573417, 694117737}, (float[]) null, Shader.TileMode.CLAMP));
paint.setShadowLayer(2.0f, 0.0f, 1.0f, -1);
if (AndroidUtilities.density > 1.0f) {
setBounds(-1, -1, createBitmap.getWidth() + 1, createBitmap.getHeight() + 1);
} else {
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
}
c(canvas, paint);
if (AndroidUtilities.density > 1.0f) {
paint.setColor(0);
paint.setShadowLayer(0.0f, 0.0f, 0.0f, 0);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
c(canvas, paint);
}
this.w[c] = new NinePatchDrawable(createBitmap, f((createBitmap.getWidth() / 2) - 1, (createBitmap.getWidth() / 2) + 1, (createBitmap.getHeight() / 2) - 1, (createBitmap.getHeight() / 2) + 1).array(), new Rect(), null);
z2 = true;
} catch (Throwable unused) {
}
}
int g = g(this.q ? "chat_outBubbleShadow" : "chat_inBubbleShadow");
Drawable[] drawableArr = this.w;
if (drawableArr[c] != null && (this.x[c] != g || z2)) {
drawableArr[c].setColorFilter(new PorterDuffColorFilter(g, PorterDuff.Mode.MULTIPLY));
this.x[c] = g;
}
return this.w[c];
}
public Drawable[] n() {
return this.w;
}
public int o() {
return this.r;
}
public Drawable p(int i) {
if (this.B == null) {
Bitmap createBitmap = Bitmap.createBitmap(b(50.0f), b(40.0f), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
this.o.set(getBounds());
Paint paint = new Paint(1);
paint.setColor(-1);
setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
c(canvas, paint);
this.B = new NinePatchDrawable(createBitmap, f((createBitmap.getWidth() / 2) - 1, (createBitmap.getWidth() / 2) + 1, (createBitmap.getHeight() / 2) - 1, (createBitmap.getHeight() / 2) + 1).array(), new Rect(), null);
setBounds(this.o);
}
if (this.C != i) {
this.C = i;
this.B.setColorFilter(new PorterDuffColorFilter(i, PorterDuff.Mode.MULTIPLY));
}
return this.B;
}
public boolean q() {
return this.a != null && w.S4;
}
public void r(boolean z) {
this.E = z;
}
public void s(int i) {
this.M = i;
}
@Override
public void setAlpha(int i) {
if (this.D != i) {
this.D = i;
this.c.setAlpha(i);
if (this.q) {
this.d.setAlpha((int) (Color.alpha(g("chat_outBubbleGradientSelectedOverlay")) * (i / 255.0f)));
}
}
if (this.a == null) {
Drawable e = e();
if (Build.VERSION.SDK_INT < 19 || e.getAlpha() != i) {
e.setAlpha(i);
}
}
}
@Override
public void setBounds(int i, int i2, int i3, int i4) {
super.setBounds(i, i2, i3, i4);
p pVar = this.F;
if (pVar != null) {
pVar.setBounds(i, i2, i3, i4);
}
}
@Override
public void setColorFilter(int i, PorterDuff.Mode mode) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
public void t(int i, int i2, int i3, int i4, boolean z, boolean z2) {
int g;
Integer num;
Integer num2;
Integer num3;
boolean z3;
char c;
Shader shader;
int i5;
int i6;
sg3[] sg3VarArr;
p pVar = this.F;
if (pVar != null) {
pVar.t(i, i2, i3, i4, z, z2);
}
if (this.q) {
g = g(this.m ? "chat_outBubbleSelected" : "chat_outBubble");
num = h("chat_outBubbleGradient");
num2 = h("chat_outBubbleGradient2");
num3 = h("chat_outBubbleGradient3");
Integer h = h("chat_outBubbleGradientAnimated");
if (h != null && h.intValue() != 0) {
z3 = true;
if (num != null) {
g = g("chat_outBubble");
}
if (num == null) {
num = 0;
}
if (num2 == null) {
num2 = 0;
}
if (num3 == null) {
num3 = 0;
}
c = !this.u ? (char) 2 : this.l == 2 ? (char) 1 : (char) 0;
if (!this.H && num2.intValue() != 0 && z3) {
sg3VarArr = N;
if (sg3VarArr[c] != null) {
int[] h2 = sg3VarArr[c].h();
this.e = h2[0];
this.f = h2[1];
this.g = h2[2];
this.h = h2[3];
}
}
if (!this.H && num2.intValue() != 0 && z3) {
if (i3 == this.b && this.K != null && this.e == g && this.f == num.intValue() && this.g == num2.intValue() && this.h == num3.intValue() && this.i == z3) {
i6 = -1;
} else {
if (this.J == null) {
this.J = Bitmap.createBitmap(60, 80, Bitmap.Config.ARGB_8888);
Bitmap bitmap = this.J;
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
this.K = new BitmapShader(bitmap, tileMode, tileMode);
}
sg3[] sg3VarArr2 = N;
if (sg3VarArr2[c] == null) {
sg3VarArr2[c] = new sg3();
if (this.l != 2) {
N[c].E(true);
}
N[c].F(AndroidUtilities.dp(1.0f));
}
i6 = -1;
N[c].w(g, num.intValue(), num2.intValue(), num3.intValue(), this.J);
this.K.setLocalMatrix(this.k);
}
Shader shader2 = this.K;
this.a = shader2;
this.c.setShader(shader2);
this.c.setColor(i6);
this.e = g;
this.i = z3;
this.f = num.intValue();
this.g = num2.intValue();
this.h = num3.intValue();
} else if (num.intValue() == 0 && (this.a == null || i3 != this.b || this.e != g || this.f != num.intValue() || this.g != num2.intValue() || this.h != num3.intValue() || this.i != z3)) {
if (num2.intValue() == 0 || !z3) {
this.a = num2.intValue() != 0 ? num3.intValue() != 0 ? new LinearGradient(0.0f, 0.0f, 0.0f, i3, new int[]{num3.intValue(), num2.intValue(), num.intValue(), g}, (float[]) null, Shader.TileMode.CLAMP) : new LinearGradient(0.0f, 0.0f, 0.0f, i3, new int[]{num2.intValue(), num.intValue(), g}, (float[]) null, Shader.TileMode.CLAMP) : new LinearGradient(0.0f, 0.0f, 0.0f, i3, new int[]{num.intValue(), g}, (float[]) null, Shader.TileMode.CLAMP);
} else {
sg3[] sg3VarArr3 = N;
if (sg3VarArr3[c] == null) {
sg3VarArr3[c] = new sg3();
if (this.l != 2) {
N[c].E(true);
}
N[c].F(AndroidUtilities.dp(1.0f));
}
N[c].u(g, num.intValue(), num2.intValue(), num3.intValue());
this.a = N[c].g();
}
this.c.setShader(this.a);
this.e = g;
this.i = z3;
this.f = num.intValue();
this.g = num2.intValue();
this.h = num3.intValue();
this.c.setColor(-1);
} else if (num.intValue() == 0) {
if (this.a != null) {
this.a = null;
this.c.setShader(null);
}
this.c.setColor(g);
}
shader = this.a;
if (shader instanceof BitmapShader) {
i5 = 0;
} else {
i5 = 0;
N[c].setBounds(0, 0, i2, i3 - (shader instanceof BitmapShader ? i4 : 0));
}
this.b = i3;
if (this.a instanceof BitmapShader) {
i5 = i4;
}
this.r = i - i5;
this.s = z;
this.t = z2;
}
} else {
g = g(this.m ? "chat_inBubbleSelected" : "chat_inBubble");
num = null;
num2 = null;
num3 = null;
}
z3 = false;
if (num != null) {
}
if (num == null) {
}
if (num2 == null) {
}
if (num3 == null) {
}
if (!this.u) {
}
if (!this.H) {
sg3VarArr = N;
if (sg3VarArr[c] != null) {
}
}
if (!this.H) {
}
if (num.intValue() == 0) {
}
if (num.intValue() == 0) {
}
shader = this.a;
if (shader instanceof BitmapShader) {
}
this.b = i3;
if (this.a instanceof BitmapShader) {
}
this.r = i - i5;
this.s = z;
this.t = z2;
}
public void u(int i, int i2, int i3, boolean z, boolean z2) {
t(i, i2, i3, i3, z, z2);
}
}
public static class q {
public String a;
public String b;
public String c;
public int d;
public int e;
public int f;
public int g;
public int h;
public boolean i;
public boolean j;
public float k;
public long l;
public long m;
public v n;
public u o;
public q() {
this.a = BuildConfig.FLAVOR;
this.b = BuildConfig.FLAVOR;
this.c = BuildConfig.FLAVOR;
}
public q(q qVar, v vVar, u uVar) {
this.a = BuildConfig.FLAVOR;
this.b = BuildConfig.FLAVOR;
this.c = BuildConfig.FLAVOR;
this.c = qVar.c;
this.d = qVar.d;
this.e = qVar.e;
this.f = qVar.f;
this.g = qVar.g;
this.h = qVar.h;
this.i = qVar.i;
this.j = qVar.j;
this.k = qVar.k;
this.n = vVar;
this.o = uVar;
if (TextUtils.isEmpty(qVar.a)) {
this.a = BuildConfig.FLAVOR;
} else {
try {
File file = new File(ApplicationLoader.getFilesDirFixed(), qVar.a);
File filesDirFixed = ApplicationLoader.getFilesDirFixed();
String z = this.n.z(this.o, false);
this.a = z;
AndroidUtilities.copyFile(file, new File(filesDirFixed, z));
} catch (Exception e) {
this.a = BuildConfig.FLAVOR;
FileLog.e(e);
}
}
if (TextUtils.isEmpty(qVar.b)) {
this.b = BuildConfig.FLAVOR;
return;
}
if (qVar.b.equals(qVar.a)) {
this.b = this.a;
return;
}
try {
File file2 = new File(ApplicationLoader.getFilesDirFixed(), qVar.b);
File filesDirFixed2 = ApplicationLoader.getFilesDirFixed();
String z2 = this.n.z(this.o, true);
this.b = z2;
AndroidUtilities.copyFile(file2, new File(filesDirFixed2, z2));
} catch (Exception e2) {
this.b = BuildConfig.FLAVOR;
FileLog.e(e2);
}
}
public void c() {
ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0).edit().remove(d()).commit();
new File(ApplicationLoader.getFilesDirFixed(), this.a).delete();
new File(ApplicationLoader.getFilesDirFixed(), this.b).delete();
}
private String d() {
StringBuilder sb;
if (this.o != null) {
sb = new StringBuilder();
sb.append(this.n.a);
sb.append("_");
sb.append(this.o.a);
} else {
sb = new StringBuilder();
sb.append(this.n.a);
}
sb.append("_owp");
return sb.toString();
}
public void h() {
try {
String d = d();
SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0).edit();
JSONObject jSONObject = new JSONObject();
jSONObject.put("wall", this.a);
jSONObject.put("owall", this.b);
jSONObject.put("pColor", this.d);
jSONObject.put("pGrColor", this.e);
jSONObject.put("pGrColor2", this.f);
jSONObject.put("pGrColor3", this.g);
jSONObject.put("pGrAngle", this.h);
String str = this.c;
if (str == null) {
str = BuildConfig.FLAVOR;
}
jSONObject.put("wallSlug", str);
jSONObject.put("wBlur", this.i);
jSONObject.put("wMotion", this.j);
jSONObject.put("pIntensity", this.k);
edit.putString(d, jSONObject.toString());
edit.commit();
} catch (Throwable th) {
FileLog.e(th);
}
}
public boolean e() {
return "c".equals(this.c);
}
public boolean f() {
return "d".equals(this.c);
}
public boolean g() {
return "t".equals(this.c);
}
public void i() {
v vVar = this.n;
if (vVar != null) {
u uVar = this.o;
if (uVar != null || vVar.c0 == this) {
if (uVar == null || uVar.y == this) {
h();
}
}
}
}
}
public static class r implements NotificationCenter.NotificationCenterDelegate {
private static r c;
private int a = UserConfig.selectedAccount;
private HashMap<String, a> b;
public static class a {
public d17 a;
public ArrayList<u> b;
private a() {
this.b = new ArrayList<>();
}
a(g gVar) {
this();
}
}
private r(final ArrayList<u> arrayList) {
if (arrayList == null) {
return;
}
Utilities.globalQueue.postRunnable(new Runnable() {
@Override
public final void run() {
w.r.this.l(arrayList);
}
});
}
private void e(final ArrayList<u> arrayList, final boolean z) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
w.r.this.i(arrayList, z);
}
});
}
public void i(ArrayList<u> arrayList, boolean z) {
if (arrayList != null && w.H.V != null && !w.H.V.isEmpty() && arrayList.contains(w.H.A(false))) {
w.S2();
}
HashMap<String, a> hashMap = this.b;
if (!z) {
if (hashMap == null || hashMap.isEmpty()) {
NotificationCenter.getInstance(this.a).removeObserver(this, NotificationCenter.fileLoaded);
NotificationCenter.getInstance(this.a).removeObserver(this, NotificationCenter.fileLoadFailed);
return;
}
return;
}
if (hashMap != null) {
NotificationCenter.getInstance(this.a).addObserver(this, NotificationCenter.fileLoaded);
NotificationCenter.getInstance(this.a).addObserver(this, NotificationCenter.fileLoadFailed);
Iterator<Map.Entry<String, a>> it = this.b.entrySet().iterator();
while (it.hasNext()) {
FileLoader.getInstance(this.a).loadFile(ImageLocation.getForDocument(it.next().getValue().a.i), "wallpaper", null, 0, 1);
}
}
}
public static void g(boolean z) {
ArrayList<u> arrayList;
if (c == null || z) {
ArrayList arrayList2 = null;
int i = 0;
while (i < 5) {
v vVar = (v) w.G.get(i != 0 ? i != 1 ? i != 2 ? i != 3 ? "Night" : "Day" : "Arctic Blue" : "Dark Blue" : "Blue");
if (vVar != null && (arrayList = vVar.V) != null && !arrayList.isEmpty()) {
int size = vVar.V.size();
for (int i2 = 0; i2 < size; i2++) {
u uVar = vVar.V.get(i2);
if (uVar.a != w.l && !TextUtils.isEmpty(uVar.o)) {
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
arrayList2.add(uVar);
}
}
}
i++;
}
c = new r(arrayList2);
}
}
private Bitmap h(Bitmap bitmap, boolean z, File file, u uVar) {
Bitmap bitmap2;
File b;
Drawable drawable;
int patternColor;
Integer num;
Integer num2;
Integer num3;
try {
b = uVar.b();
drawable = null;
} catch (Throwable th) {
th = th;
bitmap2 = bitmap;
}
if (b == null) {
return null;
}
v vVar = uVar.b;
HashMap<String, Integer> b2 = w.b2(null, vVar.d, null);
w.r0(b2, vVar);
int i = uVar.c;
int i2 = (int) uVar.j;
long j = uVar.k;
int i3 = (int) j;
if (i3 == 0 && j == 0) {
if (i2 != 0) {
i = i2;
}
Integer num4 = b2.get("chat_wallpaper_gradient_to");
if (num4 != null) {
i3 = w.m0(vVar, i, num4.intValue());
}
} else {
i = 0;
}
long j2 = uVar.l;
int i4 = (int) j2;
if (i4 == 0 && j2 == 0 && (num3 = b2.get("key_chat_wallpaper_gradient_to2")) != null) {
i4 = w.m0(vVar, i, num3.intValue());
}
long j3 = uVar.m;
int i5 = (int) j3;
if (i5 == 0 && j3 == 0 && (num2 = b2.get("key_chat_wallpaper_gradient_to3")) != null) {
i5 = w.m0(vVar, i, num2.intValue());
}
if (i2 == 0 && (num = b2.get("chat_wallpaper")) != null) {
i2 = w.m0(vVar, i, num.intValue());
}
if (i4 != 0) {
patternColor = sg3.k(i2, i3, i4, i5);
} else if (i3 != 0) {
Drawable oVar = new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(uVar.n), new int[]{i2, i3});
patternColor = AndroidUtilities.getPatternColor(AndroidUtilities.getAverageColor(i2, i3));
drawable = oVar;
} else {
drawable = new ColorDrawable(i2);
patternColor = AndroidUtilities.getPatternColor(i2);
}
if (bitmap == null) {
bitmap2 = z ? SvgHelper.getBitmap(file, AndroidUtilities.dp(360.0f), AndroidUtilities.dp(640.0f), false) : w.L2(new FileInputStream(file), 0);
} else {
bitmap2 = bitmap;
}
try {
if (drawable != null) {
Bitmap createBitmap = Bitmap.createBitmap(bitmap2.getWidth(), bitmap2.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
drawable.setBounds(0, 0, bitmap2.getWidth(), bitmap2.getHeight());
drawable.draw(canvas);
Paint paint = new Paint(2);
paint.setColorFilter(new PorterDuffColorFilter(patternColor, PorterDuff.Mode.SRC_IN));
paint.setAlpha((int) (Math.abs(uVar.p) * 255.0f));
canvas.drawBitmap(bitmap2, 0.0f, 0.0f, paint);
createBitmap.compress(Bitmap.CompressFormat.JPEG, 87, new FileOutputStream(b));
} else {
FileOutputStream fileOutputStream = new FileOutputStream(b);
bitmap2.compress(Bitmap.CompressFormat.PNG, 87, fileOutputStream);
fileOutputStream.close();
}
} catch (Throwable th2) {
th = th2;
FileLog.e(th);
return bitmap2;
}
return bitmap2;
}
public void j(a aVar) {
d17 d17Var = aVar.a;
File pathToAttach = FileLoader.getPathToAttach(d17Var.i, true);
int size = aVar.b.size();
Bitmap bitmap = null;
ArrayList<u> arrayList = null;
for (int i = 0; i < size; i++) {
u uVar = aVar.b.get(i);
if (uVar.o.equals(d17Var.h)) {
bitmap = h(bitmap, "application/x-tgwallpattern".equals(d17Var.i.mime_type), pathToAttach, uVar);
if (arrayList == null) {
arrayList = new ArrayList<>();
arrayList.add(uVar);
}
}
}
if (bitmap != null) {
bitmap.recycle();
}
e(arrayList, false);
}
public void k(ArrayList arrayList, i95 i95Var, ov5 ov5Var) {
if (i95Var instanceof j27) {
j27 j27Var = (j27) i95Var;
int size = j27Var.a.size();
Bitmap bitmap = null;
ArrayList<u> arrayList2 = null;
int i = 0;
while (i < size) {
m27 m27Var = (m27) j27Var.a.get(i);
if (m27Var instanceof d17) {
d17 d17Var = (d17) m27Var;
if (d17Var.e) {
File pathToAttach = FileLoader.getPathToAttach(d17Var.i, true);
int size2 = arrayList.size();
Bitmap bitmap2 = bitmap;
?? r12 = bitmap2;
int i2 = 0;
?? r4 = bitmap;
while (i2 < size2) {
u uVar = (u) arrayList.get(i2);
r12 = r12;
if (uVar.o.equals(d17Var.h)) {
if (r12 == 0) {
r12 = Boolean.valueOf(pathToAttach.exists());
}
if (bitmap2 != null || r12.booleanValue()) {
bitmap2 = h(bitmap2, "application/x-tgwallpattern".equals(d17Var.i.mime_type), pathToAttach, uVar);
if (arrayList2 == null) {
arrayList2 = new ArrayList<>();
}
arrayList2.add(uVar);
} else {
String attachFileName = FileLoader.getAttachFileName(d17Var.i);
if (this.b == null) {
this.b = new HashMap<>();
}
a aVar = this.b.get(attachFileName);
if (aVar == null) {
aVar = new a(r4);
aVar.a = d17Var;
this.b.put(attachFileName, aVar);
}
aVar.b.add(uVar);
}
}
i2++;
r4 = 0;
r12 = r12;
}
if (bitmap2 != null) {
bitmap2.recycle();
}
i++;
bitmap = null;
}
}
i++;
bitmap = null;
}
e(arrayList2, true);
}
}
public void l(final ArrayList arrayList) {
int size = arrayList.size();
ArrayList arrayList2 = null;
int i = 0;
while (i < size) {
u uVar = (u) arrayList.get(i);
File b = uVar.b();
if (b == null || !b.exists()) {
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
if (!arrayList2.contains(uVar.o)) {
arrayList2.add(uVar.o);
}
} else {
arrayList.remove(i);
i--;
size--;
}
i++;
}
if (arrayList2 == null) {
return;
}
ge5 ge5Var = new ge5();
int size2 = arrayList2.size();
for (int i2 = 0; i2 < size2; i2++) {
b36 b36Var = new b36();
b36Var.a = (String) arrayList2.get(i2);
ge5Var.a.add(b36Var);
}
ConnectionsManager.getInstance(this.a).sendRequest(ge5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var, ov5 ov5Var) {
w.r.this.k(arrayList, i95Var, ov5Var);
}
});
}
@Override
public void didReceivedNotification(int i, int i2, Object... objArr) {
HashMap<String, a> hashMap = this.b;
if (hashMap == null) {
return;
}
if (i == NotificationCenter.fileLoaded) {
final a remove = hashMap.remove((String) objArr[0]);
if (remove != null) {
Utilities.globalQueue.postRunnable(new Runnable() {
@Override
public final void run() {
w.r.this.j(remove);
}
});
return;
}
return;
}
if (i != NotificationCenter.fileLoadFailed || hashMap.remove((String) objArr[0]) == null) {
return;
}
e(null, false);
}
}
public interface s {
Paint b(String str);
void c(String str, int i);
void e(int i, int i2, float f, float f2);
int f(String str);
boolean g();
Integer h(String str);
Integer i(String str);
Drawable j(String str);
}
public static class t extends Drawable {
private Path a = new Path();
private RectF b = new RectF();
private float[] c;
public t(float f, float f2) {
this.c = r0;
float dp = AndroidUtilities.dp(f);
float[] fArr = {dp, dp, dp, dp};
float[] fArr2 = this.c;
float dp2 = AndroidUtilities.dp(f2);
fArr2[7] = dp2;
fArr2[6] = dp2;
fArr2[5] = dp2;
fArr2[4] = dp2;
}
public t(float f, float f2, float f3, float f4) {
float[] fArr = new float[8];
this.c = fArr;
float dp = AndroidUtilities.dp(f);
fArr[1] = dp;
fArr[0] = dp;
float[] fArr2 = this.c;
float dp2 = AndroidUtilities.dp(f2);
fArr2[3] = dp2;
fArr2[2] = dp2;
float[] fArr3 = this.c;
float dp3 = AndroidUtilities.dp(f3);
fArr3[5] = dp3;
fArr3[4] = dp3;
float[] fArr4 = this.c;
float dp4 = AndroidUtilities.dp(f4);
fArr4[7] = dp4;
fArr4[6] = dp4;
}
@Override
public void draw(Canvas canvas) {
this.b.set(getBounds());
this.a.addRoundRect(this.b, this.c, Path.Direction.CW);
canvas.drawPath(this.a, w.x);
}
@Override
public int getOpacity() {
return 0;
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
}
public static class u {
public int a;
public v b;
public int c;
public int d;
public int e;
public int f;
public int g;
public int h;
public boolean i;
public long j;
public long k;
public long l;
public long m;
public int n = 45;
public String o = BuildConfig.FLAVOR;
public float p;
public boolean q;
public cu6 r;
public d17 s;
public int t;
public String u;
public String v;
public xa5 w;
public xa5 x;
public q y;
public boolean z;
u() {
}
public boolean a(HashMap<String, Integer> hashMap, HashMap<String, Integer> hashMap2) {
String str;
boolean t3;
boolean z;
int n0;
String str2;
int n02;
String str3;
boolean z2;
int i;
int i2;
int i3;
int i4;
int i5;
int i6;
int i7;
int i8;
boolean t32;
int i9;
int i10;
int i11;
int i12;
int i13;
float[] W1 = w.W1(1);
float[] W12 = w.W1(2);
Color.colorToHSV(this.b.R, W1);
Color.colorToHSV(this.c, W12);
boolean J = this.b.J();
if (this.c != this.b.R || this.d != 0) {
HashSet hashSet = new HashSet(hashMap.keySet());
hashSet.addAll(w.M4.keySet());
hashSet.removeAll(w.O4);
Iterator it = hashSet.iterator();
while (it.hasNext()) {
String str4 = (String) it.next();
Integer num = hashMap.get(str4);
if (num != null || (str = (String) w.N4.get(str4)) == null || hashMap.get(str) == null) {
int n03 = w.n0(W1, W12, num.intValue(), J);
if (n03 != num.intValue()) {
hashMap2.put(str4, Integer.valueOf(n03));
}
}
}
}
int i14 = this.e;
if ((i14 == 0 && this.c == 0) || this.f == 0) {
z = false;
} else {
if (i14 == 0) {
i14 = this.c;
}
Integer num2 = hashMap.get("chat_outBubble");
if (num2 == null) {
num2 = (Integer) w.M4.get("chat_outBubble");
}
int colorDistance = AndroidUtilities.getColorDistance(i14, w.n0(W1, W12, num2.intValue(), J));
int colorDistance2 = AndroidUtilities.getColorDistance(i14, this.f);
if (this.g != 0) {
int averageColor = AndroidUtilities.getAverageColor(AndroidUtilities.getAverageColor(this.e, this.f), this.g);
int i15 = this.h;
if (i15 != 0) {
averageColor = AndroidUtilities.getAverageColor(averageColor, i15);
}
t3 = AndroidUtilities.computePerceivedBrightness(averageColor) > 0.705f;
} else {
t3 = w.t3(this.e, this.f);
}
z = t3 && colorDistance <= 35000 && colorDistance2 <= 35000;
i14 = w.h1(W1, num2.intValue(), i14);
}
boolean z3 = (i14 == 0 || (((i12 = this.b.R) == 0 || i14 == i12) && ((i13 = this.c) == 0 || i13 == i14))) ? false : true;
if (z3 || this.d != 0) {
int i16 = this.d;
if (i16 != 0) {
Color.colorToHSV(i16, W12);
} else {
Color.colorToHSV(i14, W12);
}
Iterator it2 = w.K4.iterator();
while (it2.hasNext()) {
String str5 = (String) it2.next();
Integer num3 = hashMap.get(str5);
if (num3 != null || (str3 = (String) w.N4.get(str5)) == null || hashMap.get(str3) == null) {
if (num3 != null && (n02 = w.n0(W1, W12, num3.intValue(), J)) != num3.intValue()) {
hashMap2.put(str5, Integer.valueOf(n02));
}
}
}
if (z3) {
Color.colorToHSV(i14, W12);
Iterator it3 = w.L4.iterator();
while (it3.hasNext()) {
String str6 = (String) it3.next();
Integer num4 = hashMap.get(str6);
if (num4 != null || (str2 = (String) w.N4.get(str6)) == null || hashMap.get(str2) == null) {
if (num4 != null && (n0 = w.n0(W1, W12, num4.intValue(), J)) != num4.intValue()) {
hashMap2.put(str6, Integer.valueOf(n0));
}
}
}
}
}
if (!z && (i8 = this.f) != 0) {
if (this.g != 0) {
int averageColor2 = AndroidUtilities.getAverageColor(AndroidUtilities.getAverageColor(this.e, i8), this.g);
int i17 = this.h;
if (i17 != 0) {
averageColor2 = AndroidUtilities.getAverageColor(averageColor2, i17);
}
t32 = AndroidUtilities.computePerceivedBrightness(averageColor2) > 0.705f;
} else {
t32 = w.t3(this.e, i8);
}
if (t32) {
i11 = -14606047;
i9 = -11184811;
i10 = 1291845632;
} else {
i9 = -1118482;
i10 = 1308622847;
i11 = -1;
}
if (this.d == 0) {
hashMap2.put("chat_outAudioProgress", Integer.valueOf(i10));
hashMap2.put("chat_outAudioSelectedProgress", Integer.valueOf(i10));
hashMap2.put("chat_outAudioSeekbar", Integer.valueOf(i10));
hashMap2.put("chat_outAudioCacheSeekbar", Integer.valueOf(i10));
hashMap2.put("chat_outAudioSeekbarSelected", Integer.valueOf(i10));
hashMap2.put("chat_outAudioSeekbarFill", Integer.valueOf(i11));
hashMap2.put("chat_outVoiceSeekbar", Integer.valueOf(i10));
hashMap2.put("chat_outVoiceSeekbarSelected", Integer.valueOf(i10));
hashMap2.put("chat_outVoiceSeekbarFill", Integer.valueOf(i11));
hashMap2.put("chat_messageLinkOut", Integer.valueOf(i11));
hashMap2.put("chat_outForwardedNameText", Integer.valueOf(i11));
hashMap2.put("chat_outViaBotNameText", Integer.valueOf(i11));
hashMap2.put("chat_outReplyLine", Integer.valueOf(i11));
hashMap2.put("chat_outReplyNameText", Integer.valueOf(i11));
hashMap2.put("chat_outPreviewLine", Integer.valueOf(i11));
hashMap2.put("chat_outSiteNameText", Integer.valueOf(i11));
hashMap2.put("chat_outInstant", Integer.valueOf(i11));
hashMap2.put("chat_outInstantSelected", Integer.valueOf(i11));
hashMap2.put("chat_outPreviewInstantText", Integer.valueOf(i11));
hashMap2.put("chat_outPreviewInstantSelectedText", Integer.valueOf(i11));
hashMap2.put("chat_outViews", Integer.valueOf(i11));
hashMap2.put("chat_outViewsSelected", Integer.valueOf(i11));
hashMap2.put("chat_outAudioTitleText", Integer.valueOf(i11));
hashMap2.put("chat_outFileNameText", Integer.valueOf(i11));
hashMap2.put("chat_outContactNameText", Integer.valueOf(i11));
hashMap2.put("chat_outAudioPerfomerText", Integer.valueOf(i11));
hashMap2.put("chat_outAudioPerfomerSelectedText", Integer.valueOf(i11));
hashMap2.put("chat_outSentCheck", Integer.valueOf(i11));
hashMap2.put("chat_outSentCheckSelected", Integer.valueOf(i11));
hashMap2.put("chat_outSentCheckRead", Integer.valueOf(i11));
hashMap2.put("chat_outSentCheckReadSelected", Integer.valueOf(i11));
hashMap2.put("chat_outSentClock", Integer.valueOf(i11));
hashMap2.put("chat_outSentClockSelected", Integer.valueOf(i11));
hashMap2.put("chat_outMenu", Integer.valueOf(i11));
hashMap2.put("chat_outMenuSelected", Integer.valueOf(i11));
hashMap2.put("chat_outTimeText", Integer.valueOf(i11));
hashMap2.put("chat_outTimeSelectedText", Integer.valueOf(i11));
hashMap2.put("chat_outAudioDurationText", Integer.valueOf(i9));
hashMap2.put("chat_outAudioDurationSelectedText", Integer.valueOf(i9));
hashMap2.put("chat_outContactPhoneText", Integer.valueOf(i9));
hashMap2.put("chat_outContactPhoneSelectedText", Integer.valueOf(i9));
hashMap2.put("chat_outFileInfoText", Integer.valueOf(i9));
hashMap2.put("chat_outFileInfoSelectedText", Integer.valueOf(i9));
hashMap2.put("chat_outVenueInfoText", Integer.valueOf(i9));
hashMap2.put("chat_outVenueInfoSelectedText", Integer.valueOf(i9));
hashMap2.put("chat_outLoader", Integer.valueOf(i11));
hashMap2.put("chat_outLoaderSelected", Integer.valueOf(i11));
hashMap2.put("chat_outFileProgress", Integer.valueOf(this.e));
hashMap2.put("chat_outFileProgressSelected", Integer.valueOf(this.e));
hashMap2.put("chat_outMediaIcon", Integer.valueOf(this.e));
hashMap2.put("chat_outMediaIconSelected", Integer.valueOf(this.e));
}
hashMap2.put("chat_outReplyMessageText", Integer.valueOf(i11));
hashMap2.put("chat_outReplyMediaMessageText", Integer.valueOf(i11));
hashMap2.put("chat_outReplyMediaMessageSelectedText", Integer.valueOf(i11));
hashMap2.put("chat_messageTextOut", Integer.valueOf(i11));
}
if (z) {
if (AndroidUtilities.getColorDistance(-1, hashMap2.containsKey("chat_outLoader") ? hashMap2.get("chat_outLoader").intValue() : 0) < 5000) {
z2 = false;
i = this.e;
if (i != 0 && this.f != 0) {
hashMap2.put("chat_outBubble", Integer.valueOf(i));
hashMap2.put("chat_outBubbleGradient", Integer.valueOf(this.f));
i7 = this.g;
if (i7 != 0) {
hashMap2.put("chat_outBubbleGradient2", Integer.valueOf(i7));
int i18 = this.h;
if (i18 != 0) {
hashMap2.put("chat_outBubbleGradient3", Integer.valueOf(i18));
}
}
hashMap2.put("chat_outBubbleGradientAnimated", Integer.valueOf(this.i ? 1 : 0));
}
long j = this.j;
i2 = (int) j;
if (i2 == 0) {
hashMap2.put("chat_wallpaper", Integer.valueOf(i2));
} else if (j != 0) {
hashMap2.remove("chat_wallpaper");
}
long j2 = this.k;
i3 = (int) j2;
if (i3 == 0) {
hashMap2.put("chat_wallpaper_gradient_to", Integer.valueOf(i3));
} else if (j2 != 0) {
hashMap2.remove("chat_wallpaper_gradient_to");
}
long j3 = this.l;
i4 = (int) j3;
if (i4 == 0) {
hashMap2.put("key_chat_wallpaper_gradient_to2", Integer.valueOf(i4));
} else if (j3 != 0) {
hashMap2.remove("key_chat_wallpaper_gradient_to2");
}
long j4 = this.m;
i5 = (int) j4;
if (i5 == 0) {
hashMap2.put("key_chat_wallpaper_gradient_to3", Integer.valueOf(i5));
} else if (j4 != 0) {
hashMap2.remove("key_chat_wallpaper_gradient_to3");
}
i6 = this.n;
if (i6 != 45) {
hashMap2.put("chat_wallpaper_gradient_rotation", Integer.valueOf(i6));
}
if (!J) {
hashMap2.remove("chat_selectedBackground");
}
return !z2;
}
}
z2 = z;
i = this.e;
if (i != 0) {
hashMap2.put("chat_outBubble", Integer.valueOf(i));
hashMap2.put("chat_outBubbleGradient", Integer.valueOf(this.f));
i7 = this.g;
if (i7 != 0) {
}
hashMap2.put("chat_outBubbleGradientAnimated", Integer.valueOf(this.i ? 1 : 0));
}
long j5 = this.j;
i2 = (int) j5;
if (i2 == 0) {
}
long j22 = this.k;
i3 = (int) j22;
if (i3 == 0) {
}
long j32 = this.l;
i4 = (int) j32;
if (i4 == 0) {
}
long j42 = this.m;
i5 = (int) j42;
if (i5 == 0) {
}
i6 = this.n;
if (i6 != 45) {
}
if (!J) {
}
return !z2;
}
public File b() {
if (this.a < 100) {
if (TextUtils.isEmpty(this.o)) {
return null;
}
return new File(ApplicationLoader.getFilesDirFixed(), String.format(Locale.US, "%s_%d_%s_v5.jpg", this.b.C(), Integer.valueOf(this.a), this.o));
}
if (TextUtils.isEmpty(this.o)) {
return null;
}
return new File(ApplicationLoader.getFilesDirFixed(), String.format(Locale.US, "%s_%d_%s_v8_debug.jpg", this.b.C(), Integer.valueOf(this.a), this.o));
}
public File c() {
String str;
Throwable th;
FileOutputStream fileOutputStream;
FileOutputStream fileOutputStream2;
File sharingDirectory = AndroidUtilities.getSharingDirectory();
sharingDirectory.mkdirs();
File file = new File(sharingDirectory, String.format(Locale.US, "%s_%d.attheme", this.b.C(), Integer.valueOf(this.a)));
HashMap<String, Integer> b2 = w.b2(null, this.b.d, null);
HashMap<String, Integer> hashMap = new HashMap<>(b2);
a(b2, hashMap);
if (TextUtils.isEmpty(this.o)) {
str = null;
} else {
StringBuilder sb = new StringBuilder();
if (this.q) {
sb.append("motion");
}
Integer num = hashMap.get("chat_wallpaper");
if (num == null) {
num = -1;
}
Integer num2 = hashMap.get("chat_wallpaper_gradient_to");
if (num2 == null) {
num2 = r8;
}
Integer num3 = hashMap.get("key_chat_wallpaper_gradient_to2");
if (num3 == null) {
num3 = r8;
}
Integer num4 = hashMap.get("key_chat_wallpaper_gradient_to3");
r8 = num4 != null ? num4 : 0;
Integer num5 = hashMap.get("chat_wallpaper_gradient_rotation");
if (num5 == null) {
num5 = 45;
}
String lowerCase = String.format("%02x%02x%02x", Integer.valueOf(((byte) (num.intValue() >> 16)) & 255), Integer.valueOf(((byte) (num.intValue() >> 8)) & 255), Byte.valueOf((byte) (num.intValue() & 255))).toLowerCase();
String lowerCase2 = num2.intValue() != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (num2.intValue() >> 16)) & 255), Integer.valueOf(((byte) (num2.intValue() >> 8)) & 255), Byte.valueOf((byte) (num2.intValue() & 255))).toLowerCase() : null;
String lowerCase3 = num3.intValue() != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (num3.intValue() >> 16)) & 255), Integer.valueOf(((byte) (num3.intValue() >> 8)) & 255), Byte.valueOf((byte) (num3.intValue() & 255))).toLowerCase() : null;
String lowerCase4 = r8.intValue() != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (r8.intValue() >> 16)) & 255), Integer.valueOf(((byte) (r8.intValue() >> 8)) & 255), Byte.valueOf((byte) (r8.intValue() & 255))).toLowerCase() : null;
if (lowerCase2 == null || lowerCase3 == null) {
if (lowerCase2 != null) {
lowerCase = (lowerCase + "-" + lowerCase2) + "&rotation=" + num5;
}
} else if (lowerCase4 != null) {
lowerCase = lowerCase + "~" + lowerCase2 + "~" + lowerCase3 + "~" + lowerCase4;
} else {
lowerCase = lowerCase + "~" + lowerCase2 + "~" + lowerCase3;
}
str = "https://attheme.org?slug=" + this.o + "&intensity=" + ((int) (this.p * 100.0f)) + "&bg_color=" + lowerCase;
if (sb.length() > 0) {
str = str + "&mode=" + sb.toString();
}
}
StringBuilder sb2 = new StringBuilder();
for (Map.Entry<String, Integer> entry : hashMap.entrySet()) {
try {
String key = entry.getKey();
if (str == null || (!"chat_wallpaper".equals(key) && !"chat_wallpaper_gradient_to".equals(key) && !"key_chat_wallpaper_gradient_to2".equals(key) && !"key_chat_wallpaper_gradient_to3".equals(key))) {
sb2.append(key);
sb2.append("=");
sb2.append(entry.getValue());
sb2.append("\n");
}
} catch (Exception e) {
FileLog.e(e);
}
}
try {
fileOutputStream2 = new FileOutputStream(file);
} catch (Exception e2) {
e = e2;
fileOutputStream = null;
} catch (Throwable th2) {
th = th2;
fileOutputStream = null;
}
try {
fileOutputStream2.write(AndroidUtilities.getStringBytes(sb2.toString()));
if (!TextUtils.isEmpty(str)) {
fileOutputStream2.write(AndroidUtilities.getStringBytes("WLS=" + str + "\n"));
}
fileOutputStream2.close();
} catch (Exception e3) {
e = e3;
fileOutputStream = fileOutputStream2;
try {
FileLog.e(e);
if (fileOutputStream != null) {
fileOutputStream.close();
}
return file;
} catch (Throwable th3) {
th = th3;
if (fileOutputStream != null) {
throw th;
}
try {
fileOutputStream.close();
throw th;
} catch (Exception e4) {
FileLog.e(e4);
throw th;
}
}
} catch (Throwable th4) {
th = th4;
fileOutputStream = fileOutputStream2;
if (fileOutputStream != null) {
}
}
return file;
}
}
public static class v implements NotificationCenter.NotificationCenterDelegate {
private int A;
private int B;
public boolean G;
public boolean H;
public boolean I;
public int J;
public int Q;
public int R;
public int S;
public int T;
public SparseArray<u> U;
public ArrayList<u> V;
public LongSparseArray<u> W;
public LongSparseArray<u> X;
public int Y;
public int Z;
public String a;
private String a0;
public String b;
private String b0;
public String c;
public q c0;
public String d;
private int d0;
public String e;
public boolean f;
public boolean g;
public boolean h;
public int i;
public int j;
public int k;
public int l;
public int m;
public int n;
public int o;
public cu6 p;
public boolean q;
public String r;
public String s;
public xa5 t;
public xa5 u;
private int v;
public int w;
public int x;
public int y;
public int z;
v() {
this.m = 45;
this.q = true;
this.I = true;
this.T = -1;
this.X = new LongSparseArray<>();
this.Y = 0;
this.Z = 100;
this.d0 = -1;
}
public v(v vVar) {
this.m = 45;
this.q = true;
this.I = true;
this.T = -1;
this.X = new LongSparseArray<>();
this.Y = 0;
this.Z = 100;
this.d0 = -1;
this.a = vVar.a;
this.b = vVar.b;
this.c = vVar.c;
this.d = vVar.d;
this.e = vVar.e;
this.f = vVar.f;
this.g = vVar.g;
this.h = vVar.h;
this.i = vVar.i;
this.j = vVar.j;
this.k = vVar.k;
this.l = vVar.l;
this.m = vVar.m;
this.n = vVar.n;
this.o = vVar.o;
this.p = vVar.p;
this.q = vVar.q;
this.r = vVar.r;
this.s = vVar.s;
this.t = vVar.t;
this.u = vVar.u;
this.v = vVar.v;
this.w = vVar.w;
this.x = vVar.x;
this.y = vVar.y;
this.z = vVar.z;
this.A = vVar.A;
this.B = vVar.B;
this.G = vVar.G;
this.H = vVar.H;
this.I = vVar.I;
this.J = vVar.J;
this.Q = vVar.Q;
this.R = vVar.R;
this.S = vVar.S;
this.T = vVar.T;
this.U = vVar.U;
this.V = vVar.V;
this.W = vVar.W;
this.Z = vVar.Z;
this.a0 = vVar.a0;
this.b0 = vVar.b0;
this.c0 = vVar.c0;
}
public boolean K() {
if (!this.G) {
return false;
}
int i = this.S;
int i2 = w.l;
if (i == i2) {
return true;
}
u uVar = this.U.get(i2);
u uVar2 = this.U.get(this.S);
return (uVar2 == null || uVar == null || uVar.c != uVar2.c) ? false : true;
}
public boolean L() {
if (!this.G) {
return false;
}
int i = this.S;
int i2 = w.l;
if (i == i2) {
return true;
}
u uVar = this.U.get(i2);
u uVar2 = this.U.get(this.S);
return uVar != null && uVar2 != null && uVar.d == uVar2.d && uVar.e == uVar2.e && uVar.f == uVar2.f && uVar.g == uVar2.g && uVar.h == uVar2.h && uVar.i == uVar2.i;
}
public boolean M() {
if (!this.G) {
return false;
}
int i = this.S;
int i2 = w.l;
if (i == i2) {
return true;
}
u uVar = this.U.get(i2);
u uVar2 = this.U.get(this.S);
return uVar != null && uVar2 != null && uVar.e == uVar2.e && uVar.f == uVar2.f && uVar.g == uVar2.g && uVar.h == uVar2.h && uVar.i == uVar2.i;
}
public void O(File file) {
s(file, this.b0);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
w.v.this.U();
}
});
}
public void P(i95 i95Var, v vVar) {
if (!(i95Var instanceof d17)) {
U();
return;
}
d17 d17Var = (d17) i95Var;
this.a0 = FileLoader.getAttachFileName(d17Var.i);
r();
FileLoader.getInstance(vVar.o).loadFile(d17Var.i, d17Var, 1, 1);
}
public void Q(final v vVar, final i95 i95Var, ov5 ov5Var) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
w.v.this.P(i95Var, vVar);
}
});
}
private void R(SharedPreferences sharedPreferences, u uVar, String str) {
try {
String string = sharedPreferences.getString(str, null);
if (TextUtils.isEmpty(string)) {
return;
}
JSONObject jSONObject = new JSONObject(string);
q qVar = new q();
qVar.a = jSONObject.getString("wall");
qVar.b = jSONObject.getString("owall");
qVar.d = jSONObject.getInt("pColor");
qVar.e = jSONObject.getInt("pGrColor");
qVar.f = jSONObject.optInt("pGrColor2");
qVar.g = jSONObject.optInt("pGrColor3");
qVar.h = jSONObject.getInt("pGrAngle");
qVar.c = jSONObject.getString("wallSlug");
qVar.i = jSONObject.getBoolean("wBlur");
qVar.j = jSONObject.getBoolean("wMotion");
qVar.k = (float) jSONObject.getDouble("pIntensity");
qVar.n = this;
qVar.o = uVar;
if (uVar != null) {
uVar.y = qVar;
} else {
this.c0 = qVar;
}
if (jSONObject.has("wallId") && jSONObject.getLong("wallId") == 1000001) {
qVar.c = "d";
}
} catch (Throwable th) {
FileLog.e(th);
}
}
public void S() {
this.q = false;
this.a0 = null;
this.b0 = null;
r();
FileLoader fileLoader = FileLoader.getInstance(this.o);
cu6 cu6Var = this.p;
fileLoader.loadFile(cu6Var.i, cu6Var, 1, 1);
}
public void T(SharedPreferences sharedPreferences) {
ArrayList<u> arrayList = this.V;
if (arrayList == null || arrayList.isEmpty()) {
R(sharedPreferences, null, this.a + "_owp");
return;
}
int size = this.V.size();
for (int i = 0; i < size; i++) {
u uVar = this.V.get(i);
R(sharedPreferences, uVar, this.a + "_" + uVar.a + "_owp");
}
}
public void U() {
this.q = true;
this.H = false;
w.W2(true);
if (this == w.H && w.L == null) {
NotificationCenter globalInstance = NotificationCenter.getGlobalInstance();
int i = NotificationCenter.needSetDayNightTheme;
Object[] objArr = new Object[5];
objArr[0] = this;
objArr[1] = Boolean.valueOf(this == w.I);
objArr[2] = null;
objArr[3] = -1;
objArr[4] = w.N4;
globalInstance.postNotificationName(i, objArr);
}
}
public void V() {
NotificationCenter.getInstance(this.o).removeObserver(this, NotificationCenter.fileLoaded);
NotificationCenter.getInstance(this.o).removeObserver(this, NotificationCenter.fileLoadFailed);
}
public void W(int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4, int[] iArr5, int[] iArr6, int[] iArr7, int[] iArr8, String[] strArr, int[] iArr9, int[] iArr10) {
this.Q = iArr.length;
this.V = new ArrayList<>();
this.U = new SparseArray<>();
this.W = new LongSparseArray<>();
for (int i = 0; i < iArr.length; i++) {
u uVar = new u();
uVar.a = iArr8 != null ? iArr8[i] : i;
if (w.v2(uVar)) {
uVar.z = true;
}
uVar.c = iArr[i];
uVar.b = this;
if (iArr2 != null) {
uVar.e = iArr2[i];
}
if (iArr3 != null) {
uVar.f = iArr3[i];
}
if (iArr4 != null) {
uVar.j = iArr4[i];
if (this.G && uVar.a == w.l) {
uVar.j = 4294967296L;
} else {
uVar.j = iArr4[i];
}
}
if (iArr5 != null) {
if (this.G && uVar.a == w.l) {
uVar.k = 4294967296L;
} else {
uVar.k = iArr5[i];
}
}
if (iArr6 != null) {
if (this.G && uVar.a == w.l) {
uVar.l = 4294967296L;
} else {
uVar.l = iArr6[i];
}
}
if (iArr7 != null) {
uVar.m = (this.G && uVar.a == w.l) ? 4294967296L : iArr7[i];
}
if (strArr != null) {
uVar.p = iArr10[i] / 100.0f;
uVar.n = iArr9[i];
uVar.o = strArr[i];
}
this.U.put(uVar.a, uVar);
this.V.add(uVar);
}
this.R = this.U.get(0).c;
}
public static boolean e(u uVar, a27 a27Var) {
long j;
long j2;
int i;
String str;
float f;
int i2;
n27 n27Var;
long j3;
int intValue = a27Var.f.size() > 0 ? a27Var.f.get(0).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
int intValue2 = a27Var.f.size() > 1 ? a27Var.f.get(1).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
if (intValue == intValue2) {
intValue2 = 0;
}
int intValue3 = a27Var.f.size() > 2 ? a27Var.f.get(2).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
int intValue4 = a27Var.f.size() > 3 ? (-16777216) | a27Var.f.get(3).intValue() : 0;
m27 m27Var = a27Var.g;
long j4 = 0;
if (m27Var == null || (n27Var = m27Var.j) == null) {
j = 0;
j2 = 0;
i = 0;
str = null;
f = 0.0f;
i2 = 0;
} else {
i2 = w.j2(n27Var.d);
long j22 = a27Var.g.j.e == 0 ? 4294967296L : w.j2(r11);
long j23 = a27Var.g.j.f == 0 ? 4294967296L : w.j2(r11);
long j24 = a27Var.g.j.g == 0 ? 4294967296L : w.j2(r11);
int wallpaperRotation = AndroidUtilities.getWallpaperRotation(a27Var.g.j.i, false);
m27 m27Var2 = a27Var.g;
if ((m27Var2 instanceof e17) || !m27Var2.e) {
i = wallpaperRotation;
j3 = j23;
str = null;
f = 0.0f;
} else {
j3 = j23;
f = m27Var2.j.h / 100.0f;
str = m27Var2.h;
i = wallpaperRotation;
}
long j5 = j24;
j4 = j22;
j = j3;
j2 = j5;
}
return a27Var.d == uVar.c && a27Var.e == uVar.d && intValue == uVar.e && intValue2 == uVar.f && intValue3 == uVar.g && intValue4 == uVar.h && a27Var.b == uVar.i && ((long) i2) == uVar.j && j4 == uVar.k && j == uVar.l && j2 == uVar.m && i == uVar.n && TextUtils.equals(str, uVar.o) && ((double) Math.abs(f - uVar.p)) < 0.001d;
}
private void r() {
NotificationCenter.getInstance(this.o).addObserver(this, NotificationCenter.fileLoaded);
NotificationCenter.getInstance(this.o).addObserver(this, NotificationCenter.fileLoadFailed);
}
static v w(JSONObject jSONObject) {
if (jSONObject == null) {
return null;
}
try {
v vVar = new v();
vVar.a = jSONObject.getString("name");
vVar.b = jSONObject.getString("path");
if (jSONObject.has("account")) {
vVar.o = jSONObject.getInt("account");
}
if (jSONObject.has("info")) {
try {
st4 st4Var = new st4(Utilities.hexToBytes(jSONObject.getString("info")));
vVar.p = z17.a(st4Var, st4Var.readInt32(true), true);
} catch (Throwable th) {
FileLog.e(th);
}
}
if (jSONObject.has("loaded")) {
vVar.q = jSONObject.getBoolean("loaded");
}
return vVar;
} catch (Exception e) {
FileLog.e(e);
return null;
}
}
static v x(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
String[] split = str.split("\\|");
if (split.length != 2) {
return null;
}
v vVar = new v();
vVar.a = split[0];
vVar.b = split[1];
return vVar;
}
public static void y(u uVar, a27 a27Var) {
n27 n27Var;
uVar.c = a27Var.d;
uVar.d = a27Var.e;
uVar.e = a27Var.f.size() > 0 ? a27Var.f.get(0).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
int intValue = a27Var.f.size() > 1 ? a27Var.f.get(1).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
uVar.f = intValue;
if (uVar.e == intValue) {
uVar.f = 0;
}
uVar.g = a27Var.f.size() > 2 ? a27Var.f.get(2).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
uVar.h = a27Var.f.size() > 3 ? a27Var.f.get(3).intValue() | com.batch.android.messaging.view.roundimage.b.v : 0;
uVar.i = a27Var.b;
m27 m27Var = a27Var.g;
if (m27Var == null || (n27Var = m27Var.j) == null) {
return;
}
if (n27Var.d == 0) {
uVar.j = 4294967296L;
} else {
uVar.j = w.j2(r0);
}
n27 n27Var2 = a27Var.g.j;
if ((n27Var2.a & 16) == 0 || n27Var2.e != 0) {
uVar.k = w.j2(n27Var2.e);
} else {
uVar.k = 4294967296L;
}
n27 n27Var3 = a27Var.g.j;
if ((n27Var3.a & 32) == 0 || n27Var3.f != 0) {
uVar.l = w.j2(n27Var3.f);
} else {
uVar.l = 4294967296L;
}
n27 n27Var4 = a27Var.g.j;
if ((n27Var4.a & 64) == 0 || n27Var4.g != 0) {
uVar.m = w.j2(n27Var4.g);
} else {
uVar.m = 4294967296L;
}
uVar.n = AndroidUtilities.getWallpaperRotation(a27Var.g.j.i, false);
m27 m27Var2 = a27Var.g;
if ((m27Var2 instanceof e17) || !m27Var2.e) {
return;
}
uVar.o = m27Var2.h;
n27 n27Var5 = m27Var2.j;
uVar.p = n27Var5.h / 100.0f;
uVar.q = n27Var5.c;
}
public u A(boolean z) {
u uVar;
if (this.V == null || (uVar = this.U.get(this.S)) == null) {
return null;
}
if (!z) {
return uVar;
}
int i = this.Z + 1;
this.Z = i;
u uVar2 = new u();
uVar2.c = uVar.c;
uVar2.d = uVar.d;
uVar2.e = uVar.e;
uVar2.f = uVar.f;
uVar2.g = uVar.g;
uVar2.h = uVar.h;
uVar2.i = uVar.i;
uVar2.j = uVar.j;
uVar2.k = uVar.k;
uVar2.l = uVar.l;
uVar2.m = uVar.m;
uVar2.n = uVar.n;
uVar2.o = uVar.o;
uVar2.p = uVar.p;
uVar2.q = uVar.q;
uVar2.b = this;
q qVar = this.c0;
if (qVar != null) {
uVar2.y = new q(qVar, this, uVar2);
}
this.T = this.S;
uVar2.a = i;
this.S = i;
this.c0 = uVar2.y;
this.U.put(i, uVar2);
this.V.add(0, uVar2);
w.q3(this);
return uVar2;
}
public int B(int i) {
u uVar = this.U.get(i);
if (uVar != null) {
return uVar.c;
}
return 0;
}
public String C() {
if (this.p == null) {
return this.a;
}
return "remote" + this.p.e;
}
public String D() {
int i;
String str;
if ("Blue".equals(this.a)) {
i = R.string.ThemeClassic;
str = "ThemeClassic";
} else if ("Dark Blue".equals(this.a)) {
i = R.string.ThemeDark;
str = "ThemeDark";
} else if ("Arctic Blue".equals(this.a)) {
i = R.string.ThemeArcticBlue;
str = "ThemeArcticBlue";
} else if ("Day".equals(this.a)) {
i = R.string.ThemeDay;
str = "ThemeDay";
} else {
if (!"Night".equals(this.a)) {
cu6 cu6Var = this.p;
return cu6Var != null ? cu6Var.h : this.a;
}
i = R.string.ThemeNight;
str = "ThemeNight";
}
return LocaleController.getString(str, i);
}
public int E() {
if (this.G && this.S == w.l) {
return -3155485;
}
return this.v;
}
public int F() {
if (this.G && this.S == w.l) {
return -1;
}
return this.A;
}
public int G() {
if (this.G && this.S == w.l) {
return -983328;
}
return this.B;
}
JSONObject H() {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("name", this.a);
jSONObject.put("path", this.b);
jSONObject.put("account", this.o);
cu6 cu6Var = this.p;
if (cu6Var != null) {
st4 st4Var = new st4(cu6Var.getObjectSize());
this.p.serializeToStream(st4Var);
jSONObject.put("info", Utilities.bytesToHex(st4Var.d()));
}
jSONObject.put("loaded", this.q);
return jSONObject;
} catch (Exception e) {
FileLog.e(e);
return null;
}
}
public boolean I() {
return this.Q != 0;
}
public boolean J() {
int i = this.d0;
if (i != -1) {
return i == 1;
}
if ("Dark Blue".equals(this.a) || "Night".equals(this.a)) {
this.d0 = 1;
} else if ("Blue".equals(this.a) || "Arctic Blue".equals(this.a) || "Day".equals(this.a)) {
this.d0 = 0;
}
if (this.d0 == -1) {
w.r0(w.b2(new File(this.b), null, new String[1]), this);
}
return this.d0 == 1;
}
public boolean N() {
return this.b == null && !J();
}
public void X(int i) {
this.S = i;
u A = A(false);
if (A != null) {
this.c0 = A.y;
}
}
public void Y(q qVar) {
if (this.c0 == qVar) {
return;
}
u A = A(false);
q qVar2 = this.c0;
if (qVar2 != null) {
qVar2.c();
}
if (qVar != null) {
qVar.o = A;
qVar.n = this;
qVar.h();
}
this.c0 = qVar;
if (A != null) {
A.y = qVar;
}
}
public void Z(int i) {
this.v = i;
}
public void a0(int i) {
this.A = i;
}
public void b0(int i) {
this.B = i;
}
@Override
public void didReceivedNotification(int i, int i2, Object... objArr) {
int i3 = NotificationCenter.fileLoaded;
if (i == i3 || i == NotificationCenter.fileLoadFailed) {
String str = (String) objArr[0];
cu6 cu6Var = this.p;
if (cu6Var == null || cu6Var.i == null) {
return;
}
if (str.equals(this.a0)) {
this.a0 = null;
final File file = (File) objArr[1];
Utilities.globalQueue.postRunnable(new Runnable() {
@Override
public final void run() {
w.v.this.O(file);
}
});
return;
}
if (str.equals(FileLoader.getAttachFileName(this.p.i))) {
V();
if (i == i3) {
File file2 = new File(this.b);
cu6 cu6Var2 = this.p;
final v f1 = w.f1(file2, cu6Var2.h, cu6Var2);
if (f1 == null || f1.c == null || new File(f1.c).exists()) {
U();
return;
}
this.i = f1.i;
this.j = f1.j;
this.k = f1.k;
this.l = f1.l;
this.m = f1.m;
this.g = f1.g;
this.n = f1.n;
this.b0 = f1.c;
oe5 oe5Var = new oe5();
b36 b36Var = new b36();
b36Var.a = f1.e;
oe5Var.a = b36Var;
ConnectionsManager.getInstance(f1.o).sendRequest(oe5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var, ov5 ov5Var) {
w.v.this.Q(f1, i95Var, ov5Var);
}
});
}
}
}
}
public boolean s(File file, String str) {
int patternColor;
try {
Bitmap scaledBitmap = AndroidUtilities.getScaledBitmap(AndroidUtilities.dp(640.0f), AndroidUtilities.dp(360.0f), file.getAbsolutePath(), null, 0);
if (scaledBitmap != null && this.i != 0) {
Bitmap createBitmap = Bitmap.createBitmap(scaledBitmap.getWidth(), scaledBitmap.getHeight(), scaledBitmap.getConfig());
Canvas canvas = new Canvas(createBitmap);
int i = this.k;
if (i != 0) {
patternColor = sg3.k(this.i, this.j, i, this.l);
} else {
int i2 = this.j;
if (i2 != 0) {
patternColor = AndroidUtilities.getAverageColor(this.i, i2);
GradientDrawable gradientDrawable = new GradientDrawable(org.telegram.ui.Components.o.m(this.m), new int[]{this.i, this.j});
gradientDrawable.setBounds(0, 0, createBitmap.getWidth(), createBitmap.getHeight());
gradientDrawable.draw(canvas);
} else {
patternColor = AndroidUtilities.getPatternColor(this.i);
canvas.drawColor(this.i);
}
}
Paint paint = new Paint(2);
paint.setColorFilter(new PorterDuffColorFilter(patternColor, PorterDuff.Mode.SRC_IN));
paint.setAlpha((int) ((this.n / 100.0f) * 255.0f));
canvas.drawBitmap(scaledBitmap, 0.0f, 0.0f, paint);
canvas.setBitmap(null);
scaledBitmap = createBitmap;
}
if (this.g) {
scaledBitmap = Utilities.blurWallpaper(scaledBitmap);
}
FileOutputStream fileOutputStream = new FileOutputStream(str);
scaledBitmap.compress(this.k != 0 ? Bitmap.CompressFormat.PNG : Bitmap.CompressFormat.JPEG, 87, fileOutputStream);
fileOutputStream.close();
return true;
} catch (Throwable th) {
FileLog.e(th);
return false;
}
}
public u t(cu6 cu6Var, int i) {
return u(cu6Var, i, false, 0);
}
public u u(cu6 cu6Var, int i, boolean z, int i2) {
if (cu6Var == null) {
return null;
}
a27 a27Var = i2 < cu6Var.j.size() ? cu6Var.j.get(i2) : null;
if (z) {
u uVar = this.X.get(cu6Var.e);
if (uVar != null) {
return uVar;
}
int i3 = this.Y + 1;
this.Y = i3;
u v = v(a27Var);
v.a = i3;
v.r = cu6Var;
v.t = i;
this.X.put(i3, v);
return v;
}
u uVar2 = this.W.get(cu6Var.e);
if (uVar2 != null) {
return uVar2;
}
int i4 = this.Z + 1;
this.Z = i4;
u v2 = v(a27Var);
v2.a = i4;
v2.r = cu6Var;
v2.t = i;
this.U.put(i4, v2);
this.V.add(0, v2);
w.q3(this);
this.W.put(cu6Var.e, v2);
return v2;
}
public u v(a27 a27Var) {
u uVar = new u();
y(uVar, a27Var);
uVar.b = this;
return uVar;
}
public String z(u uVar, boolean z) {
StringBuilder sb;
StringBuilder sb2;
if (uVar == null) {
uVar = A(false);
}
if (uVar == null) {
StringBuilder sb3 = new StringBuilder();
if (z) {
sb = new StringBuilder();
sb.append(this.a);
sb.append("_wp_o");
} else {
sb = new StringBuilder();
sb.append(this.a);
sb.append("_wp");
}
sb3.append(sb.toString());
sb3.append(Utilities.random.nextInt());
sb3.append(".jpg");
return sb3.toString();
}
StringBuilder sb4 = new StringBuilder();
if (z) {
sb2 = new StringBuilder();
sb2.append(this.a);
sb2.append("_");
sb2.append(uVar.a);
sb2.append("_wp_o");
} else {
sb2 = new StringBuilder();
sb2.append(this.a);
sb2.append("_");
sb2.append(uVar.a);
sb2.append("_wp");
}
sb4.append(sb2.toString());
sb4.append(Utilities.random.nextInt());
sb4.append(".jpg");
return sb4.toString();
}
}
static {
v vVar;
Iterator<v> it;
SharedPreferences.Editor editor;
boolean z5;
Iterator<v> it2;
SharedPreferences sharedPreferences;
SparseArray<u> sparseArray;
u A5;
boolean z6;
m = 0;
o = 0.25f;
p = 1320;
q = 480;
r = 1320;
s = -1;
t = 480;
u = BuildConfig.FLAVOR;
v = 10000.0d;
w = 10000.0d;
new HashSet();
M4 = new HashMap<>();
N4 = new HashMap<>();
O4 = new HashSet<>();
T4 = new ThreadLocal<>();
U4 = new ThreadLocal<>();
V4 = new ThreadLocal<>();
W4 = new ThreadLocal<>();
X4 = new ThreadLocal<>();
M4.put("dialogBackground", -1);
M4.put("dialogBackgroundGray", -986896);
M4.put("dialogTextBlack", -14540254);
M4.put("dialogTextLink", -14255946);
M4.put("dialogLinkSelection", 862104035);
M4.put("dialogTextRed", -3319206);
M4.put("dialogTextRed2", -2213318);
M4.put("dialogTextBlue", -13660983);
M4.put("dialogTextBlue2", -12937771);
M4.put("dialogTextBlue3", -12664327);
M4.put("dialogTextBlue4", -15095832);
M4.put("dialogTextGray", -13333567);
M4.put("dialogTextGray2", -9079435);
M4.put("dialogTextGray3", -6710887);
M4.put("dialogTextGray4", -5000269);
M4.put("dialogTextHint", -6842473);
M4.put("dialogIcon", -9999504);
M4.put("dialogRedIcon", -2011827);
M4.put("dialogGrayLine", -2960686);
M4.put("dialogTopBackground", -9456923);
M4.put("dialogInputField", -2368549);
M4.put("dialogInputFieldActivated", -13129232);
M4.put("dialogCheckboxSquareBackground", -12345121);
M4.put("dialogCheckboxSquareCheck", -1);
M4.put("dialogCheckboxSquareUnchecked", -9211021);
M4.put("dialogCheckboxSquareDisabled", -5197648);
M4.put("dialogRadioBackground", -5000269);
M4.put("dialogRadioBackgroundChecked", -13129232);
M4.put("dialogProgressCircle", -14115349);
M4.put("dialogLineProgress", -11371101);
M4.put("dialogLineProgressBackground", -2368549);
M4.put("dialogButton", -11955764);
M4.put("dialogButtonSelector", 251658240);
M4.put("dialogScrollGlow", -657673);
M4.put("dialogRoundCheckBox", -11750155);
M4.put("dialogRoundCheckBoxCheck", -1);
M4.put("dialogBadgeBackground", -12664327);
M4.put("dialogBadgeText", -1);
M4.put("dialogCameraIcon", -1);
M4.put("dialog_inlineProgressBackground", -151981323);
M4.put("dialog_inlineProgress", -9735304);
M4.put("dialogSearchBackground", -854795);
M4.put("dialogSearchHint", -6774617);
M4.put("dialogSearchIcon", -6182737);
M4.put("dialogSearchText", -14540254);
M4.put("dialogFloatingButton", -11750155);
M4.put("dialogFloatingButtonPressed", 251658240);
M4.put("dialogFloatingIcon", -1);
M4.put("dialogShadowLine", 301989888);
M4.put("dialogEmptyImage", -6314840);
M4.put("dialogEmptyText", -7565164);
M4.put("dialogSwipeRemove", -1743531);
M4.put("dialogSwipeRemove", -1743531);
M4.put("dialogReactionMentionBackground", -1026983);
M4.put("windowBackgroundWhite", -1);
M4.put("windowBackgroundUnchecked", -6445135);
M4.put("windowBackgroundChecked", -11034919);
M4.put("windowBackgroundCheckText", -1);
M4.put("progressCircle", -14904349);
M4.put("windowBackgroundWhiteGrayIcon", -8288629);
M4.put("windowBackgroundWhiteBlueText", -12545331);
M4.put("windowBackgroundWhiteBlueText2", -12937771);
M4.put("windowBackgroundWhiteBlueText3", -14255946);
M4.put("windowBackgroundWhiteBlueText4", -14904349);
M4.put("windowBackgroundWhiteBlueText5", -11759926);
M4.put("windowBackgroundWhiteBlueText6", -12940081);
M4.put("windowBackgroundWhiteBlueText7", -13141330);
M4.put("windowBackgroundWhiteBlueButton", -14776109);
M4.put("windowBackgroundWhiteBlueIcon", -13132315);
M4.put("windowBackgroundWhiteGreenText", -14248148);
M4.put("windowBackgroundWhiteGreenText2", -13129704);
M4.put("windowBackgroundWhiteRedText", -3319206);
M4.put("windowBackgroundWhiteRedText2", -2404015);
M4.put("windowBackgroundWhiteRedText3", -2995895);
M4.put("windowBackgroundWhiteRedText4", -3198928);
M4.put("windowBackgroundWhiteRedText5", -1230535);
M4.put("windowBackgroundWhiteRedText6", -39322);
M4.put("windowBackgroundWhiteGrayText", -8156010);
M4.put("windowBackgroundWhiteGrayText2", -8223094);
M4.put("windowBackgroundWhiteGrayText3", -6710887);
M4.put("windowBackgroundWhiteGrayText4", -8355712);
M4.put("windowBackgroundWhiteGrayText5", -6052957);
M4.put("windowBackgroundWhiteGrayText6", -9079435);
M4.put("windowBackgroundWhiteGrayText7", -3750202);
M4.put("windowBackgroundWhiteGrayText8", -9605774);
M4.put("windowBackgroundWhiteGrayLine", -2368549);
M4.put("windowBackgroundWhiteBlackText", -14540254);
M4.put("windowBackgroundWhiteHintText", -5723992);
M4.put("windowBackgroundWhiteValueText", -12937771);
M4.put("windowBackgroundWhiteLinkText", -14255946);
M4.put("windowBackgroundWhiteLinkSelection", 862104035);
M4.put("windowBackgroundWhiteBlueHeader", -12937771);
M4.put("windowBackgroundWhiteInputField", -2368549);
M4.put("windowBackgroundWhiteInputFieldActivated", -13129232);
M4.put("switchTrack", -5196358);
M4.put("switchTrackChecked", -11358743);
M4.put("switchTrackBlue", -8221031);
M4.put("switchTrackBlueChecked", -12810041);
M4.put("switchTrackBlueThumb", -1);
M4.put("switchTrackBlueThumbChecked", -1);
M4.put("switchTrackBlueSelector", 390089299);
M4.put("switchTrackBlueSelectorChecked", 553797505);
M4.put("switch2Track", -688514);
M4.put("switch2TrackChecked", -11358743);
M4.put("checkboxSquareBackground", -12345121);
M4.put("checkboxSquareCheck", -1);
M4.put("checkboxSquareUnchecked", -9211021);
M4.put("checkboxSquareDisabled", -5197648);
M4.put("listSelectorSDK21", 251658240);
M4.put("radioBackground", -5000269);
M4.put("radioBackgroundChecked", -13129232);
M4.put("windowBackgroundGray", -986896);
HashMap<String, Integer> hashMap = M4;
Integer valueOf = Integer.valueOf(com.batch.android.messaging.view.roundimage.b.v);
hashMap.put("windowBackgroundGrayShadow", valueOf);
M4.put("emptyListPlaceholder", -6974059);
M4.put("divider", -2500135);
M4.put("graySection", -657931);
M4.put("key_graySectionText", -8222838);
M4.put("contextProgressInner1", -4202506);
M4.put("contextProgressOuter1", -13920542);
M4.put("contextProgressInner2", -4202506);
M4.put("contextProgressOuter2", -1);
M4.put("contextProgressInner3", -5000269);
M4.put("contextProgressOuter3", -1);
M4.put("contextProgressInner4", -3486256);
M4.put("contextProgressOuter4", -13683656);
M4.put("fastScrollActive", -11361317);
M4.put("fastScrollInactive", -3551791);
M4.put("fastScrollText", -1);
M4.put("avatar_text", -1);
M4.put("avatar_backgroundSaved", -10043398);
M4.put("avatar_backgroundArchived", -5654847);
M4.put("avatar_backgroundArchivedHidden", -10043398);
M4.put("avatar_backgroundRed", -1743531);
M4.put("avatar_backgroundOrange", -881592);
M4.put("avatar_backgroundViolet", -7436818);
M4.put("avatar_backgroundGreen", -8992691);
M4.put("avatar_backgroundCyan", -10502443);
M4.put("avatar_backgroundBlue", -11232035);
M4.put("avatar_backgroundPink", -887654);
M4.put("avatar_backgroundInProfileBlue", -11500111);
M4.put("avatar_backgroundActionBarBlue", -10907718);
M4.put("avatar_subtitleInProfileBlue", -2626822);
M4.put("avatar_actionBarSelectorBlue", -11959891);
M4.put("avatar_actionBarIconBlue", -1);
M4.put("avatar_nameInMessageRed", -3516848);
M4.put("avatar_nameInMessageOrange", -2589911);
M4.put("avatar_nameInMessageViolet", -11627828);
M4.put("avatar_nameInMessageGreen", -11488718);
M4.put("avatar_nameInMessageCyan", -13132104);
M4.put("avatar_nameInMessageBlue", -11627828);
M4.put("avatar_nameInMessagePink", -11627828);
M4.put("actionBarDefault", -11371101);
M4.put("actionBarDefaultIcon", -1);
M4.put("actionBarActionModeDefault", -1);
M4.put("actionBarActionModeDefaultTop", 268435456);
M4.put("actionBarActionModeDefaultIcon", -9999761);
M4.put("actionBarDefaultTitle", -1);
M4.put("actionBarDefaultSubtitle", -2758409);
M4.put("actionBarDefaultSelector", -12554860);
M4.put("actionBarWhiteSelector", 486539264);
M4.put("actionBarDefaultSearch", -1);
M4.put("actionBarDefaultSearchPlaceholder", -1996488705);
M4.put("actionBarDefaultSubmenuItem", -14540254);
M4.put("actionBarDefaultSubmenuItemIcon", -9999504);
M4.put("actionBarDefaultSubmenuBackground", -1);
M4.put("actionBarActionModeDefaultSelector", -1907998);
M4.put("actionBarTabActiveText", -1);
M4.put("actionBarTabUnactiveText", -2758409);
M4.put("actionBarTabLine", -1);
M4.put("actionBarTabSelector", -12554860);
M4.put("actionBarBrowser", -1);
M4.put("actionBarDefaultArchived", -9471353);
M4.put("actionBarDefaultArchivedSelector", -10590350);
M4.put("actionBarDefaultArchivedIcon", -1);
M4.put("actionBarDefaultArchivedTitle", -1);
M4.put("actionBarDefaultArchivedSearch", -1);
M4.put("actionBarDefaultSearchArchivedPlaceholder", -1996488705);
M4.put("chats_onlineCircle", -11810020);
M4.put("chats_unreadCounter", -11613090);
M4.put("chats_unreadCounterMuted", -3749428);
M4.put("chats_unreadCounterText", -1);
M4.put("chats_archiveBackground", -10049056);
M4.put("chats_archivePinBackground", -6313293);
M4.put("chats_archiveIcon", -1);
M4.put("chats_archiveText", -1);
M4.put("chats_name", -14540254);
M4.put("chats_nameArchived", -11382190);
M4.put("chats_secretName", -16734706);
M4.put("chats_secretIcon", -15093466);
M4.put("chats_nameIcon", -14408668);
M4.put("chats_pinnedIcon", -5723992);
M4.put("chats_message", -7631473);
M4.put("chats_messageArchived", -7237231);
M4.put("chats_message_threeLines", -7434095);
M4.put("chats_draft", -2274503);
M4.put("chats_nameMessage", -12812624);
M4.put("chats_nameMessageArchived", -7631473);
M4.put("chats_nameMessage_threeLines", -12434359);
M4.put("chats_nameMessageArchived_threeLines", -10592674);
M4.put("chats_attachMessage", -12812624);
M4.put("chats_actionMessage", -12812624);
M4.put("chats_date", -6973028);
M4.put("chats_pinnedOverlay", 134217728);
M4.put("chats_tabletSelectedOverlay", 251658240);
M4.put("chats_sentCheck", -12146122);
M4.put("chats_sentReadCheck", -12146122);
M4.put("chats_sentClock", -9061026);
M4.put("chats_sentError", -2796974);
M4.put("chats_sentErrorIcon", -1);
M4.put("chats_verifiedBackground", -13391642);
M4.put("chats_verifiedCheck", -1);
M4.put("chats_muteIcon", -4341308);
M4.put("chats_mentionIcon", -1);
M4.put("chats_menuBackground", -1);
M4.put("chats_menuItemText", -12303292);
M4.put("chats_menuItemCheck", -10907718);
M4.put("chats_menuItemIcon", -7827048);
M4.put("chats_menuName", -1);
M4.put("chats_menuPhone", -1);
M4.put("chats_menuPhoneCats", -4004353);
M4.put("chats_menuCloud", -1);
M4.put("chats_menuCloudBackgroundCats", -12420183);
M4.put("chats_actionIcon", -1);
M4.put("chats_actionBackground", -10114592);
M4.put("chats_actionPressedBackground", -11100714);
M4.put("chats_actionUnreadIcon", -9211021);
M4.put("chats_actionUnreadBackground", -1);
M4.put("chats_actionUnreadPressedBackground", -855310);
M4.put("chats_menuTopBackgroundCats", -10907718);
M4.put("chats_archivePullDownBackground", -3749428);
M4.put("chats_archivePullDownBackgroundActive", -10049056);
M4.put("chat_attachMediaBanBackground", -12171706);
M4.put("chat_attachMediaBanText", -1);
M4.put("chat_attachCheckBoxCheck", -1);
M4.put("chat_attachCheckBoxBackground", -12995849);
M4.put("chat_attachPhotoBackground", 201326592);
M4.put("chat_attachActiveTab", -13391883);
M4.put("chat_attachUnactiveTab", -7169634);
M4.put("chat_attachPermissionImage", -13421773);
M4.put("chat_attachPermissionMark", -1945520);
M4.put("chat_attachPermissionText", -9472134);
M4.put("chat_attachEmptyImage", -3355444);
M4.put("chat_attachGalleryBackground", -12214795);
M4.put("chat_attachGalleryText", -13726231);
M4.put("chat_attachGalleryIcon", -1);
M4.put("chat_attachAudioBackground", -1351584);
M4.put("chat_attachAudioText", -2209977);
M4.put("chat_attachAudioIcon", -1);
M4.put("chat_attachFileBackground", -13321743);
M4.put("chat_attachFileText", -15423260);
M4.put("chat_attachFileIcon", -1);
M4.put("chat_attachContactBackground", -868277);
M4.put("chat_attachContactText", -2121728);
M4.put("chat_attachContactIcon", -1);
M4.put("chat_attachLocationBackground", -10436011);
M4.put("chat_attachLocationText", -12801233);
M4.put("chat_attachLocationIcon", -1);
M4.put("chat_attachPollBackground", -868277);
M4.put("chat_attachPollText", -2121728);
M4.put("chat_attachPollIcon", -1);
M4.put("chat_inPollCorrectAnswer", -10436011);
M4.put("chat_outPollCorrectAnswer", -10436011);
M4.put("chat_inPollWrongAnswer", -1351584);
M4.put("chat_outPollWrongAnswer", -1351584);
M4.put("chat_status", -2758409);
M4.put("chat_inDownCall", -16725933);
M4.put("chat_inUpCall", -47032);
M4.put("chat_outUpCall", -16725933);
M4.put("chat_lockIcon", -1);
M4.put("chat_muteIcon", -5124893);
M4.put("chat_inBubble", -1);
M4.put("chat_inBubbleSelected", -1247235);
M4.put("chat_inBubbleShadow", -14862509);
M4.put("chat_outBubble", -1048610);
M4.put("chat_outBubbleGradientSelectedOverlay", 335544320);
M4.put("chat_outBubbleSelected", -2492475);
M4.put("chat_outBubbleShadow", -14781172);
M4.put("chat_inMediaIcon", -1);
M4.put("chat_inMediaIconSelected", -1050370);
M4.put("chat_outMediaIcon", -1048610);
M4.put("chat_outMediaIconSelected", -1967921);
M4.put("chat_messageTextIn", valueOf);
M4.put("chat_messageTextOut", valueOf);
M4.put("chat_messageLinkIn", -14255946);
M4.put("chat_messageLinkOut", -14255946);
M4.put("chat_serviceText", -1);
M4.put("chat_serviceLink", -1);
M4.put("chat_serviceIcon", -1);
M4.put("chat_mediaTimeBackground", 1711276032);
M4.put("chat_outSentCheck", -10637232);
M4.put("chat_outSentCheckSelected", -10637232);
M4.put("chat_outSentCheckRead", -10637232);
M4.put("chat_outSentCheckReadSelected", -10637232);
M4.put("chat_outSentClock", -9061026);
M4.put("chat_outSentClockSelected", -9061026);
M4.put("chat_inSentClock", -6182221);
M4.put("chat_inSentClockSelected", -7094838);
M4.put("chat_mediaSentCheck", -1);
M4.put("chat_mediaSentClock", -1);
M4.put("chat_inViews", -6182221);
M4.put("chat_inViewsSelected", -7094838);
M4.put("chat_outViews", -9522601);
M4.put("chat_outViewsSelected", -9522601);
M4.put("chat_mediaViews", -1);
M4.put("chat_inMenu", -4801083);
M4.put("chat_inMenuSelected", -6766130);
M4.put("chat_outMenu", -7221634);
M4.put("chat_outMenuSelected", -7221634);
M4.put("chat_mediaMenu", -1);
M4.put("chat_outInstant", -11162801);
M4.put("chat_outInstantSelected", -12019389);
M4.put("chat_inInstant", -12940081);
M4.put("chat_inInstantSelected", -13600331);
M4.put("chat_sentError", -2411211);
M4.put("chat_sentErrorIcon", -1);
M4.put("chat_selectedBackground", 671781104);
M4.put("chat_previewDurationText", -1);
M4.put("chat_previewGameText", -1);
M4.put("chat_inPreviewInstantText", -12940081);
M4.put("chat_outPreviewInstantText", -11162801);
M4.put("chat_inPreviewInstantSelectedText", -13600331);
M4.put("chat_outPreviewInstantSelectedText", -12019389);
M4.put("chat_secretTimeText", -1776928);
M4.put("chat_stickerNameText", -1);
M4.put("chat_botButtonText", -1);
M4.put("chat_botProgress", -1);
M4.put("chat_inForwardedNameText", -13072697);
M4.put("chat_outForwardedNameText", -11162801);
M4.put("chat_inPsaNameText", -10838983);
M4.put("chat_outPsaNameText", -10838983);
M4.put("chat_inViaBotNameText", -12940081);
M4.put("chat_outViaBotNameText", -11162801);
M4.put("chat_stickerViaBotNameText", -1);
M4.put("chat_inReplyLine", -10903592);
M4.put("chat_outReplyLine", -9520791);
M4.put("chat_stickerReplyLine", -1);
M4.put("chat_inReplyNameText", -12940081);
M4.put("chat_outReplyNameText", -11162801);
M4.put("chat_stickerReplyNameText", -1);
M4.put("chat_inReplyMessageText", valueOf);
M4.put("chat_outReplyMessageText", valueOf);
M4.put("chat_inReplyMediaMessageText", -6182221);
M4.put("chat_outReplyMediaMessageText", -10112933);
M4.put("chat_inReplyMediaMessageSelectedText", -7752511);
M4.put("chat_outReplyMediaMessageSelectedText", -10112933);
M4.put("chat_stickerReplyMessageText", -1);
M4.put("chat_inPreviewLine", -9390872);
M4.put("chat_outPreviewLine", -7812741);
M4.put("chat_inSiteNameText", -12940081);
M4.put("chat_outSiteNameText", -11162801);
M4.put("chat_inContactNameText", -11625772);
M4.put("chat_outContactNameText", -11162801);
M4.put("chat_inContactPhoneText", -13683656);
M4.put("chat_inContactPhoneSelectedText", -13683656);
M4.put("chat_outContactPhoneText", -13286860);
M4.put("chat_outContactPhoneSelectedText", -13286860);
M4.put("chat_mediaProgress", -1);
M4.put("chat_inAudioProgress", -1);
M4.put("chat_outAudioProgress", -1048610);
M4.put("chat_inAudioSelectedProgress", -1050370);
M4.put("chat_outAudioSelectedProgress", -1967921);
M4.put("chat_mediaTimeText", -1);
M4.put("chat_adminText", -4143413);
M4.put("chat_adminSelectedText", -7752511);
M4.put("chat_outAdminText", -9391780);
M4.put("chat_outAdminSelectedText", -9391780);
M4.put("chat_inTimeText", -6182221);
M4.put("chat_inTimeSelectedText", -7752511);
M4.put("chat_outTimeText", -9391780);
M4.put("chat_outTimeSelectedText", -9391780);
M4.put("chat_inAudioPerfomerText", -13683656);
M4.put("chat_inAudioPerfomerSelectedText", -13683656);
M4.put("chat_outAudioPerfomerText", -13286860);
M4.put("chat_outAudioPerfomerSelectedText", -13286860);
M4.put("chat_inAudioTitleText", -11625772);
M4.put("chat_outAudioTitleText", -11162801);
M4.put("chat_inAudioDurationText", -6182221);
M4.put("chat_outAudioDurationText", -10112933);
M4.put("chat_inAudioDurationSelectedText", -7752511);
M4.put("chat_outAudioDurationSelectedText", -10112933);
M4.put("chat_inAudioSeekbar", -1774864);
M4.put("chat_inAudioCacheSeekbar", 1071966960);
M4.put("chat_outAudioSeekbar", -4463700);
M4.put("chat_outAudioCacheSeekbar", 1069278124);
M4.put("chat_inAudioSeekbarSelected", -4399384);
M4.put("chat_outAudioSeekbarSelected", -5644906);
M4.put("chat_inAudioSeekbarFill", -9259544);
M4.put("chat_outAudioSeekbarFill", -8863118);
M4.put("chat_inVoiceSeekbar", -2169365);
M4.put("chat_outVoiceSeekbar", -4463700);
M4.put("chat_inVoiceSeekbarSelected", -4399384);
M4.put("chat_outVoiceSeekbarSelected", -5644906);
M4.put("chat_inVoiceSeekbarFill", -9259544);
M4.put("chat_outVoiceSeekbarFill", -8863118);
M4.put("chat_inFileProgress", -1314571);
M4.put("chat_outFileProgress", -2427453);
M4.put("chat_inFileProgressSelected", -3413258);
M4.put("chat_outFileProgressSelected", -3806041);
M4.put("chat_inFileNameText", -11625772);
M4.put("chat_outFileNameText", -11162801);
M4.put("chat_inFileInfoText", -6182221);
M4.put("chat_outFileInfoText", -10112933);
M4.put("chat_inFileInfoSelectedText", -7752511);
M4.put("chat_outFileInfoSelectedText", -10112933);
M4.put("chat_inFileBackground", -1314571);
M4.put("chat_outFileBackground", -2427453);
M4.put("chat_inFileBackgroundSelected", -3413258);
M4.put("chat_outFileBackgroundSelected", -3806041);
M4.put("chat_inVenueInfoText", -6182221);
M4.put("chat_outVenueInfoText", -10112933);
M4.put("chat_inVenueInfoSelectedText", -7752511);
M4.put("chat_outVenueInfoSelectedText", -10112933);
M4.put("chat_mediaInfoText", -1);
M4.put("chat_linkSelectBackground", 862104035);
M4.put("chat_textSelectBackground", 1717742051);
M4.put("chat_emojiPanelBackground", -986379);
M4.put("chat_emojiPanelBadgeBackground", -11688214);
M4.put("chat_emojiPanelBadgeText", -1);
M4.put("chat_emojiSearchBackground", -1709586);
M4.put("chat_emojiSearchIcon", -7036497);
M4.put("chat_emojiPanelShadowLine", 301989888);
M4.put("chat_emojiPanelEmptyText", -7038047);
M4.put("chat_emojiPanelIcon", -6445909);
M4.put("chat_emojiBottomPanelIcon", -7564905);
M4.put("chat_emojiPanelIconSelected", -13920286);
M4.put("chat_emojiPanelStickerPackSelector", -1907225);
M4.put("chat_emojiPanelStickerPackSelectorLine", -11097104);
M4.put("chat_emojiPanelBackspace", -7564905);
M4.put("chat_emojiPanelMasksIcon", -1);
M4.put("chat_emojiPanelMasksIconSelected", -10305560);
M4.put("chat_emojiPanelTrendingTitle", -14540254);
M4.put("chat_emojiPanelStickerSetName", -8221804);
M4.put("chat_emojiPanelStickerSetNameHighlight", -14184997);
M4.put("chat_emojiPanelStickerSetNameIcon", -5130564);
M4.put("chat_emojiPanelTrendingDescription", -7697782);
M4.put("chat_botKeyboardButtonText", -13220017);
M4.put("chat_botKeyboardButtonBackground", -1775639);
M4.put("chat_botKeyboardButtonBackgroundPressed", -3354156);
M4.put("chat_unreadMessagesStartArrowIcon", -6113849);
M4.put("chat_unreadMessagesStartText", -11102772);
M4.put("chat_unreadMessagesStartBackground", -1);
M4.put("chat_inFileIcon", -6113849);
M4.put("chat_inFileSelectedIcon", -7883067);
M4.put("chat_outFileIcon", -8011912);
M4.put("chat_outFileSelectedIcon", -8011912);
M4.put("chat_inLocationBackground", -1314571);
M4.put("chat_inLocationIcon", -6113849);
M4.put("chat_outLocationBackground", -2427453);
M4.put("chat_outLocationIcon", -7880840);
M4.put("chat_inContactBackground", -9259544);
M4.put("chat_inContactIcon", -1);
M4.put("chat_outContactBackground", -8863118);
M4.put("chat_outContactIcon", -1048610);
M4.put("chat_outBroadcast", -12146122);
M4.put("chat_mediaBroadcast", -1);
M4.put("chat_searchPanelIcons", -9999761);
M4.put("chat_searchPanelText", -9999761);
M4.put("chat_secretChatStatusText", -8421505);
M4.put("chat_fieldOverlayText", -12940081);
M4.put("chat_stickersHintPanel", -1);
M4.put("chat_replyPanelIcons", -11032346);
M4.put("chat_replyPanelClose", -7432805);
M4.put("chat_replyPanelName", -12940081);
M4.put("chat_replyPanelMessage", -14540254);
M4.put("chat_replyPanelLine", -1513240);
M4.put("chat_messagePanelBackground", -1);
M4.put("chat_messagePanelText", valueOf);
M4.put("chat_messagePanelHint", -5985101);
M4.put("chat_messagePanelCursor", -11230757);
M4.put("chat_messagePanelShadow", valueOf);
M4.put("chat_messagePanelIcons", -7432805);
M4.put("chat_recordedVoicePlayPause", -1);
M4.put("chat_recordedVoiceDot", -2468275);
M4.put("chat_recordedVoiceBackground", -10637848);
M4.put("chat_recordedVoiceProgress", -5120257);
M4.put("chat_recordedVoiceProgressInner", -1);
M4.put("chat_recordVoiceCancel", -12937772);
M4.put("key_chat_recordedVoiceHighlight", 1694498815);
M4.put("chat_messagePanelSend", -10309397);
M4.put("key_chat_messagePanelVoiceLock", -5987164);
M4.put("key_chat_messagePanelVoiceLockBackground", -1);
M4.put("key_chat_messagePanelVoiceLockShadow", valueOf);
M4.put("chat_recordTime", -7432805);
M4.put("chat_emojiPanelNewTrending", -11688214);
M4.put("chat_gifSaveHintText", -1);
M4.put("chat_gifSaveHintBackground", -871296751);
M4.put("chat_goDownButton", -1);
M4.put("chat_goDownButtonShadow", valueOf);
M4.put("chat_goDownButtonIcon", -7432805);
M4.put("chat_goDownButtonCounter", -1);
M4.put("chat_goDownButtonCounterBackground", -11689240);
M4.put("chat_messagePanelCancelInlineBot", -5395027);
M4.put("chat_messagePanelVoicePressed", -1);
M4.put("chat_messagePanelVoiceBackground", -10639650);
M4.put("chat_messagePanelVoiceDelete", -9211021);
M4.put("chat_messagePanelVoiceDuration", -1);
M4.put("chat_inlineResultIcon", -11037236);
M4.put("chat_topPanelBackground", -1);
M4.put("chat_topPanelClose", -7629157);
M4.put("chat_topPanelLine", -9658414);
M4.put("chat_topPanelTitle", -12940081);
M4.put("chat_topPanelMessage", -7893359);
M4.put("chat_reportSpam", -3188393);
M4.put("chat_addContact", -11894091);
M4.put("chat_inLoader", -9259544);
M4.put("chat_inLoaderSelected", -10114080);
M4.put("chat_outLoader", -8863118);
M4.put("chat_outLoaderSelected", -9783964);
M4.put("chat_inLoaderPhoto", -6113080);
M4.put("chat_inLoaderPhotoSelected", -6113849);
M4.put("chat_inLoaderPhotoIcon", -197380);
M4.put("chat_inLoaderPhotoIconSelected", -1314571);
M4.put("chat_outLoaderPhoto", -8011912);
M4.put("chat_outLoaderPhotoSelected", -8538000);
M4.put("chat_outLoaderPhotoIcon", -2427453);
M4.put("chat_outLoaderPhotoIconSelected", -4134748);
M4.put("chat_mediaLoaderPhoto", 1711276032);
M4.put("chat_mediaLoaderPhotoSelected", 2130706432);
M4.put("chat_mediaLoaderPhotoIcon", -1);
M4.put("chat_mediaLoaderPhotoIconSelected", -2500135);
M4.put("chat_secretTimerBackground", -868326258);
M4.put("chat_secretTimerText", -1);
M4.put("profile_creatorIcon", -12937771);
M4.put("profile_actionIcon", -8288630);
M4.put("profile_actionBackground", -1);
M4.put("profile_actionPressedBackground", -855310);
M4.put("profile_verifiedBackground", -5056776);
M4.put("profile_verifiedCheck", -11959368);
M4.put("profile_title", -1);
M4.put("profile_status", -2626822);
M4.put("profile_tabText", -7893872);
M4.put("profile_tabSelectedText", -12937771);
M4.put("profile_tabSelectedLine", -11557143);
M4.put("profile_tabSelector", 251658240);
M4.put("player_actionBar", -1);
M4.put("player_actionBarSelector", 251658240);
M4.put("player_actionBarTitle", -13683656);
M4.put("player_actionBarTop", -1728053248);
M4.put("player_actionBarSubtitle", -7697782);
M4.put("player_actionBarItems", -7697782);
M4.put("player_background", -1);
M4.put("player_time", -7564650);
M4.put("player_progressBackground", -1315344);
M4.put("player_progressBackground2", -3353637);
M4.put("key_player_progressCachedBackground", -3810064);
M4.put("player_progress", -11228437);
M4.put("player_button", -13421773);
M4.put("player_buttonActive", -11753238);
M4.put("key_sheet_scrollUp", -1973016);
M4.put("key_sheet_other", -3551789);
M4.put("files_folderIcon", -1);
M4.put("files_folderIconBackground", -10637333);
M4.put("files_iconText", -1);
M4.put("sessions_devicesImage", -6908266);
M4.put("passport_authorizeBackground", -12211217);
M4.put("passport_authorizeBackgroundSelected", -12542501);
M4.put("passport_authorizeText", -1);
M4.put("location_sendLocationBackground", -12149258);
M4.put("location_sendLocationIcon", -1);
M4.put("location_sendLocationText", -14906664);
M4.put("location_sendLiveLocationBackground", -11550140);
M4.put("location_sendLiveLocationIcon", -1);
M4.put("location_sendLiveLocationText", -13194460);
M4.put("location_liveLocationProgress", -13262875);
M4.put("location_placeLocationBackground", -11753238);
M4.put("location_actionIcon", -12959675);
M4.put("location_actionActiveIcon", -12414746);
M4.put("location_actionBackground", -1);
M4.put("location_actionPressedBackground", -855310);
M4.put("dialog_liveLocationProgress", -13262875);
M4.put("calls_callReceivedGreenIcon", -16725933);
M4.put("calls_callReceivedRedIcon", -47032);
M4.put("featuredStickers_addedIcon", -11491093);
M4.put("featuredStickers_buttonProgress", -1);
M4.put("featuredStickers_addButton", -11491093);
M4.put("featuredStickers_addButtonPressed", -12346402);
M4.put("featuredStickers_removeButtonText", -11496493);
M4.put("featuredStickers_buttonText", -1);
M4.put("featuredStickers_unread", -11688214);
M4.put("inappPlayerPerformer", -13683656);
M4.put("inappPlayerTitle", -13683656);
M4.put("inappPlayerBackground", -1);
M4.put("inappPlayerPlayPause", -10309397);
M4.put("inappPlayerClose", -7629157);
M4.put("returnToCallBackground", -12279325);
M4.put("returnToCallMutedBackground", -6445135);
M4.put("returnToCallText", -1);
M4.put("sharedMedia_startStopLoadIcon", -13196562);
M4.put("sharedMedia_linkPlaceholder", -986123);
M4.put("sharedMedia_linkPlaceholderText", -4735293);
M4.put("sharedMedia_photoPlaceholder", -1182729);
M4.put("sharedMedia_actionMode", -12154957);
M4.put("checkbox", -10567099);
M4.put("checkboxCheck", -1);
M4.put("checkboxDisabled", -5195326);
M4.put("stickers_menu", -4801083);
M4.put("stickers_menuSelector", 251658240);
M4.put("changephoneinfo_image", -4669499);
M4.put("changephoneinfo_image2", -11491350);
M4.put("groupcreate_hintText", -6182221);
M4.put("groupcreate_cursor", -11361317);
M4.put("groupcreate_sectionShadow", valueOf);
M4.put("groupcreate_sectionText", -8617336);
M4.put("groupcreate_spanText", -14540254);
M4.put("groupcreate_spanBackground", -855310);
M4.put("groupcreate_spanDelete", -1);
M4.put("contacts_inviteBackground", -11157919);
M4.put("contacts_inviteText", -1);
M4.put("login_progressInner", -1971470);
M4.put("login_progressOuter", -10313520);
M4.put("musicPicker_checkbox", -14043401);
M4.put("musicPicker_checkboxCheck", -1);
M4.put("musicPicker_buttonBackground", -10702870);
M4.put("musicPicker_buttonIcon", -1);
M4.put("picker_enabledButton", -15095832);
M4.put("picker_disabledButton", -6710887);
M4.put("picker_badge", -14043401);
M4.put("picker_badgeText", -1);
M4.put("chat_botSwitchToInlineText", -12348980);
M4.put("undo_background", -366530760);
M4.put("undo_cancelColor", -8008961);
M4.put("undo_infoColor", -1);
M4.put("wallet_blackBackground", valueOf);
M4.put("wallet_graySettingsBackground", -986896);
M4.put("wallet_grayBackground", -14079703);
M4.put("wallet_whiteBackground", -1);
M4.put("wallet_blackBackgroundSelector", 1090519039);
M4.put("wallet_whiteText", -1);
M4.put("wallet_blackText", -14540254);
M4.put("wallet_statusText", -8355712);
M4.put("wallet_grayText", -8947849);
M4.put("wallet_grayText2", -10066330);
M4.put("wallet_greenText", -13129704);
M4.put("wallet_redText", -2408384);
M4.put("wallet_dateText", -6710887);
M4.put("wallet_commentText", -6710887);
M4.put("wallet_releaseBackground", -13599557);
M4.put("wallet_pullBackground", -14606047);
M4.put("wallet_buttonBackground", -12082714);
M4.put("wallet_buttonPressedBackground", -13923114);
M4.put("wallet_buttonText", -1);
M4.put("wallet_addressConfirmBackground", 218103808);
M4.put("chat_outTextSelectionHighlight", 775919907);
M4.put("chat_inTextSelectionHighlight", 1348643299);
M4.put("chat_TextSelectionCursor", -12476440);
M4.put("chat_BlurAlpha", valueOf);
M4.put("statisticChartSignature", 2133140777);
M4.put("statisticChartSignatureAlpha", 2133140777);
M4.put("statisticChartHintLine", 437792059);
M4.put("statisticChartActiveLine", 855638016);
M4.put("statisticChartInactivePickerChart", -1713180935);
M4.put("statisticChartActivePickerChart", -658846503);
M4.put("statisticChartRipple", 746495415);
M4.put("statisticChartBackZoomColor", -15692829);
M4.put("statisticChartCheckboxInactive", -4342339);
M4.put("statisticChartNightIconColor", -7434605);
M4.put("statisticChartChevronColor", -2959913);
M4.put("statisticChartHighlightColor", 552398060);
M4.put("statisticChartPopupBackground", -1);
M4.put("statisticChartLine_blue", -13467675);
M4.put("statisticChartLine_green", -10369198);
M4.put("statisticChartLine_red", -2075818);
M4.put("statisticChartLine_golden", -2180600);
M4.put("statisticChartLine_lightblue", -10966803);
M4.put("statisticChartLine_lightgreen", -7352519);
M4.put("statisticChartLine_orange", -1853657);
M4.put("statisticChartLine_indigo", -8422925);
M4.put("statisticChartLineEmpty", -1118482);
M4.put("actionBarTipBackground", -12292204);
M4.put("voipgroup_checkMenu", -9718023);
M4.put("voipgroup_muteButton", -8919716);
M4.put("voipgroup_muteButton2", -8528726);
M4.put("voipgroup_muteButton3", -11089922);
M4.put("voipgroup_searchText", -1);
M4.put("voipgroup_searchPlaceholder", -8024684);
M4.put("voipgroup_searchBackground", -13616313);
M4.put("voipgroup_leaveCallMenu", -35467);
M4.put("voipgroup_scrollUp", -13023660);
M4.put("voipgroup_soundButton", 2100052301);
M4.put("voipgroup_soundButtonActive", 2099422443);
M4.put("voipgroup_soundButtonActiveScrolled", -2110540545);
M4.put("voipgroup_soundButton2", 2099796282);
M4.put("voipgroup_soundButtonActive2", 2098771793);
M4.put("voipgroup_soundButtonActive2Scrolled", -2111520954);
M4.put("voipgroup_leaveButton", 2113363036);
M4.put("voipgroup_leaveButtonScrolled", -2100212396);
M4.put("voipgroup_connectingProgress", -14107905);
M4.put("voipgroup_disabledButton", -14933463);
M4.put("voipgroup_disabledButtonActive", -13878715);
M4.put("voipgroup_disabledButtonActiveScrolled", -2106088964);
M4.put("voipgroup_unmuteButton", -11297032);
M4.put("voipgroup_unmuteButton2", -10038021);
M4.put("voipgroup_actionBarUnscrolled", -15130842);
M4.put("voipgroup_listViewBackgroundUnscrolled", -14538189);
M4.put("voipgroup_lastSeenTextUnscrolled", -8024684);
M4.put("voipgroup_mutedIconUnscrolled", -8485236);
M4.put("voipgroup_actionBar", -15789289);
M4.put("voipgroup_emptyView", -15065823);
M4.put("voipgroup_actionBarItems", -1);
M4.put("voipgroup_actionBarSubtitle", -7697782);
M4.put("voipgroup_actionBarItemsSelector", 515562495);
M4.put("voipgroup_mutedByAdminIcon", -36752);
M4.put("voipgroup_mutedIcon", -9471616);
M4.put("voipgroup_lastSeenText", -8813686);
M4.put("voipgroup_nameText", -1);
M4.put("voipgroup_listViewBackground", -14933463);
M4.put("voipgroup_dialogBackground", -14933463);
M4.put("voipgroup_listeningText", -11683585);
M4.put("voipgroup_speakingText", -8917379);
M4.put("voipgroup_listSelector", 251658239);
M4.put("voipgroup_inviteMembersBackground", -14538189);
M4.put("voipgroup_overlayBlue1", -13906177);
M4.put("voipgroup_overlayBlue2", -16156957);
M4.put("voipgroup_overlayGreen1", -15551198);
M4.put("voipgroup_overlayGreen2", -16722239);
M4.put("voipgroup_topPanelBlue1", -10434565);
M4.put("voipgroup_topPanelBlue2", -11427847);
M4.put("voipgroup_topPanelGreen1", -11350435);
M4.put("voipgroup_topPanelGreen2", -16731712);
M4.put("voipgroup_topPanelGray", -8021590);
M4.put("voipgroup_overlayAlertGradientMuted", -14455406);
M4.put("voipgroup_overlayAlertGradientMuted2", -13873813);
M4.put("voipgroup_overlayAlertGradientUnmuted", -15955316);
M4.put("voipgroup_overlayAlertGradientUnmuted2", -14136203);
M4.put("voipgroup_mutedByAdminGradient", -11033346);
M4.put("voipgroup_mutedByAdminGradient2", -1026983);
M4.put("voipgroup_mutedByAdminGradient3", -9015575);
M4.put("voipgroup_overlayAlertMutedByAdmin", -9998178);
M4.put("kvoipgroup_overlayAlertMutedByAdmin2", -13676424);
M4.put("voipgroup_mutedByAdminMuteButton", 2138612735);
M4.put("voipgroup_mutedByAdminMuteButtonDisabled", 863544319);
M4.put("voipgroup_windowBackgroundWhiteInputField", -2368549);
M4.put("voipgroup_windowBackgroundWhiteInputFieldActivated", -13129232);
M4.put("chat_outReactionButtonBackground", -8863118);
M4.put("chat_inReactionButtonBackground", -9259544);
M4.put("chat_inReactionButtonText", -12940081);
M4.put("chat_outReactionButtonText", -11162801);
M4.put("chat_inReactionButtonTextSelected", -1);
M4.put("chat_outReactionButtonTextSelected", -1);
N4.put("chat_adminText", "chat_inTimeText");
N4.put("chat_adminSelectedText", "chat_inTimeSelectedText");
N4.put("key_player_progressCachedBackground", "player_progressBackground");
N4.put("chat_inAudioCacheSeekbar", "chat_inAudioSeekbar");
N4.put("chat_outAudioCacheSeekbar", "chat_outAudioSeekbar");
N4.put("chat_emojiSearchBackground", "chat_emojiPanelStickerPackSelector");
N4.put("location_sendLiveLocationIcon", "location_sendLocationIcon");
N4.put("changephoneinfo_image2", "featuredStickers_addButton");
N4.put("key_graySectionText", "windowBackgroundWhiteGrayText2");
N4.put("chat_inMediaIcon", "chat_inBubble");
N4.put("chat_outMediaIcon", "chat_outBubble");
N4.put("chat_inMediaIconSelected", "chat_inBubbleSelected");
N4.put("chat_outMediaIconSelected", "chat_outBubbleSelected");
N4.put("chats_actionUnreadIcon", "profile_actionIcon");
N4.put("chats_actionUnreadBackground", "profile_actionBackground");
N4.put("chats_actionUnreadPressedBackground", "profile_actionPressedBackground");
N4.put("dialog_inlineProgressBackground", "windowBackgroundGray");
N4.put("dialog_inlineProgress", "chats_menuItemIcon");
N4.put("groupcreate_spanDelete", "chats_actionIcon");
N4.put("sharedMedia_photoPlaceholder", "windowBackgroundGray");
N4.put("chat_attachPollBackground", "chat_attachAudioBackground");
N4.put("chat_attachPollIcon", "chat_attachAudioIcon");
N4.put("chats_onlineCircle", "windowBackgroundWhiteBlueText");
N4.put("windowBackgroundWhiteBlueButton", "windowBackgroundWhiteValueText");
N4.put("windowBackgroundWhiteBlueIcon", "windowBackgroundWhiteValueText");
N4.put("undo_background", "chat_gifSaveHintBackground");
N4.put("undo_cancelColor", "chat_gifSaveHintText");
N4.put("undo_infoColor", "chat_gifSaveHintText");
N4.put("windowBackgroundUnchecked", "windowBackgroundWhite");
N4.put("windowBackgroundChecked", "windowBackgroundWhite");
N4.put("switchTrackBlue", "switchTrack");
N4.put("switchTrackBlueChecked", "switchTrackChecked");
N4.put("switchTrackBlueThumb", "windowBackgroundWhite");
N4.put("switchTrackBlueThumbChecked", "windowBackgroundWhite");
N4.put("windowBackgroundCheckText", "windowBackgroundWhiteBlackText");
N4.put("contextProgressInner4", "contextProgressInner1");
N4.put("contextProgressOuter4", "contextProgressOuter1");
N4.put("switchTrackBlueSelector", "listSelectorSDK21");
N4.put("switchTrackBlueSelectorChecked", "listSelectorSDK21");
N4.put("chat_emojiBottomPanelIcon", "chat_emojiPanelIcon");
N4.put("chat_emojiSearchIcon", "chat_emojiPanelIcon");
N4.put("chat_emojiPanelStickerSetNameHighlight", "windowBackgroundWhiteBlueText4");
N4.put("chat_emojiPanelStickerPackSelectorLine", "chat_emojiPanelIconSelected");
N4.put("sharedMedia_actionMode", "actionBarDefault");
N4.put("key_sheet_scrollUp", "chat_emojiPanelStickerPackSelector");
N4.put("key_sheet_other", "player_actionBarItems");
N4.put("dialogSearchBackground", "chat_emojiPanelStickerPackSelector");
N4.put("dialogSearchHint", "chat_emojiPanelIcon");
N4.put("dialogSearchIcon", "chat_emojiPanelIcon");
N4.put("dialogSearchText", "windowBackgroundWhiteBlackText");
N4.put("dialogFloatingButton", "dialogRoundCheckBox");
N4.put("dialogFloatingButtonPressed", "dialogRoundCheckBox");
N4.put("dialogFloatingIcon", "dialogRoundCheckBoxCheck");
N4.put("dialogShadowLine", "chat_emojiPanelShadowLine");
N4.put("actionBarDefaultArchived", "actionBarDefault");
N4.put("actionBarDefaultArchivedSelector", "actionBarDefaultSelector");
N4.put("actionBarDefaultArchivedIcon", "actionBarDefaultIcon");
N4.put("actionBarDefaultArchivedTitle", "actionBarDefaultTitle");
N4.put("actionBarDefaultArchivedSearch", "actionBarDefaultSearch");
N4.put("actionBarDefaultSearchArchivedPlaceholder", "actionBarDefaultSearchPlaceholder");
N4.put("chats_message_threeLines", "chats_message");
N4.put("chats_nameMessage_threeLines", "chats_nameMessage");
N4.put("chats_nameArchived", "chats_name");
N4.put("chats_nameMessageArchived", "chats_nameMessage");
N4.put("chats_nameMessageArchived_threeLines", "chats_nameMessage");
N4.put("chats_messageArchived", "chats_message");
N4.put("avatar_backgroundArchived", "chats_unreadCounterMuted");
N4.put("chats_archiveBackground", "chats_actionBackground");
N4.put("chats_archivePinBackground", "chats_unreadCounterMuted");
N4.put("chats_archiveIcon", "chats_actionIcon");
N4.put("chats_archiveText", "chats_actionIcon");
N4.put("actionBarDefaultSubmenuItemIcon", "dialogIcon");
N4.put("checkboxDisabled", "chats_unreadCounterMuted");
N4.put("chat_status", "actionBarDefaultSubtitle");
N4.put("chat_inDownCall", "calls_callReceivedGreenIcon");
N4.put("chat_inUpCall", "calls_callReceivedRedIcon");
N4.put("chat_outUpCall", "calls_callReceivedGreenIcon");
N4.put("actionBarTabActiveText", "actionBarDefaultTitle");
N4.put("actionBarTabUnactiveText", "actionBarDefaultSubtitle");
N4.put("actionBarTabLine", "actionBarDefaultTitle");
N4.put("actionBarTabSelector", "actionBarDefaultSelector");
N4.put("profile_status", "avatar_subtitleInProfileBlue");
N4.put("chats_menuTopBackgroundCats", "avatar_backgroundActionBarBlue");
N4.put("chat_attachPermissionImage", "dialogTextBlack");
N4.put("chat_attachPermissionMark", "chat_sentError");
N4.put("chat_attachPermissionText", "dialogTextBlack");
N4.put("chat_attachEmptyImage", "emptyListPlaceholder");
N4.put("actionBarBrowser", "actionBarDefault");
N4.put("chats_sentReadCheck", "chats_sentCheck");
N4.put("chat_outSentCheckRead", "chat_outSentCheck");
N4.put("chat_outSentCheckReadSelected", "chat_outSentCheckSelected");
N4.put("chats_archivePullDownBackground", "chats_unreadCounterMuted");
N4.put("chats_archivePullDownBackgroundActive", "chats_actionBackground");
N4.put("avatar_backgroundArchivedHidden", "avatar_backgroundSaved");
N4.put("featuredStickers_removeButtonText", "featuredStickers_addButtonPressed");
N4.put("dialogEmptyImage", "player_time");
N4.put("dialogEmptyText", "player_time");
N4.put("location_actionIcon", "dialogTextBlack");
N4.put("location_actionActiveIcon", "windowBackgroundWhiteBlueText7");
N4.put("location_actionBackground", "dialogBackground");
N4.put("location_actionPressedBackground", "dialogBackgroundGray");
N4.put("location_sendLocationText", "windowBackgroundWhiteBlueText7");
N4.put("location_sendLiveLocationText", "windowBackgroundWhiteGreenText");
N4.put("chat_outTextSelectionHighlight", "chat_textSelectBackground");
N4.put("chat_inTextSelectionHighlight", "chat_textSelectBackground");
N4.put("chat_TextSelectionCursor", "chat_messagePanelCursor");
N4.put("chat_inPollCorrectAnswer", "chat_attachLocationBackground");
N4.put("chat_outPollCorrectAnswer", "chat_attachLocationBackground");
N4.put("chat_inPollWrongAnswer", "chat_attachAudioBackground");
N4.put("chat_outPollWrongAnswer", "chat_attachAudioBackground");
N4.put("profile_tabText", "windowBackgroundWhiteGrayText");
N4.put("profile_tabSelectedText", "windowBackgroundWhiteBlueHeader");
N4.put("profile_tabSelectedLine", "windowBackgroundWhiteBlueHeader");
N4.put("profile_tabSelector", "listSelectorSDK21");
N4.put("statisticChartPopupBackground", "dialogBackground");
N4.put("chat_attachGalleryText", "chat_attachGalleryBackground");
N4.put("chat_attachAudioText", "chat_attachAudioBackground");
N4.put("chat_attachFileText", "chat_attachFileBackground");
N4.put("chat_attachContactText", "chat_attachContactBackground");
N4.put("chat_attachLocationText", "chat_attachLocationBackground");
N4.put("chat_attachPollText", "chat_attachPollBackground");
N4.put("chat_inPsaNameText", "avatar_nameInMessageGreen");
N4.put("chat_outPsaNameText", "avatar_nameInMessageGreen");
N4.put("chat_outAdminText", "chat_outTimeText");
N4.put("chat_outAdminSelectedText", "chat_outTimeSelectedText");
N4.put("returnToCallMutedBackground", "windowBackgroundWhite");
N4.put("dialogSwipeRemove", "avatar_backgroundRed");
N4.put("chat_inReactionButtonBackground", "chat_inLoader");
N4.put("chat_outReactionButtonBackground", "chat_outLoader");
N4.put("chat_inReactionButtonText", "chat_inPreviewInstantText");
N4.put("chat_outReactionButtonText", "chat_outPreviewInstantText");
N4.put("chat_inReactionButtonTextSelected", "windowBackgroundWhite");
N4.put("chat_outReactionButtonTextSelected", "windowBackgroundWhite");
N4.put("dialogReactionMentionBackground", "voipgroup_mutedByAdminGradient2");
O4.addAll(Arrays.asList(E4));
O4.addAll(Arrays.asList(F4));
O4.add("chat_attachFileBackground");
O4.add("chat_attachGalleryBackground");
O4.add("chat_attachFileText");
O4.add("chat_attachGalleryText");
O4.add("statisticChartLine_blue");
O4.add("statisticChartLine_green");
O4.add("statisticChartLine_red");
O4.add("statisticChartLine_golden");
O4.add("statisticChartLine_lightblue");
O4.add("statisticChartLine_lightgreen");
O4.add("statisticChartLine_orange");
O4.add("statisticChartLine_indigo");
O4.add("voipgroup_checkMenu");
O4.add("voipgroup_muteButton");
O4.add("voipgroup_muteButton2");
O4.add("voipgroup_muteButton3");
O4.add("voipgroup_searchText");
O4.add("voipgroup_searchPlaceholder");
O4.add("voipgroup_searchBackground");
O4.add("voipgroup_leaveCallMenu");
O4.add("voipgroup_scrollUp");
O4.add("voipgroup_blueText");
O4.add("voipgroup_soundButton");
O4.add("voipgroup_soundButtonActive");
O4.add("voipgroup_soundButtonActiveScrolled");
O4.add("voipgroup_soundButton2");
O4.add("voipgroup_soundButtonActive2");
O4.add("voipgroup_soundButtonActive2Scrolled");
O4.add("voipgroup_leaveButton");
O4.add("voipgroup_leaveButtonScrolled");
O4.add("voipgroup_connectingProgress");
O4.add("voipgroup_disabledButton");
O4.add("voipgroup_disabledButtonActive");
O4.add("voipgroup_disabledButtonActiveScrolled");
O4.add("voipgroup_unmuteButton");
O4.add("voipgroup_unmuteButton2");
O4.add("voipgroup_actionBarUnscrolled");
O4.add("voipgroup_listViewBackgroundUnscrolled");
O4.add("voipgroup_lastSeenTextUnscrolled");
O4.add("voipgroup_mutedIconUnscrolled");
O4.add("voipgroup_actionBar");
O4.add("voipgroup_emptyView");
O4.add("voipgroup_actionBarItems");
O4.add("voipgroup_actionBarSubtitle");
O4.add("voipgroup_actionBarItemsSelector");
O4.add("voipgroup_mutedByAdminIcon");
O4.add("voipgroup_mutedIcon");
O4.add("voipgroup_lastSeenText");
O4.add("voipgroup_nameText");
O4.add("voipgroup_listViewBackground");
O4.add("voipgroup_listeningText");
O4.add("voipgroup_speakingText");
O4.add("voipgroup_listSelector");
O4.add("voipgroup_inviteMembersBackground");
O4.add("voipgroup_dialogBackground");
O4.add("voipgroup_overlayGreen1");
O4.add("voipgroup_overlayGreen2");
O4.add("voipgroup_overlayBlue1");
O4.add("voipgroup_overlayBlue2");
O4.add("voipgroup_topPanelGreen1");
O4.add("voipgroup_topPanelGreen2");
O4.add("voipgroup_topPanelBlue1");
O4.add("voipgroup_topPanelBlue2");
O4.add("voipgroup_topPanelGray");
O4.add("voipgroup_overlayAlertGradientMuted");
O4.add("voipgroup_overlayAlertGradientMuted2");
O4.add("voipgroup_overlayAlertGradientUnmuted");
O4.add("voipgroup_overlayAlertGradientUnmuted2");
O4.add("voipgroup_overlayAlertMutedByAdmin");
O4.add("kvoipgroup_overlayAlertMutedByAdmin2");
O4.add("voipgroup_mutedByAdminGradient");
O4.add("voipgroup_mutedByAdminGradient2");
O4.add("voipgroup_mutedByAdminGradient3");
O4.add("voipgroup_mutedByAdminMuteButton");
O4.add("voipgroup_mutedByAdminMuteButtonDisabled");
O4.add("voipgroup_windowBackgroundWhiteInputField");
O4.add("voipgroup_windowBackgroundWhiteInputFieldActivated");
L4.add("chat_outBubble");
L4.add("chat_outBubbleSelected");
L4.add("chat_outBubbleShadow");
L4.add("chat_outBubbleGradient");
K4.add("chat_outUpCall");
K4.add("chat_outSentCheck");
K4.add("chat_outSentCheckSelected");
K4.add("chat_outSentCheckRead");
K4.add("chat_outSentCheckReadSelected");
K4.add("chat_outSentClock");
K4.add("chat_outSentClockSelected");
K4.add("chat_outMediaIcon");
K4.add("chat_outMediaIconSelected");
K4.add("chat_outViews");
K4.add("chat_outViewsSelected");
K4.add("chat_outMenu");
K4.add("chat_outMenuSelected");
K4.add("chat_outInstant");
K4.add("chat_outInstantSelected");
K4.add("chat_outPreviewInstantText");
K4.add("chat_outPreviewInstantSelectedText");
K4.add("chat_outForwardedNameText");
K4.add("chat_outViaBotNameText");
K4.add("chat_outReplyLine");
K4.add("chat_outReplyNameText");
K4.add("chat_outReplyMessageText");
K4.add("chat_outReplyMediaMessageText");
K4.add("chat_outReplyMediaMessageSelectedText");
K4.add("chat_outPreviewLine");
K4.add("chat_outSiteNameText");
K4.add("chat_outContactNameText");
K4.add("chat_outContactPhoneText");
K4.add("chat_outContactPhoneSelectedText");
K4.add("chat_outAudioProgress");
K4.add("chat_outAudioSelectedProgress");
K4.add("chat_outTimeText");
K4.add("chat_outTimeSelectedText");
K4.add("chat_outAudioPerfomerText");
K4.add("chat_outAudioPerfomerSelectedText");
K4.add("chat_outAudioTitleText");
K4.add("chat_outAudioDurationText");
K4.add("chat_outAudioDurationSelectedText");
K4.add("chat_outAudioSeekbar");
K4.add("chat_outAudioCacheSeekbar");
K4.add("chat_outAudioSeekbarSelected");
K4.add("chat_outAudioSeekbarFill");
K4.add("chat_outVoiceSeekbar");
K4.add("chat_outVoiceSeekbarSelected");
K4.add("chat_outVoiceSeekbarFill");
K4.add("chat_outFileProgress");
K4.add("chat_outFileProgressSelected");
K4.add("chat_outFileNameText");
K4.add("chat_outFileInfoText");
K4.add("chat_outFileInfoSelectedText");
K4.add("chat_outFileBackground");
K4.add("chat_outFileBackgroundSelected");
K4.add("chat_outVenueInfoText");
K4.add("chat_outVenueInfoSelectedText");
K4.add("chat_outLoader");
K4.add("chat_outLoaderSelected");
K4.add("chat_outLoaderPhoto");
K4.add("chat_outLoaderPhotoSelected");
K4.add("chat_outLoaderPhotoIcon");
K4.add("chat_outLoaderPhotoIconSelected");
K4.add("chat_outLocationBackground");
K4.add("chat_outLocationIcon");
K4.add("chat_outContactBackground");
K4.add("chat_outContactIcon");
K4.add("chat_outFileIcon");
K4.add("chat_outFileSelectedIcon");
K4.add("chat_outBroadcast");
K4.add("chat_messageTextOut");
K4.add("chat_messageLinkOut");
D = new ArrayList<>();
F = new ArrayList<>();
G = new HashMap<>();
P4 = new HashMap<>();
Q4 = new HashMap<>();
SharedPreferences sharedPreferences2 = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0);
v vVar2 = new v();
vVar2.a = "Blue";
vVar2.d = "bluebubbles.attheme";
vVar2.v = -6963476;
vVar2.A = -1;
vVar2.B = -3086593;
vVar2.G = true;
vVar2.S = l;
vVar2.J = 1;
vVar2.W(new int[]{-10972987, -14444461, -3252606, -8428605, -14380627, -14050257, -7842636, -13464881, -12342073, -11359164, -3317869, -2981834, -8165684, -3256745, -2904512, -8681301}, new int[]{-4660851, -328756, -1572, -4108434, -3031781, -1335, -198952, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, -853047, -264993, 0, 0, -135756, -198730, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, -2104672, -937328, -2637335, -2639714, -1270157, -3428124, -6570777, -7223828, -6567550, -1793599, -1855875, -4674838, -1336199, -2900876, -6247730}, new int[]{0, -4532067, -1257580, -1524266, -1646910, -1519483, -1324823, -4138509, -4202516, -2040429, -1458474, -1256030, -3814930, -1000039, -1450082, -3485987}, new int[]{0, -1909081, -1592444, -2969879, -2439762, -1137033, -2119471, -6962197, -4857383, -4270699, -3364639, -2117514, -5000734, -1598028, -2045813, -5853742}, new int[]{0, -6371440, -1319256, -1258616, -1712961, -1186647, -1193816, -4467224, -4203544, -3023977, -1061929, -1255788, -2113811, -806526, -1715305, -3485976}, new int[]{99, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8}, new String[]{BuildConfig.FLAVOR, "p-pXcflrmFIBAAAAvXYQk-mCwZU", "JqSUrO0-mFIBAAAAWwTvLzoWGQI", "O-wmAfBPSFADAAAA4zINVfD_bro", "RepJ5uE_SVABAAAAr4d0YhgB850", "-Xc-np9y2VMCAAAARKr0yNNPYW0", "fqv01SQemVIBAAAApND8LDRUhRU", "fqv01SQemVIBAAAApND8LDRUhRU", "RepJ5uE_SVABAAAAr4d0YhgB850", "lp0prF8ISFAEAAAA_p385_CvG0w", "heptcj-hSVACAAAAC9RrMzOa-cs", "PllZ-bf_SFAEAAAA8crRfwZiDNg", "dhf9pceaQVACAAAAbzdVo4SCiZA", "Ujx2TFcJSVACAAAARJ4vLa50MkM", "p-pXcflrmFIBAAAAvXYQk-mCwZU", "dk_wwlghOFACAAAAfz9xrxi6euw"}, new int[]{0, 180, 45, 0, 45, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, 52, 46, 57, 45, 64, 52, 35, 36, 41, 50, 50, 35, 38, 37, 30});
q3(vVar2);
ArrayList<v> arrayList = D;
H = vVar2;
J = vVar2;
arrayList.add(vVar2);
G.put("Blue", vVar2);
v vVar3 = new v();
vVar3.a = "Dark Blue";
vVar3.d = "darkblue.attheme";
vVar3.v = -10523006;
vVar3.A = -9009508;
vVar3.B = -8214301;
vVar3.J = 3;
vVar3.W(new int[]{-7177260, -9860357, -14440464, -8687151, -9848491, -14053142, -9403671, -10044691, -13203974, -12138259, -10179489, -1344335, -1142742, -6127120, -2931932, -1131212, -8417365, -13270557}, new int[]{-6464359, -10267323, -13532789, -5413850, -11898828, -13410942, -13215889, -10914461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-10465880, -9937588, -14983040, -6736562, -14197445, -13534568, -13144441, -10587280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-14213586, -15263198, -16310753, -15724781, -15853551, -16051428, -14868183, -14668758, -15854566, -15326427, -15327979, -14411490, -14345453, -14738135, -14543346, -14212843, -15263205, -15854566}, new int[]{-15659501, -14277074, -15459034, -14542297, -14735336, -15129808, -15591910, -15459810, -15260623, -15853800, -15259879, -14477540, -14674936, -15461604, -13820650, -15067635, -14605528, -15260623}, new int[]{-13951445, -15395557, -15985382, -15855853, -16050417, -15525854, -15260627, -15327189, -15788258, -14799314, -15458796, -13952727, -13754603, -14081231, -14478324, -14081004, -15197667, -15788258}, new int[]{-15330777, -15066858, -15915220, -14213847, -15262439, -15260879, -15657695, -16443625, -15459285, -15589601, -14932454, -14740451, -15002870, -15264997, -13821660, -14805234, -14605784, -15459285}, new int[]{11, 12, 13, 14, 15, 16, 17, 18, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, new String[]{"O-wmAfBPSFADAAAA4zINVfD_bro", "RepJ5uE_SVABAAAAr4d0YhgB850", "dk_wwlghOFACAAAAfz9xrxi6euw", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "PllZ-bf_SFAEAAAA8crRfwZiDNg", "-Xc-np9y2VMCAAAARKr0yNNPYW0", "kO4jyq55SFABAAAA0WEpcLfahXk", "CJNyxPMgSVAEAAAAvW9sMwc51cw", "fqv01SQemVIBAAAApND8LDRUhRU", "RepJ5uE_SVABAAAAr4d0YhgB850", "CJNyxPMgSVAEAAAAvW9sMwc51cw", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "9GcNVISdSVADAAAAUcw5BYjELW4", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "9ShF73d1MFIIAAAAjWnm8_ZMe8Q", "3rX-PaKbSFACAAAAEiHNvcEm6X4", "dk_wwlghOFACAAAAfz9xrxi6euw", "fqv01SQemVIBAAAApND8LDRUhRU"}, new int[]{225, 45, 225, 135, 45, 225, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{40, 40, 31, 50, 25, 34, 35, 35, 38, 29, 24, 34, 34, 31, 29, 37, 21, 38});
q3(vVar3);
D.add(vVar3);
HashMap<String, v> hashMap2 = G;
I = vVar3;
hashMap2.put("Dark Blue", vVar3);
v vVar4 = new v();
vVar4.a = "Arctic Blue";
vVar4.d = "arctic.attheme";
vVar4.v = -1971728;
vVar4.A = -1;
vVar4.B = -9657877;
vVar4.J = 5;
vVar4.W(new int[]{-12537374, -12472227, -3240928, -11033621, -2194124, -3382903, -13332245, -12342073, -11359164, -3317869, -2981834, -8165684, -3256745, -2904512, -8681301}, new int[]{-13525046, -14113959, -7579073, -13597229, -3581840, -8883763, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-11616542, -9716647, -6400452, -12008744, -2592697, -4297041, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-3808528, -2433367, -2700891, -1838093, -1120848, -1712148, -2037779, -4202261, -4005713, -1058332, -925763, -1975316, -1189672, -1318451, -2302235}, new int[]{-1510157, -4398164, -1647697, -3610898, -1130838, -1980692, -4270093, -4202261, -3415654, -1259815, -1521765, -4341268, -1127744, -1318219, -3945761}, new int[]{-4924688, -3283031, -1523567, -2494477, -1126510, -595210, -2037517, -3478548, -4661623, -927514, -796762, -2696971, -1188403, -1319735, -1577487}, new int[]{-3149585, -5714021, -1978209, -4925720, -1134713, -1718833, -3613709, -5317397, -3218014, -999207, -2116466, -4343054, -931397, -1583186, -3815718}, new int[]{9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8}, new String[]{"MIo6r0qGSFAFAAAAtL8TsDzNX60", "dhf9pceaQVACAAAAbzdVo4SCiZA", "fqv01SQemVIBAAAApND8LDRUhRU", "p-pXcflrmFIBAAAAvXYQk-mCwZU", "JqSUrO0-mFIBAAAAWwTvLzoWGQI", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "fqv01SQemVIBAAAApND8LDRUhRU", "RepJ5uE_SVABAAAAr4d0YhgB850", "PllZ-bf_SFAEAAAA8crRfwZiDNg", "pgJfpFNRSFABAAAACDT8s5sEjfc", "ptuUd96JSFACAAAATobI23sPpz0", "dhf9pceaQVACAAAAbzdVo4SCiZA", "JqSUrO0-mFIBAAAAWwTvLzoWGQI", "9iklpvIPQVABAAAAORQXKur_Eyc", "F5oWoCs7QFACAAAAgf2bD_mg8Bw"}, new int[]{315, 315, 225, 315, 0, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{50, 50, 58, 47, 46, 50, 49, 46, 51, 50, 49, 34, 54, 50, 40});
q3(vVar4);
D.add(vVar4);
G.put("Arctic Blue", vVar4);
v vVar5 = new v();
vVar5.a = "Day";
vVar5.d = "day.attheme";
vVar5.v = -1;
vVar5.A = -1315084;
vVar5.B = -8604930;
vVar5.J = 2;
vVar5.W(new int[]{-11099447, -3379581, -3109305, -3382174, -7963438, -11759137, -11029287, -11226775, -2506945, -3382174, -3379581, -6587438, -2649788, -8681301}, new int[]{-10125092, -9671214, -3451775, -3978678, -10711329, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-12664362, -3642988, -2383569, -3109317, -11422261, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, null, null, new int[]{9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8}, new String[]{BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR}, new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
q3(vVar5);
D.add(vVar5);
G.put("Day", vVar5);
v vVar6 = new v();
vVar6.a = "Night";
vVar6.d = "night.attheme";
vVar6.v = -11315623;
vVar6.A = -9143676;
vVar6.B = -9067802;
vVar6.J = 4;
vVar6.W(new int[]{-9781697, -7505693, -2204034, -10913816, -2375398, -12678921, -11881005, -11880383, -2534026, -1934037, -7115558, -3128522, -1528292, -8812381}, new int[]{-7712108, -4953061, -5288081, -14258547, -9154889, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-9939525, -5948598, -10335844, -13659747, -14054507, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-15330532, -14806760, -15791344, -16184308, -16313063, -15921641, -15656164, -15986420, -15856883, -14871025, -16185078, -14937584, -14869736, -15855598}, new int[]{-14673881, -15724781, -15002342, -15458526, -15987697, -16184820, -16118258, -16250616, -15067624, -15527923, -14804447, -15790836, -15987960, -16316665}, new int[]{-15856877, -14608861, -15528430, -15921391, -15722209, -15197144, -15458015, -15591406, -15528431, -15068401, -16053749, -15594229, -15395825, -15724012}, new int[]{-14804694, -15658986, -14609382, -15656421, -16118509, -15855854, -16315381, -16052981, -14544354, -15791092, -15659241, -16316922, -15988214, -16185077}, new int[]{9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8}, new String[]{"YIxYGEALQVADAAAAA3QbEH0AowY", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "O-wmAfBPSFADAAAA4zINVfD_bro", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "-Xc-np9y2VMCAAAARKr0yNNPYW0", "fqv01SQemVIBAAAApND8LDRUhRU", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "ptuUd96JSFACAAAATobI23sPpz0", "p-pXcflrmFIBAAAAvXYQk-mCwZU", "Nl8Pg2rBQVACAAAA25Lxtb8SDp0", "dhf9pceaQVACAAAAbzdVo4SCiZA", "9GcNVISdSVADAAAAUcw5BYjELW4", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "dk_wwlghOFACAAAAfz9xrxi6euw"}, new int[]{45, 135, 0, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{34, 47, 52, 48, 54, 50, 37, 56, 48, 49, 40, 64, 38, 48});
q3(vVar6);
D.add(vVar6);
G.put("Night", vVar6);
v vVar7 = new v();
vVar7.a = "Night";
vVar7.d = "night.attheme";
vVar7.v = -11315623;
vVar7.A = -9143676;
vVar7.B = -9067802;
vVar7.J = 4;
vVar7.W(new int[]{-9781697, -7505693, -2204034, -10913816, -2375398, -12678921, -11881005, -11880383, -2534026, -1934037, -7115558, -3128522, -1528292, -8812381}, new int[]{-7712108, -4953061, -5288081, -14258547, -9154889, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-9939525, -5948598, -10335844, -13659747, -14054507, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{-15330532, -14806760, -15791344, -16184308, -16313063, -15921641, -15656164, -15986420, -15856883, -14871025, -16185078, -14937584, -14869736, -15855598}, new int[]{-14673881, -15724781, -15002342, -15458526, -15987697, -16184820, -16118258, -16250616, -15067624, -15527923, -14804447, -15790836, -15987960, -16316665}, new int[]{-15856877, -14608861, -15528430, -15921391, -15722209, -15197144, -15458015, -15591406, -15528431, -15068401, -16053749, -15594229, -15395825, -15724012}, new int[]{-14804694, -15658986, -14609382, -15656421, -16118509, -15855854, -16315381, -16052981, -14544354, -15791092, -15659241, -16316922, -15988214, -16185077}, new int[]{9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8}, new String[]{"YIxYGEALQVADAAAAA3QbEH0AowY", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "O-wmAfBPSFADAAAA4zINVfD_bro", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "-Xc-np9y2VMCAAAARKr0yNNPYW0", "fqv01SQemVIBAAAApND8LDRUhRU", "F5oWoCs7QFACAAAAgf2bD_mg8Bw", "ptuUd96JSFACAAAATobI23sPpz0", "p-pXcflrmFIBAAAAvXYQk-mCwZU", "Nl8Pg2rBQVACAAAA25Lxtb8SDp0", "dhf9pceaQVACAAAAbzdVo4SCiZA", "9GcNVISdSVADAAAAUcw5BYjELW4", "9LW_RcoOSVACAAAAFTk3DTyXN-M", "dk_wwlghOFACAAAAfz9xrxi6euw"}, new int[]{45, 135, 0, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[]{34, 47, 52, 48, 54, 50, 37, 56, 48, 49, 40, 64, 38, 48});
D.add(vVar7);
G.put("Night", vVar7);
int i5 = vVar7.J;
for (int i6 = 0; i6 < k9.a.length; i6++) {
v vVar8 = new v();
if (k9.b[i6].equals("pt")) {
vVar8.a = LocaleController.getString("AppName", R.string.AppName);
K = vVar8;
} else {
vVar8.a = k9.b[i6];
}
vVar8.d = k9.a[i6] + ".attheme";
vVar8.d0 = 0;
vVar8.v = k9.c[i6];
vVar8.A = k9.d[i6];
vVar8.B = k9.e[i6];
vVar8.J = i5 + i6;
D.add(vVar8);
G.put(k9.b[i6], vVar8);
}
String string = sharedPreferences2.getString("themes2", null);
if (sharedPreferences2.getInt("remote_version", 0) == 1) {
int i7 = 0;
while (i7 < 3) {
long[] jArr = C;
StringBuilder sb = new StringBuilder();
sb.append("2remoteThemesHash");
sb.append(i7 != 0 ? Integer.valueOf(i7) : BuildConfig.FLAVOR);
jArr[i7] = sharedPreferences2.getLong(sb.toString(), 0L);
int[] iArr = B;
StringBuilder sb2 = new StringBuilder();
sb2.append("lastLoadingThemesTime");
sb2.append(i7 != 0 ? Integer.valueOf(i7) : BuildConfig.FLAVOR);
iArr[i7] = sharedPreferences2.getInt(sb2.toString(), 0);
i7++;
}
}
sharedPreferences2.edit().putInt("remote_version", 1).apply();
if (TextUtils.isEmpty(string)) {
String string2 = sharedPreferences2.getString("themes", null);
if (!TextUtils.isEmpty(string2)) {
for (String str : string2.split("&")) {
v x5 = v.x(str);
if (x5 != null) {
F.add(x5);
D.add(x5);
G.put(x5.C(), x5);
}
}
X2(true, true);
sharedPreferences2.edit().remove("themes").commit();
}
} else {
try {
JSONArray jSONArray = new JSONArray(string);
for (int i8 = 0; i8 < jSONArray.length(); i8++) {
v w5 = v.w(jSONArray.getJSONObject(i8));
if (w5 != null) {
F.add(w5);
D.add(w5);
G.put(w5.C(), w5);
w5.T(sharedPreferences2);
}
}
} catch (Exception e5) {
FileLog.e(e5);
}
}
r3();
v vVar9 = null;
SharedPreferences globalMainSettings = MessagesController.getGlobalMainSettings();
try {
v vVar10 = G.get("Dark Blue");
String string3 = globalMainSettings.getString("theme", o9.k(o9.f.DEFAULT_DAY_THEME));
if ("Default".equals(string3)) {
vVar9 = G.get("Blue");
vVar9.S = l;
} else if ("Dark".equals(string3)) {
vVar10.S = 9;
vVar9 = vVar10;
} else if (string3 != null && (vVar9 = G.get(string3)) != null && !sharedPreferences2.contains("lastDayTheme")) {
SharedPreferences.Editor edit = sharedPreferences2.edit();
edit.putString("lastDayTheme", vVar9.C());
edit.commit();
}
String string4 = globalMainSettings.getString("nighttheme", o9.k(o9.f.DEFAULT_NIGHT_THEME));
if ("Default".equals(string4)) {
vVar9 = G.get("Blue");
vVar9.S = l;
} else if ("Dark".equals(string4)) {
I = vVar10;
vVar10.S = 9;
} else if (string4 != null && (vVar = G.get(string4)) != null) {
I = vVar;
}
if (globalMainSettings.getString("theme", null) == null && NatHelper.a()) {
vVar9 = I;
}
if (I != null && !sharedPreferences2.contains("lastDarkTheme")) {
SharedPreferences.Editor edit2 = sharedPreferences2.edit();
edit2.putString("lastDarkTheme", I.C());
edit2.commit();
}
SharedPreferences.Editor editor2 = null;
SharedPreferences.Editor editor3 = null;
Iterator<v> it3 = G.values().iterator();
while (it3.hasNext()) {
v next = it3.next();
if (next.d == null || next.R == 0) {
it = it3;
editor3 = editor3;
} else {
String string5 = sharedPreferences2.getString("accents_" + next.d, null);
next.S = sharedPreferences2.getInt("accent_current_" + next.d, next.G ? l : 0);
ArrayList arrayList2 = new ArrayList();
if (TextUtils.isEmpty(string5)) {
editor = editor3;
it = it3;
String str2 = "accent_for_" + next.d;
globalMainSettings = globalMainSettings;
int i9 = globalMainSettings.getInt(str2, 0);
if (i9 != 0) {
if (editor2 == null) {
editor2 = globalMainSettings.edit();
editor3 = sharedPreferences2.edit();
} else {
editor3 = editor;
}
editor2.remove(str2);
int size = next.V.size();
int i10 = 0;
while (true) {
if (i10 >= size) {
z6 = false;
break;
}
u uVar = next.V.get(i10);
if (uVar.c == i9) {
next.S = uVar.a;
z6 = true;
break;
}
i10++;
}
if (!z6) {
u uVar2 = new u();
uVar2.a = 100;
uVar2.c = i9;
uVar2.b = next;
next.U.put(100, uVar2);
arrayList2.add(0, uVar2);
next.S = 100;
next.Z = 101;
st4 st4Var = new st4(72);
st4Var.writeInt32(9);
st4Var.writeInt32(1);
st4Var.writeInt32(uVar2.a);
st4Var.writeInt32(uVar2.c);
st4Var.writeInt32(uVar2.e);
st4Var.writeInt32(uVar2.f);
st4Var.writeInt32(uVar2.g);
st4Var.writeInt32(uVar2.h);
st4Var.writeBool(uVar2.i);
st4Var.writeInt64(uVar2.j);
st4Var.writeInt64(uVar2.k);
st4Var.writeInt64(uVar2.l);
st4Var.writeInt64(uVar2.m);
st4Var.writeInt32(uVar2.n);
st4Var.writeInt64(0L);
st4Var.writeDouble(uVar2.p);
st4Var.writeBool(uVar2.q);
st4Var.writeString(uVar2.o);
st4Var.writeBool(false);
editor3.putString("accents_" + next.d, Base64.encodeToString(st4Var.d(), 3));
}
editor3.putInt("accent_current_" + next.d, next.S);
if (!arrayList2.isEmpty()) {
next.V.addAll(0, arrayList2);
q3(next);
}
sparseArray = next.U;
if (sparseArray != null && sparseArray.get(next.S) == null) {
next.S = !next.G ? l : 0;
}
next.T(sharedPreferences2);
A5 = next.A(false);
if (A5 == null) {
next.c0 = A5.y;
}
}
} else {
try {
st4 st4Var2 = new st4(Base64.decode(string5, 3));
boolean z7 = true;
int readInt32 = st4Var2.readInt32(true);
int readInt322 = st4Var2.readInt32(true);
int i11 = 0;
while (i11 < readInt322) {
try {
u uVar3 = new u();
uVar3.a = st4Var2.readInt32(z7);
uVar3.c = st4Var2.readInt32(z7);
if (readInt32 >= 9) {
uVar3.d = st4Var2.readInt32(z7);
}
uVar3.b = next;
uVar3.e = st4Var2.readInt32(true);
uVar3.f = st4Var2.readInt32(true);
if (readInt32 >= 7) {
uVar3.g = st4Var2.readInt32(true);
uVar3.h = st4Var2.readInt32(true);
}
if (readInt32 >= 8) {
z5 = true;
uVar3.i = st4Var2.readBool(true);
} else {
z5 = true;
}
SharedPreferences.Editor editor4 = editor3;
if (readInt32 >= 3) {
it2 = it3;
uVar3.j = st4Var2.readInt64(z5);
} else {
it2 = it3;
uVar3.j = st4Var2.readInt32(z5);
}
if (readInt32 >= 2) {
uVar3.k = st4Var2.readInt64(z5);
} else {
uVar3.k = st4Var2.readInt32(z5);
}
?? r12 = z5;
if (readInt32 >= 6) {
uVar3.l = st4Var2.readInt64(z5);
uVar3.m = st4Var2.readInt64(z5);
r12 = 1;
}
if (readInt32 >= r12) {
uVar3.n = st4Var2.readInt32(r12);
}
if (readInt32 >= 4) {
st4Var2.readInt64(r12);
uVar3.p = (float) st4Var2.readDouble(r12);
uVar3.q = st4Var2.readBool(r12);
if (readInt32 >= 5) {
uVar3.o = st4Var2.readString(r12);
}
}
if (readInt32 >= 5 && st4Var2.readBool(true)) {
uVar3.t = st4Var2.readInt32(true);
uVar3.r = z17.a(st4Var2, st4Var2.readInt32(true), true);
}
cu6 cu6Var = uVar3.r;
if (cu6Var != null) {
uVar3.z = cu6Var.c;
}
next.U.put(uVar3.a, uVar3);
cu6 cu6Var2 = uVar3.r;
if (cu6Var2 != null) {
sharedPreferences = globalMainSettings;
next.W.put(cu6Var2.e, uVar3);
} else {
sharedPreferences = globalMainSettings;
}
arrayList2.add(uVar3);
next.Z = Math.max(next.Z, uVar3.a);
i11++;
it3 = it2;
globalMainSettings = sharedPreferences;
editor3 = editor4;
z7 = true;
} finally {
RuntimeException runtimeException = new RuntimeException(th);
}
}
editor = editor3;
it = it3;
} finally {
FileLog.e(th);
}
}
editor3 = editor;
if (!arrayList2.isEmpty()) {
}
sparseArray = next.U;
if (sparseArray != null) {
next.S = !next.G ? l : 0;
}
next.T(sharedPreferences2);
A5 = next.A(false);
if (A5 == null) {
}
}
it3 = it;
}
SharedPreferences.Editor editor5 = editor3;
if (editor2 != null) {
editor2.commit();
editor5.commit();
}
m = globalMainSettings.getInt("selectedAutoNightType", Build.VERSION.SDK_INT >= 29 ? 3 : 0);
n = globalMainSettings.getBoolean("autoNightScheduleByLocation", false);
o = globalMainSettings.getFloat("autoNightBrighnessThreshold", 0.25f);
p = globalMainSettings.getInt("autoNightDayStartTime", 1320);
q = globalMainSettings.getInt("autoNightDayEndTime", 480);
r = globalMainSettings.getInt("autoNightSunsetTime", 1320);
t = globalMainSettings.getInt("autoNightSunriseTime", 480);
u = globalMainSettings.getString("autoNightCityName", BuildConfig.FLAVOR);
long j5 = globalMainSettings.getLong("autoNightLocationLatitude3", 10000L);
if (j5 != 10000) {
v = Double.longBitsToDouble(j5);
} else {
v = 10000.0d;
}
long j6 = globalMainSettings.getLong("autoNightLocationLongitude3", 10000L);
if (j6 != 10000) {
w = Double.longBitsToDouble(j6);
} else {
w = 10000.0d;
}
s = globalMainSettings.getInt("autoNightLastSunCheckDay", -1);
if (vVar9 == null) {
vVar9 = K;
} else {
J = vVar9;
}
if (globalMainSettings.contains("overrideThemeWallpaper") || globalMainSettings.contains("selectedBackground2")) {
boolean z8 = globalMainSettings.getBoolean("overrideThemeWallpaper", false);
long j7 = globalMainSettings.getLong("selectedBackground2", 1000001L);
if (j7 == -1 || (z8 && j7 != -2 && j7 != 1000001)) {
q qVar = new q();
qVar.d = globalMainSettings.getInt("selectedColor", 0);
qVar.c = globalMainSettings.getString("selectedBackgroundSlug", BuildConfig.FLAVOR);
if (j7 < -100 || j7 > -1 || qVar.d == 0) {
qVar.a = "wallpaper.jpg";
qVar.b = "wallpaper_original.jpg";
} else {
qVar.c = "c";
qVar.a = BuildConfig.FLAVOR;
qVar.b = BuildConfig.FLAVOR;
}
qVar.e = globalMainSettings.getInt("selectedGradientColor", 0);
qVar.f = globalMainSettings.getInt("selectedGradientColor2", 0);
qVar.g = globalMainSettings.getInt("selectedGradientColor3", 0);
qVar.h = globalMainSettings.getInt("selectedGradientRotation", 45);
qVar.i = globalMainSettings.getBoolean("selectedBackgroundBlurred", false);
qVar.j = globalMainSettings.getBoolean("selectedBackgroundMotion", false);
qVar.k = globalMainSettings.getFloat("selectedIntensity", 0.5f);
J.Y(qVar);
if (m != 0) {
I.Y(qVar);
}
}
globalMainSettings.edit().remove("overrideThemeWallpaper").remove("selectedBackground2").commit();
}
int N22 = N2();
if (N22 == 2) {
vVar9 = I;
}
e0(vVar9, false, false, N22 == 2);
AndroidUtilities.runOnUIThread(kz2.a);
SharedPreferences sharedPreferences3 = ApplicationLoader.applicationContext.getSharedPreferences("emojithemes_config", 0);
int i12 = sharedPreferences3.getInt("count", 0);
ArrayList arrayList3 = new ArrayList();
arrayList3.add(new p1.i(org.telegram.ui.ActionBar.p.g()));
for (int i13 = 0; i13 < i12; i13++) {
st4 st4Var3 = new st4(Utilities.hexToBytes(sharedPreferences3.getString("theme_" + i13, BuildConfig.FLAVOR)));
try {
org.telegram.ui.ActionBar.p j8 = org.telegram.ui.ActionBar.p.j(z17.a(st4Var3, st4Var3.readInt32(true), true));
if (j8.c.size() >= 4) {
try {
arrayList3.add(new p1.i(j8));
} catch (Throwable th) {
th = th;
FileLog.e(th);
}
}
ChatThemeController.chatThemeQueue.postRunnable(new i(arrayList3));
} catch (Throwable th2) {
th = th2;
}
}
b5 = new a();
c5 = new int[2];
} catch (Exception e6) {
throw new RuntimeException(e6);
}
}
public static Drawable A0(int i5, int i6, int i7) {
if (Build.VERSION.SDK_INT >= 21) {
x.setColor(-1);
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), null, new n(i6, i7));
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i5));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i5));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(0));
return stateListDrawable;
}
public static int A1() {
return t1;
}
public static void A2(i95 i95Var, u uVar, v vVar, cu6 cu6Var) {
boolean z5;
n27 n27Var;
y--;
if (i95Var instanceof cu6) {
cu6 cu6Var2 = (cu6) i95Var;
a27 a27Var = cu6Var2.j.size() > 0 ? cu6Var2.j.get(0) : null;
if (uVar == null || a27Var == null) {
ga5 ga5Var = cu6Var2.i;
if (ga5Var != null && ga5Var.id != cu6Var.i.id) {
if (uVar != null) {
uVar.r = cu6Var2;
} else {
vVar.p = cu6Var2;
vVar.S();
}
}
} else {
if (v.e(uVar, a27Var)) {
z5 = false;
} else {
File b6 = uVar.b();
if (b6 != null) {
b6.delete();
}
v.y(uVar, a27Var);
v vVar2 = H;
if (vVar2 == vVar && vVar2.S == uVar.a) {
P2();
v0(ApplicationLoader.applicationContext, false);
NotificationCenter globalInstance = NotificationCenter.getGlobalInstance();
int i5 = NotificationCenter.needSetDayNightTheme;
Object[] objArr = new Object[4];
v vVar3 = H;
objArr[0] = vVar3;
objArr[1] = Boolean.valueOf(I == vVar3);
objArr[2] = null;
objArr[3] = -1;
globalInstance.postNotificationName(i5, objArr);
}
r.g(true);
z5 = true;
}
m27 m27Var = a27Var.g;
uVar.q = (m27Var == null || (n27Var = m27Var.j) == null || !n27Var.c) ? false : true;
r1 = z5;
}
if (y != 0) {
z = (int) (System.currentTimeMillis() / 1000);
W2(r1);
return;
}
return;
}
r1 = false;
if (y != 0) {
}
}
public static void B0() {
D0();
if (i2 == null) {
i2 = new TextPaint(1);
TextPaint textPaint = new TextPaint(1);
j2 = textPaint;
textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint2 = new TextPaint(1);
l2 = textPaint2;
textPaint2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
G1 = new Paint(1);
H1 = new Paint(1);
Paint paint = new Paint(1);
I1 = paint;
paint.setStrokeCap(Paint.Cap.ROUND);
I1.setStyle(Paint.Style.STROKE);
TextPaint textPaint3 = new TextPaint(1);
m2 = textPaint3;
textPaint3.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
n2 = new TextPaint(1);
Paint paint2 = new Paint();
J1 = paint2;
CornerPathEffect cornerPathEffect = j72.k;
paint2.setPathEffect(cornerPathEffect);
Paint paint3 = new Paint();
K1 = paint3;
paint3.setPathEffect(cornerPathEffect);
Paint paint4 = new Paint(1);
Y1 = paint4;
paint4.setStrokeCap(Paint.Cap.ROUND);
Y1.setStyle(Paint.Style.STROKE);
Y1.setColor(-1610612737);
Paint paint5 = new Paint(1);
Z1 = paint5;
paint5.setStrokeCap(Paint.Cap.ROUND);
Z1.setStyle(Paint.Style.STROKE);
s2 = new TextPaint(1);
TextPaint textPaint4 = new TextPaint(1);
k2 = textPaint4;
textPaint4.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint5 = new TextPaint(1);
t2 = textPaint5;
textPaint5.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
u2 = new TextPaint(1);
TextPaint textPaint6 = new TextPaint(1);
v2 = textPaint6;
textPaint6.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint7 = new TextPaint(1);
w2 = textPaint7;
textPaint7.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint8 = new TextPaint(1);
x2 = textPaint8;
textPaint8.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint9 = new TextPaint(1);
o2 = textPaint9;
textPaint9.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint10 = new TextPaint(1);
p2 = textPaint10;
textPaint10.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint11 = new TextPaint(1);
q2 = textPaint11;
textPaint11.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint12 = new TextPaint(1);
y2 = textPaint12;
textPaint12.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint13 = new TextPaint(1);
z2 = textPaint13;
textPaint13.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint14 = new TextPaint(1);
A2 = textPaint14;
textPaint14.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
B2 = new TextPaint(1);
TextPaint textPaint15 = new TextPaint(1);
C2 = textPaint15;
textPaint15.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint16 = new TextPaint(1);
D2 = textPaint16;
textPaint16.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint17 = new TextPaint(1);
r2 = textPaint17;
textPaint17.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
Paint paint6 = new Paint(1);
L1 = paint6;
paint6.setStyle(Paint.Style.STROKE);
L1.setStrokeCap(Paint.Cap.ROUND);
Paint paint7 = new Paint(1);
M1 = paint7;
paint7.setStyle(Paint.Style.STROKE);
M1.setStrokeCap(Paint.Cap.ROUND);
N1 = new Paint(1);
O1 = new Paint(1);
P1 = new Paint(1);
Paint paint8 = new Paint(1);
Q1 = paint8;
paint8.setStyle(Paint.Style.STROKE);
Q1.setStrokeCap(Paint.Cap.ROUND);
TextPaint textPaint18 = new TextPaint(1);
c2 = textPaint18;
textPaint18.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
Paint paint9 = new Paint(1);
V1 = paint9;
paint9.setColor(704643072);
W1 = new Paint(1);
TextPaint textPaint19 = new TextPaint(1);
E2 = textPaint19;
textPaint19.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
F2 = new TextPaint(1);
X1 = new Paint();
new Paint(1);
a2 = new Paint(1);
R1 = new Paint(1);
S1 = new Paint(1);
T1 = new Paint(1);
U1 = new Paint(1);
O("paintChatActionBackground", R1, "chat_serviceBackground");
O("paintChatActionBackgroundSelected", S1, "chat_serviceBackgroundSelected");
O("paintChatActionText", c2, "chat_serviceText");
O("paintChatBotButton", v2, "chat_botButtonText");
O("paintChatComposeBackground", X1, "chat_messagePanelBackground");
O("paintChatTimeBackground", W1, "chat_mediaTimeBackground");
}
}
public static v B1() {
return I;
}
public static void B2(final u uVar, final v vVar, final cu6 cu6Var, final i95 i95Var, ov5 ov5Var) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.A2(i95.this, uVar, vVar, cu6Var);
}
});
}
public static void C0(Context context) {
if (K0 == null) {
TextPaint textPaint = new TextPaint(1);
K0 = textPaint;
textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
x0 = new Paint(1);
B0 = new Paint(1);
u0 = new Paint(1);
}
K0.setTextSize(AndroidUtilities.dp(13.0f));
}
public static String C1() {
v vVar = I;
if (vVar == null) {
return BuildConfig.FLAVOR;
}
String D5 = vVar.D();
return D5.toLowerCase().endsWith(".attheme") ? D5.substring(0, D5.lastIndexOf(46)) : D5;
}
public static void C2(int i5, i95 i95Var) {
boolean z5;
String n12;
v vVar;
n27 n27Var;
A[i5] = false;
if (i95Var instanceof xf5) {
xf5 xf5Var = (xf5) i95Var;
C[i5] = xf5Var.a;
B[i5] = (int) (System.currentTimeMillis() / 1000);
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
int size = D.size();
for (int i6 = 0; i6 < size; i6++) {
v vVar2 = D.get(i6);
if (vVar2.p != null && vVar2.o == i5) {
arrayList2.add(vVar2);
} else if (vVar2.V != null) {
for (int i7 = 0; i7 < vVar2.V.size(); i7++) {
u uVar = vVar2.V.get(i7);
if (uVar.r != null && uVar.t == i5) {
arrayList2.add(uVar);
}
}
}
}
int size2 = xf5Var.b.size();
boolean z6 = false;
boolean z7 = false;
for (int i8 = 0; i8 < size2; i8++) {
cu6 cu6Var = xf5Var.b.get(i8);
if (cu6Var instanceof cu6) {
if (cu6Var.c) {
arrayList.add(cu6Var);
}
ArrayList<a27> arrayList3 = cu6Var.j;
if (arrayList3 == null || arrayList3.size() <= 0) {
String str = "remote" + cu6Var.e;
v vVar3 = G.get(str);
if (vVar3 == null) {
vVar3 = new v();
vVar3.o = i5;
vVar3.b = new File(ApplicationLoader.getFilesDirFixed(), str + ".attheme").getAbsolutePath();
D.add(vVar3);
F.add(vVar3);
z7 = true;
} else {
arrayList2.remove(vVar3);
}
vVar3.a = cu6Var.h;
vVar3.p = cu6Var;
G.put(vVar3.C(), vVar3);
} else {
for (int i9 = 0; i9 < cu6Var.j.size(); i9++) {
a27 a27Var = cu6Var.j.get(i9);
if (a27Var != null && (n12 = n1(a27Var)) != null && (vVar = G.get(n12)) != null && vVar.V != null) {
ArrayList arrayList4 = arrayList2;
u uVar2 = vVar.W.get(cu6Var.e);
if (uVar2 != null) {
if (!v.e(uVar2, a27Var)) {
File b6 = uVar2.b();
if (b6 != null) {
b6.delete();
}
v.y(uVar2, a27Var);
v vVar4 = H;
if (vVar4 == vVar && vVar4.S == uVar2.a) {
P2();
NotificationCenter globalInstance = NotificationCenter.getGlobalInstance();
int i10 = NotificationCenter.needSetDayNightTheme;
Object[] objArr = new Object[4];
v vVar5 = H;
objArr[0] = vVar5;
objArr[1] = Boolean.valueOf(I == vVar5);
objArr[2] = null;
objArr[3] = -1;
globalInstance.postNotificationName(i10, objArr);
}
z6 = true;
z7 = true;
}
m27 m27Var = a27Var.g;
uVar2.q = (m27Var == null || (n27Var = m27Var.j) == null || !n27Var.c) ? false : true;
arrayList2 = arrayList4;
arrayList2.remove(uVar2);
} else {
arrayList2 = arrayList4;
u u5 = vVar.u(cu6Var, i5, false, i9);
if (TextUtils.isEmpty(u5.o)) {
uVar2 = u5;
} else {
uVar2 = u5;
z6 = true;
}
}
uVar2.z = cu6Var.c;
}
}
}
}
}
int size3 = arrayList2.size();
for (int i11 = 0; i11 < size3; i11++) {
Object obj = arrayList2.get(i11);
if (obj instanceof v) {
v vVar6 = (v) obj;
vVar6.V();
F.remove(vVar6);
G.remove(vVar6.a);
q qVar = vVar6.c0;
if (qVar != null) {
qVar.c();
}
D.remove(vVar6);
new File(vVar6.b).delete();
if (J == vVar6) {
J = K;
} else if (I == vVar6) {
I = G.get("Dark Blue");
z5 = true;
if (H == vVar6) {
e0(z5 ? I : J, true, false, z5);
}
}
z5 = false;
if (H == vVar6) {
}
} else if (obj instanceof u) {
u uVar3 = (u) obj;
if (d1(uVar3.b, uVar3, false) && H == uVar3.b) {
P2();
NotificationCenter globalInstance2 = NotificationCenter.getGlobalInstance();
int i12 = NotificationCenter.needSetDayNightTheme;
Object[] objArr2 = new Object[4];
v vVar7 = H;
objArr2[0] = vVar7;
objArr2[1] = Boolean.valueOf(I == vVar7);
objArr2[2] = null;
objArr2[3] = -1;
globalInstance2.postNotificationName(i12, objArr2);
}
}
}
W2(true);
r3();
if (z7) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.themeListUpdated, new Object[0]);
}
if (z6) {
r.g(true);
}
g1(arrayList, i5);
}
}
public static void D0() {
E0(false);
}
public static v D1() {
v vVar = J;
return vVar != null ? vVar : K;
}
public static void D2(final int i5, final i95 i95Var, ov5 ov5Var) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.C2(i5, i95Var);
}
});
}
public static void E0(boolean z5) {
synchronized (a) {
if (b2 == null || z5) {
TextPaint textPaint = new TextPaint(1);
b2 = textPaint;
textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint2 = new TextPaint(1);
e2 = textPaint2;
textPaint2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
f2 = new TextPaint(1);
g2 = new TextPaint(1);
h2 = new TextPaint(1);
TextPaint textPaint3 = new TextPaint(1);
d2 = textPaint3;
textPaint3.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
}
f2.setTextSize(AndroidUtilities.dp(28.0f));
g2.setTextSize(AndroidUtilities.dp(24.0f));
h2.setTextSize(AndroidUtilities.dp(20.0f));
b2.setTextSize(AndroidUtilities.dp(SharedConfig.fontSize));
e2.setTextSize(AndroidUtilities.dp(14.0f));
d2.setTextSize(AndroidUtilities.dp(15.0f));
}
}
public static int E1(String str) {
u A5;
Integer num = P4.get(str);
if (num == null || (A5 = H.A(false)) == null) {
return 0;
}
float[] W12 = W1(1);
float[] W13 = W1(2);
Color.colorToHSV(H.R, W12);
Color.colorToHSV(A5.c, W13);
return n0(W12, W13, num.intValue(), H.J());
}
public static void E2(Drawable drawable) {
b = null;
B0();
R(null, null, drawable);
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
}
public static void F0(Context context) {
if (l0 == null) {
Paint paint = new Paint();
l0 = paint;
paint.setStrokeWidth(1.0f);
Paint paint2 = new Paint();
m0 = paint2;
paint2.setStrokeWidth(1.0f);
r0 = new Paint(1);
Paint paint3 = new Paint(1);
p0 = paint3;
paint3.setStyle(Paint.Style.STROKE);
p0.setStrokeWidth(AndroidUtilities.dp(2.0f));
p0.setStrokeCap(Paint.Cap.ROUND);
Paint paint4 = new Paint(1);
o0 = paint4;
paint4.setColor(0);
o0.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
q0 = new Paint(1);
Paint paint5 = new Paint();
n0 = paint5;
paint5.setPathEffect(j72.k);
Resources resources = context.getResources();
s0[0] = resources.getDrawable(org.telegram.messenger.R.drawable.chats_saved);
s0[1] = resources.getDrawable(org.telegram.messenger.R.drawable.ghost);
s0[2] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_private);
s0[3] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_requests);
s0[4] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_group);
s0[5] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_channel);
s0[6] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_bot);
s0[7] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_mute);
s0[8] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_read);
s0[9] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_archive);
s0[10] = resources.getDrawable(org.telegram.messenger.R.drawable.folders_private);
s0[11] = resources.getDrawable(org.telegram.messenger.R.drawable.chats_replies);
RLottieDrawable rLottieDrawable = j1;
if (rLottieDrawable != null) {
rLottieDrawable.setCallback(null);
j1.N();
}
RLottieDrawable rLottieDrawable2 = k1;
if (rLottieDrawable2 != null) {
rLottieDrawable2.N();
}
RLottieDrawable rLottieDrawable3 = l1;
if (rLottieDrawable3 != null) {
rLottieDrawable3.N();
}
RLottieDrawable rLottieDrawable4 = m1;
if (rLottieDrawable4 != null) {
rLottieDrawable4.N();
}
RLottieDrawable rLottieDrawable5 = n1;
if (rLottieDrawable5 != null) {
rLottieDrawable5.N();
}
RLottieDrawable rLottieDrawable6 = o1;
if (rLottieDrawable6 != null) {
rLottieDrawable6.N();
}
j1 = new RLottieDrawable(R.raw.chats_archiveavatar, "chats_archiveavatar", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f), false, null);
k1 = new RLottieDrawable(R.raw.chats_archive, "chats_archive", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
l1 = new RLottieDrawable(R.raw.chats_unarchive, "chats_unarchive", AndroidUtilities.dp(AndroidUtilities.dp(36.0f)), AndroidUtilities.dp(36.0f));
m1 = new RLottieDrawable(R.raw.chats_hide, "chats_hide", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
n1 = new RLottieDrawable(R.raw.chats_unhide, "chats_unhide", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
o1 = new RLottieDrawable(R.raw.chat_audio_record_delete, "chats_psahide", AndroidUtilities.dp(30.0f), AndroidUtilities.dp(30.0f));
w1 = new RLottieDrawable(R.raw.swipe_mute, "swipe_mute", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
x1 = new RLottieDrawable(R.raw.swipe_unmute, "swipe_unmute", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
z1 = new RLottieDrawable(R.raw.swipe_read, "swipe_read", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
A1 = new RLottieDrawable(R.raw.swipe_unread, "swipe_unread", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
y1 = new RLottieDrawable(R.raw.swipe_delete, "swipe_delete", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
C1 = new RLottieDrawable(R.raw.swipe_unpin, "swipe_unpin", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
B1 = new RLottieDrawable(R.raw.swipe_pin, "swipe_pin", AndroidUtilities.dp(36.0f), AndroidUtilities.dp(36.0f));
T();
}
}
public static int F1(String str) {
Integer num = M4.get(str);
return num == null ? (str.equals("chats_menuTopShadow") || str.equals("chats_menuTopBackground") || str.equals("chats_menuTopShadowCats") || str.equals("key_chat_wallpaper_gradient_to2") || str.equals("key_chat_wallpaper_gradient_to3")) ? 0 : -65536 : num.intValue();
}
public static void F2(q qVar, File file, int i5, boolean z5, boolean z6, ga5 ga5Var) {
o u02 = u0(H, qVar, Q4, file, i0, h0, i5, R, z5, N, O, z6, ga5Var);
Boolean bool = u02.b;
j0 = bool != null ? bool.booleanValue() : j0;
Boolean bool2 = u02.c;
k0 = bool2 != null ? bool2.booleanValue() : k0;
Boolean bool3 = u02.d;
V = bool3 != null ? bool3.booleanValue() : V;
final Drawable drawable = u02.a;
f0 = drawable != null ? drawable : f0;
h0(drawable, 1);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.E2(drawable);
}
});
}
public static Drawable G0() {
return H0(0, 0);
}
public static HashMap<String, Integer> G1() {
return M4;
}
public static void G2(boolean z5) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewTheme, Boolean.FALSE, Boolean.valueOf(z5));
}
static long H() {
return l1();
}
public static Drawable H0(int i5, int i6) {
sg3 sg3Var = new sg3(-2368069, -9722489, -2762611, -7817084, i5 != 0);
if (i5 <= 0 || i6 <= 0) {
Point point = AndroidUtilities.displaySize;
i5 = Math.min(point.x, point.y);
Point point2 = AndroidUtilities.displaySize;
i6 = Math.max(point2.x, point2.y);
}
sg3Var.B(34, SvgHelper.getBitmap(R.raw.default_pattern, i5, i6, com.batch.android.messaging.view.roundimage.b.v));
sg3Var.C(sg3Var.j());
return sg3Var;
}
public static int H1() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int i5 = calendar.get(2);
int i6 = calendar.get(5);
calendar.get(12);
int i7 = calendar.get(11);
if ((i5 == 11 && i6 >= 24 && i6 <= 31) || (i5 == 0 && i6 == 1)) {
return 0;
}
if (i5 == 1 && i6 == 14) {
return 1;
}
if (i5 != 9 || i6 < 30) {
return (i5 == 10 && i6 == 1 && i7 < 12) ? 2 : -1;
}
return 2;
}
public static int H2(u uVar, u uVar2) {
if (v2(uVar)) {
return -1;
}
if (v2(uVar2)) {
return 1;
}
?? r02 = uVar.z;
?? r32 = uVar2.z;
if (r02 != r32) {
return r02 > r32 ? -1 : 1;
}
int i5 = uVar.a;
int i6 = uVar2.a;
if (r02 != 0) {
if (i5 > i6) {
return 1;
}
return i5 < i6 ? -1 : 0;
}
if (i5 > i6) {
return -1;
}
return i5 < i6 ? 1 : 0;
}
public static void I0(Context context) {
F0(context);
C0(context);
if (C0 == null) {
Resources resources = context.getResources();
C0 = new TextPaint[2];
D0 = new TextPaint[2];
G0 = new TextPaint[2];
I0 = new TextPaint[2];
for (int i5 = 0; i5 < 2; i5++) {
C0[i5] = new TextPaint(1);
C0[i5].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
D0[i5] = new TextPaint(1);
D0[i5].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
G0[i5] = new TextPaint(1);
G0[i5].setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
I0[i5] = new TextPaint(1);
}
TextPaint textPaint = new TextPaint(1);
E0 = textPaint;
textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint2 = new TextPaint(1);
F0 = textPaint2;
textPaint2.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint3 = new TextPaint(1);
H0 = textPaint3;
textPaint3.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
J0 = new TextPaint(1);
TextPaint textPaint4 = new TextPaint(1);
L0 = textPaint4;
textPaint4.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint5 = new TextPaint(1);
M0 = textPaint5;
textPaint5.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint6 = new TextPaint(1);
N0 = textPaint6;
textPaint6.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
TextPaint textPaint7 = new TextPaint(1);
O0 = textPaint7;
textPaint7.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
v0 = new Paint();
w0 = new Paint(1);
Paint paint = new Paint(1);
z0 = paint;
paint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
y0 = new Paint(1);
A0 = new Paint(1);
W0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_secret);
P0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_check).mutate();
Q0 = resources.getDrawable(org.telegram.messenger.R.drawable.minithumb_play).mutate();
R0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_check).mutate();
S0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_halfcheck);
T0 = new dh3();
U0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_warning_sign);
V0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_reorder).mutate();
X0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_group);
Y0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_broadcast);
a1 = resources.getDrawable(org.telegram.messenger.R.drawable.list_mute).mutate();
b1 = resources.getDrawable(org.telegram.messenger.R.drawable.verified_area).mutate();
c1 = new xl4(11, 0);
d1 = new xl4(11, 1);
e1 = resources.getDrawable(org.telegram.messenger.R.drawable.verified_check).mutate();
g1 = resources.getDrawable(org.telegram.messenger.R.drawable.mentionchatslist);
h1 = resources.getDrawable(org.telegram.messenger.R.drawable.reactionchatslist);
Z0 = resources.getDrawable(org.telegram.messenger.R.drawable.list_bot);
f1 = resources.getDrawable(org.telegram.messenger.R.drawable.list_pin);
t0 = resources.getDrawable(org.telegram.messenger.R.drawable.preview_open);
RectF rectF = new RectF();
z4[0] = new Path();
z4[2] = new Path();
float dp = AndroidUtilities.dp(12.0f);
float dp2 = AndroidUtilities.dp(12.0f);
rectF.set(dp - AndroidUtilities.dp(5.0f), dp2 - AndroidUtilities.dp(5.0f), AndroidUtilities.dp(5.0f) + dp, AndroidUtilities.dp(5.0f) + dp2);
z4[2].arcTo(rectF, -160.0f, -110.0f, true);
z4[2].arcTo(rectF, 20.0f, -110.0f, true);
z4[0].moveTo(dp, AndroidUtilities.dp(8.0f) + dp2);
z4[0].lineTo(dp, AndroidUtilities.dp(2.0f) + dp2);
z4[0].lineTo(AndroidUtilities.dp(3.0f) + dp, AndroidUtilities.dp(5.0f) + dp2);
z4[0].close();
z4[0].moveTo(dp, dp2 - AndroidUtilities.dp(8.0f));
z4[0].lineTo(dp, dp2 - AndroidUtilities.dp(2.0f));
z4[0].lineTo(dp - AndroidUtilities.dp(3.0f), dp2 - AndroidUtilities.dp(5.0f));
z4[0].close();
V();
}
H0.setTextSize(AndroidUtilities.dp(14.0f));
J0.setTextSize(AndroidUtilities.dp(13.0f));
L0.setTextSize(AndroidUtilities.dp(13.0f));
M0.setTextSize(AndroidUtilities.dp(11.0f));
N0.setTextSize(AndroidUtilities.dp(15.0f));
O0.setTextSize(AndroidUtilities.dp(15.0f));
E0.setTextSize(AndroidUtilities.dp(16.0f));
F0.setTextSize(AndroidUtilities.dp(16.0f));
}
public static String I1(String str) {
return N4.get(str);
}
public static int I2(v vVar, v vVar2) {
if (vVar.b == null && vVar.d == null) {
return -1;
}
if (vVar2.b == null && vVar2.d == null) {
return 1;
}
return vVar.a.compareTo(vVar2.a);
}
public static Drawable J0(Context context, int i5, int i6) {
Resources resources = context.getResources();
Drawable mutate = resources.getDrawable(org.telegram.messenger.R.drawable.search_dark).mutate();
mutate.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
Drawable mutate2 = resources.getDrawable(org.telegram.messenger.R.drawable.search_dark_activated).mutate();
mutate2.setColorFilter(new PorterDuffColorFilter(i6, PorterDuff.Mode.MULTIPLY));
k kVar = new k();
kVar.addState(new int[]{android.R.attr.state_enabled, android.R.attr.state_focused}, mutate2);
kVar.addState(new int[]{android.R.attr.state_focused}, mutate2);
kVar.addState(StateSet.WILD_CARD, mutate);
return kVar;
}
public static HashMap<String, String> J1() {
return N4;
}
public static void J2(MessageObject messageObject) {
nd remove = D4.remove(messageObject);
if (remove != null) {
remove.d(null);
}
}
public static Drawable K0(Context context, boolean z5) {
return J0(context, r1(z5 ? "dialogInputField" : "windowBackgroundWhiteInputField"), r1(z5 ? "dialogInputFieldActivated" : "windowBackgroundWhiteInputFieldActivated"));
}
public static dj1 K1() {
if (Y4 == null) {
Y4 = new dj1();
}
return Y4;
}
public static void K2(final int i5, boolean z5) {
if (A[i5]) {
return;
}
if ((z5 || Math.abs((System.currentTimeMillis() / 1000) - B[i5]) >= 3600) && UserConfig.getInstance(i5).isClientActivated()) {
A[i5] = true;
me5 me5Var = new me5();
me5Var.a = "android";
me5Var.b = C[i5];
ConnectionsManager.getInstance(i5).sendRequest(me5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var, ov5 ov5Var) {
org.telegram.ui.ActionBar.w.D2(i5, i95Var, ov5Var);
}
});
}
}
public static Drawable L0(Context context, int i5, int i6, int i7) {
Resources resources = context.getResources();
Drawable mutate = resources.getDrawable(i5).mutate();
if (i6 != 0) {
mutate.setColorFilter(new PorterDuffColorFilter(i6, PorterDuff.Mode.MULTIPLY));
}
Drawable mutate2 = resources.getDrawable(i5).mutate();
if (i7 != 0) {
mutate2.setColorFilter(new PorterDuffColorFilter(i7, PorterDuff.Mode.MULTIPLY));
}
j jVar = new j();
jVar.setEnterFadeDuration(1);
jVar.setExitFadeDuration(200);
jVar.addState(new int[]{android.R.attr.state_selected}, mutate2);
jVar.addState(new int[0], mutate);
return jVar;
}
public static int L1(String str) {
return u1(str, null, true);
}
public static Bitmap L2(FileInputStream fileInputStream, int i5) {
try {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
int i6 = 1;
options.inSampleSize = 1;
options.inJustDecodeBounds = true;
long j5 = i5;
fileInputStream.getChannel().position(j5);
BitmapFactory.decodeStream(fileInputStream, null, options);
float f5 = options.outWidth;
float f6 = options.outHeight;
int dp = AndroidUtilities.dp(360.0f);
int dp2 = AndroidUtilities.dp(640.0f);
float min = (dp < dp2 || f5 <= f6) ? Math.min(f5 / dp, f6 / dp2) : Math.max(f5 / dp, f6 / dp2);
if (min < 1.2f) {
min = 1.0f;
}
options.inJustDecodeBounds = false;
if (min <= 1.0f || (f5 <= dp && f6 <= dp2)) {
options.inSampleSize = (int) min;
} else {
do {
i6 *= 2;
} while (i6 * 2 < min);
options.inSampleSize = i6;
}
fileInputStream.getChannel().position(j5);
Bitmap decodeStream = BitmapFactory.decodeStream(fileInputStream, null, options);
try {
fileInputStream.close();
} catch (Exception unused) {
}
return decodeStream;
} catch (Exception e5) {
FileLog.e(e5);
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Exception unused2) {
}
}
return null;
}
} catch (Throwable th) {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Exception unused3) {
}
}
throw th;
}
}
public static v M0(String str) {
v vVar = new v();
vVar.b = new File(ApplicationLoader.getFilesDirFixed(), "theme" + Utilities.random.nextLong() + ".attheme").getAbsolutePath();
vVar.a = str;
i0 = k2(H.c0);
vVar.o = UserConfig.selectedAccount;
V2(vVar, true, true, false);
return vVar;
}
public static int M1(HashMap<String, Integer> hashMap, String str) {
Integer num = hashMap.get(str);
if (num == null) {
num = M4.get(str);
}
return num.intValue();
}
public static void M2() {
final File file;
final ga5 ga5Var;
final boolean z5;
float f5;
float f6;
m27 m27Var;
if (f0 != null) {
return;
}
v vVar = H;
final boolean z6 = vVar.G && vVar.S == l;
u A5 = vVar.A(false);
ga5 ga5Var2 = null;
if (A5 != null) {
File b6 = A5.b();
boolean z7 = A5.q;
cu6 cu6Var = A5.r;
a27 a27Var = (cu6Var == null || cu6Var.j.size() <= 0) ? null : A5.r.j.get(0);
if (A5.r != null && a27Var != null && (m27Var = a27Var.g) != null) {
ga5Var2 = m27Var.i;
}
ga5Var = ga5Var2;
file = b6;
z5 = z7;
} else {
file = null;
ga5Var = null;
z5 = false;
}
v vVar2 = H;
final q qVar = vVar2.c0;
if (qVar != null) {
f6 = qVar.k;
} else {
if (A5 == null) {
f5 = vVar2.n;
final int i5 = (int) f5;
DispatchQueue dispatchQueue = Utilities.themeQueue;
Runnable runnable = new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.F2(w.q.this, file, i5, z6, z5, ga5Var);
}
};
b = runnable;
dispatchQueue.postRunnable(runnable);
}
f6 = A5.p;
}
f5 = f6 * 100.0f;
final int i52 = (int) f5;
DispatchQueue dispatchQueue2 = Utilities.themeQueue;
Runnable runnable2 = new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.F2(w.q.this, file, i52, z6, z5, ga5Var);
}
};
b = runnable2;
dispatchQueue2.postRunnable(runnable2);
}
private static void N(String str, Drawable drawable, String str2) {
G4.put(str, drawable);
if (str2 != null) {
H4.put(str, str2);
}
}
public static void N0(Context context) {
if (E1 == null) {
D1 = new TextPaint(1);
Resources resources = context.getResources();
E1 = resources.getDrawable(org.telegram.messenger.R.drawable.verified_area).mutate();
F1 = resources.getDrawable(org.telegram.messenger.R.drawable.verified_check).mutate();
X();
}
D1.setTextSize(AndroidUtilities.dp(16.0f));
}
public static v N1() {
return L;
}
private static int N2() {
Sensor sensor;
SensorEventListener sensorEventListener;
int i5;
int i6;
int i7 = m;
if (i7 == 1) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int i8 = (calendar.get(11) * 60) + calendar.get(12);
if (n) {
int i9 = calendar.get(5);
if (s != i9) {
double d5 = v;
if (d5 != 10000.0d) {
double d6 = w;
if (d6 != 10000.0d) {
int[] calculateSunriseSunset = SunDate.calculateSunriseSunset(d5, d6);
t = calculateSunriseSunset[0];
r = calculateSunriseSunset[1];
s = i9;
U2();
}
}
}
i5 = r;
i6 = t;
} else {
i5 = p;
i6 = q;
}
return i5 < i6 ? (i5 > i8 || i8 > i6) ? 1 : 2 : ((i5 > i8 || i8 > 1440) && (i8 < 0 || i8 > i6)) ? 1 : 2;
}
if (i7 == 2) {
if (d == null) {
SensorManager sensorManager = (SensorManager) ApplicationLoader.applicationContext.getSystemService("sensor");
c = sensorManager;
d = sensorManager.getDefaultSensor(5);
}
if (!e && (sensor = d) != null && (sensorEventListener = b5) != null) {
c.registerListener(sensorEventListener, sensor, 500000);
e = true;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("light sensor registered");
}
}
if (f <= o) {
if (!i) {
return 2;
}
} else if (!h) {
return 1;
}
} else if (i7 == 3) {
int i10 = ApplicationLoader.applicationContext.getResources().getConfiguration().uiMode & 48;
if (i10 == 0 || i10 == 16) {
return 1;
}
if (i10 == 32) {
return 2;
}
} else if (i7 == 0) {
return 1;
}
return 0;
}
private static void O(String str, Paint paint, String str2) {
I4.put(str, paint);
if (str2 != null) {
J4.put(str, str2);
}
}
public static Drawable O0(int i5, int i6, int i7) {
if (Build.VERSION.SDK_INT >= 21) {
x.setColor(-1);
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), null, new t(i6, i7));
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i5));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i5));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(0));
return stateListDrawable;
}
public static wj4 O1() {
if (Z4 == null) {
Z4 = new wj4();
}
return Z4;
}
public static void O2() {
RLottieDrawable rLottieDrawable;
int L12;
String str;
int i5 = 0;
while (true) {
RLottieDrawable[] rLottieDrawableArr = o4;
if (i5 >= rLottieDrawableArr.length) {
return;
}
if (rLottieDrawableArr[i5] != null) {
rLottieDrawableArr[i5].r();
if (i5 == 0) {
o4[i5].f0("Color_Mount.**", L1("chat_attachGalleryBackground"));
o4[i5].f0("Color_PhotoShadow.**", L1("chat_attachGalleryBackground"));
o4[i5].f0("White_Photo.**", L1("chat_attachGalleryIcon"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachGalleryIcon");
str = "White_BackPhoto.**";
} else if (i5 == 1) {
o4[i5].f0("White_Play1.**", L1("chat_attachAudioIcon"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachAudioIcon");
str = "White_Play2.**";
} else if (i5 == 2) {
o4[i5].f0("Color_Corner.**", L1("chat_attachFileBackground"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachFileIcon");
str = "White_List.**";
} else if (i5 == 3) {
o4[i5].f0("White_User1.**", L1("chat_attachContactIcon"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachContactIcon");
str = "White_User2.**";
} else if (i5 == 4) {
o4[i5].f0("Color_Oval.**", L1("chat_attachLocationBackground"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachLocationIcon");
str = "White_Pin.**";
} else {
if (i5 == 5) {
o4[i5].f0("White_Column 1.**", L1("chat_attachPollIcon"));
o4[i5].f0("White_Column 2.**", L1("chat_attachPollIcon"));
rLottieDrawable = o4[i5];
L12 = L1("chat_attachPollIcon");
str = "White_Column 3.**";
}
o4[i5].t();
}
rLottieDrawable.f0(str, L12);
o4[i5].t();
}
i5++;
}
}
public static void P() {
R(null, null, f0);
}
public static Drawable P0(int i5, int i6, int i7, int i8, int i9) {
if (Build.VERSION.SDK_INT >= 21) {
x.setColor(-1);
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), null, new t(i6, i7, i8, i9));
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i5));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i5));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(0));
return stateListDrawable;
}
public static Drawable P1(int i5) {
if (Build.VERSION.SDK_INT >= 21) {
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{(i5 & 16777215) | 419430400}), null, Q0(AndroidUtilities.dp(3.0f), -1));
}
StateListDrawable stateListDrawable = new StateListDrawable();
int i6 = (i5 & 16777215) | 419430400;
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, Q0(AndroidUtilities.dp(3.0f), i6));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, Q0(AndroidUtilities.dp(3.0f), i6));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(0));
return stateListDrawable;
}
public static void P2() {
Q2(false, false);
}
public static void Q(int[] iArr, Drawable drawable) {
R(iArr, drawable, f0);
}
public static Drawable Q0(int i5, int i6) {
float f5 = i5;
ShapeDrawable shapeDrawable = new ShapeDrawable(new RoundRectShape(new float[]{f5, f5, f5, f5, f5, f5, f5, f5}, null, null));
shapeDrawable.getPaint().setColor(i6);
return shapeDrawable;
}
public static String Q1() {
q qVar = H.c0;
return qVar != null ? qVar.c : o2() ? "t" : "d";
}
public static void Q2(boolean z5, boolean z6) {
Q4.clear();
Q4.putAll(P4);
S4 = true;
u A5 = H.A(false);
if (A5 != null) {
S4 = A5.a(P4, Q4);
}
if (!z6) {
S2();
}
T();
V();
X();
S(false, z5);
final boolean z7 = !N;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.G2(z7);
}
});
}
public static void R(int[] iArr, Drawable drawable, Drawable drawable2) {
Integer num;
Integer num2;
Integer num3;
if (R1 == null) {
return;
}
W = b0;
a0 = c0;
if (iArr == null || iArr.length < 2) {
num = Q4.get("chat_serviceBackground");
num2 = Q4.get("chat_serviceBackgroundSelected");
} else {
num = Integer.valueOf(iArr[0]);
num2 = Integer.valueOf(iArr[1]);
W = iArr[0];
a0 = iArr[1];
}
if (num == null) {
num = Integer.valueOf(W);
num3 = Integer.valueOf(d0);
} else {
num3 = num;
}
Integer valueOf = num2 == null ? Integer.valueOf(a0) : num2;
if (num2 == null) {
num2 = Integer.valueOf(e0);
}
if (drawable == null) {
drawable = drawable2;
}
boolean z5 = drawable instanceof sg3;
if (z5 && SharedConfig.getDevicePerformanceClass() != 0) {
Bitmap f5 = ((sg3) drawable).f();
if (X != f5) {
X = f5;
Bitmap bitmap = X;
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
Y = new BitmapShader(bitmap, tileMode, tileMode);
if (Z == null) {
Z = new Matrix();
}
}
h3(t3, -1);
h3(d3, -1);
h3(e3, -1);
h3(f3, -1);
h3(g3, -1);
c2.setColor(-1);
c2.linkColor = -1;
v2.setColor(-1);
h3(Z3, -1);
h3(O3, -1);
h3(T3, -1);
h3(U3, -1);
h3(X3, -1);
h3(V3, -1);
} else {
X = null;
Y = null;
i3(t3, "chat_serviceText");
i3(d3, "chat_serviceText");
i3(e3, "chat_serviceText");
i3(f3, "chat_serviceText");
i3(g3, "chat_serviceText");
c2.setColor(r1("chat_serviceText"));
c2.linkColor = r1("chat_serviceLink");
i3(Z3, "chat_serviceIcon");
i3(O3, "chat_serviceIcon");
i3(T3, "chat_serviceIcon");
i3(U3, "chat_serviceIcon");
i3(X3, "chat_serviceIcon");
i3(V3, "chat_serviceIcon");
v2.setColor(r1("chat_botButtonText"));
}
R1.setColor(num.intValue());
S1.setColor(valueOf.intValue());
T1.setColor(num3.intValue());
U1.setColor(num2.intValue());
num.intValue();
if (Y == null || !(Q4.get("chat_serviceBackground") == null || z5)) {
R1.setColorFilter(null);
R1.setShader(null);
S1.setColorFilter(null);
S1.setShader(null);
return;
}
R1.setShader(Y);
ColorMatrix colorMatrix = new ColorMatrix();
colorMatrix.setSaturation(((sg3) drawable).i() >= 0 ? 1.8f : 0.5f);
R1.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
R1.setAlpha(127);
S1.setShader(Y);
S1.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
S1.setAlpha(200);
}
public static Drawable R0(int i5) {
return T0(i5, 1, -1);
}
public static Drawable R1(int i5, String str) {
if (str == null) {
return S0(i5, 2);
}
if (Build.VERSION.SDK_INT >= 21) {
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), new ColorDrawable(r1(str)), new ColorDrawable(-1));
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i5));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i5));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(r1(str)));
return stateListDrawable;
}
public static void R2(Context context) {
e1();
if (K2 != null) {
K2 = null;
v0(context, false);
}
if (C0 != null) {
C0 = null;
I0(context);
}
if (E1 != null) {
E1 = null;
N0(context);
}
}
public static void S(boolean z5, boolean z6) {
if (b2 == null || K2 == null || z5) {
return;
}
p2.setColor(r1("chat_previewGameText"));
o2.setColor(r1("chat_previewDurationText"));
v2.setColor(r1("chat_botButtonText"));
J1.setColor(r1("chat_linkSelectBackground"));
I1.setColor(r1("chat_botProgress"));
H1.setColor(r1("chat_secretTimeText"));
K1.setColor(r1("chat_textSelectBackground"));
O1.setColor(r1("chat_sentError"));
P1.setColor(r1("chat_status"));
Q1.setColor(r1("chat_status"));
c2.setColor(r1("chat_serviceText"));
c2.linkColor = r1("chat_serviceLink");
E2.setColor(r1("windowBackgroundWhiteBlackText"));
X1.setColor(r1("chat_messagePanelBackground"));
W1.setColor(r1("chat_mediaTimeBackground"));
i3(G2, "chat_mediaTimeText");
i3(K2, "chat_inBubble");
i3(L2, "chat_inBubbleSelected");
i3(O2, "chat_inBubble");
i3(P2, "chat_inBubbleSelected");
i3(U2, "chat_outSentCheck");
i3(V2, "chat_outSentCheckSelected");
i3(W2, "chat_outSentCheckRead");
i3(X2, "chat_outSentCheckReadSelected");
i3(Y2, "chat_outSentCheckRead");
i3(Z2, "chat_outSentCheckReadSelected");
i3(b3, "chat_mediaSentCheck");
i3(c3, "chat_mediaSentCheck");
i3(d3, "chat_serviceText");
i3(e3, "chat_serviceText");
i3(f3, "chat_serviceText");
i3(g3, "chat_serviceText");
i3(O3, "chat_serviceIcon");
i3(P3, "chat_serviceIcon");
i3(Q3, "chat_serviceIcon");
i3(T3, "chat_serviceIcon");
i3(U3, "chat_serviceIcon");
i3(X3, "chat_serviceIcon");
i3(V3, "chat_serviceIcon");
i3(h3, "chat_inViews");
i3(i3, "chat_inViewsSelected");
i3(j3, "chat_outViews");
i3(k3, "chat_outViewsSelected");
i3(l3, "chat_inViews");
i3(m3, "chat_inViewsSelected");
i3(n3, "chat_outViews");
i3(o3, "chat_outViewsSelected");
i3(p3, "chat_inViews");
i3(q3, "chat_inViewsSelected");
i3(r3, "chat_outViews");
i3(s3, "chat_outViewsSelected");
i3(u3, "chat_mediaViews");
i3(t3, "chat_serviceText");
i3(v3, "chat_mediaViews");
i3(w3, "chat_mediaViews");
i3(x3, "chat_inMenu");
i3(y3, "chat_inMenuSelected");
i3(z3, "chat_outMenu");
i3(A3, "chat_outMenuSelected");
i3(B3, "chat_mediaMenu");
i3(D3, "chat_outInstant");
i3(C3, "chat_inInstant");
i3(E3, "chat_sentErrorIcon");
i3(F3, "chat_muteIcon");
i3(G3, "chat_lockIcon");
i3(L3, "chat_outBroadcast");
i3(M3, "chat_mediaBroadcast");
i3(H3, "chat_inlineResultIcon");
i3(I3, "chat_inlineResultIcon");
i3(J3, "chat_inlineResultIcon");
i3(Y3, "chat_inInstant");
i3(Z3, "chat_serviceIcon");
i3(a4, "chat_inInstant");
for (int i5 = 0; i5 < 2; i5++) {
i3(b4[i5], "chat_inInstant");
i3(c4[i5], "chat_inInstantSelected");
i3(d4[i5], "chat_outInstant");
i3(e4[i5], "chat_outInstantSelected");
}
i3(j4, "chat_outUpCall");
i3(k4, "chat_inUpCall");
i3(l4, "chat_inDownCall");
i3(u4, "calls_callReceivedRedIcon");
i3(v4, "calls_callReceivedGreenIcon");
i3(w4, "calls_callReceivedRedIcon");
i3(x4, "calls_callReceivedGreenIcon");
int i6 = 0;
while (true) {
v35[] v35VarArr = S2;
if (i6 >= v35VarArr.length) {
break;
}
i3(v35VarArr[i6], "chats_actionMessage");
i6++;
}
for (int i7 = 0; i7 < 2; i7++) {
e3(s4[i7][0], r1("chat_outLoader"), false);
e3(s4[i7][0], r1("chat_outMediaIcon"), true);
e3(s4[i7][1], r1("chat_outLoaderSelected"), false);
e3(s4[i7][1], r1("chat_outMediaIconSelected"), true);
int i8 = i7 + 2;
e3(s4[i8][0], r1("chat_inLoader"), false);
e3(s4[i8][0], r1("chat_inMediaIcon"), true);
e3(s4[i8][1], r1("chat_inLoaderSelected"), false);
e3(s4[i8][1], r1("chat_inMediaIconSelected"), true);
int i9 = i7 + 4;
e3(s4[i9][0], r1("chat_mediaLoaderPhoto"), false);
e3(s4[i9][0], r1("chat_mediaLoaderPhotoIcon"), true);
e3(s4[i9][1], r1("chat_mediaLoaderPhotoSelected"), false);
e3(s4[i9][1], r1("chat_mediaLoaderPhotoIconSelected"), true);
}
for (int i10 = 0; i10 < 5; i10++) {
e3(r4[i10][0], r1("chat_outLoader"), false);
e3(r4[i10][0], r1("chat_outMediaIcon"), true);
e3(r4[i10][1], r1("chat_outLoaderSelected"), false);
e3(r4[i10][1], r1("chat_outMediaIconSelected"), true);
int i11 = i10 + 5;
e3(r4[i11][0], r1("chat_inLoader"), false);
e3(r4[i11][0], r1("chat_inMediaIcon"), true);
e3(r4[i11][1], r1("chat_inLoaderSelected"), false);
e3(r4[i11][1], r1("chat_inMediaIconSelected"), true);
}
for (int i12 = 0; i12 < 4; i12++) {
e3(t4[i12][0], r1("chat_mediaLoaderPhoto"), false);
e3(t4[i12][0], r1("chat_mediaLoaderPhotoIcon"), true);
e3(t4[i12][1], r1("chat_mediaLoaderPhotoSelected"), false);
e3(t4[i12][1], r1("chat_mediaLoaderPhotoIconSelected"), true);
}
for (int i13 = 0; i13 < 2; i13++) {
int i14 = i13 + 7;
e3(t4[i14][0], r1("chat_outLoaderPhoto"), false);
e3(t4[i14][0], r1("chat_outLoaderPhotoIcon"), true);
e3(t4[i14][1], r1("chat_outLoaderPhotoSelected"), false);
e3(t4[i14][1], r1("chat_outLoaderPhotoIconSelected"), true);
int i15 = i13 + 10;
e3(t4[i15][0], r1("chat_inLoaderPhoto"), false);
e3(t4[i15][0], r1("chat_inLoaderPhotoIcon"), true);
e3(t4[i15][1], r1("chat_inLoaderPhotoSelected"), false);
e3(t4[i15][1], r1("chat_inLoaderPhotoIconSelected"), true);
}
i3(t4[9][0], "chat_outFileIcon");
i3(t4[9][1], "chat_outFileSelectedIcon");
i3(t4[12][0], "chat_inFileIcon");
i3(t4[12][1], "chat_inFileSelectedIcon");
e3(q4[0], r1("chat_inContactBackground"), false);
e3(q4[0], r1("chat_inContactIcon"), true);
e3(q4[1], r1("chat_outContactBackground"), false);
e3(q4[1], r1("chat_outContactIcon"), true);
h3(p4[0], r1("chat_inLocationIcon"));
h3(p4[1], r1("chat_outLocationIcon"));
h3(h4[0], r1("chat_inPreviewInstantText"));
h3(h4[1], r1("chat_outPreviewInstantText"));
h3(i4[0], r1("chat_inViews"));
h3(i4[1], r1("chat_outViews"));
i3(H2, "chat_messagePanelShadow");
i3(I2, "chat_messagePanelBackground");
int r12 = r1("chat_outAudioSeekbarFill") == -1 ? r1("chat_outBubble") : -1;
h3(f4[1], r12);
h3(g4[1], r12);
h3(n4, r1("chat_attachEmptyImage"));
if (!z6) {
P();
}
O2();
}
public static Drawable S0(int i5, int i6) {
return T0(i5, i6, -1);
}
public static Drawable S1(int i5, boolean z5) {
return z5 ? R1(i5, "windowBackgroundWhite") : S0(i5, 2);
}
public static void S2() {
o.c cVar = U;
if (cVar != null) {
cVar.dispose();
U = null;
}
Drawable drawable = f0;
R = drawable instanceof sg3 ? ((sg3) drawable).l() : 0;
f0 = null;
g0 = null;
M2();
}
public static void T() {
Paint paint = l0;
if (paint == null) {
return;
}
paint.setColor(r1("divider"));
n0.setColor(r1("windowBackgroundWhiteLinkSelection"));
int i5 = 0;
while (true) {
Drawable[] drawableArr = s0;
if (i5 >= drawableArr.length) {
j1.r();
j1.f0("Arrow1.**", L1("avatar_backgroundArchived"));
j1.f0("Arrow2.**", L1("avatar_backgroundArchived"));
j1.f0("Box2.**", L1("avatar_text"));
j1.f0("Box1.**", L1("avatar_text"));
j1.t();
r1 = false;
j1.U(true);
m1.r();
m1.f0("Arrow.**", L1("chats_archiveIcon"));
m1.f0("Line.**", L1("chats_archiveIcon"));
m1.t();
n1.r();
n1.f0("Arrow.**", L1("chats_archiveIcon"));
n1.f0("Line.**", L1("chats_archiveIcon"));
n1.t();
o1.r();
o1.f0("Line 1.**", L1("chats_archiveBackground"));
o1.f0("Line 2.**", L1("chats_archiveBackground"));
o1.f0("Line 3.**", L1("chats_archiveBackground"));
o1.f0("Cup Red.**", L1("chats_archiveIcon"));
o1.f0("Box.**", L1("chats_archiveIcon"));
o1.t();
q1 = false;
k1.r();
k1.f0("Arrow.**", L1("chats_archiveBackground"));
k1.f0("Box2.**", L1("chats_archiveIcon"));
k1.f0("Box1.**", L1("chats_archiveIcon"));
k1.t();
p1 = false;
l1.r();
l1.f0("Arrow1.**", L1("chats_archiveIcon"));
l1.f0("Arrow2.**", L1("chats_archivePinBackground"));
l1.f0("Box2.**", L1("chats_archiveIcon"));
l1.f0("Box1.**", L1("chats_archiveIcon"));
l1.t();
return;
}
i3(drawableArr[i5], "avatar_text");
i5++;
}
}
public static Drawable T0(int i5, int i6, int i7) {
Drawable drawable;
int i8 = Build.VERSION.SDK_INT;
if (i8 < 21) {
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i5));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i5));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(0));
return stateListDrawable;
}
if ((i6 != 1 && i6 != 5) || i8 < 23) {
if (i6 == 1 || i6 == 3 || i6 == 4 || i6 == 5 || i6 == 6 || i6 == 7) {
x.setColor(-1);
drawable = new m(i6);
} else if (i6 == 2) {
drawable = new ColorDrawable(-1);
}
RippleDrawable rippleDrawable = new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), null, drawable);
if (i8 >= 23) {
if (i6 == 1) {
if (i7 <= 0) {
i7 = AndroidUtilities.dp(20.0f);
}
rippleDrawable.setRadius(i7);
} else if (i6 == 5) {
rippleDrawable.setRadius(-1);
}
}
return rippleDrawable;
}
drawable = null;
RippleDrawable rippleDrawable2 = new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}), null, drawable);
if (i8 >= 23) {
}
return rippleDrawable2;
}
public static Drawable T1(boolean z5) {
return S1(r1("listSelectorSDK21"), z5);
}
public static void T2(boolean z5) {
if (!z5) {
H.Y(null);
} else {
O = false;
S2();
}
}
public static void U(boolean z5) {
if (L != null) {
return;
}
if (z5) {
if (H == I) {
return;
}
Q = true;
g = SystemClock.elapsedRealtime();
P = true;
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, I, Boolean.TRUE, null, -1);
} else {
if (H == J) {
return;
}
Q = false;
g = SystemClock.elapsedRealtime();
P = true;
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, J, Boolean.TRUE, null, -1);
}
P = false;
}
public static Drawable U0(Drawable drawable, Drawable drawable2) {
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, drawable2);
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, drawable2);
stateListDrawable.addState(StateSet.WILD_CARD, drawable);
return stateListDrawable;
}
public static int U1() {
Integer num = Q4.get("chat_serviceBackground");
return num == null ? W : num.intValue();
}
public static void U2() {
SharedPreferences.Editor edit = MessagesController.getGlobalMainSettings().edit();
edit.putInt("selectedAutoNightType", m);
edit.putBoolean("autoNightScheduleByLocation", n);
edit.putFloat("autoNightBrighnessThreshold", o);
edit.putInt("autoNightDayStartTime", p);
edit.putInt("autoNightDayEndTime", q);
edit.putInt("autoNightSunriseTime", t);
edit.putString("autoNightCityName", u);
edit.putInt("autoNightSunsetTime", r);
edit.putLong("autoNightLocationLatitude3", Double.doubleToRawLongBits(v));
edit.putLong("autoNightLocationLongitude3", Double.doubleToRawLongBits(w));
edit.putInt("autoNightLastSunCheckDay", s);
v vVar = I;
if (vVar != null) {
edit.putString("nighttheme", vVar.C());
} else {
edit.remove("nighttheme");
}
edit.commit();
}
public static void V() {
if (C0 == null) {
return;
}
for (int i5 = 0; i5 < 2; i5++) {
C0[i5].setColor(r1("chats_name"));
D0[i5].setColor(r1("chats_secretName"));
TextPaint[] textPaintArr = G0;
TextPaint textPaint = textPaintArr[i5];
TextPaint textPaint2 = textPaintArr[i5];
int r12 = r1("chats_message");
textPaint2.linkColor = r12;
textPaint.setColor(r12);
I0[i5].setColor(r1("chats_actionMessage"));
}
E0.setColor(r1("chats_name"));
F0.setColor(r1("chats_secretName"));
TextPaint textPaint3 = H0;
int r13 = r1("chats_nameMessage_threeLines");
textPaint3.linkColor = r13;
textPaint3.setColor(r13);
v0.setColor(r1("chats_tabletSelectedOverlay"));
w0.setColor(r1("chats_pinnedOverlay"));
J0.setColor(r1("chats_date"));
K0.setColor(r1("chats_unreadCounterText"));
L0.setColor(r1("chats_archiveText"));
M0.setColor(r1("chats_archiveText"));
x0.setColor(r1("chats_unreadCounter"));
B0.setColor(r1("dialogReactionMentionBackground"));
z0.setColor(r1("chats_unreadCounterMuted"));
A0.setColor(r1("chats_actionMessage"));
y0.setColor(r1("chats_sentError"));
N0.setColor(r1("windowBackgroundWhiteBlueText3"));
O0.setColor(r1("windowBackgroundWhiteGrayText3"));
i3(W0, "chats_secretIcon");
i3(P0, "chats_sentCheck");
i3(R0, "chats_sentReadCheck");
i3(S0, "chats_sentReadCheck");
i3(T0, "chats_sentClock");
i3(U0, "chats_sentErrorIcon");
i3(X0, "chats_nameIcon");
i3(Y0, "chats_nameIcon");
i3(Z0, "chats_nameIcon");
i3(f1, "chats_pinnedIcon");
i3(V0, "chats_pinnedIcon");
i3(a1, "chats_muteIcon");
i3(g1, "chats_mentionIcon");
i3(h1, "chats_mentionIcon");
i3(b1, "chats_verifiedBackground");
i3(e1, "chats_verifiedCheck");
i3(i1, "actionBarDefaultTitle");
i3(c1, "chats_draft");
i3(d1, "chats_draft");
}
public static Drawable V0(int i5, int i6) {
if (Build.VERSION.SDK_INT >= 21) {
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i6}), new ColorDrawable(i5), new ColorDrawable(i5));
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(i6));
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, new ColorDrawable(i6));
stateListDrawable.addState(StateSet.WILD_CARD, new ColorDrawable(i5));
return stateListDrawable;
}
@SuppressLint({"PrivateApi"})
public static Drawable V1(Drawable drawable, int i5) {
if (Build.VERSION.SDK_INT >= 29 && (drawable instanceof StateListDrawable)) {
return ((StateListDrawable) drawable).getStateDrawable(i5);
}
if (a5 == null) {
try {
a5 = StateListDrawable.class.getDeclaredMethod("getStateDrawable", Integer.TYPE);
} catch (Throwable unused) {
}
}
Method method = a5;
if (method == null) {
return null;
}
try {
return (Drawable) method.invoke(drawable, Integer.valueOf(i5));
} catch (Exception unused2) {
return null;
}
}
public static void V2(v vVar, boolean z5, boolean z6, boolean z7) {
FileOutputStream fileOutputStream;
q qVar = vVar.c0;
String k22 = qVar != null ? k2(qVar) : i0;
Drawable drawable = z6 ? f0 : g0;
if (z6 && drawable != null) {
g0 = f0;
}
u A5 = H.A(false);
HashMap<String, Integer> hashMap = (H.G && A5.a == l) ? M4 : Q4;
StringBuilder sb = new StringBuilder();
if (hashMap != M4) {
int i5 = A5 != null ? A5.e : 0;
int i6 = A5 != null ? A5.f : 0;
int i7 = A5 != null ? A5.g : 0;
int i8 = A5 != null ? A5.h : 0;
if (i5 != 0 && i6 != 0) {
hashMap.put("chat_outBubble", Integer.valueOf(i5));
hashMap.put("chat_outBubbleGradient", Integer.valueOf(i6));
if (i7 != 0) {
hashMap.put("chat_outBubbleGradient2", Integer.valueOf(i7));
if (i8 != 0) {
hashMap.put("chat_outBubbleGradient3", Integer.valueOf(i8));
}
}
hashMap.put("chat_outBubbleGradientAnimated", Integer.valueOf((A5 == null || !A5.i) ? 0 : 1));
}
}
for (Map.Entry<String, Integer> entry : hashMap.entrySet()) {
String key = entry.getKey();
if ((!(drawable instanceof BitmapDrawable) && k22 == null) || (!"chat_wallpaper".equals(key) && !"chat_wallpaper_gradient_to".equals(key) && !"key_chat_wallpaper_gradient_to2".equals(key) && !"key_chat_wallpaper_gradient_to3".equals(key))) {
sb.append(key);
sb.append("=");
sb.append(entry.getValue());
sb.append("\n");
}
}
FileOutputStream fileOutputStream2 = null;
try {
try {
try {
fileOutputStream = new FileOutputStream(vVar.b);
} catch (Exception e5) {
e = e5;
}
} catch (Throwable th) {
th = th;
}
} catch (Exception e6) {
FileLog.e(e6);
}
try {
if (sb.length() == 0 && !(drawable instanceof BitmapDrawable) && TextUtils.isEmpty(k22)) {
sb.append(' ');
}
fileOutputStream.write(AndroidUtilities.getStringBytes(sb.toString()));
if (!TextUtils.isEmpty(k22)) {
fileOutputStream.write(AndroidUtilities.getStringBytes("WLS=" + k22 + "\n"));
if (z6) {
try {
Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
FileOutputStream fileOutputStream3 = new FileOutputStream(new File(ApplicationLoader.getFilesDirFixed(), Utilities.MD5(k22) + ".wp"));
bitmap.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream3);
fileOutputStream3.close();
} catch (Throwable th2) {
FileLog.e(th2);
}
}
} else if (drawable instanceof BitmapDrawable) {
Bitmap bitmap2 = ((BitmapDrawable) drawable).getBitmap();
if (bitmap2 != null) {
fileOutputStream.write(new byte[]{87, 80, 83, 10});
bitmap2.compress(Bitmap.CompressFormat.JPEG, 87, fileOutputStream);
fileOutputStream.write(new byte[]{10, 87, 80, 69, 10});
}
if (z5 && !z7) {
f0 = drawable;
h0(drawable, 2);
}
}
if (!z7) {
if (G.get(vVar.C()) == null) {
D.add(vVar);
G.put(vVar.C(), vVar);
F.add(vVar);
W2(true);
r3();
}
H = vVar;
if (vVar != I) {
J = vVar;
}
if (hashMap == M4) {
P4.clear();
P2();
}
SharedPreferences.Editor edit = MessagesController.getGlobalMainSettings().edit();
edit.putString("theme", J.C());
edit.commit();
}
fileOutputStream.close();
} catch (Exception e7) {
e = e7;
fileOutputStream2 = fileOutputStream;
FileLog.e(e);
if (fileOutputStream2 != null) {
fileOutputStream2.close();
}
if (z5) {
}
} catch (Throwable th3) {
th = th3;
fileOutputStream2 = fileOutputStream;
if (fileOutputStream2 != null) {
try {
fileOutputStream2.close();
} catch (Exception e8) {
FileLog.e(e8);
}
}
throw th;
}
if (z5) {
return;
}
MessagesController.getInstance(vVar.o).saveThemeToServer(vVar, vVar.A(false));
}
public static void W() {
v vVar;
v vVar2 = L;
if (vVar2 == null) {
return;
}
N = false;
if (Q && (vVar = I) != null) {
e0(vVar, true, false, true);
} else if (!O) {
e0(vVar2, true, false, false);
}
O = false;
L = null;
o0();
}
public static Drawable W0(int i5, View view, View view2) {
return X0(i5, view, view2, R1);
}
public static float[] W1(int i5) {
ThreadLocal<float[]> threadLocal = i5 != 1 ? i5 != 2 ? i5 != 3 ? i5 != 4 ? X4 : W4 : V4 : U4 : T4;
float[] fArr = threadLocal.get();
if (fArr != null) {
return fArr;
}
float[] fArr2 = new float[3];
threadLocal.set(fArr2);
return fArr2;
}
public static void W2(boolean z5) {
X2(z5, false);
}
public static void X() {
if (E1 == null) {
return;
}
D1.setColor(r1("windowBackgroundWhiteBlackText"));
D1.linkColor = r1("windowBackgroundWhiteLinkText");
i3(E1, "profile_verifiedBackground");
i3(F1, "profile_verifiedCheck");
}
public static Drawable X0(int i5, View view, View view2, Paint paint) {
return new l(view, view2, i5, paint);
}
public static v X1(String str) {
return G.get(str);
}
private static void X2(boolean z5, boolean z6) {
ArrayList<u> arrayList;
int i5 = 0;
SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0).edit();
if (z5) {
JSONArray jSONArray = new JSONArray();
for (int i6 = 0; i6 < F.size(); i6++) {
JSONObject H5 = F.get(i6).H();
if (H5 != null) {
jSONArray.put(H5);
}
}
edit.putString("themes2", jSONArray.toString());
}
int i7 = 0;
while (i7 < 3) {
StringBuilder sb = new StringBuilder();
sb.append("2remoteThemesHash");
Object obj = BuildConfig.FLAVOR;
sb.append(i7 != 0 ? Integer.valueOf(i7) : BuildConfig.FLAVOR);
edit.putLong(sb.toString(), C[i7]);
StringBuilder sb2 = new StringBuilder();
sb2.append("lastLoadingThemesTime");
if (i7 != 0) {
obj = Integer.valueOf(i7);
}
sb2.append(obj);
edit.putInt(sb2.toString(), B[i7]);
i7++;
}
edit.putInt("lastLoadingCurrentThemeTime", z);
edit.commit();
if (z5) {
while (i5 < 5) {
v vVar = G.get(i5 != 0 ? i5 != 1 ? i5 != 2 ? i5 != 3 ? "Night" : "Day" : "Arctic Blue" : "Dark Blue" : "Blue");
if (vVar != null && (arrayList = vVar.V) != null && !arrayList.isEmpty()) {
Z2(vVar, true, false, false, false, z6);
}
i5++;
}
}
}
public static void Y(int i5, int i6, float f5, float f6) {
Z(X, Y, Z, i5, i6, f5, f6);
}
public static Drawable Y0(int i5, int i6, int i7) {
OvalShape ovalShape = new OvalShape();
float f5 = i5;
ovalShape.resize(f5, f5);
ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
shapeDrawable.getPaint().setColor(i6);
ShapeDrawable shapeDrawable2 = new ShapeDrawable(ovalShape);
if (Build.VERSION.SDK_INT >= 21) {
shapeDrawable2.getPaint().setColor(-1);
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i7}), shapeDrawable, shapeDrawable2);
}
shapeDrawable2.getPaint().setColor(i7);
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, shapeDrawable2);
stateListDrawable.addState(new int[]{android.R.attr.state_focused}, shapeDrawable2);
stateListDrawable.addState(StateSet.WILD_CARD, shapeDrawable);
return stateListDrawable;
}
public static Drawable Y1(String str) {
return G4.get(str);
}
public static void Y2(v vVar, boolean z5, boolean z6, boolean z7, boolean z8) {
Z2(vVar, z5, z6, z7, z8, false);
}
public static void Z(Bitmap bitmap, BitmapShader bitmapShader, Matrix matrix, int i5, int i6, float f5, float f6) {
if (bitmapShader == null) {
return;
}
float width = bitmap.getWidth();
float height = bitmap.getHeight();
float f7 = i5;
float f8 = i6;
float max = Math.max(f7 / width, f8 / height);
matrix.reset();
matrix.setTranslate(((f7 - (width * max)) / 2.0f) - f5, ((f8 - (height * max)) / 2.0f) - f6);
matrix.preScale(max, max);
bitmapShader.setLocalMatrix(matrix);
}
public static Drawable Z0(int i5, int i6, int i7) {
return a1(i5, i6, i7, i7);
}
public static String Z1(String str) {
return H4.get(str);
}
public static void Z2(v vVar, boolean z5, boolean z6, boolean z7, boolean z8, boolean z9) {
if (z5) {
SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", 0).edit();
if (!z7) {
int size = vVar.V.size();
int max = Math.max(0, size - vVar.Q);
st4 st4Var = new st4(((max * 16) + 2) * 4);
st4Var.writeInt32(9);
st4Var.writeInt32(max);
for (int i5 = 0; i5 < size; i5++) {
u uVar = vVar.V.get(i5);
int i6 = uVar.a;
if (i6 >= 100) {
st4Var.writeInt32(i6);
st4Var.writeInt32(uVar.c);
st4Var.writeInt32(uVar.d);
st4Var.writeInt32(uVar.e);
st4Var.writeInt32(uVar.f);
st4Var.writeInt32(uVar.g);
st4Var.writeInt32(uVar.h);
st4Var.writeBool(uVar.i);
st4Var.writeInt64(uVar.j);
st4Var.writeInt64(uVar.k);
st4Var.writeInt64(uVar.l);
st4Var.writeInt64(uVar.m);
st4Var.writeInt32(uVar.n);
st4Var.writeInt64(0L);
st4Var.writeDouble(uVar.p);
st4Var.writeBool(uVar.q);
st4Var.writeString(uVar.o);
st4Var.writeBool(uVar.r != null);
if (uVar.r != null) {
st4Var.writeInt32(uVar.t);
uVar.r.serializeToStream(st4Var);
}
}
}
edit.putString("accents_" + vVar.d, Base64.encodeToString(st4Var.d(), 3));
if (!z9) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.themeAccentListUpdated, new Object[0]);
}
if (z8) {
MessagesController.getInstance(UserConfig.selectedAccount).saveThemeToServer(vVar, vVar.A(false));
}
}
edit.putInt("accent_current_" + vVar.d, vVar.S);
edit.commit();
} else {
if (vVar.T != -1) {
if (z6) {
u uVar2 = vVar.U.get(vVar.S);
vVar.U.remove(uVar2.a);
vVar.V.remove(uVar2);
cu6 cu6Var = uVar2.r;
if (cu6Var != null) {
vVar.W.remove(cu6Var.e);
}
}
vVar.S = vVar.T;
u A5 = vVar.A(false);
vVar.c0 = A5 != null ? A5.y : null;
}
if (H == vVar) {
P2();
}
}
vVar.T = -1;
}
public static void a0(View view, View view2) {
if (view == null || view2 == null) {
return;
}
view.getLocationOnScreen(c5);
int[] iArr = c5;
int i5 = iArr[0];
int i6 = iArr[1];
view2.getLocationOnScreen(iArr);
Y(view2.getMeasuredWidth(), view2.getMeasuredHeight(), i5, i6 - c5[1]);
}
public static Drawable a1(int i5, int i6, int i7, int i8) {
float f5 = i5;
ShapeDrawable shapeDrawable = new ShapeDrawable(new RoundRectShape(new float[]{f5, f5, f5, f5, f5, f5, f5, f5}, null, null));
shapeDrawable.getPaint().setColor(i6);
ShapeDrawable shapeDrawable2 = new ShapeDrawable(new RoundRectShape(new float[]{f5, f5, f5, f5, f5, f5, f5, f5}, null, null));
shapeDrawable2.getPaint().setColor(i8);
if (Build.VERSION.SDK_INT >= 21) {
return new RippleDrawable(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i7}), shapeDrawable, shapeDrawable2);
}
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, shapeDrawable2);
stateListDrawable.addState(new int[]{android.R.attr.state_selected}, shapeDrawable2);
stateListDrawable.addState(StateSet.WILD_CARD, shapeDrawable);
return stateListDrawable;
}
public static Map<String, Drawable> a2() {
return G4;
}
public static void a3(String str, int i5) {
HashMap<String, Integer> hashMap = R4;
if (hashMap == null) {
return;
}
hashMap.put(str, Integer.valueOf(i5));
}
public static void b0(v vVar) {
e0(vVar, true, true, false);
}
public static String b1(String str, String str2, u uVar) {
int i5;
int i6;
int i7;
int i8;
int intValue;
int i9;
int i10;
int intValue2;
int i11;
int i12;
int i13;
int i14;
int i15;
int i16;
int i17;
int i18;
int i19;
Paint paint;
u uVar2;
int i20;
int i21;
String queryParameter;
?? mutate;
?? mutate2;
int i22;
int i23;
?? r24;
?? r25;
boolean z5;
int i24;
int i25;
Canvas canvas;
u uVar3;
FileInputStream fileInputStream;
File file;
int i26;
Bitmap decodeStream;
int i27;
?? r02;
u uVar4 = uVar;
try {
String[] strArr = new String[1];
HashMap<String, Integer> b22 = b2(new File(str), null, strArr);
if (uVar4 != null) {
r0(b22, uVar4.b);
}
Integer num = b22.get("wallpaperFileOffset");
Bitmap createBitmap = Bitmaps.createBitmap(560, 678, Bitmap.Config.ARGB_8888);
?? canvas2 = new Canvas(createBitmap);
Paint paint2 = new Paint();
int M12 = M1(b22, "actionBarDefault");
int M13 = M1(b22, "actionBarDefaultIcon");
int M14 = M1(b22, "chat_messagePanelBackground");
int M15 = M1(b22, "chat_messagePanelIcons");
int M16 = M1(b22, "chat_inBubble");
int M17 = M1(b22, "chat_outBubble");
b22.get("chat_outBubbleGradient");
Integer num2 = b22.get("chat_wallpaper");
Integer num3 = b22.get("chat_wallpaper_gradient_to");
Integer num4 = b22.get("key_chat_wallpaper_gradient_to2");
Integer num5 = b22.get("key_chat_wallpaper_gradient_to3");
int intValue3 = num2 != null ? num2.intValue() : 0;
if (uVar4 != null) {
i5 = M13;
i6 = (int) uVar4.j;
} else {
i5 = M13;
i6 = 0;
}
try {
if (i6 != 0 || uVar4 == null) {
i7 = intValue3;
} else {
i7 = intValue3;
if (uVar4.j != 0) {
i8 = 0;
intValue = num3 == null ? num3.intValue() : 0;
i9 = uVar4 == null ? (int) uVar4.k : 0;
if (i9 == 0 || uVar4 == null || uVar4.k == 0) {
if (i9 != 0) {
intValue = i9;
}
i10 = intValue;
} else {
i10 = 0;
}
intValue2 = num4 == null ? num4.intValue() : 0;
i11 = uVar4 == null ? (int) uVar4.l : 0;
if (i11 == 0 || uVar4 == null) {
i12 = intValue2;
i13 = i8;
} else {
i12 = intValue2;
i13 = i8;
if (uVar4.l != 0) {
i12 = 0;
int intValue4 = num5 != null ? num5.intValue() : 0;
if (uVar4 != null) {
i14 = intValue4;
i15 = (int) uVar4.m;
} else {
i14 = intValue4;
i15 = 0;
}
if (i15 == 0 || uVar4 == null) {
i16 = i13;
i17 = i14;
} else {
i16 = i13;
i17 = i14;
if (uVar4.m != 0) {
i18 = 0;
if (TextUtils.isEmpty(strArr[0])) {
try {
queryParameter = Uri.parse(strArr[0]).getQueryParameter("bg_color");
} catch (Exception e5) {
e = e5;
i19 = i18;
}
if (uVar4 != null) {
if (!TextUtils.isEmpty(queryParameter)) {
i19 = i18;
try {
i20 = Integer.parseInt(queryParameter.substring(0, 6), 16) | com.batch.android.messaging.view.roundimage.b.v;
paint = paint2;
try {
uVar4.j = i20;
if (queryParameter.length() >= 13 && AndroidUtilities.isValidWallChar(queryParameter.charAt(6))) {
i10 = Integer.parseInt(queryParameter.substring(7, 13), 16) | com.batch.android.messaging.view.roundimage.b.v;
uVar4.k = i10;
}
if (queryParameter.length() < 20 || !AndroidUtilities.isValidWallChar(queryParameter.charAt(13))) {
uVar2 = canvas2;
} else {
int parseInt = Integer.parseInt(queryParameter.substring(14, 20), 16) | com.batch.android.messaging.view.roundimage.b.v;
uVar2 = canvas2;
try {
uVar4.l = parseInt;
i12 = parseInt;
} catch (Exception e6) {
e = e6;
i12 = parseInt;
FileLog.e(e);
i21 = i10;
int i28 = i12;
int i29 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i30 = i5;
h3(mutate, i30);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i30);
Drawable mutate3 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate3, M15);
Drawable mutate4 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate4, M15);
?? r11 = new p[2];
i23 = 0;
for (i22 = 2; i23 < i22; i22 = 2) {
}
r24 = mutate4;
r25 = mutate3;
RectF rectF = new RectF();
int i31 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint3 = paint;
paint3.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint3);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r11[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11[1].u(0, 560, 522, false, false);
r11[1].draw(canvas);
r11[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11[1].u(430, 560, 522, false, false);
r11[1].draw(canvas);
r11[0].setBounds(20, 323, 399, 415);
r11[0].u(323, 560, 522, false, false);
r11[0].draw(canvas);
paint3.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint3);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file2 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file2));
SharedConfig.saveConfig();
return file2.getAbsolutePath();
}
}
try {
if (queryParameter.length() == 27 && AndroidUtilities.isValidWallChar(queryParameter.charAt(20))) {
int parseInt2 = (-16777216) | Integer.parseInt(queryParameter.substring(21), 16);
try {
uVar4.m = parseInt2;
i19 = parseInt2;
} catch (Exception e7) {
e = e7;
i19 = parseInt2;
FileLog.e(e);
i21 = i10;
int i282 = i12;
int i292 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i302 = i5;
h3(mutate, i302);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i302);
Drawable mutate32 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate32, M15);
Drawable mutate42 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate42, M15);
?? r112 = new p[2];
i23 = 0;
while (i23 < i22) {
}
r24 = mutate42;
r25 = mutate32;
RectF rectF2 = new RectF();
int i312 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint32 = paint;
paint32.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint32);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r112[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r112[1].u(0, 560, 522, false, false);
r112[1].draw(canvas);
r112[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r112[1].u(430, 560, 522, false, false);
r112[1].draw(canvas);
r112[0].setBounds(20, 323, 399, 415);
r112[0].u(323, 560, 522, false, false);
r112[0].draw(canvas);
paint32.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint32);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file22 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file22));
SharedConfig.saveConfig();
return file22.getAbsolutePath();
}
}
} catch (Exception e8) {
e = e8;
}
} catch (Exception e9) {
e = e9;
uVar2 = canvas2;
}
} catch (Exception e10) {
e = e10;
paint = paint2;
uVar2 = canvas2;
i20 = i16;
FileLog.e(e);
i21 = i10;
int i2822 = i12;
int i2922 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i3022 = i5;
h3(mutate, i3022);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i3022);
Drawable mutate322 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate322, M15);
Drawable mutate422 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate422, M15);
?? r1122 = new p[2];
i23 = 0;
while (i23 < i22) {
}
r24 = mutate422;
r25 = mutate322;
RectF rectF22 = new RectF();
int i3122 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint322 = paint;
paint322.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint322);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r1122[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r1122[1].u(0, 560, 522, false, false);
r1122[1].draw(canvas);
r1122[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r1122[1].u(430, 560, 522, false, false);
r1122[1].draw(canvas);
r1122[0].setBounds(20, 323, 399, 415);
r1122[0].u(323, 560, 522, false, false);
r1122[0].draw(canvas);
paint322.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint322);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file222));
SharedConfig.saveConfig();
return file222.getAbsolutePath();
}
i21 = i10;
}
}
i19 = i18;
paint = paint2;
uVar2 = canvas2;
i20 = i16;
i21 = i10;
} else {
i19 = i18;
paint = paint2;
uVar2 = canvas2;
i21 = i10;
i20 = i16;
}
int i28222 = i12;
int i29222 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i30222 = i5;
h3(mutate, i30222);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i30222);
Drawable mutate3222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate3222, M15);
Drawable mutate4222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate4222, M15);
?? r11222 = new p[2];
i23 = 0;
while (i23 < i22) {
Drawable drawable = mutate4222;
Drawable drawable2 = mutate3222;
r11222[i23] = new c(2, i23 == 1, false, b22);
h3(r11222[i23], i23 == 0 ? M16 : M17);
i23++;
mutate4222 = drawable;
mutate3222 = drawable2;
}
r24 = mutate4222;
r25 = mutate3222;
RectF rectF222 = new RectF();
int i31222 = 80;
if (str2 != null) {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(str2, options);
int i32 = options.outWidth;
if (i32 > 0 && (i25 = options.outHeight) > 0) {
float min = Math.min(i32 / 560.0f, i25 / 560.0f);
options.inSampleSize = 1;
}
u uVar5 = uVar2;
boolean z6 = false;
z5 = z6;
i24 = 80;
uVar3 = uVar5;
canvas = uVar3;
} catch (Throwable th) {
th = th;
uVar4 = uVar2;
}
} else {
?? r32 = uVar2;
if (i20 != 0) {
if (i21 == 0) {
r02 = new ColorDrawable(i20);
} else if (i28222 != 0) {
r02 = new sg3(i20, i21, i28222, i29222, true);
} else {
Integer num6 = b22.get("chat_wallpaper_gradient_rotation");
if (num6 == null) {
num6 = 45;
}
i31222 = 90;
r02 = org.telegram.ui.Components.o.f(num6.intValue(), new int[]{i20, num4 == null ? 0 : num4.intValue()}, createBitmap.getWidth(), createBitmap.getHeight() - 120);
}
r02.setBounds(0, 120, createBitmap.getWidth(), createBitmap.getHeight() - 120);
r02.draw(r32);
i24 = i31222;
z5 = true;
uVar3 = r32;
canvas = uVar3;
} else {
if (num == null || num.intValue() < 0) {
u uVar6 = r32;
}
try {
BitmapFactory.Options options2 = new BitmapFactory.Options();
options2.inJustDecodeBounds = true;
if (TextUtils.isEmpty(strArr[0])) {
fileInputStream = new FileInputStream(str);
try {
fileInputStream.getChannel().position(num.intValue());
BitmapFactory.decodeStream(fileInputStream, null, options2);
file = null;
} catch (Throwable th2) {
th = th2;
FileLog.e(th);
u uVar7 = r32;
if (fileInputStream != null) {
}
i24 = 80;
z5 = false;
canvas = uVar7;
if (!z5) {
}
Paint paint3222 = paint;
paint3222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint3222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r11222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11222[1].u(0, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11222[1].u(430, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[0].setBounds(20, 323, 399, 415);
r11222[0].u(323, 560, 522, false, false);
r11222[0].draw(canvas);
paint3222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint3222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file2222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file2222));
SharedConfig.saveConfig();
return file2222.getAbsolutePath();
}
} else {
try {
File file3 = new File(ApplicationLoader.getFilesDirFixed(), Utilities.MD5(strArr[0]) + ".wp");
BitmapFactory.decodeFile(file3.getAbsolutePath(), options2);
file = file3;
fileInputStream = null;
} catch (Throwable th3) {
th = th3;
fileInputStream = null;
try {
FileLog.e(th);
u uVar72 = r32;
if (fileInputStream != null) {
}
i24 = 80;
z5 = false;
canvas = uVar72;
if (!z5) {
}
Paint paint32222 = paint;
paint32222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint32222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r11222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11222[1].u(0, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11222[1].u(430, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[0].setBounds(20, 323, 399, 415);
r11222[0].u(323, 560, 522, false, false);
r11222[0].draw(canvas);
paint32222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint32222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file22222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file22222));
SharedConfig.saveConfig();
return file22222.getAbsolutePath();
} finally {
}
}
}
int i33 = options2.outWidth;
if (i33 > 0 && (i26 = options2.outHeight) > 0) {
float min2 = Math.min(i33 / 560.0f, i26 / 560.0f);
options2.inSampleSize = 1;
if (min2 <= 1.0f) {
options2.inJustDecodeBounds = false;
if (file == null) {
decodeStream = BitmapFactory.decodeFile(file.getAbsolutePath(), options2);
} else {
fileInputStream.getChannel().position(num.intValue());
decodeStream = BitmapFactory.decodeStream(fileInputStream, null, options2);
}
if (decodeStream != null) {
Paint paint4 = new Paint();
paint4.setFilterBitmap(true);
float min3 = Math.min(decodeStream.getWidth() / 560.0f, decodeStream.getHeight() / 560.0f);
rectF222.set(0.0f, 0.0f, decodeStream.getWidth() / min3, decodeStream.getHeight() / min3);
rectF222.offset((createBitmap.getWidth() - rectF222.width()) / 2.0f, (createBitmap.getHeight() - rectF222.height()) / 2.0f);
r32.drawBitmap(decodeStream, null, rectF222, paint4);
z5 = true;
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (Exception e11) {
FileLog.e(e11);
}
}
i24 = 80;
canvas = r32;
}
}
do {
i27 = options2.inSampleSize * 2;
try {
options2.inSampleSize = i27;
} catch (Throwable th4) {
th = th4;
FileLog.e(th);
u uVar722 = r32;
if (fileInputStream != null) {
try {
fileInputStream.close();
uVar722 = r32;
} catch (Exception e12) {
FileLog.e(e12);
uVar722 = r32;
}
}
i24 = 80;
z5 = false;
canvas = uVar722;
if (!z5) {
}
Paint paint322222 = paint;
paint322222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint322222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r11222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11222[1].u(0, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11222[1].u(430, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[0].setBounds(20, 323, 399, 415);
r11222[0].u(323, 560, 522, false, false);
r11222[0].draw(canvas);
paint322222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint322222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file222222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file222222));
SharedConfig.saveConfig();
return file222222.getAbsolutePath();
}
} while (i27 < min2);
options2.inJustDecodeBounds = false;
if (file == null) {
}
if (decodeStream != null) {
}
}
z5 = false;
if (fileInputStream != null) {
}
i24 = 80;
canvas = r32;
} catch (Throwable th5) {
th = th5;
fileInputStream = null;
}
}
}
if (!z5) {
?? H02 = H0(createBitmap.getWidth(), createBitmap.getHeight() - 120);
H02.setBounds(0, 120, createBitmap.getWidth(), createBitmap.getHeight() - 120);
H02.draw(canvas);
}
Paint paint3222222 = paint;
paint3222222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint3222222);
if (mutate != 0) {
int intrinsicHeight = (120 - mutate.getIntrinsicHeight()) / 2;
mutate.setBounds(13, intrinsicHeight, mutate.getIntrinsicWidth() + 13, mutate.getIntrinsicHeight() + intrinsicHeight);
mutate.draw(canvas);
}
if (mutate2 != 0) {
int width = (createBitmap.getWidth() - mutate2.getIntrinsicWidth()) - 10;
int intrinsicHeight2 = (120 - mutate2.getIntrinsicHeight()) / 2;
mutate2.setBounds(width, intrinsicHeight2, mutate2.getIntrinsicWidth() + width, mutate2.getIntrinsicHeight() + intrinsicHeight2);
mutate2.draw(canvas);
}
r11222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11222[1].u(0, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11222[1].u(430, 560, 522, false, false);
r11222[1].draw(canvas);
r11222[0].setBounds(20, 323, 399, 415);
r11222[0].u(323, 560, 522, false, false);
r11222[0].draw(canvas);
paint3222222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint3222222);
if (r25 != 0) {
int height = (createBitmap.getHeight() - 120) + ((120 - r25.getIntrinsicHeight()) / 2);
r25.setBounds(22, height, r25.getIntrinsicWidth() + 22, r25.getIntrinsicHeight() + height);
r25.draw(canvas);
}
if (r24 != 0) {
int width2 = (createBitmap.getWidth() - r24.getIntrinsicWidth()) - 22;
int height2 = (createBitmap.getHeight() - 120) + ((120 - r24.getIntrinsicHeight()) / 2);
r24.setBounds(width2, height2, r24.getIntrinsicWidth() + width2, r24.getIntrinsicHeight() + height2);
r24.draw(canvas);
}
canvas.setBitmap(null);
File file2222222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file2222222));
SharedConfig.saveConfig();
return file2222222.getAbsolutePath();
}
}
if (i15 != 0) {
i17 = i15;
}
i18 = i17;
if (TextUtils.isEmpty(strArr[0])) {
}
int i282222 = i12;
int i292222 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i302222 = i5;
h3(mutate, i302222);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i302222);
Drawable mutate32222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate32222, M15);
Drawable mutate42222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate42222, M15);
?? r112222 = new p[2];
i23 = 0;
while (i23 < i22) {
}
r24 = mutate42222;
r25 = mutate32222;
RectF rectF2222 = new RectF();
int i312222 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint32222222 = paint;
paint32222222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint32222222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r112222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r112222[1].u(0, 560, 522, false, false);
r112222[1].draw(canvas);
r112222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r112222[1].u(430, 560, 522, false, false);
r112222[1].draw(canvas);
r112222[0].setBounds(20, 323, 399, 415);
r112222[0].u(323, 560, 522, false, false);
r112222[0].draw(canvas);
paint32222222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint32222222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file22222222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file22222222));
SharedConfig.saveConfig();
return file22222222.getAbsolutePath();
}
}
if (i11 != 0) {
i12 = i11;
}
if (num5 != null) {
}
if (uVar4 != null) {
}
if (i15 == 0) {
}
i16 = i13;
i17 = i14;
if (i15 != 0) {
}
i18 = i17;
if (TextUtils.isEmpty(strArr[0])) {
}
int i2822222 = i12;
int i2922222 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i3022222 = i5;
h3(mutate, i3022222);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i3022222);
Drawable mutate322222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate322222, M15);
Drawable mutate422222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate422222, M15);
?? r1122222 = new p[2];
i23 = 0;
while (i23 < i22) {
}
r24 = mutate422222;
r25 = mutate322222;
RectF rectF22222 = new RectF();
int i3122222 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint322222222 = paint;
paint322222222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint322222222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r1122222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r1122222[1].u(0, 560, 522, false, false);
r1122222[1].draw(canvas);
r1122222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r1122222[1].u(430, 560, 522, false, false);
r1122222[1].draw(canvas);
r1122222[0].setBounds(20, 323, 399, 415);
r1122222[0].u(323, 560, 522, false, false);
r1122222[0].draw(canvas);
paint322222222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint322222222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file222222222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file222222222));
SharedConfig.saveConfig();
return file222222222.getAbsolutePath();
}
}
createBitmap.compress(Bitmap.CompressFormat.JPEG, i24, new FileOutputStream(file222222222));
SharedConfig.saveConfig();
return file222222222.getAbsolutePath();
} catch (Throwable th6) {
FileLog.e(th6);
return null;
}
i8 = i6 != 0 ? i6 : i7;
if (num3 == null) {
}
if (uVar4 == null) {
}
if (i9 == 0) {
}
if (i9 != 0) {
}
i10 = intValue;
if (num4 == null) {
}
if (uVar4 == null) {
}
if (i11 == 0) {
}
i12 = intValue2;
i13 = i8;
if (i11 != 0) {
}
if (num5 != null) {
}
if (uVar4 != null) {
}
if (i15 == 0) {
}
i16 = i13;
i17 = i14;
if (i15 != 0) {
}
i18 = i17;
if (TextUtils.isEmpty(strArr[0])) {
}
int i28222222 = i12;
int i29222222 = i19;
mutate = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_back).mutate();
int i30222222 = i5;
h3(mutate, i30222222);
mutate2 = ApplicationLoader.applicationContext.getResources().getDrawable(org.telegram.messenger.R.drawable.preview_dots).mutate();
h3(mutate2, i30222222);
Drawable mutate3222222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_smile).mutate();
h3(mutate3222222, M15);
Drawable mutate4222222 = ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.preview_mic).mutate();
h3(mutate4222222, M15);
?? r11222222 = new p[2];
i23 = 0;
while (i23 < i22) {
}
r24 = mutate4222222;
r25 = mutate3222222;
RectF rectF222222 = new RectF();
int i31222222 = 80;
if (str2 != null) {
}
if (!z5) {
}
Paint paint3222222222 = paint;
paint3222222222.setColor(M12);
canvas.drawRect(0.0f, 0.0f, createBitmap.getWidth(), 120.0f, paint3222222222);
if (mutate != 0) {
}
if (mutate2 != 0) {
}
r11222222[1].setBounds(161, 216, createBitmap.getWidth() - 20, 308);
r11222222[1].u(0, 560, 522, false, false);
r11222222[1].draw(canvas);
r11222222[1].setBounds(161, 430, createBitmap.getWidth() - 20, 522);
r11222222[1].u(430, 560, 522, false, false);
r11222222[1].draw(canvas);
r11222222[0].setBounds(20, 323, 399, 415);
r11222222[0].u(323, 560, 522, false, false);
r11222222[0].draw(canvas);
paint3222222222.setColor(M14);
canvas.drawRect(0.0f, createBitmap.getHeight() - 120, createBitmap.getWidth(), createBitmap.getHeight(), paint3222222222);
if (r25 != 0) {
}
if (r24 != 0) {
}
canvas.setBitmap(null);
File file2222222222 = new File(FileLoader.getDirectory(4), "-2147483648_" + SharedConfig.getLastLocalId() + ".jpg");
} catch (Throwable th7) {
FileLog.e(th7);
return null;
}
}
public static HashMap<String, Integer> b2(File file, String str, String[] strArr) {
Integer parseInt;
int intValue;
HashMap<String, Integer> hashMap = new HashMap<>();
FileInputStream fileInputStream = null;
try {
try {
byte[] bArr = new byte[1024];
FileInputStream fileInputStream2 = new FileInputStream(str != null ? k1(str) : file);
int i5 = -1;
int i6 = 0;
int i7 = 0;
int i8 = -1;
boolean z5 = false;
while (true) {
try {
int read = fileInputStream2.read(bArr);
if (read == i5) {
break;
}
int i9 = i7;
int i10 = 0;
int i11 = 0;
while (true) {
if (i10 >= read) {
break;
}
if (bArr[i10] == 10) {
int i12 = (i10 - i11) + 1;
String str2 = new String(bArr, i11, i12 - 1);
if (str2.startsWith("WLS=")) {
if (strArr != null && strArr.length > 0) {
strArr[i6] = str2.substring(4);
}
} else {
if (str2.startsWith("WPS")) {
i8 = i12 + i9;
z5 = true;
break;
}
int indexOf = str2.indexOf(61);
if (indexOf != i5) {
String substring = str2.substring(i6, indexOf);
String substring2 = str2.substring(indexOf + 1);
if (substring2.length() <= 0 || substring2.charAt(i6) != '#') {
parseInt = Utilities.parseInt(substring2);
} else {
try {
intValue = Color.parseColor(substring2);
} catch (Exception unused) {
parseInt = Utilities.parseInt(substring2);
}
hashMap.put(substring, Integer.valueOf(intValue));
}
intValue = parseInt.intValue();
hashMap.put(substring, Integer.valueOf(intValue));
}
}
i11 += i12;
i9 += i12;
}
i10++;
i5 = -1;
i6 = 0;
}
if (i7 == i9) {
break;
}
fileInputStream2.getChannel().position(i9);
if (z5) {
break;
}
i7 = i9;
i5 = -1;
i6 = 0;
} catch (Throwable th) {
th = th;
fileInputStream = fileInputStream2;
try {
FileLog.e(th);
if (fileInputStream != null) {
fileInputStream.close();
}
return hashMap;
} finally {
}
}
}
hashMap.put("wallpaperFileOffset", Integer.valueOf(i8));
fileInputStream2.close();
} catch (Throwable th2) {
th = th2;
}
} catch (Exception e5) {
FileLog.e(e5);
}
return hashMap;
}
public static void b3(boolean z5) {
R4 = z5 ? new HashMap<>() : null;
}
public static void c0(v vVar, boolean z5) {
d0(vVar, true, z5);
}
public static boolean c1(v vVar) {
boolean z5 = false;
if (vVar.b == null) {
return false;
}
if (H == vVar) {
e0(K, true, false, false);
z5 = true;
}
if (vVar == I) {
I = G.get("Dark Blue");
}
vVar.V();
F.remove(vVar);
G.remove(vVar.a);
q qVar = vVar.c0;
if (qVar != null) {
qVar.c();
}
D.remove(vVar);
new File(vVar.b).delete();
W2(true);
return z5;
}
public static float c2(float f5) {
return (f5 >= 0.0f || i1().J()) ? f5 : -f5;
}
public static void c3(boolean z5) {
M = z5;
if (z5) {
return;
}
p0(false);
}
public static void d0(v vVar, boolean z5, boolean z6) {
e0(vVar, z5, true, z6);
}
public static boolean d1(v vVar, u uVar, boolean z5) {
boolean z6 = false;
if (uVar == null || vVar == null || vVar.V == null) {
return false;
}
boolean z7 = uVar.a == vVar.S;
File b6 = uVar.b();
if (b6 != null) {
b6.delete();
}
vVar.U.remove(uVar.a);
vVar.V.remove(uVar);
cu6 cu6Var = uVar.r;
if (cu6Var != null) {
vVar.W.remove(cu6Var.e);
}
q qVar = uVar.y;
if (qVar != null) {
qVar.c();
}
if (z7) {
vVar.X(vVar.V.get(0).a);
}
if (z5) {
Y2(vVar, true, false, false, false);
if (uVar.r != null) {
MessagesController messagesController = MessagesController.getInstance(uVar.t);
if (z7 && vVar == I) {
z6 = true;
}
messagesController.saveTheme(vVar, uVar, z6, true);
}
}
return z7;
}
public static Paint d2(String str) {
return I4.get(str);
}
public static void d3(String str, int i5, boolean z5) {
if (str.equals("chat_wallpaper") || str.equals("chat_wallpaper_gradient_to") || str.equals("key_chat_wallpaper_gradient_to2") || str.equals("key_chat_wallpaper_gradient_to3") || str.equals("windowBackgroundWhite") || str.equals("windowBackgroundGray") || str.equals("actionBarDefault") || str.equals("actionBarDefaultArchived")) {
i5 |= com.batch.android.messaging.view.roundimage.b.v;
}
if (z5) {
Q4.remove(str);
} else {
Q4.put(str, Integer.valueOf(i5));
}
char c6 = 65535;
switch (str.hashCode()) {
case -2095843767:
if (str.equals("chat_wallpaper_gradient_rotation")) {
c6 = 0;
break;
}
break;
case -1625862693:
if (str.equals("chat_wallpaper")) {
c6 = 1;
break;
}
break;
case -1397026623:
if (str.equals("windowBackgroundGray")) {
c6 = 2;
break;
}
break;
case -633951866:
if (str.equals("chat_wallpaper_gradient_to")) {
c6 = 3;
break;
}
break;
case -552118908:
if (str.equals("actionBarDefault")) {
c6 = 4;
break;
}
break;
case 426061980:
if (str.equals("chat_serviceBackground")) {
c6 = 5;
break;
}
break;
case 1381936524:
if (str.equals("key_chat_wallpaper_gradient_to2")) {
c6 = 6;
break;
}
break;
case 1381936525:
if (str.equals("key_chat_wallpaper_gradient_to3")) {
c6 = 7;
break;
}
break;
case 1573464919:
if (str.equals("chat_serviceBackgroundSelected")) {
c6 = '\b';
break;
}
break;
}
switch (c6) {
case 0:
case 1:
case 3:
case 6:
case 7:
S2();
return;
case 2:
if (Build.VERSION.SDK_INT >= 26) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needCheckSystemBarColors, new Object[0]);
return;
}
return;
case 4:
if (Build.VERSION.SDK_INT >= 23) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needCheckSystemBarColors, new Object[0]);
return;
}
return;
case 5:
case '\b':
P();
return;
default:
return;
}
}
private static void e0(v vVar, boolean z5, boolean z6, boolean z7) {
String[] split;
if (vVar == null) {
return;
}
ThemeEditorView u5 = ThemeEditorView.u();
if (u5 != null) {
u5.t();
}
try {
} catch (Exception e5) {
FileLog.e(e5);
}
if (vVar.b == null && vVar.d == null) {
if (!z7 && z5) {
SharedPreferences.Editor edit = MessagesController.getGlobalMainSettings().edit();
edit.remove("theme");
edit.commit();
}
P4.clear();
h0 = 0;
i0 = null;
f0 = null;
g0 = null;
if (!z7 && L == null) {
J = vVar;
if (s2()) {
S = 2000;
T = SystemClock.elapsedRealtime();
AndroidUtilities.runOnUIThread(kz2.a, 2100L);
}
}
H = vVar;
P2();
if (L == null || !z5 || P) {
return;
}
MessagesController.getInstance(vVar.o).saveTheme(vVar, vVar.A(false), z7, false);
return;
}
String[] strArr = new String[1];
String str = vVar.d;
P4 = str != null ? b2(null, str, null) : b2(new File(vVar.b), null, strArr);
Integer num = P4.get("wallpaperFileOffset");
h0 = num != null ? num.intValue() : -1;
if (TextUtils.isEmpty(strArr[0])) {
try {
if (vVar.c != null) {
new File(vVar.c).delete();
}
} catch (Exception unused) {
}
vVar.c = null;
i0 = null;
} else {
i0 = strArr[0];
String absolutePath = new File(ApplicationLoader.getFilesDirFixed(), Utilities.MD5(i0) + ".wp").getAbsolutePath();
try {
String str2 = vVar.c;
if (str2 != null && !str2.equals(absolutePath)) {
new File(vVar.c).delete();
}
} catch (Exception unused2) {
}
vVar.c = absolutePath;
try {
Uri parse = Uri.parse(i0);
vVar.e = parse.getQueryParameter("slug");
String queryParameter = parse.getQueryParameter("mode");
if (queryParameter != null && (split = queryParameter.toLowerCase().split(" ")) != null && split.length > 0) {
for (int i5 = 0; i5 < split.length; i5++) {
if ("blur".equals(split[i5])) {
vVar.g = true;
} else if ("motion".equals(split[i5])) {
vVar.h = true;
}
}
}
Utilities.parseInt(parse.getQueryParameter("intensity")).intValue();
vVar.m = 45;
try {
String queryParameter2 = parse.getQueryParameter("bg_color");
if (!TextUtils.isEmpty(queryParameter2)) {
vVar.i = Integer.parseInt(queryParameter2.substring(0, 6), 16) | com.batch.android.messaging.view.roundimage.b.v;
if (queryParameter2.length() >= 13 && AndroidUtilities.isValidWallChar(queryParameter2.charAt(6))) {
vVar.j = Integer.parseInt(queryParameter2.substring(7, 13), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
if (queryParameter2.length() >= 20 && AndroidUtilities.isValidWallChar(queryParameter2.charAt(13))) {
vVar.k = Integer.parseInt(queryParameter2.substring(14, 20), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
if (queryParameter2.length() == 27 && AndroidUtilities.isValidWallChar(queryParameter2.charAt(20))) {
vVar.l = Integer.parseInt(queryParameter2.substring(21), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
}
} catch (Exception unused3) {
}
try {
String queryParameter3 = parse.getQueryParameter("rotation");
if (!TextUtils.isEmpty(queryParameter3)) {
vVar.m = Utilities.parseInt(queryParameter3).intValue();
}
} catch (Exception unused4) {
}
} catch (Throwable th) {
FileLog.e(th);
}
}
if (!z7) {
J = vVar;
if (s2()) {
}
}
H = vVar;
P2();
if (L == null) {
}
}
public static void e1() {
}
public static String e2(String str) {
return J4.get(str);
}
public static void e3(Drawable drawable, int i5, boolean z5) {
if (drawable instanceof jj0) {
jj0 jj0Var = (jj0) drawable;
Drawable b6 = z5 ? jj0Var.b() : jj0Var.a();
if (b6 instanceof ColorDrawable) {
((ColorDrawable) b6).setColor(i5);
} else {
b6.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
}
}
}
public static v f0(File file, String str, cu6 cu6Var, boolean z5) {
File file2;
String str2;
try {
if (!str.toLowerCase().endsWith(".attheme")) {
str = str + ".attheme";
}
if (z5) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.goingToPreviewTheme, new Object[0]);
v vVar = new v();
vVar.a = str;
vVar.p = cu6Var;
vVar.b = file.getAbsolutePath();
vVar.o = UserConfig.selectedAccount;
g0(vVar, false);
return vVar;
}
if (cu6Var != null) {
str2 = "remote" + cu6Var.e;
file2 = new File(ApplicationLoader.getFilesDirFixed(), str2 + ".attheme");
} else {
file2 = new File(ApplicationLoader.getFilesDirFixed(), str);
str2 = str;
}
if (!AndroidUtilities.copyFile(file, file2)) {
W();
return null;
}
L = null;
N = false;
O = false;
v vVar2 = G.get(str2);
if (vVar2 == null) {
vVar2 = new v();
vVar2.a = str;
vVar2.o = UserConfig.selectedAccount;
D.add(vVar2);
F.add(vVar2);
r3();
} else {
G.remove(str2);
}
vVar2.p = cu6Var;
vVar2.b = file2.getAbsolutePath();
G.put(vVar2.C(), vVar2);
W2(true);
e0(vVar2, true, true, false);
return vVar2;
} catch (Exception e5) {
FileLog.e(e5);
return null;
}
}
public static v f1(File file, String str, cu6 cu6Var) {
String[] split;
try {
v vVar = new v();
vVar.a = str;
vVar.p = cu6Var;
vVar.b = file.getAbsolutePath();
vVar.o = UserConfig.selectedAccount;
String[] strArr = new String[1];
r0(b2(new File(vVar.b), null, strArr), vVar);
if (TextUtils.isEmpty(strArr[0])) {
i0 = null;
} else {
String str2 = strArr[0];
vVar.c = new File(ApplicationLoader.getFilesDirFixed(), Utilities.MD5(str2) + ".wp").getAbsolutePath();
try {
Uri parse = Uri.parse(str2);
vVar.e = parse.getQueryParameter("slug");
String queryParameter = parse.getQueryParameter("mode");
if (queryParameter != null && (split = queryParameter.toLowerCase().split(" ")) != null && split.length > 0) {
for (int i5 = 0; i5 < split.length; i5++) {
if ("blur".equals(split[i5])) {
vVar.g = true;
} else if ("motion".equals(split[i5])) {
vVar.h = true;
}
}
}
String queryParameter2 = parse.getQueryParameter("intensity");
if (!TextUtils.isEmpty(queryParameter2)) {
try {
String queryParameter3 = parse.getQueryParameter("bg_color");
if (!TextUtils.isEmpty(queryParameter3)) {
vVar.i = Integer.parseInt(queryParameter3.substring(0, 6), 16) | com.batch.android.messaging.view.roundimage.b.v;
if (queryParameter3.length() >= 13 && AndroidUtilities.isValidWallChar(queryParameter3.charAt(6))) {
vVar.j = Integer.parseInt(queryParameter3.substring(7, 13), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
if (queryParameter3.length() >= 20 && AndroidUtilities.isValidWallChar(queryParameter3.charAt(13))) {
vVar.k = Integer.parseInt(queryParameter3.substring(14, 20), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
if (queryParameter3.length() == 27 && AndroidUtilities.isValidWallChar(queryParameter3.charAt(20))) {
vVar.l = Integer.parseInt(queryParameter3.substring(21), 16) | com.batch.android.messaging.view.roundimage.b.v;
}
}
} catch (Exception unused) {
}
try {
String queryParameter4 = parse.getQueryParameter("rotation");
if (!TextUtils.isEmpty(queryParameter4)) {
vVar.m = Utilities.parseInt(queryParameter4).intValue();
}
} catch (Exception unused2) {
}
if (!TextUtils.isEmpty(queryParameter2)) {
vVar.n = Utilities.parseInt(queryParameter2).intValue();
}
if (vVar.n == 0) {
vVar.n = 50;
}
}
} catch (Throwable th) {
FileLog.e(th);
}
}
return vVar;
} catch (Exception e5) {
FileLog.e(e5);
return null;
}
}
public static Map<String, Paint> f2() {
return I4;
}
public static void f3(v vVar) {
boolean z5 = H == I;
I = vVar;
if (z5) {
U(true);
}
}
public static void g0(v vVar, boolean z5) {
L = D1();
N = true;
O = z5;
e0(vVar, false, false, false);
}
private static void g1(ArrayList<cu6> arrayList, int i5) {
SharedPreferences.Editor edit = ApplicationLoader.applicationContext.getSharedPreferences("emojithemes_config", 0).edit();
edit.putInt("count", arrayList.size());
for (int i6 = 0; i6 < arrayList.size(); i6++) {
cu6 cu6Var = arrayList.get(i6);
st4 st4Var = new st4(cu6Var.getObjectSize());
cu6Var.serializeToStream(st4Var);
edit.putString("theme_" + i6, Utilities.bytesToHex(st4Var.d()));
}
edit.apply();
if (arrayList.isEmpty()) {
E.clear();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.emojiPreviewThemesChanged, new Object[0]);
return;
}
ArrayList arrayList2 = new ArrayList();
arrayList2.add(new p1.i(org.telegram.ui.ActionBar.p.g()));
for (int i7 = 0; i7 < arrayList.size(); i7++) {
org.telegram.ui.ActionBar.p j5 = org.telegram.ui.ActionBar.p.j(arrayList.get(i7));
p1.i iVar = new p1.i(j5);
if (j5.c.size() >= 4) {
arrayList2.add(iVar);
}
}
ChatThemeController.chatThemeQueue.postRunnable(new b(arrayList2, i5));
}
public static Drawable g2(Context context, int i5, int i6) {
if (context == null) {
return null;
}
Drawable mutate = context.getResources().getDrawable(i5).mutate();
mutate.setColorFilter(new PorterDuffColorFilter(i6, PorterDuff.Mode.MULTIPLY));
return mutate;
}
public static void g3(String str, int i5) {
M4.put(str, Integer.valueOf(i5));
}
private static void h0(Drawable drawable, int i5) {
if (i5 != 2) {
int[] calcDrawableColor = AndroidUtilities.calcDrawableColor(drawable);
int i6 = calcDrawableColor[0];
b0 = i6;
W = i6;
int i7 = calcDrawableColor[1];
c0 = i7;
a0 = i7;
d0 = calcDrawableColor[2];
e0 = calcDrawableColor[3];
}
}
public static int h1(float[] fArr, int i5, int i6) {
float[] W12 = W1(3);
float[] W13 = W1(4);
Color.colorToHSV(i5, W12);
Color.colorToHSV(i6, W13);
float min = Math.min((W12[1] * 1.5f) / fArr[1], 1.0f);
W12[0] = (W13[0] - W12[0]) + fArr[0];
W12[1] = (W13[1] * fArr[1]) / W12[1];
W12[2] = ((((W13[2] / W12[2]) + min) - 1.0f) * fArr[2]) / min;
return W12[2] < 0.3f ? i6 : Color.HSVToColor(255, W12);
}
public static Drawable h2(Context context, int i5, String str) {
return g2(context, i5, r1(str));
}
public static void h3(Drawable drawable, int i5) {
if (drawable == null) {
return;
}
if (drawable instanceof v35) {
((v35) drawable).a(i5);
return;
}
if (drawable instanceof dh3) {
((dh3) drawable).a(i5);
return;
}
if (drawable instanceof ShapeDrawable) {
((ShapeDrawable) drawable).getPaint().setColor(i5);
} else if (drawable instanceof xl4) {
((xl4) drawable).b(i5);
} else {
drawable.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
}
}
public static boolean i0() {
return v1;
}
public static v i1() {
return H;
}
public static Drawable i2(boolean z5, View view) {
sg3 sg3Var;
File file;
int i5;
FileInputStream fileInputStream;
Bitmap decodeStream;
sg3 sg3Var2;
Integer num = Q4.get("chat_wallpaper");
int i6 = 1;
if (num != null) {
Integer num2 = Q4.get("chat_wallpaper_gradient_to");
Integer num3 = Q4.get("key_chat_wallpaper_gradient_to2");
Integer num4 = Q4.get("key_chat_wallpaper_gradient_to3");
Integer num5 = Q4.get("chat_wallpaper_gradient_rotation");
if (num5 == null) {
num5 = 45;
}
if (num2 == null) {
return new ColorDrawable(num.intValue());
}
u A5 = H.A(false);
if (A5 == null || TextUtils.isEmpty(A5.o) || L != null || (file = A5.b()) == null || !file.exists()) {
file = null;
}
if (num3 != null) {
sg3Var2 = new sg3(num.intValue(), num2.intValue(), num3.intValue(), num4 != null ? num4.intValue() : 0, true);
if (file == null) {
return sg3Var2;
}
} else {
if (file == null) {
org.telegram.ui.Components.o oVar = new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(num5.intValue()), new int[]{num.intValue(), num2.intValue()});
oVar.t(!z5 ? o.f.c() : o.f.e(0.125f, o.f.a.PORTRAIT), view != null ? new f(z5, view) : null);
return oVar;
}
sg3Var2 = null;
}
sg3Var = sg3Var2;
} else {
if (h0 > 0) {
v vVar = H;
if (vVar.b != null || vVar.d != null) {
String str = vVar.d;
file = str != null ? k1(str) : new File(H.b);
i5 = h0;
sg3Var = null;
if (file != null) {
try {
fileInputStream = new FileInputStream(file);
try {
fileInputStream.getChannel().position(i5);
BitmapFactory.Options options = new BitmapFactory.Options();
if (z5) {
options.inJustDecodeBounds = true;
float f5 = options.outWidth;
float f6 = options.outHeight;
int dp = AndroidUtilities.dp(100.0f);
while (true) {
float f7 = dp;
if (f5 <= f7 && f6 <= f7) {
break;
}
i6 *= 2;
f5 /= 2.0f;
f6 /= 2.0f;
}
}
options.inJustDecodeBounds = false;
options.inSampleSize = i6;
decodeStream = BitmapFactory.decodeStream(fileInputStream, null, options);
} catch (Throwable th) {
th = th;
try {
FileLog.e(th);
if (fileInputStream != null) {
fileInputStream.close();
}
return null;
} finally {
}
}
} catch (Throwable th2) {
th = th2;
fileInputStream = null;
}
if (sg3Var != null) {
u A6 = H.A(false);
sg3Var.B(A6 != null ? (int) (A6.p * 100.0f) : 100, decodeStream);
sg3Var.C(sg3Var.j());
try {
fileInputStream.close();
} catch (Exception e5) {
FileLog.e(e5);
}
return sg3Var;
}
if (decodeStream != null) {
BitmapDrawable bitmapDrawable = new BitmapDrawable(decodeStream);
try {
fileInputStream.close();
} catch (Exception e6) {
FileLog.e(e6);
}
return bitmapDrawable;
}
fileInputStream.close();
}
return null;
}
}
sg3Var = null;
file = null;
}
i5 = 0;
if (file != null) {
}
return null;
}
public static void i3(Drawable drawable, String str) {
if (str == null) {
return;
}
h3(drawable, r1(str));
}
public static void j0() {
if (m != 2) {
if (i) {
i = false;
AndroidUtilities.cancelRunOnUIThread(k);
}
if (h) {
h = false;
AndroidUtilities.cancelRunOnUIThread(j);
}
if (e) {
f = 1.0f;
c.unregisterListener(b5, d);
e = false;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("light sensor unregistered");
}
}
}
}
public static nd j1(MessageObject messageObject) {
HashMap<MessageObject, nd> hashMap = D4;
if (hashMap == null || messageObject == null) {
return null;
}
return hashMap.get(messageObject);
}
public static int j2(int i5) {
if (i5 == 0) {
return 0;
}
return i5 | com.batch.android.messaging.view.roundimage.b.v;
}
public static void j3(Drawable drawable, int i5, boolean z5) {
if (drawable instanceof StateListDrawable) {
try {
Drawable V12 = z5 ? V1(drawable, 0) : V1(drawable, 1);
if (V12 instanceof ShapeDrawable) {
((ShapeDrawable) V12).getPaint().setColor(i5);
} else {
V12.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
}
} catch (Throwable unused) {
}
}
}
private static int k0(int i5, float f5) {
int red = (int) (Color.red(i5) * f5);
int green = (int) (Color.green(i5) * f5);
int blue = (int) (Color.blue(i5) * f5);
return Color.argb(Color.alpha(i5), red < 0 ? 0 : Math.min(red, 255), green < 0 ? 0 : Math.min(green, 255), blue >= 0 ? Math.min(blue, 255) : 0);
}
public static File k1(String str) {
long j5;
File file = new File(ApplicationLoader.getFilesDirFixed(), str);
try {
InputStream open = ApplicationLoader.applicationContext.getAssets().open(str);
j5 = open.available();
open.close();
} catch (Exception e5) {
FileLog.e(e5);
j5 = 0;
}
if (!file.exists() || (j5 != 0 && file.length() != j5)) {
try {
InputStream open2 = ApplicationLoader.applicationContext.getAssets().open(str);
try {
AndroidUtilities.copyFile(open2, file);
if (open2 != null) {
open2.close();
}
} catch (Throwable th) {
if (open2 != null) {
try {
open2.close();
} catch (Throwable unused) {
}
}
throw th;
}
} catch (Exception e6) {
FileLog.e(e6);
}
}
return file;
}
private static String k2(q qVar) {
StringBuilder sb;
if (qVar == null || TextUtils.isEmpty(qVar.c) || qVar.c.equals("d")) {
return null;
}
StringBuilder sb2 = new StringBuilder();
if (qVar.i) {
sb2.append("blur");
}
if (qVar.j) {
if (sb2.length() > 0) {
sb2.append("+");
}
sb2.append("motion");
}
int i5 = qVar.d;
if (i5 == 0) {
sb = new StringBuilder();
sb.append("https://attheme.org?slug=");
sb.append(qVar.c);
} else {
String lowerCase = String.format("%02x%02x%02x", Integer.valueOf(((byte) (i5 >> 16)) & 255), Integer.valueOf(((byte) (qVar.d >> 8)) & 255), Byte.valueOf((byte) (qVar.d & 255))).toLowerCase();
int i6 = qVar.e;
String lowerCase2 = i6 != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (i6 >> 16)) & 255), Integer.valueOf(((byte) (qVar.e >> 8)) & 255), Byte.valueOf((byte) (qVar.e & 255))).toLowerCase() : null;
int i7 = qVar.f;
String lowerCase3 = i7 != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (i7 >> 16)) & 255), Integer.valueOf(((byte) (qVar.f >> 8)) & 255), Byte.valueOf((byte) (qVar.f & 255))).toLowerCase() : null;
int i8 = qVar.g;
String lowerCase4 = i8 != 0 ? String.format("%02x%02x%02x", Integer.valueOf(((byte) (i8 >> 16)) & 255), Integer.valueOf(((byte) (qVar.g >> 8)) & 255), Byte.valueOf((byte) (qVar.g & 255))).toLowerCase() : null;
if (lowerCase2 == null || lowerCase3 == null) {
if (lowerCase2 != null) {
lowerCase = (lowerCase + "-" + lowerCase2) + "&rotation=" + qVar.h;
}
} else if (lowerCase4 != null) {
lowerCase = lowerCase + "~" + lowerCase2 + "~" + lowerCase3 + "~" + lowerCase4;
} else {
lowerCase = lowerCase + "~" + lowerCase2 + "~" + lowerCase3;
}
sb = new StringBuilder();
sb.append("https://attheme.org?slug=");
sb.append(qVar.c);
sb.append("&intensity=");
sb.append((int) (qVar.k * 100.0f));
sb.append("&bg_color=");
sb.append(lowerCase);
}
String sb3 = sb.toString();
if (sb2.length() <= 0) {
return sb3;
}
return sb3 + "&mode=" + sb2.toString();
}
public static void k3(Drawable drawable, int i5, int i6) {
if (Build.VERSION.SDK_INT >= 21 && (drawable instanceof RippleDrawable)) {
RippleDrawable rippleDrawable = (RippleDrawable) drawable;
int numberOfLayers = rippleDrawable.getNumberOfLayers();
for (int i7 = 0; i7 < numberOfLayers; i7++) {
if (rippleDrawable.getDrawable(i7) instanceof t) {
rippleDrawable.setDrawableByLayerId(android.R.id.mask, new t(i5, i6));
return;
}
}
}
}
public static int l0(int i5) {
u A5 = H.A(false);
return m0(H, A5 != null ? A5.c : 0, i5);
}
private static long l1() {
return Math.abs(g - SystemClock.elapsedRealtime()) >= 12000 ? 1800L : 12000L;
}
public static boolean l2() {
return O && H.c0 != null;
}
@SuppressLint({"DiscouragedPrivateApi"})
@TargetApi(21)
public static void l3(RippleDrawable rippleDrawable) {
if (rippleDrawable == null) {
return;
}
try {
RippleDrawable.class.getDeclaredMethod("setForceSoftware", Boolean.TYPE).invoke(rippleDrawable, Boolean.TRUE);
} catch (Throwable unused) {
}
}
public static int m0(v vVar, int i5, int i6) {
int i7;
if (i5 == 0 || (i7 = vVar.R) == 0 || i5 == i7 || (vVar.G && vVar.S == l)) {
return i6;
}
float[] W12 = W1(3);
float[] W13 = W1(4);
Color.colorToHSV(vVar.R, W12);
Color.colorToHSV(i5, W13);
return n0(W12, W13, i6, vVar.J());
}
public static k95 m1(String str) {
if ("Blue".equals(str)) {
return new yh5();
}
if ("Day".equals(str)) {
return new zh5();
}
if ("Dark Blue".equals(str)) {
return new bi5();
}
if ("Arctic Blue".equals(str)) {
return new xh5();
}
if ("Night".equals(str)) {
return new ai5();
}
return null;
}
public static boolean m2() {
return Y != null;
}
public static void m3(Drawable drawable, int i5, boolean z5) {
Drawable V12;
if (drawable instanceof StateListDrawable) {
try {
if (z5) {
Drawable V13 = V1(drawable, 0);
if (V13 instanceof ShapeDrawable) {
((ShapeDrawable) V13).getPaint().setColor(i5);
} else {
V13.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
}
V12 = V1(drawable, 1);
} else {
V12 = V1(drawable, 2);
}
if (V12 instanceof ShapeDrawable) {
((ShapeDrawable) V12).getPaint().setColor(i5);
return;
} else {
V12.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
return;
}
} catch (Throwable unused) {
return;
}
}
if (Build.VERSION.SDK_INT < 21 || !(drawable instanceof RippleDrawable)) {
return;
}
RippleDrawable rippleDrawable = (RippleDrawable) drawable;
if (z5) {
rippleDrawable.setColor(new ColorStateList(new int[][]{StateSet.WILD_CARD}, new int[]{i5}));
return;
}
if (rippleDrawable.getNumberOfLayers() > 0) {
Drawable drawable2 = rippleDrawable.getDrawable(0);
if (drawable2 instanceof ShapeDrawable) {
((ShapeDrawable) drawable2).getPaint().setColor(i5);
} else {
drawable2.setColorFilter(new PorterDuffColorFilter(i5, PorterDuff.Mode.MULTIPLY));
}
}
}
public static int n0(float[] fArr, float[] fArr2, int i5, boolean z5) {
float[] W12 = W1(5);
Color.colorToHSV(i5, W12);
boolean z6 = false;
if (Math.min(Math.abs(W12[0] - fArr[0]), Math.abs((W12[0] - fArr[0]) - 360.0f)) > 30.0f) {
return i5;
}
float min = Math.min((W12[1] * 1.5f) / fArr[1], 1.0f);
W12[0] = (W12[0] + fArr2[0]) - fArr[0];
W12[1] = (W12[1] * fArr2[1]) / fArr[1];
W12[2] = W12[2] * ((1.0f - min) + ((min * fArr2[2]) / fArr[2]));
int HSVToColor = Color.HSVToColor(Color.alpha(i5), W12);
float computePerceivedBrightness = AndroidUtilities.computePerceivedBrightness(i5);
float computePerceivedBrightness2 = AndroidUtilities.computePerceivedBrightness(HSVToColor);
if (!z5 ? computePerceivedBrightness < computePerceivedBrightness2 : computePerceivedBrightness > computePerceivedBrightness2) {
z6 = true;
}
return z6 ? k0(HSVToColor, ((0.39999998f * computePerceivedBrightness) / computePerceivedBrightness2) + 0.6f) : HSVToColor;
}
public static String n1(a27 a27Var) {
k95 k95Var = a27Var.c;
if (k95Var instanceof yh5) {
return "Blue";
}
if (k95Var instanceof zh5) {
return "Day";
}
if (k95Var instanceof bi5) {
return "Dark Blue";
}
if (k95Var instanceof xh5) {
return "Arctic Blue";
}
if (k95Var instanceof ai5) {
return "Night";
}
return null;
}
public static boolean n2(String str) {
return Q4.containsKey(str);
}
public static void n3(cu6 cu6Var) {
ga5 ga5Var;
int size = D.size();
for (int i5 = 0; i5 < size; i5++) {
cu6 cu6Var2 = D.get(i5).p;
if (cu6Var2 != null && cu6Var2.e == cu6Var.e) {
ga5 ga5Var2 = cu6Var2.i;
if (ga5Var2 == null || (ga5Var = cu6Var.i) == null) {
return;
}
ga5Var2.file_reference = ga5Var.file_reference;
W2(true);
return;
}
}
}
public static void o0() {
p0(false);
}
public static Drawable o1() {
Drawable drawable = g0;
if (drawable == null) {
drawable = f0;
}
if (drawable != null || b == null) {
return drawable;
}
CountDownLatch countDownLatch = new CountDownLatch(1);
Utilities.themeQueue.postRunnable(new m85(countDownLatch));
try {
countDownLatch.await();
} catch (Exception e5) {
FileLog.e(e5);
}
Drawable drawable2 = g0;
return drawable2 != null ? drawable2 : f0;
}
public static boolean o2() {
v vVar = H;
if (vVar.G && vVar.S == l) {
return false;
}
return Q4.containsKey("chat_wallpaper") || h0 > 0 || !TextUtils.isEmpty(i0);
}
public static void o3(v vVar, u uVar, cu6 cu6Var, int i5, boolean z5) {
String str;
n27 n27Var;
if (cu6Var == null) {
return;
}
a27 a27Var = cu6Var.j.size() > 0 ? cu6Var.j.get(0) : null;
if (a27Var != null) {
if (vVar == null) {
String n12 = n1(a27Var);
if (n12 == null || (vVar = G.get(n12)) == null) {
return;
} else {
uVar = vVar.W.get(cu6Var.e);
}
}
if (uVar == null) {
return;
}
cu6 cu6Var2 = uVar.r;
if (cu6Var2 != null) {
vVar.W.remove(cu6Var2.e);
}
uVar.r = cu6Var;
uVar.t = i5;
vVar.W.put(cu6Var.e, uVar);
if (!v.e(uVar, a27Var)) {
File b6 = uVar.b();
if (b6 != null) {
b6.delete();
}
v.y(uVar, a27Var);
v vVar2 = H;
if (vVar2 == vVar && vVar2.S == uVar.a) {
P2();
NotificationCenter globalInstance = NotificationCenter.getGlobalInstance();
int i6 = NotificationCenter.needSetDayNightTheme;
Object[] objArr = new Object[4];
v vVar3 = H;
objArr[0] = vVar3;
objArr[1] = Boolean.valueOf(I == vVar3);
objArr[2] = null;
objArr[3] = -1;
globalInstance.postNotificationName(i6, objArr);
}
r.g(true);
}
m27 m27Var = a27Var.g;
uVar.q = (m27Var == null || (n27Var = m27Var.j) == null || !n27Var.c) ? false : true;
vVar.H = false;
} else {
if (vVar != null) {
HashMap<String, v> hashMap = G;
str = vVar.C();
hashMap.remove(str);
} else {
HashMap<String, v> hashMap2 = G;
str = "remote" + cu6Var.e;
vVar = hashMap2.get(str);
}
if (vVar == null) {
return;
}
vVar.p = cu6Var;
vVar.a = cu6Var.h;
File file = new File(vVar.b);
File file2 = new File(ApplicationLoader.getFilesDirFixed(), str + ".attheme");
if (!file.equals(file2)) {
try {
AndroidUtilities.copyFile(file, file2);
vVar.b = file2.getAbsolutePath();
} catch (Exception e5) {
FileLog.e(e5);
}
}
if (z5) {
vVar.S();
} else {
vVar.H = false;
}
G.put(vVar.C(), vVar);
}
W2(true);
}
public static void p0(boolean z5) {
if (L != null || M) {
return;
}
if (!z5 && S > 0) {
long elapsedRealtime = SystemClock.elapsedRealtime();
long j5 = elapsedRealtime - T;
T = elapsedRealtime;
int i5 = (int) (S - j5);
S = i5;
if (i5 > 0) {
return;
}
}
if (z5) {
if (i) {
i = false;
AndroidUtilities.cancelRunOnUIThread(k);
}
if (h) {
h = false;
AndroidUtilities.cancelRunOnUIThread(j);
}
}
j0();
int N22 = N2();
if (N22 != 0) {
U(N22 == 2);
}
if (z5) {
g = 0L;
}
}
public static Drawable p1() {
Drawable drawable = g0;
return drawable != null ? drawable : f0;
}
public static boolean p2() {
return R4 != null;
}
public static void p3(v vVar, Bitmap bitmap, File file) {
Q4.remove("chat_wallpaper");
Q4.remove("chat_wallpaper_gradient_to");
Q4.remove("key_chat_wallpaper_gradient_to2");
Q4.remove("key_chat_wallpaper_gradient_to3");
Q4.remove("chat_wallpaper_gradient_rotation");
i0 = null;
vVar.Y(null);
if (bitmap == null) {
g0 = null;
f0 = null;
V2(vVar, false, false, false);
S2();
return;
}
g0 = new BitmapDrawable(bitmap);
V2(vVar, false, false, false);
h0(g0, 0);
P();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetNewWallpapper, new Object[0]);
}
public static void q0(boolean z5) {
int i5;
if (y == 0) {
if (z5 || Math.abs((System.currentTimeMillis() / 1000) - z) >= 3600) {
int i6 = 0;
while (i6 < 2) {
final v vVar = i6 == 0 ? J : I;
if (vVar != null && UserConfig.getInstance(vVar.o).isClientActivated()) {
final u A5 = vVar.A(false);
final cu6 cu6Var = vVar.p;
if (cu6Var != null) {
i5 = vVar.o;
} else if (A5 != null && (cu6Var = A5.r) != null) {
i5 = UserConfig.selectedAccount;
}
if (cu6Var != null && cu6Var.i != null) {
y++;
le5 le5Var = new le5();
le5Var.c = cu6Var.i.id;
le5Var.a = "android";
s26 s26Var = new s26();
s26Var.b = cu6Var.f;
s26Var.a = cu6Var.e;
le5Var.b = s26Var;
ConnectionsManager.getInstance(i5).sendRequest(le5Var, new RequestDelegate() {
@Override
public final void run(i95 i95Var, ov5 ov5Var) {
org.telegram.ui.ActionBar.w.B2(w.u.this, vVar, cu6Var, i95Var, ov5Var);
}
});
}
}
i6++;
}
}
}
}
public static v35 q1(int i5) {
if (i5 < 0 || i5 > 5) {
return null;
}
v35[] v35VarArr = S2;
v35 v35Var = v35VarArr[i5];
if (v35Var != null) {
return v35Var;
}
if (i5 == 0) {
v35VarArr[0] = new xk7(true);
} else if (i5 == 1) {
v35VarArr[1] = new eg4(true);
} else if (i5 == 2) {
v35VarArr[2] = new qt4(true);
} else if (i5 == 3) {
v35VarArr[3] = new t34(true, null);
} else if (i5 == 4) {
v35VarArr[4] = new uj4(true);
} else if (i5 == 5) {
v35VarArr[5] = new ug0(true);
}
v35 v35Var2 = S2[i5];
v35Var2.c();
v35Var2.a(r1("chats_actionMessage"));
return v35Var2;
}
public static boolean q2() {
return H.J();
}
public static void q3(v vVar) {
Collections.sort(vVar.V, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int H22;
H22 = org.telegram.ui.ActionBar.w.H2((w.u) obj, (w.u) obj2);
return H22;
}
});
}
public static void r0(HashMap<String, Integer> hashMap, v vVar) {
if (vVar == null || hashMap == null || vVar.d0 != -1) {
return;
}
vVar.d0 = hj0.e(hj0.c(M1(hashMap, "windowBackgroundWhite"), M1(hashMap, "windowBackgroundWhite"), 0.5f)) < 0.5d ? 1 : 0;
}
public static int r1(String str) {
return u1(str, null, false);
}
public static boolean r2() {
return !i1().J();
}
private static void r3() {
Collections.sort(D, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int I22;
I22 = org.telegram.ui.ActionBar.w.I2((w.v) obj, (w.v) obj2);
return I22;
}
});
}
public static void s0() {
if (L == null) {
return;
}
N = false;
O = false;
L = null;
}
public static int s1(String str, s sVar) {
Integer h5;
return (sVar == null || (h5 = sVar.h(str)) == null) ? r1(str) : h5.intValue();
}
public static boolean s2() {
return H == I;
}
public static void s3(final MessageObject messageObject) {
nd ndVar = C4;
if (ndVar == null) {
return;
}
if (ndVar.c() == null || messageObject == null) {
C4.d(null);
return;
}
if (D4 == null) {
D4 = new HashMap<>();
}
D4.put(messageObject, C4);
C4.e(false, true, null);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
org.telegram.ui.ActionBar.w.J2(MessageObject.this);
}
}, 200L);
C4 = null;
}
public static o t0(v vVar, HashMap<String, Integer> hashMap, String str, int i5) {
float f5;
float f6;
boolean z5 = vVar.G && vVar.S == l;
u A5 = vVar.A(false);
File b6 = A5 != null ? A5.b() : null;
boolean z6 = A5 != null && A5.q;
q qVar = vVar.c0;
if (qVar != null) {
f6 = qVar.k;
} else {
if (A5 == null) {
f5 = vVar.n;
int i6 = (int) f5;
Integer num = P4.get("wallpaperFileOffset");
return u0(vVar, qVar, hashMap, b6, str, num == null ? num.intValue() : -1, i6, i5, z5, false, false, z6, null);
}
f6 = A5.p;
}
f5 = f6 * 100.0f;
int i62 = (int) f5;
Integer num2 = P4.get("wallpaperFileOffset");
return u0(vVar, qVar, hashMap, b6, str, num2 == null ? num2.intValue() : -1, i62, i5, z5, false, false, z6, null);
}
public static int t1(String str, boolean[] zArr) {
return u1(str, zArr, false);
}
public static boolean t2() {
return V;
}
public static boolean t3(int i5, int i6) {
float red = Color.red(i5) / 255.0f;
float green = Color.green(i5) / 255.0f;
float blue = Color.blue(i5) / 255.0f;
return ((((red * 0.5f) + ((Color.red(i6) / 255.0f) * 0.5f)) * 0.2126f) + (((green * 0.5f) + ((Color.green(i6) / 255.0f) * 0.5f)) * 0.7152f)) + (((blue * 0.5f) + ((((float) Color.blue(i6)) / 255.0f) * 0.5f)) * 0.0722f) > 0.705f || ((red * 0.2126f) + (green * 0.7152f)) + (blue * 0.0722f) > 0.705f;
}
public static o u0(v vVar, q qVar, HashMap<String, Integer> hashMap, File file, String str, int i5, int i6, int i7, boolean z5, boolean z6, boolean z7, boolean z8, ga5 ga5Var) {
boolean z9;
Boolean bool;
Bitmap L22;
org.telegram.ui.Components.o oVar;
Bitmap bitmap;
Drawable drawable;
o oVar2 = new o();
oVar2.a = f0;
boolean z10 = (!z6 || z7) && qVar != null;
if (qVar != null) {
oVar2.b = Boolean.valueOf(qVar.j);
if (qVar.d != 0) {
if (!qVar.f()) {
}
}
z9 = false;
} else {
oVar2.b = Boolean.valueOf(vVar.h);
}
oVar2.c = Boolean.valueOf(z9);
if (!z10) {
Integer num = z5 ? null : hashMap.get("chat_wallpaper");
Integer num2 = hashMap.get("key_chat_wallpaper_gradient_to3");
if (num2 == null) {
num2 = 0;
}
hashMap.get("key_chat_wallpaper_gradient_to2");
Integer num3 = hashMap.get("key_chat_wallpaper_gradient_to2");
Integer num4 = hashMap.get("chat_wallpaper_gradient_to");
try {
if (file != null && file.exists()) {
if (num == null || num4 == null || num3 == null) {
drawable = Drawable.createFromPath(file.getAbsolutePath());
} else {
sg3 sg3Var = new sg3(num.intValue(), num4.intValue(), num3.intValue(), num2.intValue(), false);
sg3Var.B(i6, BitmapFactory.decodeFile(file.getAbsolutePath()));
sg3Var.C(sg3Var.j());
drawable = sg3Var;
}
oVar2.a = drawable;
oVar2.b = Boolean.valueOf(z8);
Boolean bool2 = Boolean.TRUE;
oVar2.c = bool2;
oVar2.d = bool2;
} else if (num != null) {
Integer num5 = hashMap.get("chat_wallpaper_gradient_rotation");
if (num5 == null) {
num5 = 45;
}
if (num4 != null && num3 != null) {
sg3 sg3Var2 = new sg3(num.intValue(), num4.intValue(), num3.intValue(), num2.intValue(), false);
if (file == null || ga5Var == null) {
bitmap = null;
} else {
bitmap = SvgHelper.getBitmap(FileLoader.getPathToAttach(ga5Var, true), AndroidUtilities.dp(360.0f), AndroidUtilities.dp(640.0f), false);
if (bitmap != null) {
try {
FileOutputStream fileOutputStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 87, fileOutputStream);
fileOutputStream.close();
} catch (Exception e5) {
FileLog.e(e5);
e5.printStackTrace();
}
}
}
sg3Var2.B(i6, bitmap);
sg3Var2.D(i7);
oVar2.a = sg3Var2;
} else if (num4 == null || num4.equals(num)) {
oVar2.a = new ColorDrawable(num.intValue());
} else {
org.telegram.ui.Components.o oVar3 = new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(num5.intValue()), new int[]{num.intValue(), num4.intValue()});
U = oVar3.u(o.f.c(), new d(), 100L);
oVar2.a = oVar3;
}
oVar2.d = Boolean.TRUE;
} else if (str != null) {
try {
Bitmap L23 = L2(new FileInputStream(new File(ApplicationLoader.getFilesDirFixed(), Utilities.MD5(str) + ".wp")), 0);
if (L23 != null) {
oVar2.a = new BitmapDrawable(L23);
oVar2.d = Boolean.TRUE;
}
} catch (Exception e6) {
e = e6;
FileLog.e(e);
if (oVar2.a == null) {
}
return oVar2;
}
} else if (i5 > 0 && (vVar.b != null || vVar.d != null)) {
String str2 = vVar.d;
Bitmap L24 = L2(new FileInputStream(str2 != null ? k1(str2) : new File(vVar.b)), i5);
if (L24 != null) {
BitmapDrawable bitmapDrawable = new BitmapDrawable(L24);
f0 = bitmapDrawable;
oVar2.a = bitmapDrawable;
oVar2.d = Boolean.TRUE;
}
}
} catch (Throwable th) {
e = th;
}
}
if (oVar2.a == null) {
int i8 = qVar != null ? qVar.d : 0;
if (qVar != null) {
if (!qVar.f()) {
if (!qVar.e() || qVar.e != 0) {
if (i8 == 0 || (k0 && qVar.f == 0)) {
File file2 = new File(ApplicationLoader.getFilesDirFixed(), qVar.a);
if (file2.exists() && (L22 = L2(new FileInputStream(file2), 0)) != null) {
oVar2.a = new BitmapDrawable(L22);
oVar2.d = Boolean.TRUE;
}
if (oVar2.a == null) {
oVar2.a = G0();
bool = Boolean.FALSE;
oVar2.d = bool;
}
} else {
int i9 = qVar.e;
if (i9 != 0 && qVar.f != 0) {
sg3 sg3Var3 = new sg3(qVar.d, qVar.e, qVar.f, qVar.g, false);
sg3Var3.D(i7);
oVar = sg3Var3;
if (oVar2.c.booleanValue()) {
File file3 = new File(ApplicationLoader.getFilesDirFixed(), qVar.a);
oVar = sg3Var3;
if (file3.exists()) {
sg3Var3.B((int) (qVar.k * 100.0f), L2(new FileInputStream(file3), 0));
oVar2.d = Boolean.TRUE;
oVar = sg3Var3;
}
}
} else if (i9 != 0) {
org.telegram.ui.Components.o oVar4 = new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(qVar.h), new int[]{i8, i9});
U = oVar4.u(o.f.c(), new e(), 100L);
oVar = oVar4;
} else {
oVar2.a = new ColorDrawable(i8);
}
oVar2.a = oVar;
}
}
if (oVar2.a == null) {
if (i8 == 0) {
i8 = -2693905;
}
oVar2.a = new ColorDrawable(i8);
}
}
}
oVar2.a = G0();
bool = Boolean.FALSE;
oVar2.d = bool;
if (oVar2.a == null) {
}
}
return oVar2;
}
public static int u1(String str, boolean[] zArr, boolean z5) {
HashMap<String, Integer> hashMap;
Integer num;
if (!z5 && (hashMap = R4) != null && (num = hashMap.get(str)) != null) {
return num.intValue();
}
if (Y != null && ("chat_serviceText".equals(str) || "chat_serviceLink".equals(str) || "chat_serviceIcon".equals(str) || "chat_stickerReplyLine".equals(str) || "chat_stickerReplyNameText".equals(str) || "chat_stickerReplyMessageText".equals(str))) {
return -1;
}
if (H == K) {
if (L4.contains(str) ? H.M() : K4.contains(str) ? H.L() : ("chat_wallpaper".equals(str) || "chat_wallpaper_gradient_to".equals(str) || "key_chat_wallpaper_gradient_to2".equals(str) || "key_chat_wallpaper_gradient_to3".equals(str)) ? false : H.K()) {
return str.equals("chat_serviceBackground") ? W : str.equals("chat_serviceBackgroundSelected") ? a0 : F1(str);
}
}
Integer num2 = Q4.get(str);
if (num2 == null) {
String str2 = N4.get(str);
if (str2 != null) {
num2 = Q4.get(str2);
}
if (num2 == null) {
if (zArr != null) {
zArr[0] = true;
}
return str.equals("chat_serviceBackground") ? W : str.equals("chat_serviceBackgroundSelected") ? a0 : F1(str);
}
}
if ("windowBackgroundWhite".equals(str) || "windowBackgroundGray".equals(str) || "actionBarDefault".equals(str) || "actionBarDefaultArchived".equals(str)) {
num2 = Integer.valueOf(num2.intValue() | com.batch.android.messaging.view.roundimage.b.v);
}
return num2.intValue();
}
public static boolean u2() {
return l2() && H.c0.d != 0;
}
public static void v0(Context context, boolean z5) {
Paint paint;
B0();
if (!z5 && K2 == null) {
Resources resources = context.getResources();
G2 = resources.getDrawable(org.telegram.messenger.R.drawable.video_muted);
K2 = new p(0, false, false);
L2 = new p(0, false, true);
M2 = new p(0, true, false);
N2 = new p(0, true, true);
O2 = new p(1, false, false);
P2 = new p(1, false, true);
Q2 = new p(1, true, false);
R2 = new p(1, true, true);
vs3 vs3Var = new vs3(0.293f, -26.0f, -28.0f, 1.0f);
T2 = vs3Var;
vs3Var.a("M 34.141 16.042 C 37.384 17.921 40.886 20.001 44.211 21.965 C 46.139 23.104 49.285 24.729 49.586 25.917 C 50.289 28.687 48.484 30 46.274 30 L 6 30.021 C 3.79 30.021 2.075 30.023 2 26.021 L 2.009 3.417 C 2.009 0.417 5.326 -0.58 7.068 0.417 C 10.545 2.406 25.024 10.761 34.141 16.042 Z", 166.0f);
T2.a("M 37.843 17.769 C 41.143 19.508 44.131 21.164 47.429 23.117 C 48.542 23.775 49.623 24.561 49.761 25.993 C 50.074 28.708 48.557 30 46.347 30 L 6 30.012 C 3.79 30.012 2 28.222 2 26.012 L 2.009 4.609 C 2.009 1.626 5.276 0.664 7.074 1.541 C 10.608 3.309 28.488 12.842 37.843 17.769 Z", 200.0f);
T2.a("M 40.644 18.756 C 43.986 20.389 49.867 23.108 49.884 25.534 C 49.897 27.154 49.88 24.441 49.894 26.059 C 49.911 28.733 48.6 30 46.39 30 L 6 30.013 C 3.79 30.013 2 28.223 2 26.013 L 2.008 5.52 C 2.008 2.55 5.237 1.614 7.079 2.401 C 10.656 4 31.106 14.097 40.644 18.756 Z", 217.0f);
T2.a("M 43.782 19.218 C 47.117 20.675 50.075 21.538 50.041 24.796 C 50.022 26.606 50.038 24.309 50.039 26.104 C 50.038 28.736 48.663 30 46.453 30 L 6 29.986 C 3.79 29.986 2 28.196 2 25.986 L 2.008 6.491 C 2.008 3.535 5.196 2.627 7.085 3.316 C 10.708 4.731 33.992 14.944 43.782 19.218 Z", 234.0f);
T2.a("M 47.421 16.941 C 50.544 18.191 50.783 19.91 50.769 22.706 C 50.761 24.484 50.76 23.953 50.79 26.073 C 50.814 27.835 49.334 30 47.124 30 L 5 30.01 C 2.79 30.01 1 28.22 1 26.01 L 1.001 10.823 C 1.001 8.218 3.532 6.895 5.572 7.26 C 7.493 8.01 47.421 16.941 47.421 16.941 Z", 267.0f);
T2.a("M 47.641 17.125 C 50.641 18.207 51.09 19.935 51.078 22.653 C 51.07 24.191 51.062 21.23 51.088 23.063 C 51.109 24.886 49.587 27 47.377 27 L 5 27.009 C 2.79 27.009 1 25.219 1 23.009 L 0.983 11.459 C 0.983 8.908 3.414 7.522 5.476 7.838 C 7.138 8.486 47.641 17.125 47.641 17.125 Z", 300.0f);
T2.a("M 48 7 C 50.21 7 52 8.79 52 11 C 52 19 52 19 52 19 C 52 21.21 50.21 23 48 23 L 4 23 C 1.79 23 0 21.21 0 19 L 0 11 C 0 8.79 1.79 7 4 7 C 48 7 48 7 48 7 Z", 383.0f);
U2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check).mutate();
V2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check).mutate();
W2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check).mutate();
X2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check).mutate();
b3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check_s).mutate();
d3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_check_s).mutate();
Y2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_halfcheck).mutate();
Z2 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_halfcheck).mutate();
c3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_halfcheck_s).mutate();
e3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_halfcheck_s).mutate();
a3 = new dh3();
h3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
i3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
j3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
k3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
l3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
m3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
n3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
o3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
p3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
q3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
r3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
s3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
u3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
t3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_pin_mini).mutate();
v3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
w3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
f3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_views).mutate();
g3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_reply_small).mutate();
x3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_actions).mutate();
y3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_actions).mutate();
z3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_actions).mutate();
A3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_actions).mutate();
B3 = resources.getDrawable(org.telegram.messenger.R.drawable.video_actions);
C3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_instant).mutate();
D3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_instant).mutate();
E3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_warning);
F3 = resources.getDrawable(org.telegram.messenger.R.drawable.list_mute).mutate();
G3 = resources.getDrawable(org.telegram.messenger.R.drawable.ic_lock_header);
L3 = resources.getDrawable(org.telegram.messenger.R.drawable.broadcast3).mutate();
M3 = resources.getDrawable(org.telegram.messenger.R.drawable.broadcast3).mutate();
b4[0] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_voice).mutate();
c4[0] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_voice).mutate();
d4[0] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_voice).mutate();
e4[0] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_voice).mutate();
b4[1] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_video).mutate();
c4[1] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_video).mutate();
d4[1] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_video).mutate();
e4[1] = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_video).mutate();
j4 = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_outgoing).mutate();
k4 = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_incoming).mutate();
l4 = resources.getDrawable(org.telegram.messenger.R.drawable.chat_calls_incoming).mutate();
for (int i5 = 0; i5 < 2; i5++) {
f4[i5] = resources.getDrawable(org.telegram.messenger.R.drawable.poll_right).mutate();
g4[i5] = resources.getDrawable(org.telegram.messenger.R.drawable.poll_wrong).mutate();
h4[i5] = resources.getDrawable(org.telegram.messenger.R.drawable.smiles_panel_objects).mutate();
i4[i5] = resources.getDrawable(org.telegram.messenger.R.drawable.msg_psa).mutate();
}
u4 = resources.getDrawable(org.telegram.messenger.R.drawable.ic_call_made_green_18dp).mutate();
v4 = resources.getDrawable(org.telegram.messenger.R.drawable.ic_call_made_green_18dp).mutate();
w4 = resources.getDrawable(org.telegram.messenger.R.drawable.ic_call_received_green_18dp).mutate();
x4 = resources.getDrawable(org.telegram.messenger.R.drawable.ic_call_received_green_18dp).mutate();
m4 = resources.getDrawable(org.telegram.messenger.R.drawable.livepin).mutate();
H3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_file);
I3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_music);
J3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_location);
K3 = resources.getDrawable(org.telegram.messenger.R.drawable.map_pin).mutate();
V3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_link);
X3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_lines);
W3 = resources.getDrawable(org.telegram.messenger.R.drawable.bot_card);
Y3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_msgbubble);
Z3 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_msgbubble2);
a4 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_arrowright);
N3 = resources.getDrawable(org.telegram.messenger.R.drawable.header_shadow).mutate();
o4[0] = new RLottieDrawable(R.raw.attach_gallery, "attach_gallery", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
o4[1] = new RLottieDrawable(R.raw.attach_music, "attach_music", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
o4[2] = new RLottieDrawable(R.raw.attach_file, "attach_file", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
o4[3] = new RLottieDrawable(R.raw.attach_contact, "attach_contact", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
o4[4] = new RLottieDrawable(R.raw.attach_location, "attach_location", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
o4[5] = new RLottieDrawable(R.raw.attach_poll, "attach_poll", AndroidUtilities.dp(26.0f), AndroidUtilities.dp(26.0f));
n4 = resources.getDrawable(org.telegram.messenger.R.drawable.nophotos3);
P3 = resources.getDrawable(R.drawable.shape_cloud);
Q3 = resources.getDrawable(R.drawable.shape_edit);
R3 = resources.getDrawable(R.drawable.shape_star);
S3 = resources.getDrawable(R.drawable.shape_menu);
O3 = resources.getDrawable(org.telegram.messenger.R.drawable.share_arrow).mutate();
T3 = resources.getDrawable(org.telegram.messenger.R.drawable.fast_reply);
U3 = resources.getDrawable(org.telegram.messenger.R.drawable.message_arrow);
s4[0][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_arrow);
s4[0][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_arrow);
s4[1][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_cancel);
s4[1][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_cancel);
s4[2][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_arrow);
s4[2][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_arrow);
s4[3][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_cancel);
s4[3][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.audio_mini_cancel);
s4[4][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.video_mini_arrow);
s4[4][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.video_mini_arrow);
s4[5][0] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.video_mini_cancel);
s4[5][1] = x0(AndroidUtilities.dp(22.0f), org.telegram.messenger.R.drawable.video_mini_cancel);
int dp = AndroidUtilities.dp(2.0f);
RectF rectF = new RectF();
y4[0] = new Path();
y4[0].moveTo(AndroidUtilities.dp(7.0f), AndroidUtilities.dp(3.0f));
y4[0].lineTo(AndroidUtilities.dp(14.0f), AndroidUtilities.dp(3.0f));
y4[0].lineTo(AndroidUtilities.dp(21.0f), AndroidUtilities.dp(10.0f));
y4[0].lineTo(AndroidUtilities.dp(21.0f), AndroidUtilities.dp(20.0f));
int i6 = dp * 2;
rectF.set(AndroidUtilities.dp(21.0f) - i6, AndroidUtilities.dp(19.0f) - dp, AndroidUtilities.dp(21.0f), AndroidUtilities.dp(19.0f) + dp);
y4[0].arcTo(rectF, 0.0f, 90.0f, false);
y4[0].lineTo(AndroidUtilities.dp(6.0f), AndroidUtilities.dp(21.0f));
rectF.set(AndroidUtilities.dp(5.0f), AndroidUtilities.dp(19.0f) - dp, AndroidUtilities.dp(5.0f) + i6, AndroidUtilities.dp(19.0f) + dp);
y4[0].arcTo(rectF, 90.0f, 90.0f, false);
y4[0].lineTo(AndroidUtilities.dp(5.0f), AndroidUtilities.dp(4.0f));
rectF.set(AndroidUtilities.dp(5.0f), AndroidUtilities.dp(3.0f), AndroidUtilities.dp(5.0f) + i6, AndroidUtilities.dp(3.0f) + i6);
y4[0].arcTo(rectF, 180.0f, 90.0f, false);
y4[0].close();
y4[1] = new Path();
y4[1].moveTo(AndroidUtilities.dp(14.0f), AndroidUtilities.dp(5.0f));
y4[1].lineTo(AndroidUtilities.dp(19.0f), AndroidUtilities.dp(10.0f));
y4[1].lineTo(AndroidUtilities.dp(14.0f), AndroidUtilities.dp(10.0f));
y4[1].close();
A4 = resources.getDrawable(org.telegram.messenger.R.drawable.burn).mutate();
B4 = resources.getDrawable(org.telegram.messenger.R.drawable.msg_round_gif_m).mutate();
r4[0][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
r4[0][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
r4[1][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_pause_m);
r4[1][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_pause_m);
r4[2][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
r4[2][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
r4[3][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_file_s);
r4[3][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_file_s);
r4[4][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
r4[4][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
r4[5][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
r4[5][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
r4[6][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_pause_m);
r4[6][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_pause_m);
r4[7][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
r4[7][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
r4[8][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_file_s);
r4[8][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_file_s);
r4[9][0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
r4[9][1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[0][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[0][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[1][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[1][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[2][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_gif_m);
t4[2][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_gif_m);
t4[3][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
t4[3][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_play_m);
Drawable[][] drawableArr = t4;
Drawable[] drawableArr2 = drawableArr[4];
Drawable[] drawableArr3 = drawableArr[4];
Drawable drawable = resources.getDrawable(org.telegram.messenger.R.drawable.burn);
drawableArr3[1] = drawable;
drawableArr2[0] = drawable;
Drawable[][] drawableArr4 = t4;
Drawable[] drawableArr5 = drawableArr4[5];
Drawable[] drawableArr6 = drawableArr4[5];
Drawable drawable2 = resources.getDrawable(org.telegram.messenger.R.drawable.circle);
drawableArr6[1] = drawable2;
drawableArr5[0] = drawable2;
Drawable[][] drawableArr7 = t4;
Drawable[] drawableArr8 = drawableArr7[6];
Drawable[] drawableArr9 = drawableArr7[6];
Drawable drawable3 = resources.getDrawable(org.telegram.messenger.R.drawable.photocheck);
drawableArr9[1] = drawable3;
drawableArr8[0] = drawable3;
t4[7][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[7][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[8][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[8][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[9][0] = resources.getDrawable(org.telegram.messenger.R.drawable.doc_big).mutate();
t4[9][1] = resources.getDrawable(org.telegram.messenger.R.drawable.doc_big).mutate();
t4[10][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[10][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_load_m);
t4[11][0] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[11][1] = x0(AndroidUtilities.dp(48.0f), org.telegram.messenger.R.drawable.msg_round_cancel_m);
t4[12][0] = resources.getDrawable(org.telegram.messenger.R.drawable.doc_big).mutate();
t4[12][1] = resources.getDrawable(org.telegram.messenger.R.drawable.doc_big).mutate();
q4[0] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_contact);
q4[1] = x0(AndroidUtilities.dp(44.0f), org.telegram.messenger.R.drawable.msg_contact);
p4[0] = resources.getDrawable(org.telegram.messenger.R.drawable.msg_location).mutate();
p4[1] = resources.getDrawable(org.telegram.messenger.R.drawable.msg_location).mutate();
H2 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.compose_panel_shadow).mutate();
I2 = context.getResources().getDrawable(org.telegram.messenger.R.drawable.sheet_shadow_round).mutate();
try {
int dp2 = AndroidUtilities.roundMessageSize + AndroidUtilities.dp(6.0f);
Bitmap createBitmap = Bitmap.createBitmap(dp2, dp2, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
Paint paint2 = new Paint(1);
paint2.setColor(0);
paint2.setStyle(Paint.Style.FILL);
paint2.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
Paint paint3 = new Paint(1);
paint3.setShadowLayer(AndroidUtilities.dp(4.0f), 0.0f, 0.0f, 1593835520);
int i7 = 0;
while (i7 < 2) {
canvas.drawCircle(dp2 / 2, dp2 / 2, (AndroidUtilities.roundMessageSize / 2) - AndroidUtilities.dp(1.0f), i7 == 0 ? paint3 : paint2);
i7++;
}
try {
canvas.setBitmap(null);
} catch (Exception unused) {
}
J2 = new BitmapDrawable(createBitmap);
} catch (Throwable unused2) {
}
G4.clear();
H4.clear();
N("drawableBotInline", X3, "chat_serviceIcon");
N("drawableBotLink", V3, "chat_serviceIcon");
N("drawableGoIcon", U3, "chat_serviceIcon");
N("drawableCommentSticker", Z3, "chat_serviceIcon");
N("drawableMsgError", E3, "chat_sentErrorIcon");
N("drawableMsgIn", K2, null);
N("drawableMsgInSelected", L2, null);
N("drawableMsgInMedia", O2, null);
N("drawableMsgInMediaSelected", P2, null);
N("drawableMsgOut", M2, null);
N("drawableMsgOutSelected", N2, null);
N("drawableMsgOutMedia", Q2, null);
N("drawableMsgOutMediaSelected", R2, null);
N("drawableMsgOutCallAudio", d4[0], "chat_outInstant");
N("drawableMsgOutCallAudioSelected", e4[0], "chat_outInstantSelected");
N("drawableMsgOutCallVideo", d4[1], "chat_outInstant");
N("drawableMsgOutCallVideo", e4[1], "chat_outInstantSelected");
N("drawableMsgOutCheck", U2, "chat_outSentCheck");
N("drawableMsgOutCheckSelected", V2, "chat_outSentCheckSelected");
N("drawableMsgOutCheckRead", W2, "chat_outSentCheckRead");
N("drawableMsgOutCheckReadSelected", X2, "chat_outSentCheckReadSelected");
N("drawableMsgOutHalfCheck", Y2, "chat_outSentCheckRead");
N("drawableMsgOutHalfCheckSelected", Z2, "chat_outSentCheckReadSelected");
N("drawableMsgOutInstant", D3, "chat_outInstant");
N("drawableMsgOutMenu", z3, "chat_outMenu");
N("drawableMsgOutMenuSelected", A3, "chat_outMenuSelected");
N("drawableMsgOutPinned", r3, "chat_outViews");
N("drawableMsgOutPinnedSelected", s3, "chat_outViewsSelected");
N("drawableMsgOutReplies", n3, "chat_outViews");
N("drawableMsgOutReplies", o3, "chat_outViewsSelected");
N("drawableMsgOutViews", j3, "chat_outViews");
N("drawableMsgOutViewsSelected", k3, "chat_outViewsSelected");
N("drawableMsgStickerCheck", d3, "chat_serviceText");
N("drawableMsgStickerHalfCheck", e3, "chat_serviceText");
N("drawableMsgStickerPinned", t3, "chat_serviceText");
N("drawableMsgStickerReplies", g3, "chat_serviceText");
N("drawableMsgStickerViews", f3, "chat_serviceText");
N("drawableReplyIcon", T3, "chat_serviceIcon");
N("drawableShareIcon", O3, "chat_serviceIcon");
N("drawableMuteIcon", F3, "chat_muteIcon");
N("drawableLockIcon", G3, "chat_lockIcon");
N("drawable_chat_pollHintDrawableOut", h4[1], "chat_outPreviewInstantText");
N("drawable_chat_pollHintDrawableIn", h4[0], "chat_inPreviewInstantText");
S(z5, false);
}
if (z5 || (paint = I1) == null) {
return;
}
paint.setStrokeWidth(AndroidUtilities.dp(2.0f));
i2.setTextSize(AndroidUtilities.dp(12.0f));
j2.setTextSize(AndroidUtilities.dp(11.0f));
l2.setTextSize(AndroidUtilities.dp(15.0f));
m2.setTextSize(AndroidUtilities.dp(15.0f));
n2.setTextSize(AndroidUtilities.dp(13.0f));
s2.setTextSize(AndroidUtilities.dp(12.0f));
k2.setTextSize(AndroidUtilities.dp(12.0f));
t2.setTextSize(AndroidUtilities.dp(16.0f));
u2.setTextSize(AndroidUtilities.dp(15.0f));
v2.setTextSize(AndroidUtilities.dp(15.0f));
w2.setTextSize(AndroidUtilities.dp(15.0f));
x2.setTextSize(AndroidUtilities.dp(13.0f));
o2.setTextSize(AndroidUtilities.dp(12.0f));
y2.setTextSize(AndroidUtilities.dp(12.0f));
z2.setTextSize(AndroidUtilities.dp(13.0f));
A2.setTextSize(AndroidUtilities.dp(14.0f));
B2.setTextSize(AndroidUtilities.dp(14.0f));
C2.setTextSize(AndroidUtilities.dp(14.0f));
D2.setTextSize(AndroidUtilities.dp(14.0f));
p2.setTextSize(AndroidUtilities.dp(13.0f));
q2.setTextSize(AndroidUtilities.dp(13.0f));
r2.setTextSize(AndroidUtilities.dp(13.0f));
L1.setStrokeWidth(AndroidUtilities.dp(1.0f));
M1.setStrokeWidth(AndroidUtilities.dp(1.1f));
c2.setTextSize(AndroidUtilities.dp(Math.max(16, SharedConfig.fontSize) - 2));
E2.setTextSize(AndroidUtilities.dp(15.0f));
F2.setTextSize(AndroidUtilities.dp(13.0f));
Y1.setStrokeWidth(AndroidUtilities.dp(3.0f));
Z1.setStrokeWidth(AndroidUtilities.dp(2.0f));
}
public static Integer v1(String str) {
Integer num = Q4.get(str);
if (num == null) {
if (N4.get(str) != null) {
num = Q4.get(str);
}
if (num == null) {
num = M4.get(str);
}
}
return num != null ? ("windowBackgroundWhite".equals(str) || "windowBackgroundGray".equals(str) || "actionBarDefault".equals(str) || "actionBarDefaultArchived".equals(str)) ? Integer.valueOf(num.intValue() | com.batch.android.messaging.view.roundimage.b.v) : num : num;
}
public static boolean v2(u uVar) {
v vVar = uVar.b;
if (vVar == null) {
return false;
}
if (vVar.C().equals("Blue") && uVar.a == 99) {
return true;
}
if (uVar.b.C().equals("Day") && uVar.a == 9) {
return true;
}
return (uVar.b.C().equals("Night") || uVar.b.C().equals("Dark Blue")) && uVar.a == 0;
}
public static ShapeDrawable w0(int i5, int i6) {
OvalShape ovalShape = new OvalShape();
float f5 = i5;
ovalShape.resize(f5, f5);
ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
shapeDrawable.setIntrinsicWidth(i5);
shapeDrawable.setIntrinsicHeight(i5);
shapeDrawable.getPaint().setColor(i6);
return shapeDrawable;
}
public static nd w1() {
if (C4 == null) {
C4 = new nd();
}
return C4;
}
public static boolean w2() {
String Q12 = Q1();
return k0 || "CJz3BZ6YGEYBAAAABboWp6SAv04".equals(Q12) || "qeZWES8rGVIEAAAARfWlK1lnfiI".equals(Q12);
}
public static jj0 x0(int i5, int i6) {
return y0(i5, i6, 0);
}
public static org.telegram.ui.Components.o x1() {
int i5;
int i6;
q qVar = H.c0;
if (qVar == null || (i5 = qVar.d) == 0 || (i6 = qVar.e) == 0) {
return null;
}
return new org.telegram.ui.Components.o(org.telegram.ui.Components.o.m(qVar.h), new int[]{i5, i6});
}
public static boolean x2(v vVar) {
return (vVar == null || G.get(vVar.C()) == null) ? false : true;
}
public static jj0 y0(int i5, int i6, int i7) {
return z0(i5, i6 != 0 ? ApplicationLoader.applicationContext.getResources().getDrawable(i6).mutate() : null, i7);
}
public static Drawable y1() {
if (System.currentTimeMillis() - u1 >= 60000) {
u1 = System.currentTimeMillis();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int i5 = calendar.get(2);
int i6 = calendar.get(5);
calendar.get(12);
int i7 = calendar.get(11);
if (i5 == 0 && i6 == 1 && i7 <= 23) {
v1 = true;
} else {
v1 = false;
}
if (i1 == null) {
if (i5 == 11) {
if (i6 >= (BuildVars.DEBUG_PRIVATE_VERSION ? 29 : 31)) {
}
}
if (i5 == 0) {
}
}
}
return i1;
}
public static boolean y2() {
return !TextUtils.isEmpty(i0);
}
public static jj0 z0(int i5, Drawable drawable, int i6) {
OvalShape ovalShape = new OvalShape();
float f5 = i5;
ovalShape.resize(f5, f5);
ShapeDrawable shapeDrawable = new ShapeDrawable(ovalShape);
Paint paint = shapeDrawable.getPaint();
paint.setColor(-1);
if (i6 == 1) {
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(AndroidUtilities.dp(2.0f));
} else if (i6 == 2) {
paint.setAlpha(0);
}
jj0 jj0Var = new jj0(shapeDrawable, drawable);
jj0Var.c(i5, i5);
return jj0Var;
}
public static int z1() {
return s1;
}
public static boolean z2() {
return j0;
}
}