MD5 校验值:13e9f681f5bed77188ac69741746def0
PlayerService.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.mixplorer.services; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.session.MediaSession; import android.net.Uri; import android.os.Handler; import android.os.ParcelFileDescriptor; import android.text.SpannableStringBuilder; import android.text.style.TextAppearanceSpan; import android.widget.RemoteViews; import com.mixplorer.AppImpl; import com.mixplorer.R; import com.mixplorer.activities.PlayerActivity; import java.io.FileDescriptor; import java.lang.ref.WeakReference; import java.lang.reflect.Method; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.HashMap; import java.util.WeakHashMap; import java.util.concurrent.atomic.AtomicReference; import libs.bw1; import libs.d93; import libs.dd; import libs.dn1; import libs.dn2; import libs.ez; import libs.nl0; import libs.nt; import libs.tw0; import libs.uc2; import libs.ui3; import libs.vf3; import libs.wc2; import libs.xt1; import libs.xv1; import libs.yc2; import libs.yt1; import libs.yu1; import libs.z90; import libs.zr0; import libs.zt1; public class PlayerService extends bw1 { public static final int c2 = 0; public Object Y1; public Notification Z1; public xt1 a2; public PendingIntent b2; public PlayerService() { new AtomicReference(); new WeakHashMap(); new HashMap(); new ArrayList(); new WeakReference(this); new Handler(); } @Override public final int f(Intent intent) { boolean e = n().e(); if ("action_thread_pause_resume".equals(intent.getAction())) { e = m(e); } else { if ("action_thread_prev".equals(intent.getAction())) { l(false); } else if ("action_thread_next".equals(intent.getAction())) { l(true); } else if ("action_thread_stop".equals(intent.getAction())) { yc2 yc2Var = AppImpl.Q1; if (yc2Var != null) { uc2 uc2Var = yc2Var.B; if (uc2Var.b()) { PlayerService playerService = (PlayerService) uc2Var.a; playerService.getClass(); try { zt1.e().cancel(132470); } catch (Throwable unused) { } playerService.Z1 = null; } bw1.j(PlayerService.class, uc2Var); Intent intent2 = new Intent("finishplayer"); intent2.setPackage(tw0.j()); sendBroadcast(intent2); } else { try { zt1.e().cancel(132470); } catch (Throwable unused2) { } this.Z1 = null; bw1.h(PlayerService.class, this); return -1; } } e = true; } PlayerActivity.C0(e); return 1; } public final PendingIntent k() { if (this.b2 == null) { Intent intent = new Intent(tw0.g, (Class<?>) PlayerActivity.class); intent.setPackage(tw0.j()); intent.putExtra("thread_id", 132470); this.b2 = PendingIntent.getActivity(tw0.g, 132470, intent, z90.b(134217728)); } return this.b2; } public final synchronized void l(boolean z) { yc2 yc2Var = AppImpl.Q1; if (yc2Var == null) { return; } if (z) { wc2 wc2Var = yc2Var.c; if (wc2Var != null) { int i = wc2Var.b + 1; if (i >= yc2Var.a.size()) { i = 0; } yc2Var.s(i); } } else { wc2 wc2Var2 = yc2Var.c; if (wc2Var2 != null) { int i2 = wc2Var2.b - 1; if (i2 < 0) { i2 = yc2Var.a.size() - 1; } yc2Var.s(i2); } } new yu1(new dn1(this, yc2Var, 13)).start(); } public final synchronized boolean m(boolean z) { o(!z); yc2 yc2Var = AppImpl.Q1; if (z) { if (yc2Var != null) { yc2Var.m(); } return false; } if (yc2Var != null) { yc2Var.q(); } return true; } public final xt1 n() { boolean z; float f; Charset charset; int i; int i2; if (this.a2 == null) { yc2 yc2Var = AppImpl.Q1; if (yc2Var != null && yc2Var.i) { z = true; } else { z = false; } if (yc2Var != null) { f = yc2Var.f; } else { f = 1.0f; } if (yc2Var != null) { charset = yc2Var.m; } else { charset = null; } Charset charset2 = charset; if (yc2Var != null) { i = yc2Var.n; } else { i = 17; } if (yc2Var != null) { i2 = yc2Var.o; } else { i2 = -1; } this.a2 = new xt1(z, charset2, i, i2, f); } return this.a2; } public final void o(boolean z) { RemoteViews remoteViews; if (this.Z1 == null) { return; } if (zt1.f(this.Y1)) { q(z); } else { boolean k = vf3.k(); int i = R.drawable.ntf_resume; if (k) { if (z) { i = R.drawable.ntf_pause; } Bitmap a = d93.a(i, null); remoteViews = this.Z1.bigContentView; remoteViews.setImageViewBitmap(R.id.notification_pause_resume, a); } else { if (z) { i = R.drawable.ntf_pause; } this.Z1.contentView.setImageViewBitmap(R.id.notification_pause_resume, d93.a(i, null)); } } zt1.i(132470, this.Z1); } @Override public final void onDestroy() { if (AppImpl.Q1 != null) { n().i(); } try { zt1.e().cancel(132470); } catch (Throwable unused) { } this.Z1 = null; if (vf3.f()) { AudioManager audioManager = (AudioManager) tw0.g.getSystemService("audio"); Object obj = 0; Object[] objArr = {null}; Method method = dd.a; if (method != null) { try { obj = method.invoke(audioManager, objArr); } catch (Exception e) { e.printStackTrace(); } } ((Integer) obj).getClass(); } super.onDestroy(); } public final void p(Object obj, boolean z, long j) { Object obj2; boolean z2 = false; xt1 n = n(); n.a = j; n.k = false; n.j = -1L; n.l = true; if (obj != null) { nl0.y0(50L); n.g = 1; try { if (obj instanceof ParcelFileDescriptor) { obj2 = ((ParcelFileDescriptor) obj).getFileDescriptor(); } else { obj2 = obj; } ez ezVar = n.c; if (ezVar != null) { try { ezVar.d("play", new Class[]{Object.class, Uri.class, Boolean.TYPE, Integer.TYPE}, new Object[]{obj2, null, Boolean.valueOf(z), 0}); return; } catch (Throwable unused) { return; } } if (n.e != null && PlayerActivity.U3) { n.f(false); } else { n.f(true); n.b(); } MediaPlayer mediaPlayer = n.e; if (obj2 instanceof FileDescriptor) { mediaPlayer.setDataSource((FileDescriptor) obj2); } else { String obj3 = obj2.toString(); if (ui3.w(obj3) || ui3.u(obj3)) { z2 = true; } if (z2) { mediaPlayer.setDataSource(this, (Uri) obj2); } else { mediaPlayer.setDataSource(obj2.toString()); } } n.j(true); n.e.prepare(); } catch (Throwable th) { xv1.h("PLAY", ui3.A(th)); if (obj instanceof ParcelFileDescriptor) { zr0.G((ParcelFileDescriptor) obj); } n.g = -1; n.h = -1; n.i.onError(ui3.A(th)); } } } public final void q(boolean z) { int i; int i2; Notification build; MediaSession.Token token; Intent intent = new Intent(tw0.g, (Class<?>) PlayerService.class); intent.setAction("action_thread_prev"); intent.putExtra("thread_id", 132470); yt1 yt1Var = new yt1(R.drawable.ntf_prev, dn2.V(R.string.previous), PendingIntent.getService(tw0.g, 132470, intent, z90.b(134217728))); Intent intent2 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent2.setAction("action_thread_pause_resume"); intent2.putExtra("thread_id", 132470); if (z) { i = R.drawable.ntf_pause; } else { i = R.drawable.ntf_resume; } if (z) { i2 = R.string.pause; } else { i2 = R.string.resume; } yt1 yt1Var2 = new yt1(i, dn2.V(i2), PendingIntent.getService(tw0.g, 132470, intent2, z90.b(134217728))); Intent intent3 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent3.setAction("action_thread_next"); intent3.putExtra("thread_id", 132470); yt1 yt1Var3 = new yt1(R.drawable.ntf_next, dn2.V(R.string.next), PendingIntent.getService(tw0.g, 132470, intent3, z90.b(134217728))); Intent intent4 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent4.setAction("action_thread_stop"); intent4.putExtra("thread_id", 132470); yt1[] yt1VarArr = {yt1Var, yt1Var2, yt1Var3, new yt1(R.drawable.ntf_stop, dn2.V(R.string.exit), PendingIntent.getService(tw0.g, 132470, intent4, z90.b(134217728)))}; yc2 yc2Var = AppImpl.Q1; if (yc2Var != null) { Object obj = this.Y1; yc2Var.getClass(); if (vf3.o()) { token = yc2Var.y.getSessionToken(); } else { token = null; } zt1.n(obj, token, 1, 2, 3); } zt1.a(this.Y1, yt1VarArr); if (vf3.k()) { build = nt.c(this.Y1).build(); this.Z1 = build; } } public final void r(RemoteViews remoteViews) { int i; try { if (n().e()) { i = R.drawable.ntf_pause; } else { i = R.drawable.ntf_resume; } remoteViews.setImageViewBitmap(R.id.notification_pause_resume, d93.a(i, null)); Intent intent = new Intent(tw0.g, (Class<?>) PlayerService.class); intent.setAction("action_thread_pause_resume"); intent.putExtra("thread_id", 132470); remoteViews.setOnClickPendingIntent(R.id.notification_pause_resume, PendingIntent.getService(tw0.g, 132470, intent, z90.b(134217728))); remoteViews.setImageViewBitmap(R.id.notification_prev, d93.a(R.drawable.ntf_prev, null)); Intent intent2 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent2.setAction("action_thread_prev"); intent2.putExtra("thread_id", 132470); remoteViews.setOnClickPendingIntent(R.id.notification_prev, PendingIntent.getService(tw0.g, 132470, intent2, z90.b(134217728))); remoteViews.setImageViewBitmap(R.id.notification_next, d93.a(R.drawable.ntf_next, null)); Intent intent3 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent3.setAction("action_thread_next"); intent3.putExtra("thread_id", 132470); remoteViews.setOnClickPendingIntent(R.id.notification_next, PendingIntent.getService(tw0.g, 132470, intent3, z90.b(134217728))); remoteViews.setImageViewBitmap(R.id.notification_stop, d93.a(R.drawable.ntf_stop, null)); Intent intent4 = new Intent(tw0.g, (Class<?>) PlayerService.class); intent4.setAction("action_thread_stop"); intent4.putExtra("thread_id", 132470); remoteViews.setOnClickPendingIntent(R.id.notification_stop, PendingIntent.getService(tw0.g, 132470, intent4, z90.b(134217728))); } catch (Throwable th) { xv1.e("MiXService", "SNV", ui3.A(th)); } } public final void s(PendingIntent pendingIntent, boolean z) { RemoteViews remoteViews; RemoteViews remoteViews2; RemoteViews remoteViews3; Notification build; int i; Notification build2; try { yc2 yc2Var = AppImpl.Q1; if (yc2Var == null) { return; } wc2 wc2Var = yc2Var.c; if (this.Y1 != null && vf3.k()) { String str = wc2Var.i + " " + wc2Var.k; int length = wc2Var.i.length(); nt.c(this.Y1).setTicker(str); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str); Context context = tw0.g; if (vf3.o()) { i = android.R.style.TextAppearance.Material.Notification.Info; } else { i = android.R.style.TextAppearance.StatusBar.EventContent; } spannableStringBuilder.setSpan(new TextAppearanceSpan(context, i), length, str.length(), 33); Object obj = this.Y1; if (vf3.k()) { nt.c(obj).setContentTitle(spannableStringBuilder); } build2 = nt.c(this.Y1).build(); this.Z1 = build2; } if (vf3.o()) { Object obj2 = this.Y1; if (vf3.k()) { nt.c(obj2).setSubText(""); } String str2 = wc2Var.h + " " + wc2Var.j; int length2 = wc2Var.h.length(); SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(str2); spannableStringBuilder2.setSpan(new TextAppearanceSpan(tw0.g, android.R.style.TextAppearance.Material.Notification.Info), 0, length2, 33); zt1.m(this.Y1, spannableStringBuilder2); nt.c(this.Y1).setLargeIcon(yc2Var.z); build = nt.c(this.Y1).build(); this.Z1 = build; } else if (vf3.k()) { remoteViews = this.Z1.bigContentView; remoteViews.setImageViewBitmap(R.id.notification_icon, yc2Var.z); remoteViews2 = this.Z1.bigContentView; remoteViews2.setTextViewText(R.id.notification_title, wc2Var.i); remoteViews3 = this.Z1.bigContentView; remoteViews3.setTextViewText(R.id.notification_descr, wc2Var.h + " " + wc2Var.j + "\n" + wc2Var.k); } else { this.Z1.contentView.setImageViewBitmap(R.id.notification_icon, yc2Var.z); this.Z1.contentView.setTextViewText(R.id.notification_title, wc2Var.i); this.Z1.contentView.setTextViewText(R.id.notification_descr, wc2Var.h + " " + wc2Var.j + "\n" + wc2Var.k); } Notification notification = this.Z1; notification.contentIntent = pendingIntent; if (z) { zt1.i(132470, notification); } } catch (Throwable th) { xv1.e("MiXService", "updateNtf", ui3.A(th)); } } }