导航菜单

页面标题

页面副标题

JetMelo v1.0 - C2556y0.java 源代码

正在查看: JetMelo v1.0 应用的 C2556y0.java JAVA 源代码文件

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


package z2;

import A2.HandlerC0118z;
import C1.C0228y;
import F1.AbstractC0363a;
import F1.AbstractC0364b;
import J1.C0408x;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.media.MediaMetadata;
import android.media.session.MediaSession;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcel;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.support.v4.view.PointerIconCompat;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseBooleanArray;
import b4.C0851c;
import com.rcmiku.music.playback.PlaybackService;
import i3.AbstractC1324G;
import i3.C1322E;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

public final class C2556y0 extends A2.P {

    public static final int f21471r;

    public final B2.y f21472f;

    public final C2535n0 f21473g;

    public final A2.f0 f21474h;

    public final C2552w0 f21475i;

    public final HandlerC0118z f21476j;

    public final A2.Y f21477k;

    public final F1.p f21478l;

    public final ComponentName f21479m;

    public b1 f21480n;

    public volatile long f21481o;

    public C2552w0 f21482p;

    public int f21483q;

    static {
        f21471r = F1.C.f3951a >= 31 ? 33554432 : 0;
    }

    public C2556y0(C2535n0 c2535n0, Uri uri, Handler handler, Bundle bundle) {
        ComponentName componentName;
        ComponentName I;
        PendingIntent foregroundService;
        this.f21473g = c2535n0;
        PlaybackService playbackService = c2535n0.f21361f;
        this.f21474h = A2.f0.a(playbackService);
        this.f21475i = new C2552w0(this);
        B2.y yVar = new B2.y(c2535n0);
        this.f21472f = yVar;
        this.f21481o = 300000L;
        this.f21476j = new HandlerC0118z(c2535n0.f21367l.getLooper(), yVar);
        PackageManager packageManager = playbackService.getPackageManager();
        Intent intent = new Intent("android.intent.action.MEDIA_BUTTON");
        intent.setPackage(playbackService.getPackageName());
        List<ResolveInfo> queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent, 0);
        boolean z5 = true;
        if (queryBroadcastReceivers.size() == 1) {
            ActivityInfo activityInfo = queryBroadcastReceivers.get(0).activityInfo;
            componentName = new ComponentName(activityInfo.packageName, activityInfo.name);
        } else {
            if (!queryBroadcastReceivers.isEmpty()) {
                throw new IllegalStateException("Expected 1 broadcast receiver that handles android.intent.action.MEDIA_BUTTON, found " + queryBroadcastReceivers.size());
            }
            componentName = null;
        }
        this.f21479m = componentName;
        if (componentName == null || F1.C.f3951a < 31) {
            I = I(playbackService, "androidx.media3.session.MediaLibraryService");
            I = I == null ? I(playbackService, "androidx.media3.session.MediaSessionService") : I;
            if (I == null || I.equals(componentName)) {
                z5 = false;
            }
        } else {
            z5 = false;
            I = componentName;
        }
        Intent intent2 = new Intent("android.intent.action.MEDIA_BUTTON", uri);
        if (I == null) {
            F1.p pVar = new F1.p(2, this);
            this.f21478l = pVar;
            IntentFilter intentFilter = new IntentFilter("android.intent.action.MEDIA_BUTTON");
            intentFilter.addDataScheme(uri.getScheme());
            if (F1.C.f3951a < 33) {
                playbackService.registerReceiver(pVar, intentFilter);
            } else {
                playbackService.registerReceiver(pVar, intentFilter, 4);
            }
            intent2.setPackage(playbackService.getPackageName());
            foregroundService = PendingIntent.getBroadcast(playbackService, 0, intent2, f21471r);
            I = new ComponentName(playbackService, (Class<?>) PlaybackService.class);
        } else {
            intent2.setComponent(I);
            foregroundService = z5 ? F1.C.f3951a >= 26 ? PendingIntent.getForegroundService(playbackService, 0, intent2, f21471r) : PendingIntent.getService(playbackService, 0, intent2, f21471r) : PendingIntent.getBroadcast(playbackService, 0, intent2, f21471r);
            this.f21478l = null;
        }
        String join = TextUtils.join(".", new String[]{"androidx.media3.session.id", c2535n0.f21364i});
        ComponentName componentName2 = I;
        int i6 = F1.C.f3951a;
        A2.Y y2 = new A2.Y(playbackService, join, i6 >= 31 ? null : componentName2, i6 < 31 ? foregroundService : null, bundle);
        this.f21477k = y2;
        if (i6 >= 31 && componentName != null) {
            try {
                MediaSession mediaSession = ((A2.S) y2.f720h).f697a;
                mediaSession.getClass();
                mediaSession.setMediaButtonBroadcastReceiver(componentName);
            } catch (IllegalArgumentException e6) {
                if (!Build.MANUFACTURER.equals("motorola")) {
                    throw e6;
                }
                AbstractC0363a.e("MediaSessionLegacyStub", "caught IllegalArgumentException on a motorola device when attempting to set the media button broadcast receiver. See https://github.com/androidx/media/issues/1730 for details.", e6);
            }
        }
        PendingIntent pendingIntent = c2535n0.f21376u;
        if (pendingIntent != null) {
            ((A2.S) this.f21477k.f720h).f697a.setSessionActivity(pendingIntent);
        }
        ((A2.S) this.f21477k.f720h).e(this, handler);
    }

    public static void C(A2.Y y2, A2.M m2) {
        A2.S s6 = (A2.S) y2.f720h;
        s6.f705i = m2;
        MediaMetadata mediaMetadata = m2.f688h;
        if (mediaMetadata == null) {
            Parcel obtain = Parcel.obtain();
            try {
                m2.writeToParcel(obtain, 0);
                obtain.setDataPosition(0);
                MediaMetadata mediaMetadata2 = (MediaMetadata) MediaMetadata.CREATOR.createFromParcel(obtain);
                m2.f688h = mediaMetadata2;
                obtain.recycle();
                mediaMetadata = mediaMetadata2;
            } catch (Throwable th) {
                obtain.recycle();
                throw th;
            }
        }
        s6.f697a.setMetadata(mediaMetadata);
    }

    public static void D(C2556y0 c2556y0, d1 d1Var) {
        c2556y0.getClass();
        int i6 = d1Var.s(20) ? 4 : 0;
        if (c2556y0.f21483q != i6) {
            c2556y0.f21483q = i6;
            ((A2.S) c2556y0.f21477k.f720h).f697a.setFlags(i6 | 3);
        }
    }

    public static void E(A2.Y y2, ArrayList arrayList) {
        if (arrayList != null) {
            y2.getClass();
            HashSet hashSet = new HashSet();
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                A2.V v3 = (A2.V) it.next();
                if (v3 == null) {
                    throw new IllegalArgumentException("queue shouldn't have null items");
                }
                long j6 = v3.f711h;
                if (hashSet.contains(Long.valueOf(j6))) {
                    Log.e("MediaSessionCompat", android.support.v4.media.c.h(j6, "Found duplicate queue id: "), new IllegalArgumentException("id of each queue item should be unique"));
                }
                hashSet.add(Long.valueOf(j6));
            }
        }
        A2.S s6 = (A2.S) y2.f720h;
        s6.f704h = arrayList;
        MediaSession mediaSession = s6.f697a;
        if (arrayList == null) {
            mediaSession.setQueue(null);
            return;
        }
        ArrayList arrayList2 = new ArrayList(arrayList.size());
        Iterator it2 = arrayList.iterator();
        while (it2.hasNext()) {
            A2.V v6 = (A2.V) it2.next();
            MediaSession.QueueItem queueItem = v6.f712i;
            if (queueItem == null) {
                MediaSession.QueueItem queueItem2 = new MediaSession.QueueItem(v6.f710g.b(), v6.f711h);
                v6.f712i = queueItem2;
                queueItem = queueItem2;
            }
            arrayList2.add(queueItem);
        }
        mediaSession.setQueue(arrayList2);
    }

    public static C1.J F(String str, Uri uri, String str2, Bundle bundle) {
        C0228y c0228y = new C0228y();
        C1322E c1322e = AbstractC1324G.f13948h;
        i3.Z z5 = i3.Z.f13985k;
        List list = Collections.EMPTY_LIST;
        i3.Z z6 = i3.Z.f13985k;
        C1.C c6 = new C1.C();
        C1.F f6 = C1.F.f1879d;
        if (str == null) {
            str = "";
        }
        String str3 = str;
        C0851c c0851c = new C0851c();
        c0851c.f12183a = uri;
        c0851c.f12184b = str2;
        c0851c.f12185c = bundle;
        return new C1.J(str3, new C1.A(c0228y), null, new C1.D(c6), C1.M.f1954K, new C1.F(c0851c));
    }

    public static ComponentName I(PlaybackService playbackService, String str) {
        PackageManager packageManager = playbackService.getPackageManager();
        Intent intent = new Intent(str);
        intent.setPackage(playbackService.getPackageName());
        List<ResolveInfo> queryIntentServices = packageManager.queryIntentServices(intent, 0);
        if (queryIntentServices == null || queryIntentServices.isEmpty()) {
            return null;
        }
        ServiceInfo serviceInfo = queryIntentServices.get(0).serviceInfo;
        return new ComponentName(serviceInfo.packageName, serviceInfo.name);
    }

    @Override
    public final void A(long j6) {
        if (j6 < 0) {
            return;
        }
        G(10, new C2539p0(this, j6, 0), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void B() {
        G(3, new C2537o0(this, 6), ((A2.S) this.f21477k.f720h).c(), true);
    }

    public final void G(final int i6, final InterfaceC2554x0 interfaceC2554x0, final A2.e0 e0Var, final boolean z5) {
        C2535n0 c2535n0 = this.f21473g;
        if (c2535n0.h()) {
            return;
        }
        if (e0Var != null) {
            F1.C.F(c2535n0.f21367l, new Runnable() {
                @Override
                public final void run() {
                    C2556y0 c2556y0 = C2556y0.this;
                    C2535n0 c2535n02 = c2556y0.f21473g;
                    if (c2535n02.h()) {
                        return;
                    }
                    boolean isActive = ((A2.S) c2556y0.f21477k.f720h).f697a.isActive();
                    int i7 = i6;
                    A2.e0 e0Var2 = e0Var;
                    if (!isActive) {
                        StringBuilder n6 = android.support.v4.media.c.n(i7, "Ignore incoming player command before initialization. command=", ", pid=");
                        n6.append(e0Var2.f734a.f731b);
                        AbstractC0363a.k("MediaSessionLegacyStub", n6.toString());
                        return;
                    }
                    C2519f0 K6 = c2556y0.K(e0Var2);
                    if (!c2556y0.f21472f.A(K6, i7)) {
                        if (i7 != 1 || c2535n02.f21375t.i()) {
                            return;
                        }
                        AbstractC0363a.k("MediaSessionLegacyStub", "Calling play() omitted due to COMMAND_PLAY_PAUSE not being available. If this play command has started the service for instance for playback resumption, this may prevent the service from being started into the foreground.");
                        return;
                    }
                    c2535n02.r(K6);
                    c2535n02.f21360e.getClass();
                    try {
                        interfaceC2554x0.a(K6);
                    } catch (RemoteException e6) {
                        AbstractC0363a.l("MediaSessionLegacyStub", "Exception in " + K6, e6);
                    }
                    if (z5) {
                        new SparseBooleanArray().append(i7, true);
                        c2535n02.o(K6);
                    }
                }
            });
            return;
        }
        AbstractC0363a.b("MediaSessionLegacyStub", "RemoteUserInfo is null, ignoring command=" + i6);
    }

    public final void H(h1 h1Var, int i6, InterfaceC2554x0 interfaceC2554x0, A2.e0 e0Var) {
        if (e0Var != null) {
            F1.C.F(this.f21473g.f21367l, new J1.U(this, h1Var, i6, e0Var, interfaceC2554x0));
            return;
        }
        StringBuilder sb = new StringBuilder("RemoteUserInfo is null, ignoring command=");
        Object obj = h1Var;
        if (h1Var == null) {
            obj = Integer.valueOf(i6);
        }
        sb.append(obj);
        AbstractC0363a.b("MediaSessionLegacyStub", sb.toString());
    }

    public final void J(final C1.J j6, final boolean z5) {
        G(31, new InterfaceC2554x0() {
            @Override
            public final void a(C2519f0 c2519f0) {
                C2556y0 c2556y0 = C2556y0.this;
                c2556y0.getClass();
                m3.F p6 = c2556y0.f21473g.p(c2519f0, AbstractC1324G.q(j6), -1, -9223372036854775807L);
                E2.D d6 = new E2.D(c2556y0, c2519f0, z5);
                p6.a(new m3.t(p6, d6), m3.r.f15130g);
            }
        }, ((A2.S) this.f21477k.f720h).c(), false);
    }

    public final C2519f0 K(A2.e0 e0Var) {
        C2519f0 v3 = this.f21472f.v(e0Var);
        if (v3 == null) {
            C2519f0 c2519f0 = new C2519f0(e0Var, 0, 0, this.f21474h.b(e0Var), new C2550v0(e0Var), Bundle.EMPTY);
            C2515d0 k5 = this.f21473g.k(c2519f0);
            this.f21472f.b(e0Var, c2519f0, k5.f21205a, k5.f21206b);
            v3 = c2519f0;
        }
        HandlerC0118z handlerC0118z = this.f21476j;
        long j6 = this.f21481o;
        handlerC0118z.removeMessages(PointerIconCompat.TYPE_CONTEXT_MENU, v3);
        handlerC0118z.sendMessageDelayed(handlerC0118z.obtainMessage(PointerIconCompat.TYPE_CONTEXT_MENU, v3), j6);
        return v3;
    }

    public final void L(d1 d1Var) {
        F1.C.F(this.f21473g.f21367l, new RunnableC2541q0(this, d1Var, 1));
    }

    @Override
    public final void b(A2.L l6) {
        if (l6 != null) {
            G(20, new C0408x(this, l6, -1), ((A2.S) this.f21477k.f720h).c(), false);
        }
    }

    @Override
    public final void c(A2.L l6, int i6) {
        if (l6 != null) {
            if (i6 == -1 || i6 >= 0) {
                G(20, new C0408x(this, l6, i6), ((A2.S) this.f21477k.f720h).c(), false);
            }
        }
    }

    @Override
    public final void d(String str, Bundle bundle, ResultReceiver resultReceiver) {
        AbstractC0364b.g(str);
        if (str.equals("androidx.media3.session.SESSION_COMMAND_MEDIA3_PLAY_REQUEST")) {
            return;
        }
        if (str.equals("androidx.media3.session.SESSION_COMMAND_REQUEST_SESSION3_TOKEN") && resultReceiver != null) {
            resultReceiver.send(0, this.f21473g.f21365j.b());
        } else {
            h1 h1Var = new h1(str, Bundle.EMPTY);
            H(h1Var, 0, new P1.c(this, h1Var, bundle, resultReceiver), ((A2.S) this.f21477k.f720h).c());
        }
    }

    @Override
    public final void e(String str, Bundle bundle) {
        if (str.equals("androidx.media3.session.SESSION_COMMAND_MEDIA3_PLAY_REQUEST")) {
            return;
        }
        h1 h1Var = new h1(str, Bundle.EMPTY);
        H(h1Var, 0, new P1.e(this, h1Var, bundle, 2), ((A2.S) this.f21477k.f720h).c());
    }

    @Override
    public final void f() {
        G(12, new C2537o0(this, 0), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final boolean g(Intent intent) {
        A2.e0 c6 = ((A2.S) this.f21477k.f720h).c();
        c6.getClass();
        return this.f21473g.m(new C2519f0(c6, 0, 0, false, null, Bundle.EMPTY), intent);
    }

    @Override
    public final void h() {
        G(1, new C2537o0(this, 11), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void i() {
        G(1, new C2537o0(this, 10), ((A2.S) this.f21477k.f720h).c(), false);
    }

    @Override
    public final void j(String str, Bundle bundle) {
        J(F(str, null, null, bundle), true);
    }

    @Override
    public final void k(String str, Bundle bundle) {
        J(F(null, null, str, bundle), true);
    }

    @Override
    public final void l(Uri uri, Bundle bundle) {
        J(F(null, uri, null, bundle), true);
    }

    @Override
    public final void m() {
        G(2, new C2537o0(this, 5), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void n(String str, Bundle bundle) {
        J(F(str, null, null, bundle), false);
    }

    @Override
    public final void o(String str, Bundle bundle) {
        J(F(null, null, str, bundle), false);
    }

    @Override
    public final void p(Uri uri, Bundle bundle) {
        J(F(null, uri, null, bundle), false);
    }

    @Override
    public final void q(A2.L l6) {
        if (l6 == null) {
            return;
        }
        G(20, new K1.d(11, this, l6), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void r() {
        G(11, new C2537o0(this, 4), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void s(long j6) {
        G(5, new C2539p0(this, j6, 1), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void t(final float f6) {
        if (f6 <= 0.0f) {
            return;
        }
        G(13, new InterfaceC2554x0() {
            @Override
            public final void a(C2519f0 c2519f0) {
                C2556y0.this.f21473g.f21375t.k0(f6);
            }
        }, ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void u(A2.j0 j0Var) {
        v(j0Var);
    }

    @Override
    public final void v(A2.j0 j0Var) {
        C1.b0 o6 = AbstractC2543s.o(j0Var);
        if (o6 != null) {
            H(null, 40010, new C2537o0(this, o6), ((A2.S) this.f21477k.f720h).c());
            return;
        }
        AbstractC0363a.k("MediaSessionLegacyStub", "Ignoring invalid RatingCompat " + j0Var);
    }

    @Override
    public final void w(int i6) {
        G(15, new C2542r0(this, i6, 0), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void x(int i6) {
        G(14, new C2542r0(this, i6, 1), ((A2.S) this.f21477k.f720h).c(), true);
    }

    @Override
    public final void y() {
        boolean s6 = this.f21473g.f21375t.s(9);
        A2.Y y2 = this.f21477k;
        if (s6) {
            G(9, new C2537o0(this, 8), ((A2.S) y2.f720h).c(), true);
        } else {
            G(8, new C2537o0(this, 9), ((A2.S) y2.f720h).c(), true);
        }
    }

    @Override
    public final void z() {
        boolean s6 = this.f21473g.f21375t.s(7);
        A2.Y y2 = this.f21477k;
        if (s6) {
            G(7, new C2537o0(this, 2), ((A2.S) y2.f720h).c(), true);
        } else {
            G(6, new C2537o0(this, 3), ((A2.S) y2.f720h).c(), true);
        }
    }
}