正在查看: JetMelo v1.0 应用的 C2533y0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: JetMelo v1.0 应用的 C2533y0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package z2;
import A2.HandlerC0095z;
import C1.C0205y;
import F1.AbstractC0340a;
import F1.AbstractC0341b;
import J1.C0385x;
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.text.TextUtils;
import android.util.Log;
import android.util.SparseBooleanArray;
import b4.C0828c;
import com.rcmiku.music.playback.PlaybackService;
import i3.AbstractC1301G;
import i3.C1299E;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public final class C2533y0 extends A2.P {
public static final int f21338r;
public final B2.y f21339f;
public final C2512n0 f21340g;
public final A2.f0 f21341h;
public final C2529w0 f21342i;
public final HandlerC0095z f21343j;
public final A2.Y f21344k;
public final F1.p f21345l;
public final ComponentName f21346m;
public b1 f21347n;
public volatile long f21348o;
public C2529w0 f21349p;
public int f21350q;
static {
f21338r = F1.C.f3818a >= 31 ? 33554432 : 0;
}
public C2533y0(C2512n0 c2512n0, Uri uri, Handler handler, Bundle bundle) {
ComponentName componentName;
ComponentName I;
PendingIntent foregroundService;
this.f21340g = c2512n0;
PlaybackService playbackService = c2512n0.f21228f;
this.f21341h = A2.f0.a(playbackService);
this.f21342i = new C2529w0(this);
B2.y yVar = new B2.y(c2512n0);
this.f21339f = yVar;
this.f21348o = 300000L;
this.f21343j = new HandlerC0095z(c2512n0.f21234l.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.f21346m = componentName;
if (componentName == null || F1.C.f3818a < 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.f21345l = pVar;
IntentFilter intentFilter = new IntentFilter("android.intent.action.MEDIA_BUTTON");
intentFilter.addDataScheme(uri.getScheme());
if (F1.C.f3818a < 33) {
playbackService.registerReceiver(pVar, intentFilter);
} else {
playbackService.registerReceiver(pVar, intentFilter, 4);
}
intent2.setPackage(playbackService.getPackageName());
foregroundService = PendingIntent.getBroadcast(playbackService, 0, intent2, f21338r);
I = new ComponentName(playbackService, (Class<?>) PlaybackService.class);
} else {
intent2.setComponent(I);
foregroundService = z5 ? F1.C.f3818a >= 26 ? PendingIntent.getForegroundService(playbackService, 0, intent2, f21338r) : PendingIntent.getService(playbackService, 0, intent2, f21338r) : PendingIntent.getBroadcast(playbackService, 0, intent2, f21338r);
this.f21345l = null;
}
String join = TextUtils.join(".", new String[]{"androidx.media3.session.id", c2512n0.f21231i});
ComponentName componentName2 = I;
int i6 = F1.C.f3818a;
A2.Y y2 = new A2.Y(playbackService, join, i6 >= 31 ? null : componentName2, i6 < 31 ? foregroundService : null, bundle);
this.f21344k = y2;
if (i6 >= 31 && componentName != null) {
try {
MediaSession mediaSession = ((A2.S) y2.f587h).f564a;
mediaSession.getClass();
mediaSession.setMediaButtonBroadcastReceiver(componentName);
} catch (IllegalArgumentException e6) {
if (!Build.MANUFACTURER.equals("motorola")) {
throw e6;
}
AbstractC0340a.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 = c2512n0.f21243u;
if (pendingIntent != null) {
((A2.S) this.f21344k.f587h).f564a.setSessionActivity(pendingIntent);
}
((A2.S) this.f21344k.f587h).e(this, handler);
}
public static void C(A2.Y y2, A2.M m2) {
A2.S s6 = (A2.S) y2.f587h;
s6.f572i = m2;
MediaMetadata mediaMetadata = m2.f555h;
if (mediaMetadata == null) {
Parcel obtain = Parcel.obtain();
try {
m2.writeToParcel(obtain, 0);
obtain.setDataPosition(0);
MediaMetadata mediaMetadata2 = (MediaMetadata) MediaMetadata.CREATOR.createFromParcel(obtain);
m2.f555h = mediaMetadata2;
obtain.recycle();
mediaMetadata = mediaMetadata2;
} catch (Throwable th) {
obtain.recycle();
throw th;
}
}
s6.f564a.setMetadata(mediaMetadata);
}
public static void D(C2533y0 c2533y0, d1 d1Var) {
c2533y0.getClass();
int i6 = d1Var.s(20) ? 4 : 0;
if (c2533y0.f21350q != i6) {
c2533y0.f21350q = i6;
((A2.S) c2533y0.f21344k.f587h).f564a.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.f578h;
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.f587h;
s6.f571h = arrayList;
MediaSession mediaSession = s6.f564a;
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.f579i;
if (queueItem == null) {
MediaSession.QueueItem queueItem2 = new MediaSession.QueueItem(v6.f577g.b(), v6.f578h);
v6.f579i = queueItem2;
queueItem = queueItem2;
}
arrayList2.add(queueItem);
}
mediaSession.setQueue(arrayList2);
}
public static C1.J F(String str, Uri uri, String str2, Bundle bundle) {
C0205y c0205y = new C0205y();
C1299E c1299e = AbstractC1301G.f13815h;
i3.Z z5 = i3.Z.f13852k;
List list = Collections.EMPTY_LIST;
i3.Z z6 = i3.Z.f13852k;
C1.C c6 = new C1.C();
C1.F f6 = C1.F.f1746d;
if (str == null) {
str = "";
}
String str3 = str;
C0828c c0828c = new C0828c();
c0828c.f12050a = uri;
c0828c.f12051b = str2;
c0828c.f12052c = bundle;
return new C1.J(str3, new C1.A(c0205y), null, new C1.D(c6), C1.M.f1821K, new C1.F(c0828c));
}
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 C2516p0(this, j6, 0), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void B() {
G(3, new C2514o0(this, 6), ((A2.S) this.f21344k.f587h).c(), true);
}
public final void G(final int i6, final InterfaceC2531x0 interfaceC2531x0, final A2.e0 e0Var, final boolean z5) {
C2512n0 c2512n0 = this.f21340g;
if (c2512n0.h()) {
return;
}
if (e0Var != null) {
F1.C.F(c2512n0.f21234l, new Runnable() {
@Override
public final void run() {
C2533y0 c2533y0 = C2533y0.this;
C2512n0 c2512n02 = c2533y0.f21340g;
if (c2512n02.h()) {
return;
}
boolean isActive = ((A2.S) c2533y0.f21344k.f587h).f564a.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.f601a.f598b);
AbstractC0340a.k("MediaSessionLegacyStub", n6.toString());
return;
}
C2496f0 K6 = c2533y0.K(e0Var2);
if (!c2533y0.f21339f.A(K6, i7)) {
if (i7 != 1 || c2512n02.f21242t.i()) {
return;
}
AbstractC0340a.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;
}
c2512n02.r(K6);
c2512n02.f21227e.getClass();
try {
interfaceC2531x0.a(K6);
} catch (RemoteException e6) {
AbstractC0340a.l("MediaSessionLegacyStub", "Exception in " + K6, e6);
}
if (z5) {
new SparseBooleanArray().append(i7, true);
c2512n02.o(K6);
}
}
});
return;
}
AbstractC0340a.b("MediaSessionLegacyStub", "RemoteUserInfo is null, ignoring command=" + i6);
}
public final void H(h1 h1Var, int i6, InterfaceC2531x0 interfaceC2531x0, A2.e0 e0Var) {
if (e0Var != null) {
F1.C.F(this.f21340g.f21234l, new J1.U(this, h1Var, i6, e0Var, interfaceC2531x0));
return;
}
StringBuilder sb = new StringBuilder("RemoteUserInfo is null, ignoring command=");
Object obj = h1Var;
if (h1Var == null) {
obj = Integer.valueOf(i6);
}
sb.append(obj);
AbstractC0340a.b("MediaSessionLegacyStub", sb.toString());
}
public final void J(final C1.J j6, final boolean z5) {
G(31, new InterfaceC2531x0() {
@Override
public final void a(C2496f0 c2496f0) {
C2533y0 c2533y0 = C2533y0.this;
c2533y0.getClass();
m3.F p6 = c2533y0.f21340g.p(c2496f0, AbstractC1301G.q(j6), -1, -9223372036854775807L);
E2.D d6 = new E2.D(c2533y0, c2496f0, z5);
p6.a(new m3.t(p6, d6), m3.r.f14997g);
}
}, ((A2.S) this.f21344k.f587h).c(), false);
}
public final C2496f0 K(A2.e0 e0Var) {
C2496f0 v3 = this.f21339f.v(e0Var);
if (v3 == null) {
C2496f0 c2496f0 = new C2496f0(e0Var, 0, 0, this.f21341h.b(e0Var), new C2527v0(e0Var), Bundle.EMPTY);
C2492d0 k5 = this.f21340g.k(c2496f0);
this.f21339f.b(e0Var, c2496f0, k5.f21072a, k5.f21073b);
v3 = c2496f0;
}
HandlerC0095z handlerC0095z = this.f21343j;
long j6 = this.f21348o;
handlerC0095z.removeMessages(1001, v3);
handlerC0095z.sendMessageDelayed(handlerC0095z.obtainMessage(1001, v3), j6);
return v3;
}
public final void L(d1 d1Var) {
F1.C.F(this.f21340g.f21234l, new RunnableC2518q0(this, d1Var, 1));
}
@Override
public final void b(A2.L l6) {
if (l6 != null) {
G(20, new C0385x(this, l6, -1), ((A2.S) this.f21344k.f587h).c(), false);
}
}
@Override
public final void c(A2.L l6, int i6) {
if (l6 != null) {
if (i6 == -1 || i6 >= 0) {
G(20, new C0385x(this, l6, i6), ((A2.S) this.f21344k.f587h).c(), false);
}
}
}
@Override
public final void d(String str, Bundle bundle, ResultReceiver resultReceiver) {
AbstractC0341b.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.f21340g.f21232j.b());
} else {
h1 h1Var = new h1(str, Bundle.EMPTY);
H(h1Var, 0, new P1.c(this, h1Var, bundle, resultReceiver), ((A2.S) this.f21344k.f587h).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.f21344k.f587h).c());
}
@Override
public final void f() {
G(12, new C2514o0(this, 0), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final boolean g(Intent intent) {
A2.e0 c6 = ((A2.S) this.f21344k.f587h).c();
c6.getClass();
return this.f21340g.m(new C2496f0(c6, 0, 0, false, null, Bundle.EMPTY), intent);
}
@Override
public final void h() {
G(1, new C2514o0(this, 11), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void i() {
G(1, new C2514o0(this, 10), ((A2.S) this.f21344k.f587h).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 C2514o0(this, 5), ((A2.S) this.f21344k.f587h).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.f21344k.f587h).c(), true);
}
@Override
public final void r() {
G(11, new C2514o0(this, 4), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void s(long j6) {
G(5, new C2516p0(this, j6, 1), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void t(final float f6) {
if (f6 <= 0.0f) {
return;
}
G(13, new InterfaceC2531x0() {
@Override
public final void a(C2496f0 c2496f0) {
C2533y0.this.f21340g.f21242t.k0(f6);
}
}, ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void u(A2.j0 j0Var) {
v(j0Var);
}
@Override
public final void v(A2.j0 j0Var) {
C1.b0 o6 = AbstractC2520s.o(j0Var);
if (o6 != null) {
H(null, 40010, new C2514o0(this, o6), ((A2.S) this.f21344k.f587h).c());
return;
}
AbstractC0340a.k("MediaSessionLegacyStub", "Ignoring invalid RatingCompat " + j0Var);
}
@Override
public final void w(int i6) {
G(15, new C2519r0(this, i6, 0), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void x(int i6) {
G(14, new C2519r0(this, i6, 1), ((A2.S) this.f21344k.f587h).c(), true);
}
@Override
public final void y() {
boolean s6 = this.f21340g.f21242t.s(9);
A2.Y y2 = this.f21344k;
if (s6) {
G(9, new C2514o0(this, 8), ((A2.S) y2.f587h).c(), true);
} else {
G(8, new C2514o0(this, 9), ((A2.S) y2.f587h).c(), true);
}
}
@Override
public final void z() {
boolean s6 = this.f21340g.f21242t.s(7);
A2.Y y2 = this.f21344k;
if (s6) {
G(7, new C2514o0(this, 2), ((A2.S) y2.f587h).c(), true);
} else {
G(6, new C2514o0(this, 3), ((A2.S) y2.f587h).c(), true);
}
}
}