discord-jadx/app/src/main/java/c/i/a/c/a2/h0/h.java

111 lines
5.7 KiB
Java

package c.i.a.c.a2.h0;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import c.d.b.a.a;
import c.i.a.c.i2.w;
import com.google.android.exoplayer2.metadata.id3.ApicFrame;
import com.google.android.exoplayer2.metadata.id3.CommentFrame;
import com.google.android.exoplayer2.metadata.id3.Id3Frame;
import com.google.android.exoplayer2.metadata.id3.TextInformationFrame;
/* compiled from: MetadataUtil */
public final class h {
@VisibleForTesting
public static final String[] a = {"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk-Rock", "National Folk", "Swing", "Fast Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", "Indie", "BritPop", "Afro-Punk", "Polsk Punk", "Beat", "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover", "Contemporary Christian", "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "Jpop", "Synthpop", "Abstract", "Art Rock", "Baroque", "Bhangra", "Big beat", "Breakbeat", "Chillout", "Downtempo", "Dub", "EBM", "Eclectic", "Electro", "Electroclash", "Emo", "Experimental", "Garage", "Global", "IDM", "Illbient", "Industro-Goth", "Jam Band", "Krautrock", "Leftfield", "Lounge", "Math Rock", "New Romantic", "Nu-Breakz", "Post-Punk", "Post-Rock", "Psytrance", "Shoegaze", "Space Rock", "Trop Rock", "World Music", "Neoclassical", "Audiobook", "Audio theatre", "Neue Deutsche Welle", "Podcast", "Indie-Rock", "G-Funk", "Dubstep", "Garage Rock", "Psybient"};
@Nullable
public static CommentFrame a(int i, w wVar) {
int f = wVar.f();
if (wVar.f() == 1684108385) {
wVar.E(8);
String o = wVar.o(f - 16);
return new CommentFrame("und", o, o);
}
StringBuilder L = a.L("Failed to parse comment attribute: ");
L.append(d.a(i));
Log.w("MetadataUtil", L.toString());
return null;
}
@Nullable
public static ApicFrame b(w wVar) {
int f = wVar.f();
if (wVar.f() == 1684108385) {
int f2 = wVar.f() & 16777215;
String str = f2 == 13 ? "image/jpeg" : f2 == 14 ? "image/png" : null;
if (str == null) {
a.f0("Unrecognized cover art flags: ", f2, "MetadataUtil");
return null;
}
wVar.E(4);
int i = f - 16;
byte[] bArr = new byte[i];
System.arraycopy(wVar.a, wVar.b, bArr, 0, i);
wVar.b += i;
return new ApicFrame(str, null, 3, bArr);
}
Log.w("MetadataUtil", "Failed to parse cover art attribute");
return null;
}
@Nullable
public static TextInformationFrame c(int i, String str, w wVar) {
int f = wVar.f();
if (wVar.f() == 1684108385 && f >= 22) {
wVar.E(10);
int x2 = wVar.x();
if (x2 > 0) {
String l = a.l("", x2);
int x3 = wVar.x();
if (x3 > 0) {
l = l + "/" + x3;
}
return new TextInformationFrame(str, null, l);
}
}
StringBuilder L = a.L("Failed to parse index/count attribute: ");
L.append(d.a(i));
Log.w("MetadataUtil", L.toString());
return null;
}
@Nullable
public static TextInformationFrame d(int i, String str, w wVar) {
int f = wVar.f();
if (wVar.f() == 1684108385) {
wVar.E(8);
return new TextInformationFrame(str, null, wVar.o(f - 16));
}
StringBuilder L = a.L("Failed to parse text attribute: ");
L.append(d.a(i));
Log.w("MetadataUtil", L.toString());
return null;
}
@Nullable
public static Id3Frame e(int i, String str, w wVar, boolean z2, boolean z3) {
int f = f(wVar);
if (z3) {
f = Math.min(1, f);
}
if (f >= 0) {
return z2 ? new TextInformationFrame(str, null, Integer.toString(f)) : new CommentFrame("und", str, Integer.toString(f));
}
StringBuilder L = a.L("Failed to parse uint8 attribute: ");
L.append(d.a(i));
Log.w("MetadataUtil", L.toString());
return null;
}
public static int f(w wVar) {
wVar.E(4);
if (wVar.f() == 1684108385) {
wVar.E(8);
return wVar.s();
}
Log.w("MetadataUtil", "Failed to parse uint8 attribute value");
return -1;
}
}