- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
108 lines
4.0 KiB
Java
108 lines
4.0 KiB
Java
package com.applovin.impl;
|
|
|
|
import com.applovin.impl.eb;
|
|
import com.applovin.impl.mf;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.C;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
|
|
import java.io.StringReader;
|
|
import org.xmlpull.v1.XmlPullParser;
|
|
import org.xmlpull.v1.XmlPullParserException;
|
|
import org.xmlpull.v1.XmlPullParserFactory;
|
|
|
|
/* loaded from: classes.dex */
|
|
abstract class hs {
|
|
private static final String[] a = {"Camera:MotionPhoto", "GCamera:MotionPhoto", "Camera:MicroVideo", "GCamera:MicroVideo"};
|
|
private static final String[] b = {"Camera:MotionPhotoPresentationTimestampUs", "GCamera:MotionPhotoPresentationTimestampUs", "Camera:MicroVideoPresentationTimestampUs", "GCamera:MicroVideoPresentationTimestampUs"};
|
|
private static final String[] c = {"Camera:MicroVideoOffset", "GCamera:MicroVideoOffset"};
|
|
|
|
private static mf b(String str) {
|
|
XmlPullParser newPullParser = XmlPullParserFactory.newInstance().newPullParser();
|
|
newPullParser.setInput(new StringReader(str));
|
|
newPullParser.next();
|
|
if (!gs.c(newPullParser, "x:xmpmeta")) {
|
|
throw dh.a("Couldn't find xmp metadata", null);
|
|
}
|
|
eb h = eb.h();
|
|
long j = C.TIME_UNSET;
|
|
do {
|
|
newPullParser.next();
|
|
if (gs.c(newPullParser, "rdf:Description")) {
|
|
if (!b(newPullParser)) {
|
|
return null;
|
|
}
|
|
j = c(newPullParser);
|
|
h = a(newPullParser);
|
|
} else if (gs.c(newPullParser, "Container:Directory")) {
|
|
h = a(newPullParser, "Container", "Item");
|
|
} else if (gs.c(newPullParser, "GContainer:Directory")) {
|
|
h = a(newPullParser, "GContainer", "GContainerItem");
|
|
}
|
|
} while (!gs.b(newPullParser, "x:xmpmeta"));
|
|
if (h.isEmpty()) {
|
|
return null;
|
|
}
|
|
return new mf(j, h);
|
|
}
|
|
|
|
private static long c(XmlPullParser xmlPullParser) {
|
|
for (String str : b) {
|
|
String a2 = gs.a(xmlPullParser, str);
|
|
if (a2 != null) {
|
|
long parseLong = Long.parseLong(a2);
|
|
return parseLong == -1 ? C.TIME_UNSET : parseLong;
|
|
}
|
|
}
|
|
return C.TIME_UNSET;
|
|
}
|
|
|
|
private static boolean b(XmlPullParser xmlPullParser) {
|
|
for (String str : a) {
|
|
String a2 = gs.a(xmlPullParser, str);
|
|
if (a2 != null) {
|
|
return Integer.parseInt(a2) == 1;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static mf a(String str) {
|
|
try {
|
|
return b(str);
|
|
} catch (dh | NumberFormatException | XmlPullParserException unused) {
|
|
pc.d("MotionPhotoXmpParser", "Ignoring unexpected XMP metadata");
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private static eb a(XmlPullParser xmlPullParser) {
|
|
for (String str : c) {
|
|
String a2 = gs.a(xmlPullParser, str);
|
|
if (a2 != null) {
|
|
return eb.a(new mf.a("image/jpeg", "Primary", 0L, 0L), new mf.a(MimeTypes.VIDEO_MP4, "MotionPhoto", Long.parseLong(a2), 0L));
|
|
}
|
|
}
|
|
return eb.h();
|
|
}
|
|
|
|
private static eb a(XmlPullParser xmlPullParser, String str, String str2) {
|
|
eb.a f = eb.f();
|
|
String str3 = str + ":Item";
|
|
String str4 = str + ":Directory";
|
|
do {
|
|
xmlPullParser.next();
|
|
if (gs.c(xmlPullParser, str3)) {
|
|
String a2 = gs.a(xmlPullParser, str2 + ":Mime");
|
|
String a3 = gs.a(xmlPullParser, str2 + ":Semantic");
|
|
String a4 = gs.a(xmlPullParser, str2 + ":Length");
|
|
String a5 = gs.a(xmlPullParser, str2 + ":Padding");
|
|
if (a2 != null && a3 != null) {
|
|
f.b(new mf.a(a2, a3, a4 != null ? Long.parseLong(a4) : 0L, a5 != null ? Long.parseLong(a5) : 0L));
|
|
} else {
|
|
return eb.h();
|
|
}
|
|
}
|
|
} while (!gs.b(xmlPullParser, str4));
|
|
return f.a();
|
|
}
|
|
}
|