APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:IntelliInvest
版本号:3.0.40
包名称:com.intelli.intelliinvest

MD5 校验值:8d01bad3385dcb060a6dcda2da0f8dbf

反编译源代码说明

l0.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package e1;

import a1.u1;
import android.annotation.SuppressLint;
import android.media.MediaCrypto;
import android.media.MediaCryptoException;
import android.media.MediaDrm;
import android.media.MediaDrm$PlaybackComponent;
import android.media.UnsupportedSchemeException;
import android.media.metrics.LogSessionId;
import android.text.TextUtils;
import e1.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.Objects;
import java.util.UUID;
import s0.l;

public final class l0 implements f0 {

    public static final f0.c f12204d = new f0.c() {
        @Override
        public final f0 a(UUID uuid) {
            f0 A;
            A = l0.A(uuid);
            return A;
        }
    };

    private final UUID f12205a;

    private final MediaDrm f12206b;

    private int f12207c;

    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, u1 u1Var) {
            MediaDrm$PlaybackComponent playbackComponent;
            LogSessionId a10 = u1Var.a();
            if (a10.equals(LogSessionId.LOG_SESSION_ID_NONE)) {
                return;
            }
            playbackComponent = mediaDrm.getPlaybackComponent(bArr);
            ((MediaDrm$PlaybackComponent) v0.a.e(playbackComponent)).setLogSessionId(a10);
        }
    }

    private l0(UUID uuid) {
        v0.a.e(uuid);
        v0.a.b(!s0.f.f22740b.equals(uuid), "Use C.CLEARKEY_UUID instead");
        this.f12205a = uuid;
        MediaDrm mediaDrm = new MediaDrm(u(uuid));
        this.f12206b = mediaDrm;
        this.f12207c = 1;
        if (s0.f.f22742d.equals(uuid) && B()) {
            w(mediaDrm);
        }
    }

    public static f0 A(UUID uuid) {
        try {
            return C(uuid);
        } catch (q0 unused) {
            v0.o.c("FrameworkMediaDrm", "Failed to instantiate a FrameworkMediaDrm for uuid: " + uuid + ".");
            return new c0();
        }
    }

    private static boolean B() {
        return "ASUS_Z00AD".equals(v0.i0.f25735d);
    }

    public static l0 C(UUID uuid) {
        try {
            return new l0(uuid);
        } catch (UnsupportedSchemeException e10) {
            throw new q0(1, e10);
        } catch (Exception e11) {
            throw new q0(2, e11);
        }
    }

    private boolean D() {
        return v0.i0.f25732a < 21 && s0.f.f22742d.equals(this.f12205a) && "L3".equals(x("securityLevel"));
    }

    private static byte[] p(byte[] bArr) {
        v0.x xVar = new v0.x(bArr);
        int t10 = xVar.t();
        short v10 = xVar.v();
        short v11 = xVar.v();
        if (v10 != 1 || v11 != 1) {
            v0.o.f("FrameworkMediaDrm", "Unexpected record count or type. Skipping LA_URL workaround.");
            return bArr;
        }
        short v12 = xVar.v();
        Charset charset = x8.e.f27736e;
        String E = xVar.E(v12, charset);
        if (E.contains("<LA_URL>")) {
            return bArr;
        }
        int indexOf = E.indexOf("</DATA>");
        if (indexOf == -1) {
            v0.o.h("FrameworkMediaDrm", "Could not find the </DATA> tag. Skipping LA_URL workaround.");
        }
        String str = E.substring(0, indexOf) + "<LA_URL>https://x</LA_URL>" + E.substring(indexOf);
        int i10 = t10 + 52;
        ByteBuffer allocate = ByteBuffer.allocate(i10);
        allocate.order(ByteOrder.LITTLE_ENDIAN);
        allocate.putInt(i10);
        allocate.putShort(v10);
        allocate.putShort(v11);
        allocate.putShort((short) (str.length() * 2));
        allocate.put(str.getBytes(charset));
        return allocate.array();
    }

    private String q(String str) {
        if ("<LA_URL>https://x</LA_URL>".equals(str)) {
            return "";
        }
        if (v0.i0.f25732a >= 33 && "https://default.url".equals(str)) {
            String x10 = x("version");
            if (Objects.equals(x10, "1.2") || Objects.equals(x10, "aidl-1")) {
                return "";
            }
        }
        return str;
    }

    private static byte[] r(UUID uuid, byte[] bArr) {
        return s0.f.f22741c.equals(uuid) ? e1.a.a(bArr) : bArr;
    }

    private static byte[] s(UUID uuid, byte[] bArr) {
        UUID uuid2 = s0.f.f22743e;
        if (uuid2.equals(uuid)) {
            byte[] e10 = r2.o.e(bArr, uuid);
            if (e10 != null) {
                bArr = e10;
            }
            bArr = r2.o.a(uuid2, p(bArr));
        }
        if (v0.i0.f25732a >= 23 || !s0.f.f22742d.equals(uuid)) {
            if (uuid2.equals(uuid) && "Amazon".equals(v0.i0.f25734c)) {
                String str = v0.i0.f25735d;
                if (!"AFTB".equals(str)) {
                    if (!"AFTS".equals(str)) {
                        if (!"AFTM".equals(str)) {
                        }
                    }
                }
            }
        }
        byte[] e11 = r2.o.e(bArr, uuid);
        return e11 != null ? e11 : bArr;
    }

    private static String t(UUID uuid, String str) {
        return (v0.i0.f25732a < 26 && s0.f.f22741c.equals(uuid) && ("video/mp4".equals(str) || "audio/mp4".equals(str))) ? "cenc" : str;
    }

    private static UUID u(UUID uuid) {
        return (v0.i0.f25732a >= 27 || !s0.f.f22741c.equals(uuid)) ? uuid : s0.f.f22740b;
    }

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

    private static l.b y(UUID uuid, List<l.b> list) {
        boolean z10;
        if (s0.f.f22742d.equals(uuid)) {
            if (v0.i0.f25732a >= 28 && list.size() > 1) {
                l.b bVar = list.get(0);
                int i10 = 0;
                for (int i11 = 0; i11 < list.size(); i11++) {
                    l.b bVar2 = list.get(i11);
                    byte[] bArr = (byte[]) v0.a.e(bVar2.f22849e);
                    if (!v0.i0.c(bVar2.f22848d, bVar.f22848d) || !v0.i0.c(bVar2.f22847c, bVar.f22847c) || !r2.o.c(bArr)) {
                        z10 = false;
                        break;
                    }
                    i10 += bArr.length;
                }
                z10 = true;
                if (z10) {
                    byte[] bArr2 = new byte[i10];
                    int i12 = 0;
                    for (int i13 = 0; i13 < list.size(); i13++) {
                        byte[] bArr3 = (byte[]) v0.a.e(list.get(i13).f22849e);
                        int length = bArr3.length;
                        System.arraycopy(bArr3, 0, bArr2, i12, length);
                        i12 += length;
                    }
                    return bVar.b(bArr2);
                }
            }
            for (int i14 = 0; i14 < list.size(); i14++) {
                l.b bVar3 = list.get(i14);
                int g10 = r2.o.g((byte[]) v0.a.e(bVar3.f22849e));
                int i15 = v0.i0.f25732a;
                if (i15 < 23 && g10 == 0) {
                    return bVar3;
                }
                if (i15 >= 23 && g10 == 1) {
                    return bVar3;
                }
            }
        }
        return list.get(0);
    }

    public void z(f0.b bVar, MediaDrm mediaDrm, byte[] bArr, int i10, int i11, byte[] bArr2) {
        bVar.a(this, bArr, i10, i11, bArr2);
    }

    @Override
    public Map<String, String> a(byte[] bArr) {
        return this.f12206b.queryKeyStatus(bArr);
    }

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

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

    @Override
    public boolean e(byte[] bArr, String str) {
        boolean z10;
        MediaCrypto mediaCrypto;
        if (v0.i0.f25732a >= 31) {
            z10 = a.a(this.f12206b, str);
        } else {
            MediaCrypto mediaCrypto2 = null;
            try {
                mediaCrypto = new MediaCrypto(this.f12205a, bArr);
            } catch (MediaCryptoException unused) {
            } catch (Throwable th) {
                th = th;
            }
            try {
                z10 = mediaCrypto.requiresSecureDecoderComponent(str);
                mediaCrypto.release();
            } catch (MediaCryptoException unused2) {
                mediaCrypto2 = mediaCrypto;
                if (mediaCrypto2 != null) {
                    mediaCrypto2.release();
                }
                z10 = true;
                if (z10) {
                }
            } catch (Throwable th2) {
                th = th2;
                mediaCrypto2 = mediaCrypto;
                if (mediaCrypto2 != null) {
                    mediaCrypto2.release();
                }
                throw th;
            }
        }
        return (z10 || D()) ? false : true;
    }

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

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

    @Override
    public byte[] h(byte[] bArr, byte[] bArr2) {
        if (s0.f.f22741c.equals(this.f12205a)) {
            bArr2 = e1.a.b(bArr2);
        }
        return this.f12206b.provideKeyResponse(bArr, bArr2);
    }

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

    @Override
    @SuppressLint({"WrongConstant"})
    public f0.a j(byte[] bArr, List<l.b> list, int i10, HashMap<String, String> hashMap) {
        byte[] bArr2;
        String str;
        l.b bVar = null;
        if (list != null) {
            bVar = y(this.f12205a, list);
            bArr2 = s(this.f12205a, (byte[]) v0.a.e(bVar.f22849e));
            str = t(this.f12205a, bVar.f22848d);
        } else {
            bArr2 = null;
            str = null;
        }
        MediaDrm.KeyRequest keyRequest = this.f12206b.getKeyRequest(bArr, bArr2, str, i10, hashMap);
        byte[] r10 = r(this.f12205a, keyRequest.getData());
        String q10 = q(keyRequest.getDefaultUrl());
        if (TextUtils.isEmpty(q10) && bVar != null && !TextUtils.isEmpty(bVar.f22847c)) {
            q10 = bVar.f22847c;
        }
        return new f0.a(r10, q10, v0.i0.f25732a >= 23 ? keyRequest.getRequestType() : Integer.MIN_VALUE);
    }

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

    @Override
    public void l(final f0.b bVar) {
        this.f12206b.setOnEventListener(bVar == null ? null : new MediaDrm.OnEventListener() {
            @Override
            public final void onEvent(MediaDrm mediaDrm, byte[] bArr, int i10, int i11, byte[] bArr2) {
                l0.this.z(bVar, mediaDrm, bArr, i10, i11, bArr2);
            }
        });
    }

    @Override
    public void m(byte[] bArr, u1 u1Var) {
        if (v0.i0.f25732a >= 31) {
            try {
                a.b(this.f12206b, bArr, u1Var);
            } catch (UnsupportedOperationException unused) {
                v0.o.h("FrameworkMediaDrm", "setLogSessionId failed.");
            }
        }
    }

    @Override
    public synchronized void release() {
        int i10 = this.f12207c - 1;
        this.f12207c = i10;
        if (i10 == 0) {
            this.f12206b.release();
        }
    }

    @Override
    public g0 c(byte[] bArr) {
        return new g0(u(this.f12205a), bArr, D());
    }

    public String x(String str) {
        return this.f12206b.getPropertyString(str);
    }
}