ViMusic v0.5.4版本的 MD5 值为:e5d76df875234aa34db5af7d13eb379b

以下内容为反编译后的 w0.java 源代码,内容仅作参考


package y;

import android.net.Uri;
import android.text.TextUtils;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public final class w0 {
    public final int f13823a;
    public boolean f13824b;
    public final Object f13825c;
    public Object f13826d;
    public Object f13827e;

    public w0() {
        this.f13823a = 0;
        this.f13825c = new Object();
        this.f13826d = new ArrayList();
        this.f13827e = new ArrayList();
        this.f13824b = true;
    }

    public static byte[] d(s2.b bVar, String str, byte[] bArr, Map map) {
        boolean z9;
        Map map2;
        List list;
        s2.u uVar = new s2.u(bVar.i());
        Collections.emptyMap();
        Uri parse = Uri.parse(str);
        v.y0.t(parse, "The uri must be set.");
        String str2 = "The uri must be set.";
        s2.f fVar = new s2.f(parse, 0L, 2, bArr, map, 0L, -1L, null, 1, null);
        int i10 = 0;
        s2.f fVar2 = fVar;
        int i11 = 0;
        while (true) {
            try {
                s2.e eVar = new s2.e(uVar, fVar2);
                try {
                    int i12 = q2.x.f9650a;
                    byte[] bArr2 = new byte[4096];
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                    while (true) {
                        int read = eVar.read(bArr2);
                        if (read != -1) {
                            byteArrayOutputStream.write(bArr2, i10, read);
                        } else {
                            byte[] byteArray = byteArrayOutputStream.toByteArray();
                            q2.x.e(eVar);
                            return byteArray;
                        }
                    }
                } catch (s2.q e10) {
                    int i13 = e10.f10706t;
                    if ((i13 == 307 || i13 == 308) && i11 < 5) {
                        z9 = true;
                    } else {
                        z9 = false;
                    }
                    String str3 = null;
                    if (z9 && (map2 = e10.f10707u) != null && (list = (List) map2.get("Location")) != null && !list.isEmpty()) {
                        str3 = (String) list.get(i10);
                    }
                    throw e10;
                }
            } catch (Exception e11) {
                Uri uri = uVar.f10717s;
                uri.getClass();
                throw new y2.e0(fVar, uri, uVar.c(), uVar.f10716r, e11);
            }
        }
    }

    public final void a(e1.f0 f0Var) {
        boolean z9;
        g7.e.z(f0Var, "node");
        if (f0Var.v()) {
            if (this.f13824b) {
                Integer num = (Integer) ((Map) ((n7.d) this.f13825c).getValue()).get(f0Var);
                if (num == null) {
                    ((Map) ((n7.d) this.f13825c).getValue()).put(f0Var, Integer.valueOf(f0Var.f1966y));
                } else {
                    if (num.intValue() == f0Var.f1966y) {
                        z9 = true;
                    } else {
                        z9 = false;
                    }
                    if (!z9) {
                        throw new IllegalStateException("Check failed.".toString());
                    }
                }
            }
            ((e1.m1) this.f13827e).add(f0Var);
            return;
        }
        throw new IllegalStateException("Check failed.".toString());
    }

    public final void b(boolean z9) {
        Object obj = this.f13827e;
        j4.g gVar = (j4.g) obj;
        j4.g gVar2 = (j4.g) obj;
        synchronized (gVar) {
            if (!this.f13824b) {
                if (g7.e.n(((j4.c) this.f13825c).f5312g, this)) {
                    j4.g.a(gVar2, this, z9);
                }
                this.f13824b = true;
            } else {
                throw new IllegalStateException("editor is closed".toString());
            }
        }
    }

    public final byte[] c(UUID uuid, y2.w wVar) {
        String str;
        String str2 = wVar.f13993b;
        if (this.f13824b || TextUtils.isEmpty(str2)) {
            str2 = (String) this.f13826d;
        }
        if (!TextUtils.isEmpty(str2)) {
            HashMap hashMap = new HashMap();
            UUID uuid2 = o2.k.f8555e;
            if (uuid2.equals(uuid)) {
                str = "text/xml";
            } else if (o2.k.f8553c.equals(uuid)) {
                str = "application/json";
            } else {
                str = "application/octet-stream";
            }
            hashMap.put("Content-Type", str);
            if (uuid2.equals(uuid)) {
                hashMap.put("SOAPAction", "http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense");
            }
            synchronized (((Map) this.f13827e)) {
                hashMap.putAll((Map) this.f13827e);
            }
            return d((s2.b) this.f13825c, str2, wVar.f13992a, hashMap);
        }
        Map emptyMap = Collections.emptyMap();
        Uri uri = Uri.EMPTY;
        v.y0.t(uri, "The uri must be set.");
        throw new y2.e0(new s2.f(uri, 0L, 1, null, emptyMap, 0L, -1L, null, 0, null), Uri.EMPTY, z4.d1.f14476w, 0L, new IllegalStateException("No license URL"));
    }

    public final byte[] e(y2.x xVar) {
        StringBuilder sb = new StringBuilder();
        sb.append(xVar.f13995b);
        sb.append("&signedRequest=");
        byte[] bArr = xVar.f13994a;
        int i10 = q2.x.f9650a;
        sb.append(new String(bArr, y4.a.f14010a));
        return d((s2.b) this.f13825c, sb.toString(), null, Collections.emptyMap());
    }

    public final k9.x f(int i10) {
        k9.x xVar;
        j4.g gVar = (j4.g) this.f13827e;
        synchronized (gVar) {
            if (!this.f13824b) {
                ((boolean[]) this.f13826d)[i10] = true;
                Object obj = ((j4.c) this.f13825c).f5309d.get(i10);
                j4.e eVar = gVar.F;
                k9.x xVar2 = (k9.x) obj;
                if (!eVar.f(xVar2)) {
                    w4.e.a(eVar.k(xVar2));
                }
                xVar = (k9.x) obj;
            } else {
                throw new IllegalStateException("editor is closed".toString());
            }
        }
        return xVar;
    }

    public final boolean g(e1.f0 f0Var) {
        g7.e.z(f0Var, "node");
        if (f0Var.v()) {
            boolean remove = ((e1.m1) this.f13827e).remove(f0Var);
            if (this.f13824b) {
                Integer num = (Integer) ((Map) ((n7.d) this.f13825c).getValue()).remove(f0Var);
                boolean z9 = true;
                if (remove) {
                    if (!((num == null || num.intValue() != f0Var.f1966y) ? false : false)) {
                        throw new IllegalStateException("Check failed.".toString());
                    }
                } else {
                    if (num != null) {
                        z9 = false;
                    }
                    if (!z9) {
                        throw new IllegalStateException("Check failed.".toString());
                    }
                }
            }
            return remove;
        }
        throw new IllegalStateException("Check failed.".toString());
    }

    public final String toString() {
        switch (this.f13823a) {
            case 1:
                String obj = ((e1.m1) this.f13827e).toString();
                g7.e.y(obj, "set.toString()");
                return obj;
            default:
                return super.toString();
        }
    }

    public w0(int i10) {
        this.f13823a = 1;
        this.f13824b = false;
        this.f13825c = i8.a0.Z0(3, a.l.Q);
        this.f13826d = new o(1);
        this.f13827e = new e1.m1((Comparator) this.f13826d);
    }

    public w0(j4.g gVar, j4.c cVar) {
        this.f13823a = 3;
        this.f13827e = gVar;
        this.f13825c = cVar;
        gVar.getClass();
        this.f13826d = new boolean[2];
    }

    public w0(String str, boolean z9, s2.g gVar) {
        this.f13823a = 2;
        v.y0.p((z9 && TextUtils.isEmpty(str)) ? false : true);
        this.f13825c = gVar;
        this.f13826d = str;
        this.f13824b = z9;
        this.f13827e = new HashMap();
    }
}