导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - o0.java 源代码

正在查看: Cantique de Louanges v12 应用的 o0.java JAVA 源代码文件

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


package h1;

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 androidx.media3.common.DrmInitData;
import com.applovin.mediation.MaxReward;
import d1.v3;
import h1.f0;
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 o0 implements f0 {

    public static final f0.c f12846d = new f0.c() {
        @Override
        public final f0 acquireExoMediaDrm(UUID uuid) {
            f0 t4;
            t4 = o0.t(uuid);
            return t4;
        }
    };

    private final UUID f12847a;

    private final MediaDrm f12848b;

    private int f12849c;

    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, v3 v3Var) {
            LogSessionId logSessionId;
            boolean equals;
            MediaDrm.PlaybackComponent playbackComponent;
            LogSessionId a5 = v3Var.a();
            logSessionId = LogSessionId.LOG_SESSION_ID_NONE;
            equals = a5.equals(logSessionId);
            if (equals) {
                return;
            }
            playbackComponent = mediaDrm.getPlaybackComponent(bArr);
            l0.a(x0.a.e(playbackComponent)).setLogSessionId(a5);
        }
    }

    private o0(UUID uuid) {
        x0.a.e(uuid);
        x0.a.b(!u0.j.f15499b.equals(uuid), "Use C.CLEARKEY_UUID instead");
        this.f12847a = uuid;
        MediaDrm mediaDrm = new MediaDrm(n(uuid));
        this.f12848b = mediaDrm;
        this.f12849c = 1;
        if (u0.j.f15501d.equals(uuid) && u()) {
            p(mediaDrm);
        }
    }

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

    private static String j(String str) {
        return "<LA_URL>https://x</LA_URL>".equals(str) ? MaxReward.DEFAULT_LABEL : (x0.s0.f16418a == 33 && "https://default.url".equals(str)) ? MaxReward.DEFAULT_LABEL : str;
    }

    private static byte[] k(UUID uuid, byte[] bArr) {
        return u0.j.f15500c.equals(uuid) ? h1.a.a(bArr) : bArr;
    }

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

    private static String m(UUID uuid, String str) {
        return (x0.s0.f16418a < 26 && u0.j.f15500c.equals(uuid) && ("video/mp4".equals(str) || "audio/mp4".equals(str))) ? "cenc" : str;
    }

    private static UUID n(UUID uuid) {
        return (x0.s0.f16418a >= 27 || !u0.j.f15500c.equals(uuid)) ? uuid : u0.j.f15499b;
    }

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

    private static DrmInitData.SchemeData r(UUID uuid, List list) {
        boolean z4;
        if (!u0.j.f15501d.equals(uuid)) {
            return (DrmInitData.SchemeData) list.get(0);
        }
        if (x0.s0.f16418a >= 28 && list.size() > 1) {
            DrmInitData.SchemeData schemeData = (DrmInitData.SchemeData) list.get(0);
            int i5 = 0;
            for (int i6 = 0; i6 < list.size(); i6++) {
                DrmInitData.SchemeData schemeData2 = (DrmInitData.SchemeData) list.get(i6);
                byte[] bArr = (byte[]) x0.a.e(schemeData2.f4259e);
                if (!x0.s0.c(schemeData2.f4258d, schemeData.f4258d) || !x0.s0.c(schemeData2.f4257c, schemeData.f4257c) || !o2.l.c(bArr)) {
                    z4 = false;
                    break;
                }
                i5 += bArr.length;
            }
            z4 = true;
            if (z4) {
                byte[] bArr2 = new byte[i5];
                int i7 = 0;
                for (int i8 = 0; i8 < list.size(); i8++) {
                    byte[] bArr3 = (byte[]) x0.a.e(((DrmInitData.SchemeData) list.get(i8)).f4259e);
                    int length = bArr3.length;
                    System.arraycopy(bArr3, 0, bArr2, i7, length);
                    i7 += length;
                }
                return schemeData.b(bArr2);
            }
        }
        for (int i9 = 0; i9 < list.size(); i9++) {
            DrmInitData.SchemeData schemeData3 = (DrmInitData.SchemeData) list.get(i9);
            int g5 = o2.l.g((byte[]) x0.a.e(schemeData3.f4259e));
            int i10 = x0.s0.f16418a;
            if (i10 < 23 && g5 == 0) {
                return schemeData3;
            }
            if (i10 >= 23 && g5 == 1) {
                return schemeData3;
            }
        }
        return (DrmInitData.SchemeData) list.get(0);
    }

    public void s(f0.b bVar, MediaDrm mediaDrm, byte[] bArr, int i5, int i6, byte[] bArr2) {
        bVar.a(this, bArr, i5, i6, bArr2);
    }

    public static f0 t(UUID uuid) {
        try {
            return v(uuid);
        } catch (t0 unused) {
            x0.q.c("FrameworkMediaDrm", "Failed to instantiate a FrameworkMediaDrm for uuid: " + uuid + ".");
            return new c0();
        }
    }

    private static boolean u() {
        return "ASUS_Z00AD".equals(x0.s0.f16421d);
    }

    public static o0 v(UUID uuid) {
        try {
            return new o0(uuid);
        } catch (UnsupportedSchemeException e5) {
            throw new t0(1, e5);
        } catch (Exception e6) {
            throw new t0(2, e6);
        }
    }

    @Override
    public void a(byte[] bArr, v3 v3Var) {
        if (x0.s0.f16418a >= 31) {
            try {
                a.b(this.f12848b, bArr, v3Var);
            } catch (UnsupportedOperationException unused) {
                x0.q.i("FrameworkMediaDrm", "setLogSessionId failed.");
            }
        }
    }

    @Override
    public void b(final f0.b bVar) {
        this.f12848b.setOnEventListener(bVar == null ? null : new MediaDrm.OnEventListener() {
            @Override
            public final void onEvent(MediaDrm mediaDrm, byte[] bArr, int i5, int i6, byte[] bArr2) {
                o0.this.s(bVar, mediaDrm, bArr, i5, i6, bArr2);
            }
        });
    }

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

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

    @Override
    public boolean e(byte[] bArr, String str) {
        if (x0.s0.f16418a >= 31) {
            return a.a(this.f12848b, str);
        }
        try {
            MediaCrypto mediaCrypto = new MediaCrypto(this.f12847a, bArr);
            try {
                return mediaCrypto.requiresSecureDecoderComponent(str);
            } finally {
                mediaCrypto.release();
            }
        } catch (MediaCryptoException unused) {
            return true;
        }
    }

    @Override
    public f0.a f(byte[] bArr, List list, int i5, HashMap hashMap) {
        DrmInitData.SchemeData schemeData;
        byte[] bArr2;
        String str;
        if (list != null) {
            schemeData = r(this.f12847a, list);
            bArr2 = l(this.f12847a, (byte[]) x0.a.e(schemeData.f4259e));
            str = m(this.f12847a, schemeData.f4258d);
        } else {
            schemeData = null;
            bArr2 = null;
            str = null;
        }
        MediaDrm.KeyRequest keyRequest = this.f12848b.getKeyRequest(bArr, bArr2, str, i5, hashMap);
        byte[] k5 = k(this.f12847a, keyRequest.getData());
        String j5 = j(keyRequest.getDefaultUrl());
        if (TextUtils.isEmpty(j5) && schemeData != null && !TextUtils.isEmpty(schemeData.f4257c)) {
            j5 = schemeData.f4257c;
        }
        return new f0.a(k5, j5, x0.s0.f16418a >= 23 ? keyRequest.getRequestType() : Integer.MIN_VALUE);
    }

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

    @Override
    public g0 d(byte[] bArr) {
        return new g0(n(this.f12847a), bArr, x0.s0.f16418a < 21 && u0.j.f15501d.equals(this.f12847a) && "L3".equals(q("securityLevel")));
    }

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

    @Override
    public byte[] provideKeyResponse(byte[] bArr, byte[] bArr2) {
        if (u0.j.f15500c.equals(this.f12847a)) {
            bArr2 = h1.a.b(bArr2);
        }
        return this.f12848b.provideKeyResponse(bArr, bArr2);
    }

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

    public String q(String str) {
        return this.f12848b.getPropertyString(str);
    }

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

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

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