导航菜单

页面标题

页面副标题

Aisle v12.32 - I.java 源代码

正在查看: Aisle v12.32 应用的 I.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package Z0;

import P0.AbstractC0558j;
import P0.C0564p;
import S0.AbstractC0665a;
import X0.v1;
import Z0.A;
import android.media.MediaCrypto;
import android.media.MediaCryptoException;
import android.media.MediaDrm;
import android.media.UnsupportedSchemeException;
import android.media.metrics.LogSessionId;
import android.text.TextUtils;
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 I implements A {

    public static final A.c f11565d = new A.c() {
        @Override
        public final A a(UUID uuid) {
            return I.o(uuid);
        }
    };

    private final UUID f11566a;

    private final MediaDrm f11567b;

    private int f11568c;

    private static class a {
        public static boolean a(MediaDrm mediaDrm, String str) {
            boolean requiresSecureDecoder;
            requiresSecureDecoder = mediaDrm.requiresSecureDecoder(str);
            return requiresSecureDecoder;
        }

        public static void b(MediaDrm mediaDrm, byte[] bArr, v1 v1Var) {
            LogSessionId logSessionId;
            boolean equals;
            MediaDrm.PlaybackComponent playbackComponent;
            LogSessionId a5 = v1Var.a();
            logSessionId = LogSessionId.LOG_SESSION_ID_NONE;
            equals = a5.equals(logSessionId);
            if (equals) {
                return;
            }
            playbackComponent = mediaDrm.getPlaybackComponent(bArr);
            F.a(AbstractC0665a.e(playbackComponent)).setLogSessionId(a5);
        }
    }

    private I(UUID uuid) {
        AbstractC0665a.e(uuid);
        AbstractC0665a.b(!AbstractC0558j.f4596b.equals(uuid), "Use C.CLEARKEY_UUID instead");
        this.f11566a = uuid;
        MediaDrm mediaDrm = new MediaDrm(v(uuid));
        this.f11567b = mediaDrm;
        this.f11568c = 1;
        if (AbstractC0558j.f4598d.equals(uuid) && A()) {
            x(mediaDrm);
        }
    }

    private static boolean A() {
        return "ASUS_Z00AD".equals(S0.L.f7515d);
    }

    public static I B(UUID uuid) {
        try {
            return new I(uuid);
        } catch (UnsupportedSchemeException e5) {
            throw new N(1, e5);
        } catch (Exception e6) {
            throw new N(2, e6);
        }
    }

    public static A o(UUID uuid) {
        try {
            return B(uuid);
        } catch (N unused) {
            S0.p.c("FrameworkMediaDrm", "Failed to instantiate a FrameworkMediaDrm for uuid: " + uuid + ".");
            return new y();
        }
    }

    public static void p(I i5, A.b bVar, MediaDrm mediaDrm, byte[] bArr, int i6, int i7, byte[] bArr2) {
        i5.getClass();
        bVar.a(i5, bArr, i6, i7, bArr2);
    }

    private static byte[] q(byte[] bArr) {
        S0.A a5 = new S0.A(bArr);
        int u5 = a5.u();
        short w5 = a5.w();
        short w6 = a5.w();
        if (w5 != 1 || w6 != 1) {
            S0.p.f("FrameworkMediaDrm", "Unexpected record count or type. Skipping LA_URL workaround.");
            return bArr;
        }
        short w7 = a5.w();
        Charset charset = M7.e.e;
        String F4 = a5.F(w7, charset);
        if (F4.contains("<LA_URL>")) {
            return bArr;
        }
        int indexOf = F4.indexOf("</DATA>");
        if (indexOf == -1) {
            S0.p.h("FrameworkMediaDrm", "Could not find the </DATA> tag. Skipping LA_URL workaround.");
        }
        String str = F4.substring(0, indexOf) + "<LA_URL>https://x</LA_URL>" + F4.substring(indexOf);
        int i5 = u5 + 52;
        ByteBuffer allocate = ByteBuffer.allocate(i5);
        allocate.order(ByteOrder.LITTLE_ENDIAN);
        allocate.putInt(i5);
        allocate.putShort(w5);
        allocate.putShort(w6);
        allocate.putShort((short) (str.length() * 2));
        allocate.put(str.getBytes(charset));
        return allocate.array();
    }

    private static String r(String str) {
        return "<LA_URL>https://x</LA_URL>".equals(str) ? "" : (S0.L.f7512a < 33 || !"https://default.url".equals(str)) ? str : "";
    }

    private static byte[] s(UUID uuid, byte[] bArr) {
        return AbstractC0558j.f4597c.equals(uuid) ? AbstractC1155a.a(bArr) : bArr;
    }

    private static byte[] t(java.util.UUID r3, byte[] r4) {
        throw new UnsupportedOperationException("Method not decompiled: Z0.I.t(java.util.UUID, byte[]):byte[]");
    }

    private static String u(UUID uuid, String str) {
        return (S0.L.f7512a < 26 && AbstractC0558j.f4597c.equals(uuid) && ("video/mp4".equals(str) || "audio/mp4".equals(str))) ? "cenc" : str;
    }

    private static UUID v(UUID uuid) {
        return (S0.L.f7512a >= 27 || !AbstractC0558j.f4597c.equals(uuid)) ? uuid : AbstractC0558j.f4596b;
    }

    private static void x(MediaDrm mediaDrm) {
        mediaDrm.setPropertyString("securityLevel", "L3");
    }

    private static C0564p.b z(UUID uuid, List list) {
        if (!AbstractC0558j.f4598d.equals(uuid)) {
            return (C0564p.b) list.get(0);
        }
        if (S0.L.f7512a >= 28 && list.size() > 1) {
            C0564p.b bVar = (C0564p.b) list.get(0);
            int i5 = 0;
            for (int i6 = 0; i6 < list.size(); i6++) {
                C0564p.b bVar2 = (C0564p.b) list.get(i6);
                byte[] bArr = (byte[]) AbstractC0665a.e(bVar2.f4645e);
                if (S0.L.c(bVar2.f4644d, bVar.f4644d) && S0.L.c(bVar2.f4643c, bVar.f4643c) && C1.l.c(bArr)) {
                    i5 += bArr.length;
                }
            }
            byte[] bArr2 = new byte[i5];
            int i7 = 0;
            for (int i8 = 0; i8 < list.size(); i8++) {
                byte[] bArr3 = (byte[]) AbstractC0665a.e(((C0564p.b) list.get(i8)).f4645e);
                int length = bArr3.length;
                System.arraycopy(bArr3, 0, bArr2, i7, length);
                i7 += length;
            }
            return bVar.a(bArr2);
        }
        for (int i9 = 0; i9 < list.size(); i9++) {
            C0564p.b bVar3 = (C0564p.b) list.get(i9);
            int g5 = C1.l.g((byte[]) AbstractC0665a.e(bVar3.f4645e));
            int i10 = S0.L.f7512a;
            if ((i10 < 23 && g5 == 0) || (i10 >= 23 && g5 == 1)) {
                return bVar3;
            }
        }
        return (C0564p.b) list.get(0);
    }

    @Override
    public synchronized void a() {
        int i5 = this.f11568c - 1;
        this.f11568c = i5;
        if (i5 == 0) {
            this.f11567b.release();
        }
    }

    @Override
    public Map b(byte[] bArr) {
        return this.f11567b.queryKeyStatus(bArr);
    }

    @Override
    public A.d c() {
        MediaDrm.ProvisionRequest provisionRequest = this.f11567b.getProvisionRequest();
        return new A.d(provisionRequest.getData(), provisionRequest.getDefaultUrl());
    }

    @Override
    public void d(byte[] bArr, v1 v1Var) {
        if (S0.L.f7512a >= 31) {
            try {
                a.b(this.f11567b, bArr, v1Var);
            } catch (UnsupportedOperationException unused) {
                S0.p.h("FrameworkMediaDrm", "setLogSessionId failed.");
            }
        }
    }

    @Override
    public void e(final A.b bVar) {
        this.f11567b.setOnEventListener(bVar == null ? null : new MediaDrm.OnEventListener() {
            @Override
            public final void onEvent(MediaDrm mediaDrm, byte[] bArr, int i5, int i6, byte[] bArr2) {
                I.p(I.this, bVar, mediaDrm, bArr, i5, i6, bArr2);
            }
        });
    }

    @Override
    public byte[] g() {
        return this.f11567b.openSession();
    }

    @Override
    public boolean h(byte[] bArr, String str) {
        if (S0.L.f7512a >= 31) {
            return a.a(this.f11567b, str);
        }
        try {
            MediaCrypto mediaCrypto = new MediaCrypto(this.f11566a, bArr);
            try {
                return mediaCrypto.requiresSecureDecoderComponent(str);
            } finally {
                mediaCrypto.release();
            }
        } catch (MediaCryptoException unused) {
            return true;
        }
    }

    @Override
    public void i(byte[] bArr, byte[] bArr2) {
        this.f11567b.restoreKeys(bArr, bArr2);
    }

    @Override
    public void j(byte[] bArr) {
        this.f11567b.closeSession(bArr);
    }

    @Override
    public byte[] k(byte[] bArr, byte[] bArr2) {
        if (AbstractC0558j.f4597c.equals(this.f11566a)) {
            bArr2 = AbstractC1155a.b(bArr2);
        }
        return this.f11567b.provideKeyResponse(bArr, bArr2);
    }

    @Override
    public void l(byte[] bArr) {
        this.f11567b.provideProvisionResponse(bArr);
    }

    @Override
    public A.a m(byte[] bArr, List list, int i5, HashMap hashMap) {
        C0564p.b bVar;
        byte[] bArr2;
        String str;
        if (list != null) {
            bVar = z(this.f11566a, list);
            bArr2 = t(this.f11566a, (byte[]) AbstractC0665a.e(bVar.f4645e));
            str = u(this.f11566a, bVar.f4644d);
        } else {
            bVar = null;
            bArr2 = null;
            str = null;
        }
        MediaDrm.KeyRequest keyRequest = this.f11567b.getKeyRequest(bArr, bArr2, str, i5, hashMap);
        byte[] s5 = s(this.f11566a, keyRequest.getData());
        String r5 = r(keyRequest.getDefaultUrl());
        if (TextUtils.isEmpty(r5) && bVar != null && !TextUtils.isEmpty(bVar.f4643c)) {
            r5 = bVar.f4643c;
        }
        return new A.a(s5, r5, S0.L.f7512a >= 23 ? keyRequest.getRequestType() : Integer.MIN_VALUE);
    }

    @Override
    public int n() {
        return 2;
    }

    @Override
    public B f(byte[] bArr) {
        return new B(v(this.f11566a), bArr, S0.L.f7512a < 21 && AbstractC0558j.f4598d.equals(this.f11566a) && "L3".equals(y("securityLevel")));
    }

    public String y(String str) {
        return this.f11567b.getPropertyString(str);
    }
}