discord-jadx/app/src/main/java/com/airbnb/lottie/parser/AnimatableValueParser.java

3684 lines
137 KiB
Java

package com.airbnb.lottie.parser;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.media.MediaFormat;
import android.net.Uri;
import android.opengl.GLES20;
import android.opengl.GLU;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PowerManager;
import android.os.Process;
import android.os.Trace;
import android.text.Spannable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Base64;
import android.util.Log;
import android.util.Pair;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RecentlyNonNull;
import androidx.core.app.NotificationCompat;
import androidx.core.internal.view.SupportMenu;
import androidx.core.text.TextUtilsCompat;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import c.c.a.a0.g0;
import c.c.a.a0.h;
import c.c.a.a0.q;
import c.c.a.b0.g;
import c.c.a.y.k.b;
import c.c.a.y.k.f;
import c.f.b.a.c;
import c.f.d.d.i;
import c.f.g.e.b0;
import c.f.g.e.d0;
import c.f.g.e.e;
import c.f.g.e.p;
import c.f.g.e.r;
import c.f.g.e.s;
import c.f.g.e.t;
import c.f.g.e.v;
import c.f.g.e.w;
import c.f.g.e.x;
import c.f.g.e.z;
import c.g.a.a.p;
import c.g.a.c.c0.e0;
import c.g.a.c.i0.d;
import c.i.a.b.i.d;
import c.i.a.c.a2.h0.j;
import c.i.a.c.a2.o;
import c.i.a.c.a2.y;
import c.i.a.c.i2.f0;
import c.i.a.c.i2.s;
import c.i.a.c.j2.x.d;
import com.adjust.sdk.Constants;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils$getDisplayName$1;
import com.discord.api.channel.ChannelUtils$getSortByNameAndType$1;
import com.discord.api.permission.PermissionOverwrite;
import com.discord.api.stageinstance.StageInstance;
import com.discord.api.stageinstance.StageInstancePrivacyLevel;
import com.discord.api.thread.ThreadMetadata;
import com.discord.api.user.User;
import com.discord.api.voice.state.StageRequestToSpeakState;
import com.discord.api.voice.state.VoiceState;
import com.discord.app.AppPermissionsRequests;
import com.discord.i18n.RenderContext;
import com.discord.models.presence.Presence;
import com.discord.models.user.CoreUser;
import com.discord.player.MediaSource;
import com.discord.player.MediaType;
import com.discord.simpleast.core.node.Node;
import com.discord.utilities.logging.Logger;
import com.discord.utilities.logging.LoggingProvider;
import com.discord.utilities.user.UserUtils;
import com.facebook.cache.common.CacheKey;
import com.facebook.common.file.FileUtils$CreateDirectoryException;
import com.facebook.common.file.FileUtils$FileDeleteException;
import com.facebook.common.file.FileUtils$ParentDirNotFoundException;
import com.facebook.common.file.FileUtils$RenameException;
import com.facebook.datasource.DataSource;
import com.facebook.drawee.R;
import com.facebook.drawee.drawable.ScalingUtils$ScaleType;
import com.facebook.soloader.SysUtil$LollipopSysdeps;
import com.facebook.soloader.SysUtil$MarshmallowSysdeps;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.database.DatabaseIOException;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader$ParseException;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.material.shadow.ShadowDrawableWrapper;
import com.google.android.material.snackbar.BaseTransientBottomBar;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import d0.t.k;
import d0.t.n;
import d0.t.o;
import d0.t.u;
import d0.z.d.m;
import java.io.EOFException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.ScheduledExecutorService;
import java.util.zip.Inflater;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.dataflow.qual.Pure;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
public class AnimatableValueParser {
public static boolean a;
public static ScheduledExecutorService b;
/* compiled from: ArrayBuilders */
public static class a {
public final /* synthetic */ Class a;
public final /* synthetic */ int b;
/* renamed from: c reason: collision with root package name */
public final /* synthetic */ Object f1549c;
public a(Class cls, int i, Object obj) {
this.a = cls;
this.b = i;
this.f1549c = obj;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(d.o(obj, this.a) && Array.getLength(obj) == this.b)) {
return false;
}
for (int i = 0; i < this.b; i++) {
Object obj2 = Array.get(this.f1549c, i);
Object obj3 = Array.get(obj, i);
if (!(obj2 == obj3 || obj2 == null || obj2.equals(obj3))) {
return false;
}
}
return true;
}
}
@NonNull
@EnsuresNonNull({"#1"})
public static <T> T A(@Nullable T t) {
Objects.requireNonNull(t, "null reference");
return t;
}
public static /* synthetic */ String A0(Channel channel, Context context, boolean z2, int i) {
if ((i & 2) != 0) {
z2 = true;
}
return z0(channel, context, z2);
}
public static final boolean A1(Channel channel) {
User user;
m.checkNotNullParameter(channel, "$this$isSystemDM");
if (channel.A() == 1) {
List<User> w = channel.w();
if (m.areEqual((w == null || (user = (User) u.firstOrNull(w)) == null) ? null : user.p(), Boolean.TRUE)) {
return true;
}
}
return false;
}
public static void A2(Drawable drawable, e eVar) {
if (drawable != null && eVar != null) {
int i = eVar.a;
if (i != -1) {
drawable.setAlpha(i);
}
if (eVar.b) {
drawable.setColorFilter(eVar.f393c);
}
int i2 = eVar.d;
boolean z2 = false;
if (i2 != -1) {
drawable.setDither(i2 != 0);
}
int i3 = eVar.e;
if (i3 != -1) {
if (i3 != 0) {
z2 = true;
}
drawable.setFilterBitmap(z2);
}
}
}
public static void B(boolean z2) {
if (!z2) {
throw new IllegalStateException();
}
}
public static Drawable B0(Context context, TypedArray typedArray, int i) {
int resourceId = typedArray.getResourceId(i, 0);
if (resourceId == 0) {
return null;
}
return context.getResources().getDrawable(resourceId);
}
public static final boolean B1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isTextChannel");
return u1(channel) || m1(channel);
}
public static <TResult> void B2(Status status, @Nullable TResult tresult, TaskCompletionSource<TResult> taskCompletionSource) {
if (status.v0()) {
taskCompletionSource.a.t(tresult);
return;
}
taskCompletionSource.a.s(new ApiException(status));
}
public static void C(boolean z2, Object obj) {
if (!z2) {
throw new IllegalStateException(String.valueOf(obj));
}
}
@RecentlyNonNull
public static String C0(@RecentlyNonNull PowerManager.WakeLock wakeLock, @RecentlyNonNull String str) {
String valueOf = String.valueOf(String.valueOf(((long) System.identityHashCode(wakeLock)) | (((long) Process.myPid()) << 32)));
String str2 = null;
if (TextUtils.isEmpty(null)) {
str2 = "";
}
String valueOf2 = String.valueOf(str2);
return valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf);
}
public static final boolean C1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isThread");
return channel.A() == 10 || channel.A() == 11 || channel.A() == 12;
}
public static void C2(SQLiteDatabase sQLiteDatabase, int i, String str, int i2) throws DatabaseIOException {
try {
sQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS ExoPlayerVersions (feature INTEGER NOT NULL,instance_uid TEXT NOT NULL,version INTEGER NOT NULL,PRIMARY KEY (feature, instance_uid))");
ContentValues contentValues = new ContentValues();
contentValues.put("feature", Integer.valueOf(i));
contentValues.put("instance_uid", str);
contentValues.put("version", Integer.valueOf(i2));
sQLiteDatabase.replaceOrThrow("ExoPlayerVersions", null, contentValues);
} catch (SQLException e) {
throw new DatabaseIOException(e);
}
}
@Pure
public static void D(boolean z2) {
if (!z2) {
throw new IllegalStateException();
}
}
public static int D0(InputStream inputStream) throws IOException {
return ((((byte) inputStream.read()) << 24) & ViewCompat.MEASURED_STATE_MASK) | ((((byte) inputStream.read()) << 16) & ItemTouchHelper.ACTION_MODE_DRAG_MASK) | ((((byte) inputStream.read()) << 8) & 65280) | (((byte) inputStream.read()) & 255);
}
public static final boolean D1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isThreaded");
return channel.A() == 0 || channel.A() == 5;
}
public static boolean D2(Object obj, Collection<String> collection, Collection<String> collection2) {
if (collection == null && collection2 == null) {
return false;
}
return collection2 == null ? collection.contains(obj) : collection == null ? !collection2.contains(obj) : !collection2.contains(obj) || collection.contains(obj);
}
@Pure
public static void E(boolean z2, Object obj) {
if (!z2) {
throw new IllegalStateException(String.valueOf(obj));
}
}
public static final Integer E0(Intent intent, String str) {
m.checkNotNullParameter(intent, "$this$getIntExtraOrNull");
m.checkNotNullParameter(str, "key");
Integer valueOf = Integer.valueOf(intent.getIntExtra(str, Integer.MIN_VALUE));
if (!(valueOf.intValue() == Integer.MIN_VALUE)) {
return valueOf;
}
return null;
}
public static final boolean E1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isVoiceChannel");
return channel.A() == 2;
}
public static final boolean E2(Channel channel) {
m.checkNotNullParameter(channel, "$this$shouldPlayJoinLeaveSounds");
return E1(channel) || u1(channel);
}
public static void F(@RecentlyNonNull boolean z2) {
if (!z2) {
throw new IllegalStateException();
}
}
public static final PermissionOverwrite F0(Channel channel, long j) {
boolean z2;
m.checkNotNullParameter(channel, "$this$getPermissionOverwriteForId");
List<PermissionOverwrite> s2 = channel.s();
Object obj = null;
if (s2 == null) {
return null;
}
Iterator<T> it = s2.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Object next = it.next();
if (((PermissionOverwrite) next).e() == j) {
z2 = true;
continue;
} else {
z2 = false;
continue;
}
if (z2) {
obj = next;
break;
}
}
return (PermissionOverwrite) obj;
}
public static final void F1(String str, String str2) {
m.checkNotNullParameter(str, "tag");
m.checkNotNullParameter(str2, NotificationCompat.CATEGORY_MESSAGE);
Logger.d$default(LoggingProvider.INSTANCE.get(), str, str2, null, 4, null);
}
public static long F2(InputStream inputStream, long j) throws IOException {
j(Boolean.valueOf(j >= 0));
long j2 = j;
while (j2 > 0) {
long skip = inputStream.skip(j2);
if (skip <= 0) {
if (inputStream.read() == -1) {
return j - j2;
}
skip = 1;
}
j2 -= skip;
}
return j;
}
public static void G(@RecentlyNonNull boolean z2, @RecentlyNonNull Object obj) {
if (!z2) {
throw new IllegalStateException(String.valueOf(obj));
}
}
public static final List<com.discord.models.user.User> G0(Channel channel) {
m.checkNotNullParameter(channel, "$this$getRecipients");
List<User> w = channel.w();
if (w == null) {
return n.emptyList();
}
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(w, 10));
for (User user : w) {
arrayList.add(new CoreUser(user));
}
return arrayList;
}
public static final void G1(String str, String str2, Throwable th) {
m.checkNotNullParameter(str, "tag");
m.checkNotNullParameter(str2, NotificationCompat.CATEGORY_MESSAGE);
Logger.e$default(LoggingProvider.INSTANCE.get(), str, str2, th, null, 8, null);
}
public static void G2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
parcel.setDataPosition(parcel.dataPosition() + p2(parcel, i));
}
@EnsuresNonNull({"#1"})
@Pure
public static <T> T H(@Nullable T t) {
if (t != null) {
return t;
}
throw new IllegalStateException();
}
public static final StageRequestToSpeakState H0(VoiceState voiceState) {
return voiceState == null ? StageRequestToSpeakState.NONE : (!voiceState.l() || voiceState.f() == null) ? (voiceState.l() || voiceState.f() == null) ? !voiceState.l() ? StageRequestToSpeakState.ON_STAGE : StageRequestToSpeakState.NONE : StageRequestToSpeakState.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK : StageRequestToSpeakState.REQUESTED_TO_SPEAK;
}
public static final void H1(String str, String str2) {
m.checkNotNullParameter(str, "tag");
m.checkNotNullParameter(str2, NotificationCompat.CATEGORY_MESSAGE);
Logger.i$default(LoggingProvider.INSTANCE.get(), str, str2, null, 4, null);
}
public static final <P extends Parcelable> Bundle H2(P p) {
m.checkNotNullParameter(p, "$this$toBundle");
Bundle bundle = new Bundle();
bundle.putParcelable("intent_args_key", p);
return bundle;
}
@EnsuresNonNull({"#1"})
@Pure
public static <T> T I(@Nullable T t, Object obj) {
if (t != null) {
return t;
}
throw new IllegalStateException(String.valueOf(obj));
}
public static List<String> I0(CacheKey cacheKey) {
try {
if (!(cacheKey instanceof c)) {
ArrayList arrayList = new ArrayList(1);
arrayList.add(cacheKey.a() ? cacheKey.b() : x2(cacheKey));
return arrayList;
}
Objects.requireNonNull((c) cacheKey);
throw null;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
public static final void I1(String str, String str2) {
m.checkNotNullParameter(str, "tag");
m.checkNotNullParameter(str2, NotificationCompat.CATEGORY_MESSAGE);
Logger.v$default(LoggingProvider.INSTANCE.get(), str, str2, null, 4, null);
}
public static String I2(@ColorInt int i) {
return f0.k("rgba(%d,%d,%d,%.3f)", Integer.valueOf(Color.red(i)), Integer.valueOf(Color.green(i)), Integer.valueOf(Color.blue(i)), Double.valueOf(((double) Color.alpha(i)) / 255.0d));
}
public static boolean J(byte[] bArr, String str) {
if (bArr.length != str.length()) {
return false;
}
for (int i = 0; i < bArr.length; i++) {
if (str.charAt(i) != bArr[i]) {
return false;
}
}
return true;
}
public static ScalingUtils$ScaleType J0(TypedArray typedArray, int i) {
switch (typedArray.getInt(i, -2)) {
case -1:
return null;
case 0:
ScalingUtils$ScaleType scalingUtils$ScaleType = ScalingUtils$ScaleType.a;
return z.l;
case 1:
ScalingUtils$ScaleType scalingUtils$ScaleType2 = ScalingUtils$ScaleType.a;
return x.l;
case 2:
ScalingUtils$ScaleType scalingUtils$ScaleType3 = ScalingUtils$ScaleType.a;
return v.l;
case 3:
ScalingUtils$ScaleType scalingUtils$ScaleType4 = ScalingUtils$ScaleType.a;
return w.l;
case 4:
ScalingUtils$ScaleType scalingUtils$ScaleType5 = ScalingUtils$ScaleType.a;
return r.l;
case 5:
ScalingUtils$ScaleType scalingUtils$ScaleType6 = ScalingUtils$ScaleType.a;
return t.l;
case 6:
ScalingUtils$ScaleType scalingUtils$ScaleType7 = ScalingUtils$ScaleType.a;
return s.l;
case 7:
ScalingUtils$ScaleType scalingUtils$ScaleType8 = ScalingUtils$ScaleType.a;
return b0.l;
case 8:
ScalingUtils$ScaleType scalingUtils$ScaleType9 = ScalingUtils$ScaleType.a;
return c.f.g.e.u.l;
default:
throw new RuntimeException("XML attribute not specified!");
}
}
public static final void J1(String str, String str2) {
m.checkNotNullParameter(str, "tag");
m.checkNotNullParameter(str2, NotificationCompat.CATEGORY_MESSAGE);
Logger.w$default(LoggingProvider.INSTANCE.get(), str, str2, null, 4, null);
}
public static final <P extends Parcelable> Intent J2(P p) {
m.checkNotNullParameter(p, "$this$toIntent");
Intent putExtra = new Intent().putExtra("intent_args_key", p);
m.checkNotNullExpressionValue(putExtra, "Intent().putExtra(INTENT_ARGS, this)");
return putExtra;
}
public static int K(String str, String str2) {
int glCreateProgram = GLES20.glCreateProgram();
r();
d(35633, str, glCreateProgram);
d(35632, str2, glCreateProgram);
GLES20.glLinkProgram(glCreateProgram);
int[] iArr = {0};
GLES20.glGetProgramiv(glCreateProgram, 35714, iArr, 0);
if (iArr[0] != 1) {
StringBuilder O = c.d.b.a.a.O("Unable to link shader program: \n");
O.append(GLES20.glGetProgramInfoLog(glCreateProgram));
Log.e("GlUtil", O.toString());
}
r();
return glCreateProgram;
}
public static final Comparator<Channel> K0(Channel.Companion companion) {
m.checkNotNullParameter(companion, "$this$getSortByNameAndType");
return new ChannelUtils$getSortByNameAndType$1(companion);
}
public static ParameterizedType K1(Type type) {
if (type instanceof ParameterizedType) {
return (ParameterizedType) type;
}
if (type instanceof WildcardType) {
WildcardType wildcardType = (WildcardType) type;
if (wildcardType.getLowerBounds().length != 0) {
return null;
}
Type[] upperBounds = wildcardType.getUpperBounds();
if (upperBounds.length == 1) {
return K1(upperBounds[0]);
}
}
return null;
}
public static i K2(Object obj) {
return new i(obj.getClass().getSimpleName(), null);
}
public static void L(long j, c.i.a.c.i2.w wVar, c.i.a.c.a2.w[] wVarArr) {
while (true) {
boolean z2 = true;
if (wVar.a() > 1) {
int l2 = l2(wVar);
int l22 = l2(wVar);
int i = wVar.b + l22;
if (l22 == -1 || l22 > wVar.a()) {
Log.w("CeaUtil", "Skipping remainder of malformed SEI NAL unit.");
i = wVar.f920c;
} else if (l2 == 4 && l22 >= 8) {
int s2 = wVar.s();
int x2 = wVar.x();
int f = x2 == 49 ? wVar.f() : 0;
int s3 = wVar.s();
if (x2 == 47) {
wVar.E(1);
}
boolean z3 = s2 == 181 && (x2 == 49 || x2 == 47) && s3 == 3;
if (x2 == 49) {
if (f != 1195456820) {
z2 = false;
}
z3 &= z2;
}
if (z3) {
M(j, wVar, wVarArr);
}
}
wVar.D(i);
} else {
return;
}
}
}
@NonNull
public static String L0(@RecentlyNonNull int i) {
switch (i) {
case -1:
return "SUCCESS_CACHE";
case 0:
return "SUCCESS";
case 1:
case 9:
case 11:
case 12:
default:
return c.d.b.a.a.f(32, "unknown status code: ", i);
case 2:
return "SERVICE_VERSION_UPDATE_REQUIRED";
case 3:
return "SERVICE_DISABLED";
case 4:
return "SIGN_IN_REQUIRED";
case 5:
return "INVALID_ACCOUNT";
case 6:
return "RESOLUTION_REQUIRED";
case 7:
return "NETWORK_ERROR";
case 8:
return "INTERNAL_ERROR";
case 10:
return "DEVELOPER_ERROR";
case 13:
return "ERROR";
case 14:
return "INTERRUPTED";
case 15:
return "TIMEOUT";
case 16:
return "CANCELED";
case 17:
return "API_NOT_CONNECTED";
case 18:
return "DEAD_CLIENT";
case 19:
return "REMOTE_EXCEPTION";
case 20:
return "CONNECTION_SUSPENDED_DURING_CALL";
case 21:
return "RECONNECTION_TIMED_OUT_DURING_UPDATE";
case 22:
return "RECONNECTION_TIMED_OUT";
}
}
public static TypeVariable<?> L1(Type type) {
if (type instanceof TypeVariable) {
return (TypeVariable) type;
}
if (type instanceof WildcardType) {
WildcardType wildcardType = (WildcardType) type;
if (wildcardType.getLowerBounds().length != 0) {
return null;
}
Type[] upperBounds = wildcardType.getUpperBounds();
if (upperBounds.length == 1) {
return L1(upperBounds[0]);
}
}
return null;
}
public static void L2(Collection<? extends Node> collection, c.a.t.b.c.a aVar) {
for (Node node : collection) {
M2(node, aVar);
}
}
public static void M(long j, c.i.a.c.i2.w wVar, c.i.a.c.a2.w[] wVarArr) {
int s2 = wVar.s();
if ((s2 & 64) != 0) {
wVar.E(1);
int i = (s2 & 31) * 3;
int i2 = wVar.b;
for (c.i.a.c.a2.w wVar2 : wVarArr) {
wVar.D(i2);
wVar2.c(wVar, i);
wVar2.d(j, 1, i, 0, null);
}
}
}
public static String[] M0() {
return Build.VERSION.SDK_INT >= 23 ? SysUtil$MarshmallowSysdeps.getSupportedAbis() : SysUtil$LollipopSysdeps.getSupportedAbis();
}
public static void M1(MediaFormat mediaFormat, String str, int i) {
if (i != -1) {
mediaFormat.setInteger(str, i);
}
}
public static void M2(Node node, c.a.t.b.c.a aVar) {
if (node.hasChildren()) {
for (Node node2 : node.getChildren()) {
M2(node2, aVar);
}
}
aVar.processNode(node);
}
public static void N(Drawable drawable, Drawable drawable2) {
if (drawable != null && drawable != drawable2) {
drawable.setBounds(drawable2.getBounds());
drawable.setChangingConfigurations(drawable2.getChangingConfigurations());
drawable.setLevel(drawable2.getLevel());
drawable.setVisible(drawable2.isVisible(), false);
drawable.setState(drawable2.getState());
}
}
public static String N0(String str) {
return c.d.b.a.a.u("TransportRuntime.", str);
}
public static String N1(String str, String str2) {
int length = str.length() - str2.length();
if (length < 0 || length > 1) {
throw new IllegalArgumentException("Invalid input received");
}
StringBuilder sb = new StringBuilder(str2.length() + str.length());
for (int i = 0; i < str.length(); i++) {
sb.append(str.charAt(i));
if (str2.length() > i) {
sb.append(str2.charAt(i));
}
}
return sb.toString();
}
public static void N2(Node node, c.a.t.b.c.a aVar) {
aVar.processNode(node);
if (node.hasChildren()) {
for (Node node2 : node.getChildren()) {
N2(node2, aVar);
}
}
}
public static FloatBuffer O(float[] fArr) {
return (FloatBuffer) ByteBuffer.allocateDirect(fArr.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().put(fArr).flip();
}
public static Pair<Integer, Integer> O0(InputStream inputStream) throws IOException {
inputStream.skip(7);
short read = (short) (inputStream.read() & 255);
short read2 = (short) (inputStream.read() & 255);
short read3 = (short) (inputStream.read() & 255);
if (read == 157 && read2 == 1 && read3 == 42) {
return new Pair<>(Integer.valueOf(p0(inputStream)), Integer.valueOf(p0(inputStream)));
}
return null;
}
public static void O1(File file) throws FileUtils$CreateDirectoryException {
if (file.exists()) {
if (!file.isDirectory()) {
if (!file.delete()) {
throw new FileUtils$CreateDirectoryException(file.getAbsolutePath(), new FileUtils$FileDeleteException(file.getAbsolutePath()));
}
} else {
return;
}
}
if (!file.mkdirs() && !file.isDirectory()) {
throw new FileUtils$CreateDirectoryException(file.getAbsolutePath());
}
}
/* JADX INFO: finally extract failed */
/* JADX WARNING: Code restructure failed: missing block: B:142:0x024a, code lost:
if (r15 != false) goto L_0x0266;
*/
/* JADX WARNING: Code restructure failed: missing block: B:156:0x0264, code lost:
if (r16 != false) goto L_0x0266;
*/
public static c.f.g.f.a O2(c.f.g.f.a aVar, Context context, AttributeSet attributeSet) {
int i;
int i2;
boolean z2;
boolean z3;
boolean z4;
boolean z5;
boolean z6;
boolean z7;
int i3;
boolean z8;
int i4;
boolean z9;
boolean z10;
Context context2 = context;
int i5 = 1;
if (attributeSet != null) {
TypedArray obtainStyledAttributes = context2.obtainStyledAttributes(attributeSet, R.a.GenericDraweeHierarchy);
try {
int indexCount = obtainStyledAttributes.getIndexCount();
int i6 = 0;
int i7 = 0;
i = 0;
boolean z11 = true;
boolean z12 = true;
boolean z13 = true;
boolean z14 = true;
boolean z15 = true;
boolean z16 = true;
boolean z17 = true;
boolean z18 = true;
while (i6 < indexCount) {
int index = obtainStyledAttributes.getIndex(i6);
if (index == R.a.GenericDraweeHierarchy_actualImageScaleType) {
aVar.n = J0(obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_placeholderImage) {
aVar.f = B0(context2, obtainStyledAttributes, index);
} else {
if (index == R.a.GenericDraweeHierarchy_pressedStateOverlayImage) {
Drawable B0 = B0(context2, obtainStyledAttributes, index);
if (B0 == null) {
aVar.q = null;
} else {
StateListDrawable stateListDrawable = new StateListDrawable();
i3 = indexCount;
int[] iArr = new int[i5];
iArr[0] = 16842919;
stateListDrawable.addState(iArr, B0);
aVar.q = stateListDrawable;
}
} else {
i3 = indexCount;
if (index == R.a.GenericDraweeHierarchy_progressBarImage) {
aVar.l = B0(context2, obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_fadeDuration) {
aVar.d = obtainStyledAttributes.getInt(index, 0);
} else if (index == R.a.GenericDraweeHierarchy_viewAspectRatio) {
aVar.e = obtainStyledAttributes.getFloat(index, 0.0f);
} else if (index == R.a.GenericDraweeHierarchy_placeholderImageScaleType) {
aVar.g = J0(obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_retryImage) {
aVar.h = B0(context2, obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_retryImageScaleType) {
aVar.i = J0(obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_failureImage) {
aVar.j = B0(context2, obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_failureImageScaleType) {
aVar.k = J0(obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_progressBarImageScaleType) {
aVar.m = J0(obtainStyledAttributes, index);
} else {
if (index == R.a.GenericDraweeHierarchy_progressBarAutoRotateInterval) {
i = obtainStyledAttributes.getInteger(index, i);
} else if (index == R.a.GenericDraweeHierarchy_backgroundImage) {
aVar.o = B0(context2, obtainStyledAttributes, index);
} else if (index == R.a.GenericDraweeHierarchy_overlayImage) {
aVar.b(B0(context2, obtainStyledAttributes, index));
} else if (index == R.a.GenericDraweeHierarchy_roundAsCircle) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
aVar.r.b = obtainStyledAttributes.getBoolean(index, false);
} else if (index == R.a.GenericDraweeHierarchy_roundedCornerRadius) {
i7 = obtainStyledAttributes.getDimensionPixelSize(index, i7);
} else if (index == R.a.GenericDraweeHierarchy_roundTopLeft) {
z11 = obtainStyledAttributes.getBoolean(index, z11);
} else if (index == R.a.GenericDraweeHierarchy_roundTopRight) {
z14 = obtainStyledAttributes.getBoolean(index, z14);
} else {
if (index == R.a.GenericDraweeHierarchy_roundBottomLeft) {
z9 = obtainStyledAttributes.getBoolean(index, z18);
} else {
z9 = z18;
if (index == R.a.GenericDraweeHierarchy_roundBottomRight) {
z15 = obtainStyledAttributes.getBoolean(index, z15);
} else if (index == R.a.GenericDraweeHierarchy_roundTopStart) {
z12 = obtainStyledAttributes.getBoolean(index, z12);
} else if (index == R.a.GenericDraweeHierarchy_roundTopEnd) {
z13 = obtainStyledAttributes.getBoolean(index, z13);
} else {
if (index == R.a.GenericDraweeHierarchy_roundBottomStart) {
z8 = obtainStyledAttributes.getBoolean(index, z17);
} else {
z8 = z17;
if (index == R.a.GenericDraweeHierarchy_roundBottomEnd) {
z16 = obtainStyledAttributes.getBoolean(index, z16);
} else if (index == R.a.GenericDraweeHierarchy_roundWithOverlayColor) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
aVar.r.b(obtainStyledAttributes.getColor(index, 0));
} else {
if (index == R.a.GenericDraweeHierarchy_roundingBorderWidth) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
c.f.g.f.c cVar = aVar.r;
float dimensionPixelSize = (float) obtainStyledAttributes.getDimensionPixelSize(index, 0);
Objects.requireNonNull(cVar);
if (dimensionPixelSize >= 0.0f) {
i4 = i7;
z10 = true;
} else {
i4 = i7;
z10 = false;
}
l(z10, "the border width cannot be < 0");
cVar.e = dimensionPixelSize;
} else {
i4 = i7;
if (index == R.a.GenericDraweeHierarchy_roundingBorderColor) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
aVar.r.f = obtainStyledAttributes.getColor(index, 0);
} else if (index == R.a.GenericDraweeHierarchy_roundingBorderPadding) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
c.f.g.f.c cVar2 = aVar.r;
float dimensionPixelSize2 = (float) obtainStyledAttributes.getDimensionPixelSize(index, 0);
Objects.requireNonNull(cVar2);
l(dimensionPixelSize2 >= 0.0f, "the padding cannot be < 0");
cVar2.g = dimensionPixelSize2;
}
}
i7 = i4;
z18 = z9;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
}
i4 = i7;
i7 = i4;
z18 = z9;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
}
i4 = i7;
z8 = z17;
i7 = i4;
z18 = z9;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
z8 = z17;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
}
z8 = z17;
z9 = z18;
i4 = i7;
i7 = i4;
z18 = z9;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
i3 = indexCount;
z8 = z17;
z9 = z18;
i4 = i7;
i7 = i4;
z18 = z9;
i6++;
context2 = context;
z17 = z8;
i5 = 1;
indexCount = i3;
}
obtainStyledAttributes.recycle();
if (context.getResources().getConfiguration().getLayoutDirection() == 1) {
z7 = z11 && z13;
z6 = z14 && z12;
z3 = z15 && z17;
if (z18) {
}
z2 = false;
i2 = i7;
z4 = z7;
z5 = z6;
} else {
z7 = z11 && z12;
z6 = z14 && z13;
z3 = z15 && z16;
if (z18) {
}
z2 = false;
i2 = i7;
z4 = z7;
z5 = z6;
}
z2 = true;
i2 = i7;
z4 = z7;
z5 = z6;
} catch (Throwable th) {
obtainStyledAttributes.recycle();
context.getResources().getConfiguration().getLayoutDirection();
throw th;
}
} else {
z5 = true;
z4 = true;
z3 = true;
z2 = true;
i2 = 0;
i = 0;
}
if (aVar.l != null && i > 0) {
aVar.l = new c.f.g.e.c(aVar.l, i);
}
if (i2 > 0) {
if (aVar.r == null) {
aVar.r = new c.f.g.f.c();
}
c.f.g.f.c cVar3 = aVar.r;
float f = z4 ? (float) i2 : 0.0f;
float f2 = z5 ? (float) i2 : 0.0f;
float f3 = z3 ? (float) i2 : 0.0f;
float f4 = z2 ? (float) i2 : 0.0f;
if (cVar3.f409c == null) {
cVar3.f409c = new float[8];
}
float[] fArr = cVar3.f409c;
fArr[1] = f;
fArr[0] = f;
fArr[3] = f2;
fArr[2] = f2;
fArr[5] = f3;
fArr[4] = f3;
fArr[7] = f4;
fArr[6] = f4;
}
return aVar;
}
@RecentlyNonNull
public static Bundle P(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
Bundle readBundle = parcel.readBundle();
parcel.setDataPosition(dataPosition + p2);
return readBundle;
}
public static Pair<Integer, Integer> P0(InputStream inputStream) throws IOException {
D0(inputStream);
if (((byte) (inputStream.read() & 255)) != 47) {
return null;
}
int read = ((byte) inputStream.read()) & 255;
return new Pair<>(Integer.valueOf(((((byte) inputStream.read()) & 255) | ((read & 63) << 8)) + 1), Integer.valueOf(((((((byte) inputStream.read()) & 255) & 15) << 10) | ((((byte) inputStream.read()) & 255) << 2) | ((read & 192) >> 6)) + 1));
}
public static int P1(int i, int i2) {
if (i2 == 255) {
return i;
}
if (i2 == 0) {
return i & ViewCompat.MEASURED_SIZE_MASK;
}
int i3 = i2 + (i2 >> 7);
return (i & ViewCompat.MEASURED_SIZE_MASK) | ((((i >>> 24) * i3) >> 8) << 24);
}
@RecentlyNonNull
public static int P2(@RecentlyNonNull Parcel parcel) {
int readInt = parcel.readInt();
int p2 = p2(parcel, readInt);
int dataPosition = parcel.dataPosition();
if ((65535 & readInt) != 20293) {
String valueOf = String.valueOf(Integer.toHexString(readInt));
throw new SafeParcelReader$ParseException(valueOf.length() != 0 ? "Expected object header. Got 0x".concat(valueOf) : new String("Expected object header. Got 0x"), parcel);
}
int i = p2 + dataPosition;
if (i >= dataPosition && i <= parcel.dataSize()) {
return i;
}
StringBuilder sb = new StringBuilder(54);
sb.append("Size read is invalid start=");
sb.append(dataPosition);
sb.append(" end=");
sb.append(i);
throw new SafeParcelReader$ParseException(sb.toString(), parcel);
}
@RecentlyNonNull
public static byte[] Q(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
byte[] createByteArray = parcel.createByteArray();
parcel.setDataPosition(dataPosition + p2);
return createByteArray;
}
/* JADX WARNING: Code restructure failed: missing block: B:16:0x0041, code lost:
r12 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:17:0x0042, code lost:
if (r10 != null) goto L_0x0044;
*/
/* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost:
r10.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:20:0x0048, code lost:
r10 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:21:0x0049, code lost:
r11.addSuppressed(r10);
*/
/* JADX WARNING: Code restructure failed: missing block: B:22:0x004c, code lost:
throw r12;
*/
public static int Q0(SQLiteDatabase sQLiteDatabase, int i, String str) throws DatabaseIOException {
try {
if (!f0.I(sQLiteDatabase, "ExoPlayerVersions")) {
return -1;
}
Cursor query = sQLiteDatabase.query("ExoPlayerVersions", new String[]{"version"}, "feature = ? AND instance_uid = ?", new String[]{Integer.toString(i), str}, null, null, null);
if (query.getCount() == 0) {
query.close();
return -1;
}
query.moveToNext();
int i2 = query.getInt(0);
query.close();
return i2;
} catch (SQLException e) {
throw new DatabaseIOException(e);
}
}
public static final Integer Q1(JsonReader jsonReader) {
m.checkNotNullParameter(jsonReader, "$this$nextIntOrNull");
if (jsonReader.N() != JsonToken.NULL) {
return Integer.valueOf(jsonReader.z());
}
jsonReader.H();
return null;
}
public static boolean Q2(int i, c.i.a.c.i2.w wVar, boolean z2) throws ParserException {
if (wVar.a() < 7) {
if (z2) {
return false;
}
StringBuilder O = c.d.b.a.a.O("too short header: ");
O.append(wVar.a());
throw new ParserException(O.toString());
} else if (wVar.s() != i) {
if (z2) {
return false;
}
StringBuilder O2 = c.d.b.a.a.O("expected header type ");
O2.append(Integer.toHexString(i));
throw new ParserException(O2.toString());
} else if (wVar.s() == 118 && wVar.s() == 111 && wVar.s() == 114 && wVar.s() == 98 && wVar.s() == 105 && wVar.s() == 115) {
return true;
} else {
if (z2) {
return false;
}
throw new ParserException("expected characters 'vorbis'");
}
}
public static final MediaSource R(MediaType mediaType, String str, String str2) {
m.checkNotNullParameter(mediaType, "mediaType");
m.checkNotNullParameter(str, "progressiveMediaUri");
m.checkNotNullParameter(str2, "featureTag");
Uri parse = Uri.parse(str);
m.checkNotNullExpressionValue(parse, "Uri.parse(progressiveMediaUri)");
return new MediaSource(parse, str2, mediaType);
}
public static long R0(FileChannel fileChannel, ByteBuffer byteBuffer, long j) throws IOException {
f2(fileChannel, byteBuffer, 4, j);
return ((long) byteBuffer.getInt()) & 4294967295L;
}
@Nullable
public static <T> List<c.c.a.c0.a<T>> R1(c.c.a.a0.h0.c cVar, c.c.a.d dVar, g0<T> g0Var) throws IOException {
return q.a(cVar, dVar, 1.0f, g0Var);
}
public static void R2(File file, c.f.d.c.a aVar) {
aVar.b(file);
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
R2(file2, aVar);
} else {
aVar.a(file2);
}
}
}
aVar.c(file);
}
@RecentlyNonNull
public static <T extends Parcelable> T S(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull Parcelable.Creator<T> creator) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
T createFromParcel = creator.createFromParcel(parcel);
parcel.setDataPosition(dataPosition + p2);
return createFromParcel;
}
public static final boolean S0(Long l, long j) {
return l != null && (l.longValue() & j) == j;
}
public static c.c.a.y.k.a S1(c.c.a.a0.h0.c cVar, c.c.a.d dVar) throws IOException {
return new c.c.a.y.k.a(R1(cVar, dVar, c.c.a.a0.e.a));
}
public static void S2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull Bundle bundle, @RecentlyNonNull boolean z2) {
if (bundle != null) {
int a3 = a3(parcel, i);
parcel.writeBundle(bundle);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
@RecentlyNonNull
public static String T(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
String readString = parcel.readString();
parcel.setDataPosition(dataPosition + p2);
return readString;
}
public static boolean T0(byte[] bArr, byte[] bArr2, int i) {
Objects.requireNonNull(bArr);
Objects.requireNonNull(bArr2);
if (bArr2.length + i > bArr.length) {
return false;
}
for (int i2 = 0; i2 < bArr2.length; i2++) {
if (bArr[i + i2] != bArr2[i2]) {
return false;
}
}
return true;
}
public static b T1(c.c.a.a0.h0.c cVar, c.c.a.d dVar) throws IOException {
return U1(cVar, dVar, true);
}
public static void T2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull byte[] bArr, @RecentlyNonNull boolean z2) {
if (bArr != null) {
int a3 = a3(parcel, i);
parcel.writeByteArray(bArr);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
@RecentlyNonNull
public static String[] U(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
String[] createStringArray = parcel.createStringArray();
parcel.setDataPosition(dataPosition + p2);
return createStringArray;
}
public static final boolean U0(VoiceState voiceState) {
m.checkNotNullParameter(voiceState, "$this$hasVideo");
return voiceState.i() || voiceState.j();
}
public static b U1(c.c.a.a0.h0.c cVar, c.c.a.d dVar, boolean z2) throws IOException {
return new b(q.a(cVar, dVar, z2 ? g.c() : 1.0f, h.a));
}
public static void U2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull IBinder iBinder, @RecentlyNonNull boolean z2) {
if (iBinder != null) {
int a3 = a3(parcel, i);
parcel.writeStrongBinder(iBinder);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
@RecentlyNonNull
public static ArrayList<String> V(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
ArrayList<String> createStringArrayList = parcel.createStringArrayList();
parcel.setDataPosition(dataPosition + p2);
return createStringArrayList;
}
public static int V0(int i, int i2) {
return ((i + 31) * 31) + i2;
}
public static c.c.a.y.k.d V1(c.c.a.a0.h0.c cVar, c.c.a.d dVar) throws IOException {
return new c.c.a.y.k.d(R1(cVar, dVar, c.c.a.a0.n.a));
}
public static void V2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull Parcelable parcelable, @RecentlyNonNull int i2, @RecentlyNonNull boolean z2) {
if (parcelable != null) {
int a3 = a3(parcel, i);
parcelable.writeToParcel(parcel, i2);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
@RecentlyNonNull
public static <T> T[] W(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull Parcelable.Creator<T> creator) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
T[] tArr = (T[]) parcel.createTypedArray(creator);
parcel.setDataPosition(dataPosition + p2);
return tArr;
}
public static int W0(Object obj, Object obj2) {
int i = 0;
int hashCode = obj == null ? 0 : obj.hashCode();
if (obj2 != null) {
i = obj2.hashCode();
}
return V0(hashCode, i);
}
/* JADX WARNING: Removed duplicated region for block: B:58:0x01a5 */
/* JADX WARNING: Removed duplicated region for block: B:66:0x01bc A[SYNTHETIC] */
@Nullable
public static ArrayList<d.a> W1(c.i.a.c.i2.w wVar) {
int i;
ArrayList<d.a> arrayList;
ArrayList<d.a> arrayList2;
d.a aVar;
c.i.a.c.i2.w wVar2 = wVar;
if (wVar.s() != 0) {
return null;
}
wVar2.E(7);
int f = wVar.f();
if (f == 1684433976) {
c.i.a.c.i2.w wVar3 = new c.i.a.c.i2.w();
Inflater inflater = new Inflater(true);
try {
if (!f0.x(wVar2, wVar3, inflater)) {
return null;
}
inflater.end();
wVar2 = wVar3;
} finally {
inflater.end();
}
} else if (f != 1918990112) {
return null;
}
ArrayList<d.a> arrayList3 = new ArrayList<>();
int i2 = wVar2.b;
int i3 = wVar2.f920c;
while (i2 < i3) {
int f2 = wVar2.f() + i2;
if (f2 > i2 && f2 <= i3) {
if (wVar2.f() == 1835365224) {
int f3 = wVar2.f();
if (f3 <= 10000) {
float[] fArr = new float[f3];
for (int i4 = 0; i4 < f3; i4++) {
fArr[i4] = Float.intBitsToFloat(wVar2.f());
}
int f4 = wVar2.f();
if (f4 <= 32000) {
double log = Math.log(2.0d);
arrayList2 = arrayList3;
int ceil = (int) Math.ceil(Math.log(((double) f3) * 2.0d) / log);
c.i.a.c.i2.v vVar = new c.i.a.c.i2.v(wVar2.a);
vVar.k(wVar2.b * 8);
float[] fArr2 = new float[(f4 * 5)];
int i5 = 5;
int[] iArr = new int[5];
int i6 = 0;
int i7 = 0;
while (true) {
if (i6 >= f4) {
vVar.k((vVar.e() + 7) & -8);
int i8 = 32;
int g = vVar.g(32);
d.b[] bVarArr = new d.b[g];
int i9 = 0;
while (true) {
if (i9 >= g) {
i = i3;
aVar = new d.a(bVarArr);
break;
}
int g2 = vVar.g(8);
int g3 = vVar.g(8);
int g4 = vVar.g(i8);
if (g4 > 128000) {
break;
}
i = i3;
int ceil2 = (int) Math.ceil(Math.log(((double) f4) * 2.0d) / log);
float[] fArr3 = new float[(g4 * 3)];
float[] fArr4 = new float[(g4 * 2)];
int i10 = 0;
int i11 = 0;
while (i10 < g4) {
int g5 = vVar.g(ceil2);
int i12 = i11 + ((-(g5 & 1)) ^ (g5 >> 1));
if (i12 < 0 || i12 >= f4) {
break;
}
int i13 = i10 * 3;
int i14 = i12 * 5;
fArr3[i13] = fArr2[i14];
fArr3[i13 + 1] = fArr2[i14 + 1];
fArr3[i13 + 2] = fArr2[i14 + 2];
int i15 = i10 * 2;
fArr4[i15] = fArr2[i14 + 3];
fArr4[i15 + 1] = fArr2[i14 + 4];
i10++;
i11 = i12;
fArr4 = fArr4;
g = g;
vVar = vVar;
}
bVarArr[i9] = new d.b(g2, fArr3, fArr4, g3);
i9++;
i3 = i;
g = g;
i8 = 32;
}
} else {
int i16 = 0;
while (i16 < i5) {
int i17 = iArr[i16];
int g6 = vVar.g(ceil);
int i18 = i17 + ((-(g6 & 1)) ^ (g6 >> 1));
if (i18 >= f3 || i18 < 0) {
break;
}
fArr2[i7] = fArr[i18];
iArr[i16] = i18;
i16++;
i7++;
i5 = 5;
}
i6++;
i5 = 5;
}
}
i = i3;
aVar = null;
if (aVar == null) {
arrayList = arrayList2;
arrayList.add(aVar);
}
}
}
arrayList2 = arrayList3;
i = i3;
aVar = null;
if (aVar == null) {
}
} else {
arrayList = arrayList3;
i = i3;
}
wVar2.D(f2);
arrayList3 = arrayList;
i2 = f2;
i3 = i;
}
return null;
}
return arrayList3;
}
public static void W2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull String str, @RecentlyNonNull boolean z2) {
if (str != null) {
int a3 = a3(parcel, i);
parcel.writeString(str);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
@RecentlyNonNull
public static <T> ArrayList<T> X(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull Parcelable.Creator<T> creator) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
ArrayList<T> createTypedArrayList = parcel.createTypedArrayList(creator);
parcel.setDataPosition(dataPosition + p2);
return createTypedArrayList;
}
public static void X0(String str, String str2) {
Log.i(N0(str), str2);
}
public static f X1(c.c.a.a0.h0.c cVar, c.c.a.d dVar) throws IOException {
return new f(q.a(cVar, dVar, g.c(), c.c.a.a0.v.a));
}
public static void X2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull String[] strArr, @RecentlyNonNull boolean z2) {
if (strArr != null) {
int a3 = a3(parcel, i);
parcel.writeStringArray(strArr);
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
public static String Y(String str) {
return "." + str + ",." + str + " *";
}
public static int Y0(int i) {
int i2 = 0;
while (i > 0) {
i2++;
i >>>= 1;
}
return i2;
}
@Nullable
public static j Y1(byte[] bArr) {
c.i.a.c.i2.w wVar = new c.i.a.c.i2.w(bArr);
if (wVar.f920c < 32) {
return null;
}
wVar.D(0);
if (wVar.f() != wVar.a() + 4 || wVar.f() != 1886614376) {
return null;
}
int f = (wVar.f() >> 24) & 255;
if (f > 1) {
c.d.b.a.a.i0("Unsupported pssh version: ", f, "PsshAtomUtil");
return null;
}
UUID uuid = new UUID(wVar.m(), wVar.m());
if (f == 1) {
wVar.E(wVar.v() * 16);
}
int v = wVar.v();
if (v != wVar.a()) {
return null;
}
byte[] bArr2 = new byte[v];
System.arraycopy(wVar.a, wVar.b, bArr2, 0, v);
wVar.b += v;
return new j(uuid, f, bArr2);
}
public static <T extends Parcelable> void Y2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull T[] tArr, @RecentlyNonNull int i2, @RecentlyNonNull boolean z2) {
if (tArr != null) {
int a3 = a3(parcel, i);
int length = tArr.length;
parcel.writeInt(length);
for (T t : tArr) {
if (t == null) {
parcel.writeInt(0);
} else {
c3(parcel, t, i2);
}
}
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
public static void Z(String str, String str2, Object obj) {
Log.d(N0(str), String.format(str2, obj));
}
public static <T> DataSource<T> Z0(Throwable th) {
c.f.e.h hVar = new c.f.e.h();
Objects.requireNonNull(th);
hVar.k(th, null);
return hVar;
}
@Nullable
public static byte[] Z1(byte[] bArr, UUID uuid) {
j Y1 = Y1(bArr);
if (Y1 == null) {
return null;
}
if (uuid.equals(Y1.a)) {
return Y1.f707c;
}
Log.w("PsshAtomUtil", "UUID mismatch. Expected: " + uuid + ", got: " + Y1.a + ".");
return null;
}
public static <T extends Parcelable> void Z2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i, @RecentlyNonNull List<T> list, @RecentlyNonNull boolean z2) {
if (list != null) {
int a3 = a3(parcel, i);
int size = list.size();
parcel.writeInt(size);
for (int i2 = 0; i2 < size; i2++) {
T t = list.get(i2);
if (t == null) {
parcel.writeInt(0);
} else {
c3(parcel, t, 0);
}
}
f3(parcel, a3);
} else if (z2) {
d3(parcel, i, 0);
}
}
public static float a(float f) {
return f <= 0.04045f ? f / 12.92f : (float) Math.pow((double) ((f + 0.055f) / 1.055f), 2.4000000953674316d);
}
public static void a0(String str, String str2, Object... objArr) {
Log.d(N0(str), String.format(str2, objArr));
}
/* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARNING: Code restructure failed: missing block: B:98:0x01a2, code lost:
if (r0.equals("video/mp2t") == false) goto L_0x01bc;
*/
/* JADX WARNING: Removed duplicated region for block: B:102:0x01b1 */
/* JADX WARNING: Removed duplicated region for block: B:105:0x01bc */
/* JADX WARNING: Removed duplicated region for block: B:107:0x01c2 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:108:0x01c4 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:109:0x01c6 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:110:0x01c9 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:111:0x01cc A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:112:0x01ce A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:113:0x01d0 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:114:0x01d3 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:115:0x01d6 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:116:0x01d9 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:117:0x01db A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:118:0x01dd A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:119:0x01e0 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:120:0x01e3 A[ORIG_RETURN, RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:27:0x0072 */
/* JADX WARNING: Removed duplicated region for block: B:31:0x007b */
/* JADX WARNING: Removed duplicated region for block: B:34:0x0085 */
/* JADX WARNING: Removed duplicated region for block: B:37:0x0094 */
/* JADX WARNING: Removed duplicated region for block: B:40:0x00a2 */
/* JADX WARNING: Removed duplicated region for block: B:43:0x00ae */
/* JADX WARNING: Removed duplicated region for block: B:46:0x00ba */
/* JADX WARNING: Removed duplicated region for block: B:49:0x00c8 */
/* JADX WARNING: Removed duplicated region for block: B:52:0x00d6 */
/* JADX WARNING: Removed duplicated region for block: B:55:0x00e5 */
/* JADX WARNING: Removed duplicated region for block: B:58:0x00f1 */
/* JADX WARNING: Removed duplicated region for block: B:61:0x00ff */
/* JADX WARNING: Removed duplicated region for block: B:64:0x010d */
/* JADX WARNING: Removed duplicated region for block: B:67:0x011b */
/* JADX WARNING: Removed duplicated region for block: B:70:0x0129 */
/* JADX WARNING: Removed duplicated region for block: B:73:0x0137 */
/* JADX WARNING: Removed duplicated region for block: B:76:0x0146 */
/* JADX WARNING: Removed duplicated region for block: B:79:0x0154 */
/* JADX WARNING: Removed duplicated region for block: B:82:0x0162 */
/* JADX WARNING: Removed duplicated region for block: B:85:0x016e */
/* JADX WARNING: Removed duplicated region for block: B:88:0x0179 */
/* JADX WARNING: Removed duplicated region for block: B:91:0x0184 */
/* JADX WARNING: Removed duplicated region for block: B:94:0x018f */
/* JADX WARNING: Removed duplicated region for block: B:97:0x019b */
/* JADX WARNING: Removed duplicated region for block: B:99:0x01a5 */
public static int a1(Map<String, List<String>> map) {
char c2;
List<String> list = map.get("Content-Type");
String str = (list == null || list.isEmpty()) ? null : list.get(0);
if (str != null) {
ArrayList<s.a> arrayList = c.i.a.c.i2.s.a;
int hashCode = str.hashCode();
char c3 = 2;
if (hashCode != -1007807498) {
if (hashCode != -586683234) {
if (hashCode == 187090231 && str.equals("audio/mp3")) {
c2 = 2;
if (c2 != 0) {
str = "audio/flac";
} else if (c2 == 1) {
str = "audio/wav";
} else if (c2 == 2) {
str = "audio/mpeg";
}
switch (str.hashCode()) {
case -2123537834:
if (str.equals("audio/eac3-joc")) {
c3 = 0;
break;
}
c3 = 65535;
break;
case -1662384011:
if (str.equals("video/mp2p")) {
c3 = 1;
break;
}
c3 = 65535;
break;
case -1662384007:
break;
case -1662095187:
if (str.equals("video/webm")) {
c3 = 3;
break;
}
c3 = 65535;
break;
case -1606874997:
if (str.equals("audio/amr-wb")) {
c3 = 4;
break;
}
c3 = 65535;
break;
case -1487394660:
if (str.equals("image/jpeg")) {
c3 = 5;
break;
}
c3 = 65535;
break;
case -1248337486:
if (str.equals("application/mp4")) {
c3 = 6;
break;
}
c3 = 65535;
break;
case -1004728940:
if (str.equals("text/vtt")) {
c3 = 7;
break;
}
c3 = 65535;
break;
case -387023398:
if (str.equals("audio/x-matroska")) {
c3 = '\b';
break;
}
c3 = 65535;
break;
case -43467528:
if (str.equals("application/webm")) {
c3 = '\t';
break;
}
c3 = 65535;
break;
case 13915911:
if (str.equals("video/x-flv")) {
c3 = '\n';
break;
}
c3 = 65535;
break;
case 187078296:
if (str.equals("audio/ac3")) {
c3 = 11;
break;
}
c3 = 65535;
break;
case 187078297:
if (str.equals("audio/ac4")) {
c3 = '\f';
break;
}
c3 = 65535;
break;
case 187078669:
if (str.equals("audio/amr")) {
c3 = '\r';
break;
}
c3 = 65535;
break;
case 187090232:
if (str.equals("audio/mp4")) {
c3 = 14;
break;
}
c3 = 65535;
break;
case 187091926:
if (str.equals("audio/ogg")) {
c3 = 15;
break;
}
c3 = 65535;
break;
case 187099443:
if (str.equals("audio/wav")) {
c3 = 16;
break;
}
c3 = 65535;
break;
case 1331848029:
if (str.equals("video/mp4")) {
c3 = 17;
break;
}
c3 = 65535;
break;
case 1503095341:
if (str.equals("audio/3gpp")) {
c3 = 18;
break;
}
c3 = 65535;
break;
case 1504578661:
if (str.equals("audio/eac3")) {
c3 = 19;
break;
}
c3 = 65535;
break;
case 1504619009:
if (str.equals("audio/flac")) {
c3 = 20;
break;
}
c3 = 65535;
break;
case 1504831518:
if (str.equals("audio/mpeg")) {
c3 = 21;
break;
}
c3 = 65535;
break;
case 1505118770:
if (str.equals("audio/webm")) {
c3 = 22;
break;
}
c3 = 65535;
break;
case 2039520277:
if (str.equals("video/x-matroska")) {
c3 = 23;
break;
}
c3 = 65535;
break;
default:
c3 = 65535;
break;
}
switch (c3) {
case 0:
case 11:
case 19:
return 0;
case 1:
return 10;
case 2:
return 11;
case 3:
case '\b':
case '\t':
case 22:
case 23:
return 6;
case 4:
case '\r':
case 18:
return 3;
case 5:
return 14;
case 6:
case 14:
case 17:
return 8;
case 7:
return 13;
case '\n':
return 5;
case '\f':
return 1;
case 15:
return 9;
case 16:
return 12;
case 20:
return 4;
case 21:
return 7;
}
}
} else if (str.equals("audio/x-wav")) {
c2 = 1;
if (c2 != 0) {
}
switch (str.hashCode()) {
case -2123537834:
break;
case -1662384011:
break;
case -1662384007:
break;
case -1662095187:
break;
case -1606874997:
break;
case -1487394660:
break;
case -1248337486:
break;
case -1004728940:
break;
case -387023398:
break;
case -43467528:
break;
case 13915911:
break;
case 187078296:
break;
case 187078297:
break;
case 187078669:
break;
case 187090232:
break;
case 187091926:
break;
case 187099443:
break;
case 1331848029:
break;
case 1503095341:
break;
case 1504578661:
break;
case 1504619009:
break;
case 1504831518:
break;
case 1505118770:
break;
case 2039520277:
break;
}
switch (c3) {
}
}
} else if (str.equals("audio/x-flac")) {
c2 = 0;
if (c2 != 0) {
}
switch (str.hashCode()) {
case -2123537834:
break;
case -1662384011:
break;
case -1662384007:
break;
case -1662095187:
break;
case -1606874997:
break;
case -1487394660:
break;
case -1248337486:
break;
case -1004728940:
break;
case -387023398:
break;
case -43467528:
break;
case 13915911:
break;
case 187078296:
break;
case 187078297:
break;
case 187078669:
break;
case 187090232:
break;
case 187091926:
break;
case 187099443:
break;
case 1331848029:
break;
case 1503095341:
break;
case 1504578661:
break;
case 1504619009:
break;
case 1504831518:
break;
case 1505118770:
break;
case 2039520277:
break;
}
switch (c3) {
}
}
c2 = 65535;
if (c2 != 0) {
}
switch (str.hashCode()) {
case -2123537834:
break;
case -1662384011:
break;
case -1662384007:
break;
case -1662095187:
break;
case -1606874997:
break;
case -1487394660:
break;
case -1248337486:
break;
case -1004728940:
break;
case -387023398:
break;
case -43467528:
break;
case 13915911:
break;
case 187078296:
break;
case 187078297:
break;
case 187078669:
break;
case 187090232:
break;
case 187091926:
break;
case 187099443:
break;
case 1331848029:
break;
case 1503095341:
break;
case 1504578661:
break;
case 1504619009:
break;
case 1504831518:
break;
case 1505118770:
break;
case 2039520277:
break;
}
switch (c3) {
}
}
return -1;
}
@Nullable
public static c.i.a.c.a2.k0.c a2(c.i.a.c.a2.i iVar) throws IOException {
byte[] bArr;
Objects.requireNonNull(iVar);
c.i.a.c.i2.w wVar = new c.i.a.c.i2.w(16);
if (c.i.a.c.a2.k0.d.a(iVar, wVar).a != 1380533830) {
return null;
}
iVar.n(wVar.a, 0, 4);
wVar.D(0);
int f = wVar.f();
if (f != 1463899717) {
Log.e("WavHeaderReader", "Unsupported RIFF format: " + f);
return null;
}
c.i.a.c.a2.k0.d a2 = c.i.a.c.a2.k0.d.a(iVar, wVar);
while (a2.a != 1718449184) {
iVar.g((int) a2.b);
a2 = c.i.a.c.a2.k0.d.a(iVar, wVar);
}
D(a2.b >= 16);
iVar.n(wVar.a, 0, 16);
wVar.D(0);
int l = wVar.l();
int l2 = wVar.l();
int k = wVar.k();
int k2 = wVar.k();
int l3 = wVar.l();
int l4 = wVar.l();
int i = ((int) a2.b) - 16;
if (i > 0) {
byte[] bArr2 = new byte[i];
iVar.n(bArr2, 0, i);
bArr = bArr2;
} else {
bArr = f0.f;
}
return new c.i.a.c.a2.k0.c(l, l2, k, k2, l3, l4, bArr);
}
public static int a3(Parcel parcel, int i) {
parcel.writeInt(i | SupportMenu.CATEGORY_MASK);
parcel.writeInt(0);
return parcel.dataPosition();
}
public static float b(float f) {
return f <= 0.0031308f ? f * 12.92f : (float) ((Math.pow((double) f, 0.4166666567325592d) * 1.0549999475479126d) - 0.054999999701976776d);
}
public static boolean b0(File file) {
File[] listFiles;
if (file.isDirectory() && (listFiles = file.listFiles()) != null) {
for (File file2 : listFiles) {
b0(file2);
}
}
return file.delete();
}
public static int b1(Uri uri) {
String lastPathSegment = uri.getLastPathSegment();
if (lastPathSegment == null) {
return -1;
}
if (lastPathSegment.endsWith(".ac3") || lastPathSegment.endsWith(".ec3")) {
return 0;
}
if (lastPathSegment.endsWith(".ac4")) {
return 1;
}
if (lastPathSegment.endsWith(".adts") || lastPathSegment.endsWith(".aac")) {
return 2;
}
if (lastPathSegment.endsWith(".amr")) {
return 3;
}
if (lastPathSegment.endsWith(".flac")) {
return 4;
}
if (lastPathSegment.endsWith(".flv")) {
return 5;
}
if (lastPathSegment.startsWith(".mk", lastPathSegment.length() - 4) || lastPathSegment.endsWith(".webm")) {
return 6;
}
if (lastPathSegment.endsWith(".mp3")) {
return 7;
}
if (lastPathSegment.endsWith(".mp4") || lastPathSegment.startsWith(".m4", lastPathSegment.length() - 4) || lastPathSegment.startsWith(".mp4", lastPathSegment.length() - 5) || lastPathSegment.startsWith(".cmf", lastPathSegment.length() - 5)) {
return 8;
}
if (lastPathSegment.startsWith(".og", lastPathSegment.length() - 4) || lastPathSegment.endsWith(".opus")) {
return 9;
}
if (lastPathSegment.endsWith(".ps") || lastPathSegment.endsWith(".mpeg") || lastPathSegment.endsWith(".mpg") || lastPathSegment.endsWith(".m2p")) {
return 10;
}
if (lastPathSegment.endsWith(".ts") || lastPathSegment.startsWith(".ts", lastPathSegment.length() - 4)) {
return 11;
}
if (lastPathSegment.endsWith(".wav") || lastPathSegment.endsWith(".wave")) {
return 12;
}
if (lastPathSegment.endsWith(".vtt") || lastPathSegment.endsWith(".webvtt")) {
return 13;
}
return (lastPathSegment.endsWith(".jpg") || lastPathSegment.endsWith(".jpeg")) ? 14 : -1;
}
@Nullable
public static Metadata b2(c.i.a.c.a2.i iVar, boolean z2) throws IOException {
c.i.a.c.c2.k.a aVar;
if (z2) {
aVar = null;
} else {
int i = c.i.a.c.c2.k.b.a;
aVar = c.i.a.c.c2.k.a.a;
}
c.i.a.c.i2.w wVar = new c.i.a.c.i2.w(10);
Metadata metadata = null;
int i2 = 0;
while (true) {
try {
iVar.n(wVar.a, 0, 10);
wVar.D(0);
if (wVar.u() != 4801587) {
break;
}
wVar.E(3);
int r = wVar.r();
int i3 = r + 10;
if (metadata == null) {
byte[] bArr = new byte[i3];
System.arraycopy(wVar.a, 0, bArr, 0, 10);
iVar.n(bArr, 10, r);
metadata = new c.i.a.c.c2.k.b(aVar).d(bArr, i3);
} else {
iVar.g(r);
}
i2 += i3;
} catch (EOFException unused) {
}
}
iVar.k();
iVar.g(i2);
if (metadata == null || metadata.i.length == 0) {
return null;
}
return metadata;
}
public static void b3(Parcel parcel, int i, int i2) {
int p2 = p2(parcel, i);
if (p2 != i2) {
String hexString = Integer.toHexString(p2);
StringBuilder sb = new StringBuilder(String.valueOf(hexString).length() + 46);
sb.append("Expected size ");
sb.append(i2);
sb.append(" got ");
sb.append(p2);
sb.append(" (0x");
sb.append(hexString);
sb.append(")");
throw new SafeParcelReader$ParseException(sb.toString(), parcel);
}
}
public static void c(Spannable spannable, Object obj, int i, int i2, int i3) {
Object[] spans = spannable.getSpans(i, i2, obj.getClass());
for (Object obj2 : spans) {
if (spannable.getSpanStart(obj2) == i && spannable.getSpanEnd(obj2) == i2 && spannable.getSpanFlags(obj2) == i3) {
spannable.removeSpan(obj2);
}
}
spannable.setSpan(obj, i, i2, i3);
}
/* JADX WARNING: Removed duplicated region for block: B:38:0x009c */
/* JADX WARNING: Removed duplicated region for block: B:44:0x00b2 */
/* JADX WARNING: Removed duplicated region for block: B:51:0x00dd */
/* JADX WARNING: Removed duplicated region for block: B:52:0x00e0 */
/* JADX WARNING: Removed duplicated region for block: B:55:0x00ea */
public static int c0(c.f.j.d.f fVar, c.f.j.d.e eVar, c.f.j.j.e eVar2, int i) {
float f;
int max;
float f2;
int i2;
int i3;
int i4;
int i5 = 1;
if (!c.f.j.j.e.r(eVar2)) {
return 1;
}
j(Boolean.valueOf(c.f.j.j.e.r(eVar2)));
if (eVar != null && eVar.b > 0 && eVar.a > 0) {
eVar2.w();
if (eVar2.n != 0) {
eVar2.w();
if (eVar2.o != 0) {
boolean z2 = false;
if (!fVar.c()) {
i2 = 0;
} else {
eVar2.w();
i2 = eVar2.l;
j(Boolean.valueOf(i2 == 0 || i2 == 90 || i2 == 180 || i2 == 270));
}
if (i2 == 90 || i2 == 270) {
z2 = true;
}
if (z2) {
eVar2.w();
i3 = eVar2.o;
} else {
eVar2.w();
i3 = eVar2.n;
}
if (z2) {
eVar2.w();
i4 = eVar2.n;
} else {
eVar2.w();
i4 = eVar2.o;
}
f = Math.max(((float) eVar.a) / ((float) i3), ((float) eVar.b) / ((float) i4));
int i6 = c.f.d.e.a.a;
eVar2.w();
int i7 = 2;
if (eVar2.k != c.f.i.b.a) {
if (f <= 0.6666667f) {
i5 = 2;
while (true) {
int i8 = i5 * 2;
double d = 1.0d / ((double) i8);
if ((d * 0.3333333432674408d) + d <= ((double) f)) {
break;
}
i5 = i8;
}
}
} else if (f <= 0.6666667f) {
while (true) {
double d2 = (double) i7;
if (((1.0d / (Math.pow(d2, 2.0d) - d2)) * 0.3333333432674408d) + (1.0d / d2) <= ((double) f)) {
break;
}
i7++;
}
i5 = i7 - 1;
}
eVar2.w();
int i9 = eVar2.o;
eVar2.w();
max = Math.max(i9, eVar2.n);
f2 = eVar == null ? eVar.f437c : (float) i;
while (((float) (max / i5)) > f2) {
eVar2.w();
i5 = eVar2.k == c.f.i.b.a ? i5 * 2 : i5 + 1;
}
return i5;
}
}
}
f = 1.0f;
eVar2.w();
int i7 = 2;
if (eVar2.k != c.f.i.b.a) {
}
eVar2.w();
int i9 = eVar2.o;
eVar2.w();
max = Math.max(i9, eVar2.n);
if (eVar == null) {
}
while (((float) (max / i5)) > f2) {
}
return i5;
}
public static void c1(String str) {
throw new IllegalArgumentException(c.d.b.a.a.u("Unknown library: ", str));
}
public static int c2(c.i.a.c.a2.i iVar, byte[] bArr, int i, int i2) throws IOException {
int i3 = 0;
while (i3 < i2) {
int i4 = iVar.i(bArr, i + i3, i2 - i3);
if (i4 == -1) {
break;
}
i3 += i4;
}
return i3;
}
public static <T extends Parcelable> void c3(Parcel parcel, T t, int i) {
int dataPosition = parcel.dataPosition();
parcel.writeInt(1);
int dataPosition2 = parcel.dataPosition();
t.writeToParcel(parcel, i);
int dataPosition3 = parcel.dataPosition();
parcel.setDataPosition(dataPosition);
parcel.writeInt(dataPosition3 - dataPosition2);
parcel.setDataPosition(dataPosition3);
}
public static void d(int i, String str, int i2) {
int glCreateShader = GLES20.glCreateShader(i);
GLES20.glShaderSource(glCreateShader, str);
GLES20.glCompileShader(glCreateShader);
int[] iArr = {0};
GLES20.glGetShaderiv(glCreateShader, 35713, iArr, 0);
if (iArr[0] != 1) {
Log.e("GlUtil", GLES20.glGetShaderInfoLog(glCreateShader) + ", source: " + str);
}
GLES20.glAttachShader(i2, glCreateShader);
GLES20.glDeleteShader(glCreateShader);
r();
}
public static void d0(File file) throws IOException {
if (file.isDirectory()) {
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File file2 : listFiles) {
d0(file2);
}
} else {
return;
}
}
if (!file.delete() && file.exists()) {
throw new IOException("could not delete: " + file);
}
}
public static final boolean d1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isAnnouncementChannel");
return channel.A() == 5;
}
public static boolean d2(e0 e0Var, c.g.a.c.j jVar, Type type) {
if (!jVar.B(e0Var.a(type)._class)) {
return false;
}
ParameterizedType K1 = K1(type);
if (K1 == null || !Objects.equals(jVar._class, K1.getRawType())) {
return true;
}
Type[] actualTypeArguments = K1.getActualTypeArguments();
c.g.a.c.h0.m j = jVar.j();
if (j.j() != actualTypeArguments.length) {
return false;
}
for (int i = 0; i < j.j(); i++) {
if (!d2(e0Var, j.f(i), actualTypeArguments[i])) {
return false;
}
}
return true;
}
public static void d3(Parcel parcel, int i, int i2) {
if (i2 >= 65535) {
parcel.writeInt(i | SupportMenu.CATEGORY_MASK);
parcel.writeInt(i2);
return;
}
parcel.writeInt(i | (i2 << 16));
}
public static int e(int i, int i2, int i3) {
return Math.min(Math.max(0, i3 - i), i2);
}
public static void e0(String str, String str2, Throwable th) {
Log.e(N0(str), str2, th);
}
public static final boolean e1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isArchivedThread");
ThreadMetadata y2 = channel.y();
return y2 != null && y2.b();
}
public static int e2(InputStream inputStream, byte[] bArr, int i, int i2) throws IOException {
if (i2 >= 0) {
int i3 = 0;
while (i3 < i2) {
int read = inputStream.read(bArr, i + i3, i2 - i3);
if (read == -1) {
break;
}
i3 += read;
}
return i3;
}
throw new IndexOutOfBoundsException("len is negative");
}
public static void e3(Parcel parcel, int i, int i2) {
if (i != i2) {
String hexString = Integer.toHexString(i);
StringBuilder sb = new StringBuilder(String.valueOf(hexString).length() + 46);
sb.append("Expected size ");
sb.append(i2);
sb.append(" got ");
sb.append(i);
sb.append(" (0x");
sb.append(hexString);
sb.append(")");
throw new SafeParcelReader$ParseException(sb.toString(), parcel);
}
}
public static byte[] f(String str) {
try {
return str.getBytes("ASCII");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("ASCII not found!", e);
}
}
public static void f0() {
if (f0.a >= 18) {
Trace.endSection();
}
}
public static final boolean f1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isCategory");
return channel.A() == 4;
}
public static void f2(FileChannel fileChannel, ByteBuffer byteBuffer, int i, long j) throws IOException {
int read;
byteBuffer.position(0);
byteBuffer.limit(i);
while (byteBuffer.remaining() > 0 && (read = fileChannel.read(byteBuffer, j)) != -1) {
j += (long) read;
}
if (byteBuffer.remaining() <= 0) {
byteBuffer.position(0);
return;
}
throw new c.f.m.h("ELF file truncated");
}
public static void f3(Parcel parcel, int i) {
int dataPosition = parcel.dataPosition();
parcel.setDataPosition(i - 4);
parcel.writeInt(dataPosition - i);
parcel.setDataPosition(dataPosition);
}
public static void g(String str) {
if (f0.a >= 18) {
Trace.beginSection(str);
}
}
public static synchronized void g0() {
synchronized (AnimatableValueParser.class) {
if (!a) {
c.f.m.n.a.c("native-imagetranscoder");
a = true;
}
}
}
public static final boolean g1(int i) {
return i == 0 || i == 5 || i == 10 || i == 11 || i == 12 || i == 14;
}
public static int g2(InputStream inputStream) throws IOException {
return ((((byte) (inputStream.read() & 255)) << 16) & ItemTouchHelper.ACTION_MODE_DRAG_MASK) | ((((byte) (inputStream.read() & 255)) << 8) & 65280) | (((byte) (inputStream.read() & 255)) & 255);
}
public static List<byte[]> h(byte[] bArr) {
ArrayList arrayList = new ArrayList(3);
arrayList.add(bArr);
arrayList.add(i((((long) (((bArr[11] & 255) << 8) | (bArr[10] & 255))) * 1000000000) / 48000));
arrayList.add(i(80000000));
return arrayList;
}
public static void h0(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
if (parcel.dataPosition() != i) {
throw new SafeParcelReader$ParseException(c.d.b.a.a.f(37, "Overread allowed size end=", i), parcel);
}
}
public static final boolean h1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isDM");
return channel.A() == 1;
}
@RecentlyNonNull
public static boolean h2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
b3(parcel, i, 4);
return parcel.readInt() != 0;
}
public static byte[] i(long j) {
return ByteBuffer.allocate(8).order(ByteOrder.nativeOrder()).putLong(j).array();
}
public static boolean i0(Object obj, Object obj2) {
return obj == obj2 || (obj != null && obj.equals(obj2));
}
public static final boolean i1(Channel channel, Presence presence) {
m.checkNotNullParameter(channel, "$this$isDMStatusVisible");
com.discord.models.user.User v0 = v0(channel);
return h1(channel) && !A1(channel) && (v0 != null ? UserUtils.INSTANCE.isStatusVisible(v0, presence, true) : false);
}
@RecentlyNonNull
public static IBinder i2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
int p2 = p2(parcel, i);
int dataPosition = parcel.dataPosition();
if (p2 == 0) {
return null;
}
IBinder readStrongBinder = parcel.readStrongBinder();
parcel.setDataPosition(dataPosition + p2);
return readStrongBinder;
}
public static void j(Boolean bool) {
if (bool != null && !bool.booleanValue()) {
throw new IllegalArgumentException();
}
}
@RecentlyNonNull
public static boolean j0(@Nullable Object obj, @Nullable Object obj2) {
if (obj != obj2) {
return obj != null && obj.equals(obj2);
}
return true;
}
public static final boolean j1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isDirectory");
return channel.A() == 14;
}
@RecentlyNonNull
public static int j2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
b3(parcel, i, 4);
return parcel.readInt();
}
@Pure
public static void k(boolean z2) {
if (!z2) {
throw new IllegalArgumentException();
}
}
public static int k0(float f, int i, int i2) {
if (i == i2) {
return i;
}
float f2 = ((float) ((i >> 24) & 255)) / 255.0f;
float a2 = a(((float) ((i >> 16) & 255)) / 255.0f);
float a3 = a(((float) ((i >> 8) & 255)) / 255.0f);
float a4 = a(((float) (i & 255)) / 255.0f);
float a5 = a(((float) ((i2 >> 16) & 255)) / 255.0f);
float a6 = a(((float) ((i2 >> 8) & 255)) / 255.0f);
float a7 = a(((float) (i2 & 255)) / 255.0f);
float a8 = c.d.b.a.a.a(((float) ((i2 >> 24) & 255)) / 255.0f, f2, f, f2);
float a9 = c.d.b.a.a.a(a5, a2, f, a2);
float a10 = c.d.b.a.a.a(a6, a3, f, a3);
float a11 = c.d.b.a.a.a(a7, a4, f, a4);
int round = Math.round(b(a9) * 255.0f) << 16;
return Math.round(b(a11) * 255.0f) | round | (Math.round(a8 * 255.0f) << 24) | (Math.round(b(a10) * 255.0f) << 8);
}
public static boolean k1(XmlPullParser xmlPullParser, String str) throws XmlPullParserException {
return (xmlPullParser.getEventType() == 3) && xmlPullParser.getName().equals(str);
}
@RecentlyNonNull
public static long k2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
b3(parcel, i, 8);
return parcel.readLong();
}
public static void l(boolean z2, Object obj) {
if (!z2) {
throw new IllegalArgumentException(String.valueOf(obj));
}
}
public static String[] l0(FileChannel fileChannel) throws IOException {
long j;
long j2;
long j3;
long j4;
long j5;
long j6;
long j7;
long j8;
long j9;
long j10;
long j11;
long j12;
long j13;
long j14;
int i = 8;
ByteBuffer allocate = ByteBuffer.allocate(8);
allocate.order(ByteOrder.LITTLE_ENDIAN);
if (R0(fileChannel, allocate, 0) == 1179403647) {
f2(fileChannel, allocate, 1, 4);
boolean z2 = ((short) (allocate.get() & 255)) == 1;
f2(fileChannel, allocate, 1, 5);
if (((short) (allocate.get() & 255)) == 2) {
allocate.order(ByteOrder.BIG_ENDIAN);
}
if (z2) {
j = R0(fileChannel, allocate, 28);
} else {
f2(fileChannel, allocate, 8, 32);
j = allocate.getLong();
}
if (z2) {
f2(fileChannel, allocate, 2, 44);
j2 = (long) (allocate.getShort() & 65535);
} else {
f2(fileChannel, allocate, 2, 56);
j2 = (long) (allocate.getShort() & 65535);
}
f2(fileChannel, allocate, 2, z2 ? 42 : 54);
int i2 = allocate.getShort() & 65535;
if (j2 == 65535) {
if (z2) {
j14 = R0(fileChannel, allocate, 32);
} else {
f2(fileChannel, allocate, 8, 40);
j14 = allocate.getLong();
}
j2 = z2 ? R0(fileChannel, allocate, j14 + 28) : R0(fileChannel, allocate, j14 + 44);
}
long j15 = j;
long j16 = 0;
while (true) {
if (j16 >= j2) {
j3 = 0;
break;
}
if ((z2 ? R0(fileChannel, allocate, j15 + 0) : R0(fileChannel, allocate, j15 + 0)) != 2) {
j15 += (long) i2;
j16++;
} else if (z2) {
j3 = R0(fileChannel, allocate, j15 + 4);
} else {
f2(fileChannel, allocate, 8, j15 + 8);
j3 = allocate.getLong();
}
}
long j17 = 0;
if (j3 != 0) {
long j18 = j3;
long j19 = 0;
int i3 = 0;
while (true) {
long j20 = j18 + j17;
if (z2) {
j4 = R0(fileChannel, allocate, j20);
} else {
f2(fileChannel, allocate, i, j20);
j4 = allocate.getLong();
}
if (j4 == 1) {
j5 = j3;
if (i3 != Integer.MAX_VALUE) {
i3++;
} else {
throw new c.f.m.h("malformed DT_NEEDED section");
}
} else {
j5 = j3;
if (j4 == 5) {
if (z2) {
j13 = R0(fileChannel, allocate, j18 + 4);
} else {
f2(fileChannel, allocate, 8, j18 + 8);
j13 = allocate.getLong();
}
j19 = j13;
}
}
long j21 = 16;
j18 += z2 ? 8 : 16;
long j22 = 0;
if (j4 != 0) {
j17 = 0;
j3 = j5;
i = 8;
} else if (j19 != 0) {
int i4 = 0;
while (true) {
if (((long) i4) >= j2) {
j6 = 0;
break;
}
if ((z2 ? R0(fileChannel, allocate, j + j22) : R0(fileChannel, allocate, j + j22)) == 1) {
if (z2) {
j10 = R0(fileChannel, allocate, j + 8);
} else {
f2(fileChannel, allocate, 8, j + j21);
j10 = allocate.getLong();
}
if (z2) {
j9 = j2;
j11 = R0(fileChannel, allocate, j + 20);
} else {
j9 = j2;
f2(fileChannel, allocate, 8, j + 40);
j11 = allocate.getLong();
}
if (j10 <= j19 && j19 < j11 + j10) {
if (z2) {
j12 = R0(fileChannel, allocate, j + 4);
} else {
f2(fileChannel, allocate, 8, j + 8);
j12 = allocate.getLong();
}
j6 = j12 + (j19 - j10);
}
} else {
j9 = j2;
}
j += (long) i2;
i4++;
j2 = j9;
j21 = 16;
j22 = 0;
}
long j23 = 0;
if (j6 != 0) {
String[] strArr = new String[i3];
int i5 = 0;
while (true) {
long j24 = j5 + j23;
if (z2) {
j7 = R0(fileChannel, allocate, j24);
} else {
f2(fileChannel, allocate, 8, j24);
j7 = allocate.getLong();
}
if (j7 == 1) {
if (z2) {
j8 = R0(fileChannel, allocate, j5 + 4);
} else {
f2(fileChannel, allocate, 8, j5 + 8);
j8 = allocate.getLong();
}
long j25 = j8 + j6;
StringBuilder sb = new StringBuilder();
while (true) {
long j26 = j25 + 1;
f2(fileChannel, allocate, 1, j25);
short s2 = (short) (allocate.get() & 255);
if (s2 == 0) {
break;
}
sb.append((char) s2);
j25 = j26;
}
strArr[i5] = sb.toString();
if (i5 != Integer.MAX_VALUE) {
i5++;
} else {
throw new c.f.m.h("malformed DT_NEEDED section");
}
}
j5 += z2 ? 8 : 16;
if (j7 != 0) {
j23 = 0;
} else if (i5 == i3) {
return strArr;
} else {
throw new c.f.m.h("malformed DT_NEEDED section");
}
}
} else {
throw new c.f.m.h("did not find file offset of DT_STRTAB table");
}
} else {
throw new c.f.m.h("Dynamic section string-table not found");
}
}
} else {
throw new c.f.m.h("ELF file does not contain dynamic linking information");
}
} else {
throw new c.f.m.h("file is not ELF");
}
}
public static final boolean l1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isGroup");
return channel.A() == 3;
}
public static int l2(c.i.a.c.i2.w wVar) {
int i = 0;
while (wVar.a() != 0) {
int s2 = wVar.s();
i += s2;
if (s2 != 255) {
return i;
}
}
return -1;
}
public static void m(@RecentlyNonNull boolean z2) {
if (!z2) {
throw new IllegalArgumentException();
}
}
public static String m0(String str, Object... objArr) {
int indexOf;
String valueOf = String.valueOf(str);
StringBuilder sb = new StringBuilder((objArr.length * 16) + valueOf.length());
int i = 0;
int i2 = 0;
while (i < objArr.length && (indexOf = valueOf.indexOf("%s", i2)) != -1) {
sb.append(valueOf.substring(i2, indexOf));
sb.append(objArr[i]);
i2 = indexOf + 2;
i++;
}
sb.append(valueOf.substring(i2));
if (i < objArr.length) {
sb.append(" [");
sb.append(objArr[i]);
for (int i3 = i + 1; i3 < objArr.length; i3++) {
sb.append(", ");
sb.append(objArr[i3]);
}
sb.append(']');
}
return sb.toString();
}
public static final boolean m1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isGuildTextyChannel");
return g1(channel.A());
}
public static int m2(InputStream inputStream, int i, boolean z2) throws IOException {
int i2;
int i3 = 0;
for (int i4 = 0; i4 < i; i4++) {
int read = inputStream.read();
if (read != -1) {
if (z2) {
i2 = (read & 255) << (i4 * 8);
} else {
i3 <<= 8;
i2 = read & 255;
}
i3 |= i2;
} else {
throw new IOException("no more bytes");
}
}
return i3;
}
@Pure
public static void n(boolean z2, Object obj) {
if (!z2) {
throw new IllegalArgumentException(String.valueOf(obj));
}
}
@NonNull
public static ApiException n0(@NonNull Status status) {
return status.q != null ? new ResolvableApiException(status) : new ApiException(status);
}
public static final boolean n1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isGuildVocalChannel");
return channel.A() == 2 || channel.A() == 13;
}
public static long n2(c.i.a.c.i2.w wVar, int i, int i2) {
wVar.D(i);
if (wVar.a() < 5) {
return -9223372036854775807L;
}
int f = wVar.f();
if ((8388608 & f) != 0 || ((2096896 & f) >> 8) != i2) {
return -9223372036854775807L;
}
if (((f & 32) != 0) && wVar.s() >= 7 && wVar.a() >= 7) {
if ((wVar.s() & 16) == 16) {
byte[] bArr = new byte[6];
System.arraycopy(wVar.a, wVar.b, bArr, 0, 6);
wVar.b += 6;
return ((((long) bArr[0]) & 255) << 25) | ((((long) bArr[1]) & 255) << 17) | ((((long) bArr[2]) & 255) << 9) | ((((long) bArr[3]) & 255) << 1) | ((((long) bArr[4]) & 255) >> 7);
}
}
return -9223372036854775807L;
}
public static void o(@RecentlyNonNull boolean z2, @RecentlyNonNull String str, @RecentlyNonNull Object... objArr) {
if (!z2) {
throw new IllegalArgumentException(String.format(str, objArr));
}
}
/* JADX WARNING: Code restructure failed: missing block: B:19:0x0051, code lost:
r1 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:21:?, code lost:
r0.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:22:0x0056, code lost:
r0 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:23:0x0057, code lost:
r3.addSuppressed(r0);
*/
/* JADX WARNING: Code restructure failed: missing block: B:24:0x005a, code lost:
throw r1;
*/
public static void o0(File file) throws IOException {
if (file.isDirectory()) {
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File file2 : listFiles) {
o0(file2);
}
return;
}
throw new IOException("cannot list directory " + file);
} else if (!file.getPath().endsWith("_lock")) {
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r");
randomAccessFile.getFD().sync();
randomAccessFile.close();
}
}
public static boolean o1(int i, int i2, c.f.j.d.e eVar) {
return eVar == null ? ((float) q0(i)) >= 2048.0f && q0(i2) >= 2048 : q0(i) >= eVar.a && q0(i2) >= eVar.b;
}
public static o.a o2(c.i.a.c.i2.w wVar) {
wVar.E(1);
int u = wVar.u();
long j = ((long) wVar.b) + ((long) u);
int i = u / 18;
long[] jArr = new long[i];
long[] jArr2 = new long[i];
int i2 = 0;
while (true) {
if (i2 >= i) {
break;
}
long m = wVar.m();
if (m == -1) {
jArr = Arrays.copyOf(jArr, i2);
jArr2 = Arrays.copyOf(jArr2, i2);
break;
}
jArr[i2] = m;
jArr2[i2] = wVar.m();
wVar.E(2);
i2++;
}
wVar.E((int) (j - ((long) wVar.b)));
return new o.a(jArr, jArr2);
}
public static void p(@RecentlyNonNull boolean z2, @RecentlyNonNull Object obj) {
if (!z2) {
throw new IllegalArgumentException(String.valueOf(obj));
}
}
public static int p0(InputStream inputStream) throws IOException {
return ((((byte) inputStream.read()) << 8) & 65280) | (((byte) inputStream.read()) & 255);
}
public static boolean p1(c.f.j.j.e eVar, c.f.j.d.e eVar2) {
if (eVar == null) {
return false;
}
eVar.w();
int i = eVar.l;
if (i == 90 || i == 270) {
eVar.w();
int i2 = eVar.o;
eVar.w();
return o1(i2, eVar.n, eVar2);
}
eVar.w();
int i3 = eVar.n;
eVar.w();
return o1(i3, eVar.o, eVar2);
}
@RecentlyNonNull
public static int p2(@RecentlyNonNull Parcel parcel, @RecentlyNonNull int i) {
return (i & SupportMenu.CATEGORY_MASK) != -65536 ? (i >> 16) & 65535 : parcel.readInt();
}
public static void q(int i, int i2, int i3, int i4, int i5) {
boolean z2 = true;
j(Boolean.valueOf(i4 >= 0));
j(Boolean.valueOf(i >= 0));
j(Boolean.valueOf(i3 >= 0));
j(Boolean.valueOf(i + i4 <= i5));
if (i3 + i4 > i2) {
z2 = false;
}
j(Boolean.valueOf(z2));
}
public static int q0(int i) {
return (int) (((float) i) * 1.3333334f);
}
public static final boolean q1(Context context) {
m.checkNotNullParameter(context, "$this$isLtr");
return TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == 0;
}
public static y q2(c.i.a.c.i2.w wVar, boolean z2, boolean z3) throws ParserException {
if (z2) {
Q2(3, wVar, false);
}
String p = wVar.p((int) wVar.j());
long j = wVar.j();
String[] strArr = new String[((int) j)];
int length = p.length() + 11 + 4;
for (int i = 0; ((long) i) < j; i++) {
strArr[i] = wVar.p((int) wVar.j());
length = length + 4 + strArr[i].length();
}
if (!z3 || (wVar.s() & 1) != 0) {
return new y(p, strArr, length + 1);
}
throw new ParserException("framing bit expected to be set");
}
public static void r() {
while (true) {
int glGetError = GLES20.glGetError();
if (glGetError != 0) {
StringBuilder O = c.d.b.a.a.O("glError ");
O.append(GLU.gluErrorString(glGetError));
Log.e("GlUtil", O.toString());
} else {
return;
}
}
}
public static p r0(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof p) {
return (p) drawable;
}
if (drawable instanceof c.f.g.e.d) {
return r0(((c.f.g.e.d) drawable).l());
}
if (drawable instanceof c.f.g.e.b) {
c.f.g.e.b bVar = (c.f.g.e.b) drawable;
int length = bVar.k.length;
for (int i = 0; i < length; i++) {
p r0 = r0(bVar.a(i));
if (r0 != null) {
return r0;
}
}
}
return null;
}
public static final boolean r1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isManaged");
return channel.b() != 0;
}
public static void r2(File file, File file2) throws FileUtils$RenameException {
Objects.requireNonNull(file);
file2.delete();
if (!file.renameTo(file2)) {
Throwable th = null;
if (file2.exists()) {
th = new FileUtils$FileDeleteException(file2.getAbsolutePath());
} else if (!file.getParentFile().exists()) {
th = new FileUtils$ParentDirNotFoundException(file.getAbsolutePath());
} else if (!file.exists()) {
th = new FileNotFoundException(file.getAbsolutePath());
}
StringBuilder O = c.d.b.a.a.O("Unknown error renaming ");
O.append(file.getAbsolutePath());
O.append(" to ");
O.append(file2.getAbsolutePath());
throw new FileUtils$RenameException(O.toString(), th);
}
}
public static void s(@RecentlyNonNull Handler handler) {
Looper myLooper = Looper.myLooper();
if (myLooper != handler.getLooper()) {
String name = myLooper != null ? myLooper.getThread().getName() : "null current looper";
String name2 = handler.getLooper().getThread().getName();
StringBuilder N = c.d.b.a.a.N(c.d.b.a.a.b(name, c.d.b.a.a.b(name2, 36)), "Must be called on ", name2, " thread, but got ", name);
N.append(".");
throw new IllegalStateException(N.toString());
}
}
public static Object s0(Object obj) {
return new a(obj.getClass(), Array.getLength(obj), obj);
}
public static final boolean s1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isMultiUserDM");
return channel.A() == 3;
}
public static final RenderContext s2(Function1<? super RenderContext, Unit> function1, Object... objArr) {
m.checkNotNullParameter(function1, "init");
m.checkNotNullParameter(objArr, "orderedArguments");
RenderContext renderContext = new RenderContext();
function1.invoke(renderContext);
if (!(objArr.length == 0)) {
if (!(!renderContext.a.isEmpty())) {
renderContext.f2095c = k.toList(objArr);
} else {
throw new IllegalArgumentException("must provide named arguments OR formatArgs, not both.");
}
}
return renderContext;
}
@Pure
public static int t(int i, int i2, int i3) {
if (i >= i2 && i < i3) {
return i;
}
throw new IndexOutOfBoundsException();
}
@Nullable
public static String t0(XmlPullParser xmlPullParser, String str) {
int attributeCount = xmlPullParser.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
if (xmlPullParser.getAttributeName(i).equals(str)) {
return xmlPullParser.getAttributeValue(i);
}
}
return null;
}
public static final boolean t1(VoiceState voiceState) {
m.checkNotNullParameter(voiceState, "$this$isMutedByAnySource");
return voiceState.h() || voiceState.e() || voiceState.l();
}
public static /* synthetic */ void t2(AppPermissionsRequests appPermissionsRequests, Function0 function0, Function0 function02, int i, Object obj) {
int i2 = i & 1;
appPermissionsRequests.requestMicrophone(null, function02);
}
public static void u(@RecentlyNonNull String str) {
if (!(Looper.getMainLooper() == Looper.myLooper())) {
throw new IllegalStateException(str);
}
}
public static int u0(int i) {
if (i == 3) {
return BaseTransientBottomBar.ANIMATION_FADE_DURATION;
}
if (i != 6) {
return i != 8 ? 0 : 270;
}
return 90;
}
public static final boolean u1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isPrivate");
return channel.A() == 1 || channel.A() == 3;
}
@Nullable
public static c.i.a.c.e2.s.f u2(@Nullable c.i.a.c.e2.s.f fVar, @Nullable String[] strArr, Map<String, c.i.a.c.e2.s.f> map) {
int i = 0;
if (fVar == null) {
if (strArr == null) {
return null;
}
if (strArr.length == 1) {
return map.get(strArr[0]);
}
if (strArr.length > 1) {
c.i.a.c.e2.s.f fVar2 = new c.i.a.c.e2.s.f();
int length = strArr.length;
while (i < length) {
fVar2.a(map.get(strArr[i]));
i++;
}
return fVar2;
}
} else if (strArr != null && strArr.length == 1) {
fVar.a(map.get(strArr[0]));
return fVar;
} else if (strArr != null && strArr.length > 1) {
int length2 = strArr.length;
while (i < length2) {
fVar.a(map.get(strArr[i]));
i++;
}
}
return fVar;
}
@RecentlyNonNull
public static String v(@RecentlyNonNull String str, @RecentlyNonNull Object obj) {
if (!TextUtils.isEmpty(str)) {
return str;
}
throw new IllegalArgumentException(String.valueOf(obj));
}
public static final com.discord.models.user.User v0(Channel channel) {
List<User> w;
List<User> w2;
User user;
m.checkNotNullParameter(channel, "$this$getDMRecipient");
if (!h1(channel) || (w = channel.w()) == null || w.size() != 1 || (w2 = channel.w()) == null || (user = (User) u.first((List<? extends Object>) w2)) == null) {
return null;
}
return new CoreUser(user);
}
public static final boolean v1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isPrivateThread");
return channel.A() == 12;
}
public static float v2(int i, float f, int i2, int i3) {
float f2;
if (f == -3.4028235E38f) {
return -3.4028235E38f;
}
if (i == 0) {
f2 = (float) i3;
} else if (i == 1) {
f2 = (float) i2;
} else if (i != 2) {
return -3.4028235E38f;
} else {
return f;
}
return f * f2;
}
@RecentlyNonNull
public static String w(@RecentlyNonNull String str) {
if (!TextUtils.isEmpty(str)) {
return str;
}
throw new IllegalArgumentException("Given String is empty or null");
}
public static Object w0(c.g.a.c.j jVar) {
Class<?> cls = jVar._class;
Class<?> v = c.g.a.c.i0.d.v(cls);
if (v != null) {
if (v == Integer.TYPE) {
return 0;
}
if (v == Long.TYPE) {
return 0L;
}
if (v == Boolean.TYPE) {
return Boolean.FALSE;
}
if (v == Double.TYPE) {
return Double.valueOf((double) ShadowDrawableWrapper.COS_45);
}
if (v == Float.TYPE) {
return Float.valueOf(0.0f);
}
if (v == Byte.TYPE) {
return (byte) 0;
}
if (v == Short.TYPE) {
return (short) 0;
}
if (v == Character.TYPE) {
return (char) 0;
}
throw new IllegalArgumentException(c.d.b.a.a.j(v, c.d.b.a.a.O("Class "), " is not a primitive type"));
} else if (jVar.v() || jVar.b()) {
return p.a.NON_EMPTY;
} else {
if (cls == String.class) {
return "";
}
if (jVar.B(Date.class)) {
return new Date(0);
}
if (!jVar.B(Calendar.class)) {
return null;
}
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTimeInMillis(0);
return gregorianCalendar;
}
}
public static final boolean w1(StageInstance stageInstance) {
m.checkNotNullParameter(stageInstance, "$this$isPublic");
return stageInstance.e() == StageInstancePrivacyLevel.PUBLIC;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARNING: Unknown variable types count: 1 */
public static <TInput, TResult, TException extends Throwable> TResult w2(int i, TInput tinput, c.i.a.b.i.b<TInput, TResult, TException> bVar, c.i.a.b.j.s.a<TInput, TResult> aVar) throws Throwable {
TResult tresult;
if (i < 1) {
return (TResult) bVar.a(tinput);
}
do {
tresult = (TResult) bVar.a(tinput);
TInput tinput2 = tinput;
TResult tresult2 = tresult;
URL url = tresult2.b;
if (url != null) {
Z("CctTransportBackend", "Following redirect to: %s", url);
tinput = new d.a(tresult2.b, tinput2.b, tinput2.f601c);
} else {
tinput = null;
}
if (tinput == null) {
break;
}
i--;
} while (i >= 1);
return tresult;
}
public static void x(@RecentlyNonNull String str) {
if (Looper.getMainLooper() == Looper.myLooper()) {
throw new IllegalStateException(str);
}
}
public static final Integer x0(Channel channel) {
m.checkNotNullParameter(channel, "$this$getDeletedMessage");
if (f1(channel)) {
return Integer.valueOf((int) com.discord.R.string.category_has_been_deleted);
}
if (C1(channel)) {
return Integer.valueOf((int) com.discord.R.string.thread_has_been_deleted);
}
if (u1(channel)) {
return null;
}
return Integer.valueOf((int) com.discord.R.string.channel_has_been_deleted);
}
public static final boolean x1(VoiceState voiceState) {
m.checkNotNullParameter(voiceState, "$this$isRemoveSignal");
return voiceState.a() == null;
}
public static String x2(CacheKey cacheKey) throws UnsupportedEncodingException {
byte[] bytes = cacheKey.b().getBytes(Constants.ENCODING);
try {
MessageDigest instance = MessageDigest.getInstance(Constants.SHA1);
instance.update(bytes, 0, bytes.length);
return Base64.encodeToString(instance.digest(), 11);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
public static <T> T y(T t, Object obj) {
if (t != null) {
return t;
}
throw new NullPointerException(String.valueOf(obj));
}
public static final String y0(Channel channel) {
String str;
m.checkNotNullParameter(channel, "$this$getDisplayName");
if (u1(channel)) {
String m = channel.m();
if (m == null || m.length() == 0) {
List<User> w = channel.w();
str = w != null ? u.joinToString$default(w, null, null, null, 0, null, ChannelUtils$getDisplayName$1.INSTANCE, 31, null) : null;
if (str == null) {
return "";
}
return str;
}
}
str = channel.m();
if (str == null) {
return "";
}
return str;
}
public static final boolean y1(Channel channel) {
m.checkNotNullParameter(channel, "$this$isStageVoiceChannel");
return channel.A() == 13;
}
public static void y2(Drawable drawable, Drawable.Callback callback, c.f.g.e.e0 e0Var) {
if (drawable != null) {
drawable.setCallback(callback);
if (drawable instanceof d0) {
((d0) drawable).b(e0Var);
}
}
}
@NonNull
@EnsuresNonNull({"#1"})
public static <T> T z(@RecentlyNonNull T t, @RecentlyNonNull Object obj) {
if (t != null) {
return t;
}
throw new NullPointerException(String.valueOf(obj));
}
public static final String z0(Channel channel, Context context, boolean z2) {
m.checkNotNullParameter(channel, "$this$getDisplayNameOrDefault");
m.checkNotNullParameter(context, "context");
String y0 = y0(channel);
m.checkNotNullParameter(channel, "$this$isGuildTextChannel");
boolean z3 = true;
if ((channel.A() == 0) || d1(channel)) {
if (y0.length() != 0) {
z3 = false;
}
if (z3) {
String string = context.getString(com.discord.R.string.invalid_text_channel);
m.checkNotNullExpressionValue(string, "context.getString(R.string.invalid_text_channel)");
return string;
} else if (z2) {
StringBuilder sb = new StringBuilder();
m.checkNotNullParameter(Channel.Companion, "$this$DISPLAY_PREFIX_GUILD");
sb.append("#");
sb.append(y0);
return sb.toString();
}
} else if (n1(channel)) {
if (y0.length() != 0) {
z3 = false;
}
if (z3) {
String string2 = context.getString(com.discord.R.string.invalid_voice_channel);
m.checkNotNullExpressionValue(string2, "context.getString(R.string.invalid_voice_channel)");
return string2;
}
} else if (l1(channel)) {
if (y0.length() != 0) {
z3 = false;
}
if (z3) {
String string3 = context.getString(com.discord.R.string.unnamed);
m.checkNotNullExpressionValue(string3, "context.getString(R.string.unnamed)");
return string3;
}
} else if (h1(channel)) {
if (y0.length() != 0) {
z3 = false;
}
if (z3) {
String string4 = context.getString(com.discord.R.string.direct_message);
m.checkNotNullExpressionValue(string4, "context.getString(R.string.direct_message)");
return string4;
} else if (z2) {
StringBuilder sb2 = new StringBuilder();
m.checkNotNullParameter(Channel.Companion, "$this$DISPLAY_PREFIX_DM");
sb2.append("@");
sb2.append(y0);
return sb2.toString();
}
}
return y0;
}
public static boolean z1(XmlPullParser xmlPullParser, String str) throws XmlPullParserException {
return (xmlPullParser.getEventType() == 2) && xmlPullParser.getName().equals(str);
}
public static void z2(MediaFormat mediaFormat, List<byte[]> list) {
for (int i = 0; i < list.size(); i++) {
mediaFormat.setByteBuffer(c.d.b.a.a.l("csd-", i), ByteBuffer.wrap(list.get(i)));
}
}
}