CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 ExoPlayer.java 源代码,内容仅作参考
package com.service.playback;
import android.app.Application;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Looper;
import android.text.TextUtils;
import com.blankj.utilcode.util.NetworkUtils;
import com.danikula.videocache.ProxyCacheException;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.service.MusicService;
import d.c.b.s1.m;
import d.c.b.s1.t;
import i.c.a.c.w;
import i.c.a.c.y;
import i.d.a.k.e;
import i.f.a.b;
import i.f.a.f;
import i.f.a.p.d;
import i.j.a.b.a0;
import i.j.a.b.g1.p;
import i.j.a.b.g1.s;
import i.j.a.b.i0;
import i.j.a.b.i1.g;
import i.j.a.b.j0;
import i.j.a.b.k1.l;
import i.j.a.b.k1.n;
import i.j.a.b.l0;
import i.j.a.b.m0;
import i.j.a.b.t0;
import i.j.a.b.u0;
import i.j.a.b.x;
import i.j.a.b.y0.k;
import i.j.a.b.z;
import i.t.f.a;
import i.z.a.c;
import io.github.inflationx.calligraphy3.BuildConfig;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import kotlin.Metadata;
import n.i.b.h;
import o.b.e0;
import o.b.n0;
import org.apache.lucene.analysis.standard.StandardTokenizer;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.entity.Track;
import org.godfootsteps.audio.AudioRoom.AudioDataSource;
import org.godfootsteps.audio.AudioRoom.MineDataSource$insetNewRecentPlay$1;
import org.godfootsteps.audio.DownloadManager.DownloadJob;
import org.godfootsteps.audio.DownloadManager.IDownloadManager;
import org.godfootsteps.audio.SongHelper.AudioMethodUtil;
import org.godfootsteps.audio.SongHelper.SongCache;
import r.b0;
import r.c0;
import r.g0;
import r.i;
import r.j;
@Metadata(d1 = {"\u0000~\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\u0007\n\u0002\b\u0004\u0018\u0000 C2\u00020\u00012\u00020\u0002:\u0001CB\u0005¢\u0006\u0002\u0010\u0003J\u0018\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u001e\u001a\u00020\n2\u0006\u0010\u001f\u001a\u00020 H\u0002J\u0012\u0010!\u001a\u00020\u001d2\b\u0010\"\u001a\u0004\u0018\u00010\u001bH\u0002J\b\u0010#\u001a\u00020\u001dH\u0002J\b\u0010$\u001a\u00020\u001dH\u0002J\b\u0010%\u001a\u00020\u001dH\u0002J\b\u0010&\u001a\u00020\u001dH\u0002J\b\u0010'\u001a\u00020\u0005H\u0016J\b\u0010(\u001a\u00020\u0005H\u0016J\b\u0010)\u001a\u00020\u0005H\u0016J\n\u0010*\u001a\u0004\u0018\u00010\u0014H\u0002J\b\u0010+\u001a\u00020\u0005H\u0016J\u0018\u0010,\u001a\u00020\f2\u0006\u0010-\u001a\u00020\u001b2\u0006\u0010.\u001a\u00020/H\u0002J\b\u00100\u001a\u00020\fH\u0016J\b\u0010\r\u001a\u00020\fH\u0016J\b\u00101\u001a\u00020\fH\u0016J$\u00102\u001a\u00020\u001d2\b\u00103\u001a\u0004\u0018\u0001042\b\u0010\"\u001a\u0004\u0018\u00010\u001b2\u0006\u00105\u001a\u00020\u0005H\u0016J\b\u00106\u001a\u00020\fH\u0016J\b\u00107\u001a\u00020\u0005H\u0016J\b\u00108\u001a\u00020\u001dH\u0016J\b\u00109\u001a\u00020\u001dH\u0016J\u0010\u0010:\u001a\u00020\u00052\u0006\u0010;\u001a\u00020\u0005H\u0016J\u0012\u0010<\u001a\u00020\u001d2\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0016J\u0010\u0010=\u001a\u00020\f2\u0006\u0010\u001e\u001a\u00020\nH\u0016J\u0010\u0010>\u001a\u00020\f2\u0006\u0010?\u001a\u00020@H\u0016J\b\u0010A\u001a\u00020\fH\u0016J\b\u0010B\u001a\u00020\u001dH\u0016R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0013\u001a\u0004\u0018\u00010\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0015\u001a\b\u0018\u00010\u0016R\u00020\u0017X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0018\u001a\u00020\u0019X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u001bX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006D"}, d2 = {"Lcom/service/playback/ExoPlayer;", "Lcom/service/playback/Playback;", "Lcom/danikula/videocache/CacheListener;", "()V", "buffer", "", "callbacks", "Lcom/service/playback/Playback$PlaybackCallbacks;", "currentState", "currentTrack", "Lorg/godfootsteps/arch/api/entity/Track;", "isErrored", "", "isInitialized", "listen", "Lcom/google/android/exoplayer2/Player$EventListener;", "lrcLoaded", "mExoPlayer", "Lcom/google/android/exoplayer2/SimpleExoPlayer;", "mFactory", "Lcom/google/android/exoplayer2/source/ExtractorMediaSource$Factory;", "mWifiLock", "Landroid/net/wifi/WifiManager$WifiLock;", "Landroid/net/wifi/WifiManager;", "proxy", "Lcom/danikula/videocache/HttpProxyCacheServer;", "source", "", "cacheComplete", "", "track", "downloadJob", "Lorg/godfootsteps/audio/DownloadManager/DownloadJob;", "cacheDownloadUrl", "url", "callNoInternet", "callNoLocalPath", "callStateChanged", "callUnKnownError", "duration", "getAudioSessionId", "getBuffering", "getExtraFac", "getState", "isCanMoveTo", "path", "fileSize", "", "isExoPlayerAlive", "isPlaying", "onCacheAvailable", "cacheFile", "Ljava/io/File;", "percentsAvailable", "pause", "position", BuildConfig.BUILD_TYPE, "resetError", "seek", "whereto", "setCallbacks", "setDataSource", "setVolume", "vol", "", "start", "stop", "Companion", "audio_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ExoPlayer implements i.t.f.a, b {
public t0 f4052i;
public WifiManager.WifiLock f4053j;
public p.b f4054k;
public boolean f4055l;
public boolean f4056m;
public boolean f4057n;
public String f4058o = "";
public Track f4059p;
public a.InterfaceC0212a f4060q;
public int f4061r;
public int f4062s;
public final f f4063t;
public final m0.a f4064u;
@Metadata(d1 = {"\u00003\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0018\u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016J\u0018\u0010\u000b\u001a\u00020\u00032\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0016¨\u0006\u0010"}, d2 = {"com/service/playback/ExoPlayer$listen$1", "Lcom/google/android/exoplayer2/Player$EventListener;", "onPlayerError", "", "error", "Lcom/google/android/exoplayer2/ExoPlaybackException;", "onPlayerStateChanged", "playWhenReady", "", "playbackState", "", "onTracksChanged", "trackGroups", "Lcom/google/android/exoplayer2/source/TrackGroupArray;", "trackSelections", "Lcom/google/android/exoplayer2/trackselection/TrackSelectionArray;", "audio_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class a implements m0.a {
@Metadata(d1 = {"\u0000%\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0016J\u0018\u0010\b\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\t\u001a\u00020\nH\u0016¨\u0006\u000b"}, d2 = {"com/service/playback/ExoPlayer$listen$1$onPlayerError$1", "Lokhttp3/Callback;", "onFailure", "", "call", "Lokhttp3/Call;", e.f9530u, "Ljava/io/IOException;", "onResponse", "response", "Lokhttp3/Response;", "audio_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class C0015a implements j {
public final ExoPlayer a;
public C0015a(ExoPlayer exoPlayer) {
this.a = exoPlayer;
}
@Override
public void a(i iVar, g0 g0Var) {
h.e(iVar, "call");
h.e(g0Var, "response");
if (g0Var.f16523k == 404) {
ExoPlayer exoPlayer = this.a;
a.InterfaceC0212a interfaceC0212a = exoPlayer.f4060q;
if (interfaceC0212a != null) {
((MusicService) interfaceC0212a).h(exoPlayer.f4059p, "off shelf");
}
AudioDataSource a = AudioDataSource.J.a();
Track track = this.a.f4059p;
if (track == null) {
return;
}
t tVar = a.D;
if (tVar != null) {
tVar.L(track.getRowId(), 0, 0, 1);
}
if (AudioMethodUtil.f15534e == null) {
AudioMethodUtil.f15534e = new AudioMethodUtil();
}
AudioMethodUtil audioMethodUtil = AudioMethodUtil.f15534e;
Objects.requireNonNull(audioMethodUtil, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.AudioMethodUtil");
a.d(track, audioMethodUtil.j(track), false);
}
}
@Override
public void b(i iVar, IOException iOException) {
h.e(iVar, "call");
h.e(iOException, e.f9530u);
ExoPlayer.c(this.a);
}
}
public a() {
}
@Override
public void F(TrackGroupArray trackGroupArray, g gVar) {
h.e(trackGroupArray, "trackGroups");
h.e(gVar, "trackSelections");
}
@Override
public void I(j0 j0Var) {
l0.c(this, j0Var);
}
@Override
public void K(boolean z) {
l0.a(this, z);
}
@Override
public void b() {
l0.h(this);
}
@Override
public void e(int i2) {
l0.d(this, i2);
}
@Override
public void f(boolean z) {
l0.b(this, z);
}
@Override
public void g(int i2) {
l0.f(this, i2);
}
@Override
public void k(ExoPlaybackException exoPlaybackException) {
h.e(exoPlaybackException, "error");
ExoPlayer exoPlayer = ExoPlayer.this;
exoPlayer.f4061r = 5;
if (exoPlaybackException.type == 0) {
if ((!TextUtils.isEmpty(exoPlayer.f4058o) && n.o.a.B(ExoPlayer.this.f4058o, "http", true)) && !ExoPlayer.this.f4056m) {
c0.a aVar = new c0.a();
aVar.f(ExoPlayer.this.f4058o);
c0 a = aVar.a();
h.d(a, "Builder().url(source).build()");
if (NetworkUtils.c()) {
((b0) AppClient.a.b().b(a)).b(new C0015a(ExoPlayer.this));
} else {
ExoPlayer.this.e();
}
}
} else if (NetworkUtils.c()) {
ExoPlayer.c(ExoPlayer.this);
} else {
ExoPlayer.this.e();
}
ExoPlayer.this.f4056m = true;
}
@Override
public void m(u0 u0Var, int i2) {
l0.j(this, u0Var, i2);
}
@Override
public void onRepeatModeChanged(int i2) {
l0.g(this, i2);
}
@Override
public void s(boolean z) {
l0.i(this, z);
}
@Override
public void v(boolean z, int i2) {
if (i2 == 1) {
ExoPlayer.this.f4061r = 0;
} else if (i2 == 2) {
ExoPlayer.this.f4061r = 1;
} else if (i2 == 3) {
ExoPlayer.this.f4061r = z ? 2 : 4;
} else if (i2 == 4) {
ExoPlayer.this.f4061r = 6;
}
a.InterfaceC0212a interfaceC0212a = ExoPlayer.this.f4060q;
if (interfaceC0212a != null) {
((MusicService) interfaceC0212a).i();
}
if (i2 == 1 || i2 == 2 || i2 == 3) {
a.InterfaceC0212a interfaceC0212a2 = ExoPlayer.this.f4060q;
if (interfaceC0212a2 != null) {
((MusicService) interfaceC0212a2).i();
}
} else if (i2 == 4) {
a.InterfaceC0212a interfaceC0212a3 = ExoPlayer.this.f4060q;
h.c(interfaceC0212a3);
MusicService musicService = (MusicService) interfaceC0212a3;
musicService.y.acquire(30000L);
musicService.z.sendEmptyMessage(1);
}
if (i2 == 3) {
i.t.d.b.a.v();
ExoPlayer exoPlayer = ExoPlayer.this;
exoPlayer.f4056m = false;
exoPlayer.f4055l = true;
if (exoPlayer.f4057n) {
return;
}
if (AudioMethodUtil.f15534e == null) {
AudioMethodUtil.f15534e = new AudioMethodUtil();
}
AudioMethodUtil audioMethodUtil = AudioMethodUtil.f15534e;
Objects.requireNonNull(audioMethodUtil, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.AudioMethodUtil");
if (audioMethodUtil.j(ExoPlayer.this.f4059p)) {
c.b.a.h(ExoPlayer.this.f4059p);
}
if ((ExoPlayer.this.f4058o.length() > 0) && n.o.a.C(ExoPlayer.this.f4058o, "http", false, 2)) {
ExoPlayer exoPlayer2 = ExoPlayer.this;
if (exoPlayer2.f4063t.d(exoPlayer2.f4058o)) {
ExoPlayer exoPlayer3 = ExoPlayer.this;
exoPlayer3.d(exoPlayer3.f4058o);
}
}
ExoPlayer.this.f4057n = true;
}
}
@Override
public void y(u0 u0Var, Object obj, int i2) {
l0.k(this, u0Var, obj, i2);
}
}
public ExoPlayer() {
l lVar;
if (AudioMethodUtil.f15534e == null) {
AudioMethodUtil.f15534e = new AudioMethodUtil();
}
AudioMethodUtil audioMethodUtil = AudioMethodUtil.f15534e;
Objects.requireNonNull(audioMethodUtil, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.AudioMethodUtil");
Object value = audioMethodUtil.b.getValue();
h.d(value, "<get-proxy>(...)");
this.f4063t = (f) value;
a aVar = new a();
this.f4064u = aVar;
if (this.f4052i == null) {
Context c = w.c();
z zVar = new z(w.c());
DefaultTrackSelector defaultTrackSelector = new DefaultTrackSelector();
x xVar = new x();
int i2 = i.j.a.b.l1.z.a;
Looper myLooper = Looper.myLooper();
Looper mainLooper = myLooper == null ? Looper.getMainLooper() : myLooper;
i.j.a.b.l1.e eVar = i.j.a.b.l1.e.a;
i.j.a.b.x0.a aVar2 = new i.j.a.b.x0.a(eVar);
Map<String, int[]> map = l.f11675n;
synchronized (l.class) {
if (l.f11680s == null) {
l.a aVar3 = new l.a(c);
l.f11680s = new l(aVar3.a, aVar3.b, aVar3.c, aVar3.f11691d, aVar3.f11692e);
}
lVar = l.f11680s;
}
this.f4052i = new t0(c, zVar, defaultTrackSelector, xVar, null, lVar, aVar2, eVar, mainLooper);
}
t0 t0Var = this.f4052i;
if (t0Var != null) {
t0Var.l(aVar);
}
Object systemService = w.c().getSystemService("wifi");
Objects.requireNonNull(systemService, "null cannot be cast to non-null type android.net.wifi.WifiManager");
this.f4053j = ((WifiManager) systemService).createWifiLock(1, "new_song_lock");
}
public static final void b(ExoPlayer exoPlayer, Track track, DownloadJob downloadJob) {
Objects.requireNonNull(exoPlayer);
if (d.c.b.z1.a.a == null) {
d.c.b.z1.a.a = new d.c.b.z1.a();
}
d.c.b.z1.a aVar = d.c.b.z1.a.a;
Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
boolean z = aVar.i() == 1;
track.setDownloaded(2);
track.setOfflineTitle(track.getTitle());
track.setOfflineName(track.getName());
track.setDownloadQuality(z ? 2 : 1);
downloadJob.setSize((int) (z ? track.getSizeHigh() : track.getSizeLow()));
if (IDownloadManager.f15524d == null) {
IDownloadManager.f15524d = new IDownloadManager();
}
IDownloadManager iDownloadManager = IDownloadManager.f15524d;
Objects.requireNonNull(iDownloadManager, "null cannot be cast to non-null type org.godfootsteps.audio.DownloadManager.IDownloadManager");
iDownloadManager.f(downloadJob);
}
public static final void c(ExoPlayer exoPlayer) {
exoPlayer.f4055l = false;
if (exoPlayer.f4056m) {
return;
}
a.InterfaceC0212a interfaceC0212a = exoPlayer.f4060q;
if (interfaceC0212a != null) {
((MusicService) interfaceC0212a).h(exoPlayer.f4059p, "unknown");
}
exoPlayer.f4056m = true;
}
@Override
public void a(File file, String str, int i2) {
this.f4062s = i2;
if (i2 == 100) {
d(str);
}
}
public final void d(String str) {
if (d.c.b.z1.a.a == null) {
d.c.b.z1.a.a = new d.c.b.z1.a();
}
d.c.b.z1.a aVar = d.c.b.z1.a.a;
Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
if (aVar.f().a.getBoolean("isCacheDownload", false)) {
if ((str == null || str.length() == 0) || !n.o.a.C(str, "http", false, 2) || !this.f4063t.d(this.f4058o) || this.f4059p == null) {
return;
}
n.m.t.a.p.m.e1.a.o(n.m.t.a.p.m.e1.a.c(e0.b), null, null, new ExoPlayer$cacheDownloadUrl$1(this, str, null), 3, null);
}
}
public final void e() {
this.f4055l = false;
if (this.f4056m) {
return;
}
this.f4056m = true;
a.InterfaceC0212a interfaceC0212a = this.f4060q;
if (interfaceC0212a == null) {
return;
}
((MusicService) interfaceC0212a).h(this.f4059p, "no internet");
}
public final void f() {
this.f4055l = false;
if (this.f4056m) {
return;
}
this.f4056m = true;
a.InterfaceC0212a interfaceC0212a = this.f4060q;
if (interfaceC0212a == null) {
return;
}
((MusicService) interfaceC0212a).h(this.f4059p, "no local path");
}
public boolean g() {
t0 t0Var = this.f4052i;
if (t0Var != null && this.f4055l) {
h.c(t0Var);
if (t0Var.h()) {
t0 t0Var2 = this.f4052i;
h.c(t0Var2);
return t0Var2.getPlaybackState() == 3;
}
return false;
}
return false;
}
public boolean h(Track track) {
String str;
h.e(track, "track");
this.f4056m = false;
this.f4055l = false;
this.f4058o = "";
this.f4059p = track;
this.f4061r = 1;
this.f4062s = 0;
a.InterfaceC0212a interfaceC0212a = this.f4060q;
if (interfaceC0212a != null) {
((MusicService) interfaceC0212a).i();
}
i.t.d.b bVar = i.t.d.b.a;
if (bVar.n()) {
if (d.c.b.x1.c0.a == null) {
d.c.b.x1.c0.a = new d.c.b.x1.c0();
}
d.c.b.x1.c0 c0Var = d.c.b.x1.c0.a;
Objects.requireNonNull(c0Var, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
this.f4058o = c0Var.o(track);
if (track.getDownloaded() == 4) {
f();
} else if (!new File(this.f4058o).exists()) {
Track i2 = bVar.i(track.getRowId());
if (i2 != null) {
i2.setDownloaded(4);
}
Track track2 = this.f4059p;
if (track2 != null) {
track2.setDownloaded(4);
}
if (track.getDeleteMark() > 0) {
bVar.u(track, true);
}
AudioDataSource.J.a().q(track);
f();
}
} else {
if (d.c.b.z1.a.a == null) {
d.c.b.z1.a.a = new d.c.b.z1.a();
}
d.c.b.z1.a aVar = d.c.b.z1.a.a;
Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
String j2 = h.j(aVar.a(), track.getHighUrl());
if (d.c.b.z1.a.a == null) {
d.c.b.z1.a.a = new d.c.b.z1.a();
}
d.c.b.z1.a aVar2 = d.c.b.z1.a.a;
Objects.requireNonNull(aVar2, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
String j3 = h.j(aVar2.a(), track.getLowUrl());
if (d.c.b.z1.a.a == null) {
d.c.b.z1.a.a = new d.c.b.z1.a();
}
d.c.b.z1.a aVar3 = d.c.b.z1.a.a;
Objects.requireNonNull(aVar3, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
boolean z = aVar3.i() == 1;
if (track.getDownloaded() == 2) {
if (d.c.b.x1.c0.a == null) {
d.c.b.x1.c0.a = new d.c.b.x1.c0();
}
d.c.b.x1.c0 c0Var2 = d.c.b.x1.c0.a;
Objects.requireNonNull(c0Var2, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
this.f4058o = c0Var2.o(track);
if (!new File(this.f4058o).exists()) {
Track i3 = bVar.i(track.getRowId());
if (i3 != null) {
i3.setDownloaded(4);
}
Track track3 = this.f4059p;
if (track3 != null) {
track3.setDownloaded(4);
}
AudioDataSource.J.a().q(track);
if (NetworkUtils.c()) {
this.f4058o = z ? j2 : j3;
if (SongCache.b == null) {
SongCache.b = new SongCache();
}
SongCache songCache = SongCache.b;
Objects.requireNonNull(songCache, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongCache");
if (z) {
j2 = j3;
}
songCache.a(j2);
} else {
e();
}
}
} else {
this.f4058o = z ? j2 : j3;
if (NetworkUtils.c()) {
if (SongCache.b == null) {
SongCache.b = new SongCache();
}
SongCache songCache2 = SongCache.b;
Objects.requireNonNull(songCache2, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongCache");
if (z) {
j2 = j3;
}
songCache2.a(j2);
}
if (!NetworkUtils.c() && !this.f4063t.d(this.f4058o)) {
e();
}
}
}
String str2 = this.f4058o;
if (n.o.a.B(str2, "http", true)) {
f fVar = this.f4063t;
String str3 = this.f4058o;
Objects.requireNonNull(fVar);
Object[] objArr = {this, str3};
for (int i4 = 0; i4 < 2; i4++) {
Objects.requireNonNull(objArr[i4]);
}
synchronized (fVar.a) {
try {
fVar.a(str3).f9927d.add(this);
} catch (ProxyCacheException e2) {
f.f9917i.warn("Error registering cache listener", (Throwable) e2);
}
}
f fVar2 = this.f4063t;
String str4 = this.f4058o;
if (fVar2.d(str4)) {
i.f.a.c cVar = fVar2.f9921g;
File file = new File(cVar.a, cVar.b.a(str4));
try {
d dVar = (d) fVar2.f9921g.c;
dVar.a.submit(new d.a(file));
} catch (IOException e3) {
f.f9917i.error("Error touching file " + file, e3);
}
str2 = Uri.fromFile(file).toString();
} else if (fVar2.c()) {
Locale locale = Locale.US;
Object[] objArr2 = new Object[3];
objArr2[0] = "127.0.0.1";
objArr2[1] = Integer.valueOf(fVar2.f9919e);
d.i.b bVar2 = i.f.a.l.a;
try {
objArr2[2] = URLEncoder.encode(str4, "utf-8");
str2 = String.format(locale, "http://%s:%d/%s", objArr2);
} catch (UnsupportedEncodingException e4) {
throw new RuntimeException("Error encoding url", e4);
}
} else {
str2 = str4;
}
h.d(str2, "proxy.getProxyUrl(source)");
}
if (this.f4054k == null) {
Application J = y.J();
Application J2 = y.J();
int i5 = i.j.a.b.l1.z.a;
try {
str = J2.getPackageManager().getPackageInfo(J2.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException unused) {
str = "?";
}
StringBuilder sb = new StringBuilder();
sb.append("CAGLite");
sb.append("/");
sb.append(str);
sb.append(" (Linux;Android ");
n nVar = new n(J, i.a.b.a.a.B(sb, Build.VERSION.RELEASE, ") ", "ExoPlayerLib/2.11.5"), null);
i.j.a.b.b1.f fVar3 = new i.j.a.b.b1.f();
p.b bVar3 = new p.b(nVar);
this.f4054k = bVar3;
h.c(bVar3);
y.j(!bVar3.f11264d);
bVar3.b = fVar3;
}
p.b bVar4 = this.f4054k;
h.c(bVar4);
Uri parse = Uri.parse(str2);
bVar4.f11264d = true;
if (bVar4.b == null) {
bVar4.b = new i.j.a.b.b1.f();
}
p pVar = new p(parse, bVar4.a, bVar4.b, bVar4.c, null, StandardTokenizer.MAX_TOKEN_LENGTH_LIMIT, null, null);
t0 t0Var = this.f4052i;
if (t0Var != null) {
t0Var.P();
s sVar = t0Var.z;
if (sVar != null) {
sVar.c(t0Var.f11865m);
t0Var.f11865m.R();
}
t0Var.z = pVar;
pVar.i(t0Var.f11856d, t0Var.f11865m);
boolean h2 = t0Var.h();
t0Var.O(h2, t0Var.f11867o.d(h2, 2));
a0 a0Var = t0Var.c;
Objects.requireNonNull(a0Var);
i0 b = a0Var.b(true, true, true, 2);
a0Var.f10628p = true;
a0Var.f10627o++;
a0Var.f10618f.f10656o.a.obtainMessage(0, 1, 1, pVar).sendToTarget();
a0Var.M(b, false, 4, 1, false);
}
if (m.f6353j == null) {
m.f6353j = new m();
}
m mVar = m.f6353j;
Objects.requireNonNull(mVar, "null cannot be cast to non-null type org.godfootsteps.audio.AudioRoom.MineDataSource");
Track track4 = this.f4059p;
if (track4 != null && !h.a(track4.getType(), "sermon")) {
t tVar = mVar.f6356f;
if ((tVar == null ? null : tVar.k(track4.getRowId())) != null) {
n.m.t.a.p.m.e1.a.z1(n0.f14883i, e0.b, null, new MineDataSource$insetNewRecentPlay$1(track4, mVar, null), 2, null);
}
}
this.f4057n = false;
if (!this.f4056m) {
this.f4055l = true;
}
WifiManager.WifiLock wifiLock = this.f4053j;
h.c(wifiLock);
if (!wifiLock.isHeld()) {
WifiManager.WifiLock wifiLock2 = this.f4053j;
h.c(wifiLock2);
wifiLock2.acquire();
}
return this.f4055l;
}
public boolean i(float f2) {
try {
t0 t0Var = this.f4052i;
if (t0Var != null) {
t0Var.P();
float e2 = i.j.a.b.l1.z.e(f2, 0.0f, 1.0f);
if (t0Var.y != e2) {
t0Var.y = e2;
t0Var.I();
Iterator<k> it = t0Var.f11859g.iterator();
while (it.hasNext()) {
it.next().n(e2);
}
}
}
return true;
} catch (IllegalStateException unused) {
return false;
}
}
public void j() {
WifiManager.WifiLock wifiLock;
t0 t0Var = this.f4052i;
if (t0Var != null) {
t0Var.P();
t0Var.f11867o.d(t0Var.h(), 1);
a0 a0Var = t0Var.c;
i0 b = a0Var.b(true, true, true, 1);
a0Var.f10627o++;
a0Var.f10618f.f10656o.a(6, 1, 0).sendToTarget();
a0Var.M(b, false, 4, 1, false);
s sVar = t0Var.z;
if (sVar != null) {
sVar.c(t0Var.f11865m);
t0Var.f11865m.R();
t0Var.z = null;
}
t0Var.A = Collections.emptyList();
}
this.f4061r = 7;
this.f4055l = false;
WifiManager.WifiLock wifiLock2 = this.f4053j;
Boolean valueOf = wifiLock2 != null ? Boolean.valueOf(wifiLock2.isHeld()) : null;
h.c(valueOf);
if (!valueOf.booleanValue() || (wifiLock = this.f4053j) == null) {
return;
}
wifiLock.release();
}
}