正在查看: Bhakti v5.4.0 应用的 P0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Bhakti v5.4.0 应用的 P0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package s4;
import L8.C0472l;
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 androidx.media3.session.MediaSessionService;
import b3.C1012A;
import b3.C1014C;
import b3.C1017G;
import b3.C1020J;
import b3.C1036n;
import b3.C1042v;
import b3.C1044x;
import b3.C1046z;
import e3.AbstractC1357b;
import e3.AbstractC1359d;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public final class P0 extends t4.M {
public static final int f19380r;
public final h5.c0 f19381f;
public final H0 f19382g;
public final t4.c0 f19383h;
public final G3.o f19384i;
public final Ed.O f19385j;
public final t4.V f19386k;
public final Pb.k f19387l;
public final ComponentName f19388m;
public Xd.c n;
public volatile long f19389o;
public G3.o f19390p;
public int f19391q;
static {
f19380r = e3.C.a >= 31 ? 33554432 : 0;
}
public P0(H0 h02, Uri uri, Handler handler, Bundle bundle) {
ComponentName componentName;
ComponentName J9;
PendingIntent foregroundService;
this.f19382g = h02;
MediaSessionService mediaSessionService = h02.f19348f;
this.f19383h = t4.c0.a(mediaSessionService);
G3.o oVar = new G3.o();
oVar.f3351e = this;
oVar.b = C1020J.f11350K;
oVar.f3349c = "";
oVar.a = -9223372036854775807L;
this.f19384i = oVar;
h5.c0 c0Var = new h5.c0(h02);
this.f19381f = c0Var;
this.f19389o = 300000L;
this.f19385j = new Ed.O(h02.f19354l.getLooper(), c0Var);
PackageManager packageManager = mediaSessionService.getPackageManager();
Intent intent = new Intent("android.intent.action.MEDIA_BUTTON");
intent.setPackage(mediaSessionService.getPackageName());
List<ResolveInfo> queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent, 0);
boolean z10 = 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.f19388m = componentName;
if (componentName == null || e3.C.a < 31) {
J9 = J(mediaSessionService, "androidx.media3.session.MediaLibraryService");
J9 = J9 == null ? J(mediaSessionService, "androidx.media3.session.MediaSessionService") : J9;
if (J9 == null || J9.equals(componentName)) {
z10 = false;
}
} else {
z10 = false;
J9 = componentName;
}
Intent intent2 = new Intent("android.intent.action.MEDIA_BUTTON", uri);
if (J9 == null) {
Pb.k kVar = new Pb.k(this, 19);
this.f19387l = kVar;
IntentFilter intentFilter = new IntentFilter("android.intent.action.MEDIA_BUTTON");
intentFilter.addDataScheme(uri.getScheme());
if (e3.C.a < 33) {
mediaSessionService.registerReceiver(kVar, intentFilter);
} else {
com.google.android.gms.internal.ads.a.f(mediaSessionService, kVar, intentFilter);
}
intent2.setPackage(mediaSessionService.getPackageName());
foregroundService = PendingIntent.getBroadcast(mediaSessionService, 0, intent2, f19380r);
J9 = new ComponentName(mediaSessionService, mediaSessionService.getClass());
} else {
intent2.setComponent(J9);
foregroundService = z10 ? e3.C.a >= 26 ? PendingIntent.getForegroundService(mediaSessionService, 0, intent2, f19380r) : PendingIntent.getService(mediaSessionService, 0, intent2, f19380r) : PendingIntent.getBroadcast(mediaSessionService, 0, intent2, f19380r);
this.f19387l = null;
}
String join = TextUtils.join(".", new String[]{"androidx.media3.session.id", h02.f19351i});
int i10 = e3.C.a;
t4.V v10 = new t4.V(mediaSessionService, join, i10 < 31 ? J9 : null, i10 < 31 ? foregroundService : null, bundle);
this.f19386k = v10;
if (i10 >= 31 && componentName != null) {
try {
MediaSession mediaSession = ((t4.O) v10.b).a;
mediaSession.getClass();
mediaSession.setMediaButtonBroadcastReceiver(componentName);
} catch (IllegalArgumentException e4) {
if (!Build.MANUFACTURER.equals("motorola")) {
throw e4;
}
AbstractC1357b.i("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.", e4);
}
}
PendingIntent pendingIntent = h02.f19361u;
if (pendingIntent != null) {
((t4.O) this.f19386k.b).a.setSessionActivity(pendingIntent);
}
((t4.O) this.f19386k.b).e(this, handler);
}
public static void D(t4.V v10, t4.J j10) {
t4.O o10 = (t4.O) v10.b;
o10.f19941i = j10;
MediaMetadata mediaMetadata = j10.b;
if (mediaMetadata == null) {
Parcel obtain = Parcel.obtain();
try {
j10.writeToParcel(obtain, 0);
obtain.setDataPosition(0);
MediaMetadata mediaMetadata2 = (MediaMetadata) MediaMetadata.CREATOR.createFromParcel(obtain);
j10.b = mediaMetadata2;
obtain.recycle();
mediaMetadata = mediaMetadata2;
} catch (Throwable th2) {
obtain.recycle();
throw th2;
}
}
o10.a.setMetadata(mediaMetadata);
}
public static void E(P0 p02, s1 s1Var) {
p02.getClass();
int i10 = s1Var.e1(20) ? 4 : 0;
if (p02.f19391q != i10) {
p02.f19391q = i10;
((t4.O) p02.f19386k.b).a.setFlags(i10 | 3);
}
}
public static void F(t4.V v10, ArrayList arrayList) {
if (arrayList != null) {
v10.getClass();
HashSet hashSet = new HashSet();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
t4.S s10 = (t4.S) it.next();
if (s10 == null) {
throw new IllegalArgumentException("queue shouldn't have null items");
}
long j10 = s10.b;
if (hashSet.contains(Long.valueOf(j10))) {
Log.e("MediaSessionCompat", Ai.o.g("Found duplicate queue id: ", j10), new IllegalArgumentException("id of each queue item should be unique"));
}
hashSet.add(Long.valueOf(j10));
}
}
t4.O o10 = (t4.O) v10.b;
o10.f19940h = arrayList;
MediaSession mediaSession = o10.a;
if (arrayList == null) {
mediaSession.setQueue(null);
return;
}
ArrayList arrayList2 = new ArrayList(arrayList.size());
Iterator it2 = arrayList.iterator();
while (it2.hasNext()) {
t4.S s11 = (t4.S) it2.next();
MediaSession.QueueItem queueItem = s11.f19946c;
if (queueItem == null) {
MediaSession.QueueItem queueItem2 = new MediaSession.QueueItem(s11.a.b(), s11.b);
s11.f19946c = queueItem2;
queueItem = queueItem2;
}
arrayList2.add(queueItem);
}
mediaSession.setQueue(arrayList2);
}
public static C1017G G(String str, Uri uri, String str2, Bundle bundle) {
C1042v c1042v = new C1042v();
cc.U u10 = cc.Y.b;
cc.B0 b0 = cc.B0.e;
Collections.emptyList();
cc.B0 b02 = cc.B0.e;
C1046z c1046z = new C1046z();
C1014C c1014c = C1014C.f11287d;
if (str == null) {
str = "";
}
String str3 = str;
uo.a aVar = new uo.a((char) 0, 19);
aVar.b = uri;
aVar.c = str2;
aVar.d = bundle;
return new C1017G(str3, new C1044x(c1042v), null, new C1012A(c1046z), C1020J.f11350K, new C1014C(aVar));
}
public static ComponentName J(MediaSessionService mediaSessionService, String str) {
PackageManager packageManager = mediaSessionService.getPackageManager();
Intent intent = new Intent(str);
intent.setPackage(mediaSessionService.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 j10) {
if (j10 < 0) {
return;
}
H(10, new K0(this, j10, 0), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void B() {
H(3, new J0(this, 6), ((t4.O) this.f19386k.b).c(), true);
}
public final void H(final int i10, final O0 o02, final t4.b0 b0Var, final boolean z10) {
H0 h02 = this.f19382g;
if (h02.l()) {
return;
}
if (b0Var != null) {
e3.C.V(h02.f19354l, new Runnable() {
@Override
public final void run() {
P0 p02 = P0.this;
H0 h03 = p02.f19382g;
if (h03.l()) {
return;
}
boolean isActive = ((t4.O) p02.f19386k.b).a.isActive();
int i11 = i10;
t4.b0 b0Var2 = b0Var;
if (!isActive) {
StringBuilder v10 = Ai.o.v(i11, "Ignore incoming player command before initialization. command=", ", pid=");
v10.append(b0Var2.a.b);
AbstractC1357b.q("MediaSessionLegacyStub", v10.toString());
return;
}
C2319z0 L9 = p02.L(b0Var2);
if (!p02.f19381f.N(L9, i11)) {
if (i11 != 1 || h03.t.w()) {
return;
}
AbstractC1357b.q("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;
}
h03.f19347e.r(h03.f19353k, h03.w(L9), i11);
try {
o02.b(L9);
} catch (RemoteException e4) {
AbstractC1357b.r("MediaSessionLegacyStub", "Exception in " + L9, e4);
}
if (z10) {
SparseBooleanArray sparseBooleanArray = new SparseBooleanArray();
sparseBooleanArray.append(i11, true);
h03.t(L9, new b3.T(new C1036n(sparseBooleanArray)));
}
}
});
return;
}
AbstractC1357b.f("MediaSessionLegacyStub", "RemoteUserInfo is null, ignoring command=" + i10);
}
public final void I(y1 y1Var, int i10, O0 o02, t4.b0 b0Var) {
if (b0Var != null) {
e3.C.V(this.f19382g.f19354l, new l3.Z(this, y1Var, i10, b0Var, o02));
return;
}
StringBuilder sb = new StringBuilder("RemoteUserInfo is null, ignoring command=");
Object obj = y1Var;
if (y1Var == null) {
obj = Integer.valueOf(i10);
}
sb.append(obj);
AbstractC1357b.f("MediaSessionLegacyStub", sb.toString());
}
public final void K(C1017G c1017g, boolean z10) {
H(31, new com.google.firebase.messaging.g(this, c1017g, z10), ((t4.O) this.f19386k.b).c(), false);
}
public final C2319z0 L(t4.b0 b0Var) {
C2319z0 z10 = this.f19381f.z(b0Var);
if (z10 == null) {
z10 = new C2319z0(b0Var, 0, 0, this.f19383h.b(b0Var), new N0(b0Var), Bundle.EMPTY);
C2315x0 o10 = this.f19382g.o(z10);
this.f19381f.e(b0Var, z10, o10.a, o10.b);
}
Ed.O o11 = this.f19385j;
long j10 = this.f19389o;
o11.removeMessages(1001, z10);
o11.sendMessageDelayed(o11.obtainMessage(1001, z10), j10);
return z10;
}
public final void M(s1 s1Var) {
e3.C.V(this.f19382g.f19354l, new L0(this, s1Var, 0));
}
@Override
public final void b(t4.I i10) {
if (i10 != null) {
H(20, new C0472l(this, i10, -1, 6), ((t4.O) this.f19386k.b).c(), false);
}
}
@Override
public final void c(t4.I i10, int i11) {
if (i10 != null) {
if (i11 == -1 || i11 >= 0) {
H(20, new C0472l(this, i10, i11, 6), ((t4.O) this.f19386k.b).c(), false);
}
}
}
@Override
public final void d(String str, Bundle bundle, ResultReceiver resultReceiver) {
AbstractC1359d.h(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.f19382g.f19352j.b());
} else {
y1 y1Var = new y1(str, Bundle.EMPTY);
I(y1Var, 0, new D3.e(this, y1Var, bundle, resultReceiver), ((t4.O) this.f19386k.b).c());
}
}
@Override
public final void e(String str, Bundle bundle) {
if (str.equals("androidx.media3.session.SESSION_COMMAND_MEDIA3_PLAY_REQUEST")) {
return;
}
y1 y1Var = new y1(str, Bundle.EMPTY);
I(y1Var, 0, new A3.M(this, y1Var, bundle, 19), ((t4.O) this.f19386k.b).c());
}
@Override
public final void f() {
H(12, new J0(this, 9), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final boolean g(Intent intent) {
t4.b0 c5 = ((t4.O) this.f19386k.b).c();
c5.getClass();
return this.f19382g.r(new C2319z0(c5, 0, 0, false, null, Bundle.EMPTY), intent);
}
@Override
public final void h() {
H(1, new J0(this, 0), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void i() {
H(1, new J0(this, 10), ((t4.O) this.f19386k.b).c(), false);
}
@Override
public final void j(String str, Bundle bundle) {
K(G(str, null, null, bundle), true);
}
@Override
public final void k(String str, Bundle bundle) {
K(G(null, null, str, bundle), true);
}
@Override
public final void l(Uri uri, Bundle bundle) {
K(G(null, uri, null, bundle), true);
}
@Override
public final void m() {
H(2, new J0(this, 5), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void n(String str, Bundle bundle) {
K(G(str, null, null, bundle), false);
}
@Override
public final void o(String str, Bundle bundle) {
K(G(null, null, str, bundle), false);
}
@Override
public final void p(Uri uri, Bundle bundle) {
K(G(null, uri, null, bundle), false);
}
@Override
public final void q(t4.I i10) {
if (i10 == null) {
return;
}
H(20, new io.sentry.util.k(11, this, i10), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void r() {
H(11, new J0(this, 4), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void s(long j10) {
H(5, new K0(this, j10, 1), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void t(float f10) {
if (f10 <= 0.0f) {
return;
}
H(13, new E(f10, 2, this), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void u(t4.h0 h0Var) {
v(h0Var);
}
@Override
public final void v(t4.h0 h0Var) {
b3.Y t = s.t(h0Var);
if (t != null) {
I(null, 40010, new io.sentry.util.k(10, this, t), ((t4.O) this.f19386k.b).c());
return;
}
AbstractC1357b.q("MediaSessionLegacyStub", "Ignoring invalid RatingCompat " + h0Var);
}
@Override
public final void w(int i10) {
H(15, new M0(this, i10, 0), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void x(int i10) {
H(14, new M0(this, i10, 1), ((t4.O) this.f19386k.b).c(), true);
}
@Override
public final void y() {
boolean e12 = this.f19382g.t.e1(9);
t4.V v10 = this.f19386k;
if (e12) {
H(9, new J0(this, 7), ((t4.O) v10.b).c(), true);
} else {
H(8, new J0(this, 8), ((t4.O) v10.b).c(), true);
}
}
@Override
public final void z() {
boolean e12 = this.f19382g.t.e1(7);
t4.V v10 = this.f19386k;
if (e12) {
H(7, new J0(this, 2), ((t4.O) v10.b).c(), true);
} else {
H(6, new J0(this, 3), ((t4.O) v10.b).c(), true);
}
}
}