FlixOlé v4.4.0版本的 MD5 值为:50e7f767ca3e8715936523e9ef089581
以下内容为反编译后的 k0.java 源代码,内容仅作参考
package i.d.a.b.m4;
import android.media.DeniedByServerException;
import android.media.MediaCrypto;
import android.media.MediaCryptoException;
import android.media.MediaDrm;
import android.media.MediaDrmException;
import android.media.NotProvisionedException;
import android.media.UnsupportedSchemeException;
import android.media.metrics.LogSessionId;
import android.text.TextUtils;
import com.google.common.base.Charsets;
import i.d.a.b.j4.t1;
import i.d.a.b.k2;
import i.d.a.b.m4.i0;
import i.d.a.b.m4.v;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public final class k0 implements i0 {
public static final i0.c d = new i0.c() {
@Override
public final i0 a(UUID uuid) {
return k0.A(uuid);
}
};
public final UUID a;
public final MediaDrm b;
public int c;
public static class a {
public static boolean a(MediaDrm mediaDrm, String str) {
return mediaDrm.requiresSecureDecoder(str);
}
public static void b(MediaDrm mediaDrm, byte[] bArr, t1 t1Var) {
LogSessionId a = t1Var.a();
if (a.equals(LogSessionId.LOG_SESSION_ID_NONE)) {
return;
}
MediaDrm.PlaybackComponent playbackComponent = mediaDrm.getPlaybackComponent(bArr);
i.d.a.b.x4.e.e(playbackComponent);
playbackComponent.setLogSessionId(a);
}
}
public k0(UUID uuid) throws UnsupportedSchemeException {
i.d.a.b.x4.e.e(uuid);
i.d.a.b.x4.e.b(!k2.b.equals(uuid), "Use C.CLEARKEY_UUID instead");
this.a = uuid;
MediaDrm mediaDrm = new MediaDrm(t(uuid));
this.b = mediaDrm;
this.c = 1;
if (k2.d.equals(uuid) && B()) {
v(mediaDrm);
}
}
public static i0 A(UUID uuid) {
try {
return C(uuid);
} catch (r0 unused) {
i.d.a.b.x4.u.c("FrameworkMediaDrm", "Failed to instantiate a FrameworkMediaDrm for uuid: " + uuid + ".");
return new f0();
}
}
public static boolean B() {
return "ASUS_Z00AD".equals(i.d.a.b.x4.p0.d);
}
public static k0 C(UUID uuid) throws r0 {
try {
return new k0(uuid);
} catch (UnsupportedSchemeException e) {
throw new r0(1, e);
} catch (Exception e2) {
throw new r0(2, e2);
}
}
public static byte[] o(byte[] bArr) {
int indexOf;
i.d.a.b.x4.c0 c0Var = new i.d.a.b.x4.c0(bArr);
int r = c0Var.r();
short s = c0Var.s();
short s2 = c0Var.s();
if (s != 1 || s2 != 1) {
i.d.a.b.x4.u.f("FrameworkMediaDrm", "Unexpected record count or type. Skipping LA_URL workaround.");
return bArr;
}
short s3 = c0Var.s();
Charset charset = Charsets.UTF_16LE;
String z = c0Var.z(s3, charset);
if (z.contains("<LA_URL>")) {
return bArr;
}
if (z.indexOf("</DATA>") == -1) {
i.d.a.b.x4.u.i("FrameworkMediaDrm", "Could not find the </DATA> tag. Skipping LA_URL workaround.");
}
String str = z.substring(0, indexOf) + "<LA_URL>https://x</LA_URL>" + z.substring(indexOf);
int i2 = r + 52;
ByteBuffer allocate = ByteBuffer.allocate(i2);
allocate.order(ByteOrder.LITTLE_ENDIAN);
allocate.putInt(i2);
allocate.putShort(s);
allocate.putShort(s2);
allocate.putShort((short) (str.length() * 2));
allocate.put(str.getBytes(charset));
return allocate.array();
}
public static String p(String str) {
return "<LA_URL>https://x</LA_URL>".equals(str) ? "" : (i.d.a.b.x4.p0.a == 33 && "https://default.url".equals(str)) ? "" : str;
}
public static byte[] q(UUID uuid, byte[] bArr) {
return k2.c.equals(uuid) ? r.a(bArr) : bArr;
}
public static byte[] r(UUID uuid, byte[] bArr) {
UUID uuid2 = k2.e;
if (uuid2.equals(uuid)) {
byte[] e = i.d.a.b.o4.v.h.e(bArr, uuid);
if (e != null) {
bArr = e;
}
bArr = i.d.a.b.o4.v.h.a(uuid2, o(bArr));
}
if (i.d.a.b.x4.p0.a >= 23 || !k2.d.equals(uuid)) {
if (uuid2.equals(uuid) && "Amazon".equals(i.d.a.b.x4.p0.c)) {
String str = i.d.a.b.x4.p0.d;
if (!"AFTB".equals(str)) {
if (!"AFTS".equals(str)) {
if (!"AFTM".equals(str)) {
}
}
}
}
}
byte[] e2 = i.d.a.b.o4.v.h.e(bArr, uuid);
return e2 != null ? e2 : bArr;
}
public static String s(UUID uuid, String str) {
return (i.d.a.b.x4.p0.a < 26 && k2.c.equals(uuid) && (i.f.a.h.b.e.a.a.equals(str) || "audio/mp4".equals(str))) ? "cenc" : str;
}
public static UUID t(UUID uuid) {
return (i.d.a.b.x4.p0.a >= 27 || !k2.c.equals(uuid)) ? uuid : k2.b;
}
public static void v(MediaDrm mediaDrm) {
mediaDrm.setPropertyString("securityLevel", "L3");
}
public static v.b x(UUID uuid, List<v.b> list) {
boolean z;
if (k2.d.equals(uuid)) {
if (i.d.a.b.x4.p0.a >= 28 && list.size() > 1) {
v.b bVar = list.get(0);
int i2 = 0;
for (int i3 = 0; i3 < list.size(); i3++) {
v.b bVar2 = list.get(i3);
byte[] bArr = bVar2.r;
i.d.a.b.x4.e.e(bArr);
byte[] bArr2 = bArr;
if (!i.d.a.b.x4.p0.b(bVar2.f4512q, bVar.f4512q) || !i.d.a.b.x4.p0.b(bVar2.f4511p, bVar.f4511p) || !i.d.a.b.o4.v.h.c(bArr2)) {
z = false;
break;
}
i2 += bArr2.length;
}
z = true;
if (z) {
byte[] bArr3 = new byte[i2];
int i4 = 0;
for (int i5 = 0; i5 < list.size(); i5++) {
byte[] bArr4 = list.get(i5).r;
i.d.a.b.x4.e.e(bArr4);
byte[] bArr5 = bArr4;
int length = bArr5.length;
System.arraycopy(bArr5, 0, bArr3, i4, length);
i4 += length;
}
return bVar.b(bArr3);
}
}
for (int i6 = 0; i6 < list.size(); i6++) {
v.b bVar3 = list.get(i6);
byte[] bArr6 = bVar3.r;
i.d.a.b.x4.e.e(bArr6);
int g2 = i.d.a.b.o4.v.h.g(bArr6);
int i7 = i.d.a.b.x4.p0.a;
if (i7 < 23 && g2 == 0) {
return bVar3;
}
if (i7 >= 23 && g2 == 1) {
return bVar3;
}
}
}
return list.get(0);
}
public void z(i0.b bVar, MediaDrm mediaDrm, byte[] bArr, int i2, int i3, byte[] bArr2) {
bVar.a(this, bArr, i2, i3, bArr2);
}
@Override
public synchronized void a() {
int i2 = this.c - 1;
this.c = i2;
if (i2 == 0) {
this.b.release();
}
}
@Override
public Map<String, String> b(byte[] bArr) {
return this.b.queryKeyStatus(bArr);
}
@Override
public void c(byte[] bArr, t1 t1Var) {
if (i.d.a.b.x4.p0.a >= 31) {
try {
a.b(this.b, bArr, t1Var);
} catch (UnsupportedOperationException unused) {
i.d.a.b.x4.u.i("FrameworkMediaDrm", "setLogSessionId failed.");
}
}
}
@Override
public i0.d d() {
MediaDrm.ProvisionRequest provisionRequest = this.b.getProvisionRequest();
return new i0.d(provisionRequest.getData(), provisionRequest.getDefaultUrl());
}
@Override
public byte[] f() throws MediaDrmException {
return this.b.openSession();
}
@Override
public boolean g(byte[] bArr, String str) {
if (i.d.a.b.x4.p0.a >= 31) {
return a.a(this.b, str);
}
try {
MediaCrypto mediaCrypto = new MediaCrypto(this.a, bArr);
try {
return mediaCrypto.requiresSecureDecoderComponent(str);
} finally {
mediaCrypto.release();
}
} catch (MediaCryptoException unused) {
return true;
}
}
@Override
public void h(byte[] bArr, byte[] bArr2) {
this.b.restoreKeys(bArr, bArr2);
}
@Override
public void i(byte[] bArr) {
this.b.closeSession(bArr);
}
@Override
public void j(final i0.b bVar) {
this.b.setOnEventListener(bVar == null ? null : new MediaDrm.OnEventListener() {
@Override
public final void onEvent(MediaDrm mediaDrm, byte[] bArr, int i2, int i3, byte[] bArr2) {
k0.this.z(bVar, mediaDrm, bArr, i2, i3, bArr2);
}
});
}
@Override
public byte[] k(byte[] bArr, byte[] bArr2) throws NotProvisionedException, DeniedByServerException {
if (k2.c.equals(this.a)) {
bArr2 = r.b(bArr2);
}
return this.b.provideKeyResponse(bArr, bArr2);
}
@Override
public void l(byte[] bArr) throws DeniedByServerException {
this.b.provideProvisionResponse(bArr);
}
@Override
public i0.a m(byte[] bArr, List<v.b> list, int i2, HashMap<String, String> hashMap) throws NotProvisionedException {
byte[] bArr2;
String str;
v.b bVar = null;
if (list != null) {
bVar = x(this.a, list);
UUID uuid = this.a;
byte[] bArr3 = bVar.r;
i.d.a.b.x4.e.e(bArr3);
bArr2 = r(uuid, bArr3);
str = s(this.a, bVar.f4512q);
} else {
bArr2 = null;
str = null;
}
MediaDrm.KeyRequest keyRequest = this.b.getKeyRequest(bArr, bArr2, str, i2, hashMap);
byte[] q2 = q(this.a, keyRequest.getData());
String p2 = p(keyRequest.getDefaultUrl());
if (TextUtils.isEmpty(p2) && bVar != null && !TextUtils.isEmpty(bVar.f4511p)) {
p2 = bVar.f4511p;
}
return new i0.a(q2, p2, i.d.a.b.x4.p0.a >= 23 ? keyRequest.getRequestType() : Integer.MIN_VALUE);
}
@Override
public int n() {
return 2;
}
@Override
public j0 e(byte[] bArr) throws MediaCryptoException {
return new j0(t(this.a), bArr, i.d.a.b.x4.p0.a < 21 && k2.d.equals(this.a) && "L3".equals(w("securityLevel")));
}
public String w(String str) {
return this.b.getPropertyString(str);
}
}