MD5 校验值:13e9f681f5bed77188ac69741746def0
s11.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package libs; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.widget.RemoteViews; import com.mixplorer.AppImpl; import com.mixplorer.R; import com.mixplorer.activities.BrowseActivity; import com.mixplorer.providers.FileProvider; import com.mixplorer.services.OperationService; import java.io.EOFException; import java.net.Proxy; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; public final class s11 implements gn0 { public int a; public long b; public final Object c; public final Object d; public final Object e; public Object f; public s11() { this.c = new AtomicInteger(0); this.d = Collections.synchronizedList(new ArrayList()); this.e = Collections.synchronizedSet(new HashSet()); j53 j53Var = AppImpl.Z; if (j53Var.i == null) { int i = vf3.u() ? 3 : 2; j53Var.i = Integer.valueOf(tw0.l(i, j53Var.P0.getString("operation_poll_size", u41.e(i, "")))); } this.a = j53Var.i.intValue(); } public static void B(Context context, w42 w42Var, int i, boolean z) { int i2; boolean z2; List list; int i3; int i4 = w42Var.V1; String I0 = x32.I0(w42Var.g2, w42Var.d2, false, w42Var.P1); long j = w42Var.d2; long j2 = w42Var.g2; if (j >= j2) { if (j > 0) { i3 = (int) ((j2 * 100) / j); } else { i3 = 0; } if (i3 > 100) { i3 = 99; } else if (i3 < 1) { i3 = 1; } I0 = I0 + " " + i3 + "%"; } Object obj = w42Var.c2; StringBuilder sb = new StringBuilder("#"); int i5 = w42Var.a2; sb.append(i5); sb.append(" "); sb.append(w42Var.o2); String sb2 = sb.toString(); if (vf3.k()) { nt.c(obj).setContentTitle(sb2); } Object obj2 = w42Var.c2; StringBuilder q = u41.q(I0, " "); q.append(w42Var.p2); zt1.m(obj2, q.toString()); try { list = (List) x91.q(w42Var.c2, "mActions"); } catch (Throwable unused) { } try { if (list != null) { i2 = list.size(); z2 = w42Var.v2; if (z2 && i2 != 1) { zt1.a(w42Var.c2, r(context, i5)); } else if (z2 && i2 != 2) { zt1.a(w42Var.c2, q(context, i5, w42Var.F2), r(context, i5)); } nt.c(w42Var.c2).setProgress(100, i, z); return; } nt.c(w42Var.c2).setProgress(100, i, z); return; } catch (Throwable th) { xv1.h("QueueHelper", "Percent:" + i + ", " + z + " > " + ui3.A(th)); return; } i2 = 0; z2 = w42Var.v2; if (z2) { } if (z2) { zt1.a(w42Var.c2, q(context, i5, w42Var.F2), r(context, i5)); } } public static void k(w42 w42Var) { zt1.h(w42Var.a2); } public static void o(String str, String str2, w42 w42Var, boolean z, is0 is0Var) { int i; Uri Z; if (w42Var.c2 == null) { return; } Intent intent = new Intent(tw0.g, (Class<?>) BrowseActivity.class); intent.setPackage(tw0.j()); if (is0Var != null && is0Var.N1) { if (vf3.r()) { Z = FileProvider.h(is0Var); } else { Z = is0Var.Z(); } wv1.l(intent, Z); } int i2 = w42Var.a2; zt1.h(i2); Context context = tw0.g; if (z) { i = R.drawable.notification_task_failed; } else { i = R.drawable.notification_task_done; } zt1.j(i2, zt1.c(context, i, "", str, "#" + i2 + ": " + str2, null, true, false, z, PendingIntent.getActivity(tw0.g, 0, intent, z90.b(1073741824)), 0, true, true, "CH_COMMON")); } public static yt1 q(Context context, int i, boolean z) { int i2; int i3; Intent intent = new Intent(context, (Class<?>) OperationService.class); intent.setPackage(tw0.j()); intent.setAction("action_thread_pause_resume"); intent.putExtra("thread_id", i); if (z) { i2 = R.drawable.ntf_resume; } else { i2 = R.drawable.ntf_pause; } if (z) { i3 = R.string.resume; } else { i3 = R.string.pause; } return new yt1(i2, dn2.V(i3), PendingIntent.getService(context, i, intent, z90.b(134217728))); } public static yt1 r(Context context, int i) { Intent intent = new Intent(context, (Class<?>) OperationService.class); intent.setPackage(tw0.j()); intent.setAction("action_thread_stop"); intent.putExtra("thread_id", i); return new yt1(R.drawable.ntf_cancel, dn2.V(R.string.abort), PendingIntent.getService(context, i, intent, z90.b(134217728))); } public static void w(bw1 bw1Var, w42 w42Var) { zt1.h(w42Var.a2); Intent intent = new Intent(bw1Var, (Class<?>) BrowseActivity.class); intent.setPackage(tw0.j()); intent.setAction("action_thread_no_space"); int i = w42Var.a2; intent.putExtra("thread_id", i); String V = dn2.V(R.string.not_enough_free_space); Object c = zt1.c(bw1Var, R.drawable.notification_task, V, V, dn2.V(R.string.click_to_see_options_dialog), null, false, true, true, PendingIntent.getActivity(bw1Var, i, intent, z90.b(0)), 0, true, true, "CH_COMMON"); zt1.a(c, q(bw1Var, i, w42Var.F2), r(bw1Var, i)); zt1.j(i, c); } public void A() { try { d52 d52Var = (d52) this.f; if (d52Var != null) { d52Var.shutdownNow(); } } catch (Throwable unused) { xv1.h("QueueHelper", "Shutdown error!"); } } public void C(zz0 zz0Var, String str) { if (this.a == 0) { kk2 kk2Var = (kk2) this.f; kk2Var.k(str); kk2Var.k("\r\n"); int f = zz0Var.f(); for (int i = 0; i < f; i++) { kk2Var.k(zz0Var.d(i)); kk2Var.k(": "); kk2Var.k(zz0Var.g(i)); kk2Var.k("\r\n"); } kk2Var.k("\r\n"); this.a = 1; return; } throw new IllegalStateException("state: " + this.a); } @Override public p83 a(ym2 ym2Var, long j) { v33 v33Var = ym2Var.d; if ("chunked".equalsIgnoreCase(ym2Var.c.c("Transfer-Encoding"))) { if (this.a == 1) { this.a = 2; return new n11(this); } throw new IllegalStateException("state: " + this.a); } if (j != -1) { if (this.a == 1) { this.a = 2; return new q11(this); } throw new IllegalStateException("state: " + this.a); } throw new IllegalStateException("Cannot stream a request body without chunked encoding or a known content length!"); } @Override public void b(ym2 ym2Var) { Proxy.Type type = ((nk2) this.d).c.b.type(); StringBuilder sb = new StringBuilder(); sb.append(ym2Var.b); sb.append(' '); z21 z21Var = ym2Var.a; if (!z21Var.a.equals("https") && type == Proxy.Type.HTTP) { sb.append(z21Var); } else { sb.append(ll.b0(z21Var)); } sb.append(" HTTP/1.1"); C(ym2Var.c, sb.toString()); } @Override public jb3 c(yn2 yn2Var) { if (!p21.b(yn2Var)) { return v(0L); } if ("chunked".equalsIgnoreCase(yn2Var.c("Transfer-Encoding"))) { z21 z21Var = yn2Var.X.a; if (this.a == 4) { this.a = 5; return new o11(this, z21Var); } throw new IllegalStateException("state: " + this.a); } long a = p21.a(yn2Var); if (a != -1) { return v(a); } if (this.a == 4) { this.a = 5; ((nk2) this.d).i(); return new r11(this); } throw new IllegalStateException("state: " + this.a); } @Override public void cancel() { nk2 nk2Var = (nk2) this.d; if (nk2Var != null) { yo3.d(nk2Var.d); } } @Override public void d() { ((kk2) this.f).flush(); } @Override public void e() { ((kk2) this.f).flush(); } @Override public long f(yn2 yn2Var) { if (!p21.b(yn2Var)) { return 0L; } if ("chunked".equalsIgnoreCase(yn2Var.c("Transfer-Encoding"))) { return -1L; } return p21.a(yn2Var); } @Override public wn2 g(boolean z) { String str; int i = this.a; if (i != 1 && i != 3) { throw new IllegalStateException("state: " + this.a); } iv0 iv0Var = null; try { n3 b = n3.b(y()); int i2 = b.b; wn2 wn2Var = new wn2(); wn2Var.b = (sf2) b.c; wn2Var.c = i2; wn2Var.d = (String) b.d; wn2Var.f = z().e(); if (z && i2 == 100) { return null; } if (i2 == 100) { this.a = 3; return wn2Var; } this.a = 4; return wn2Var; } catch (EOFException e) { nk2 nk2Var = (nk2) this.d; if (nk2Var != null) { z21 z21Var = nk2Var.c.a.a; z21Var.getClass(); try { iv0 iv0Var2 = new iv0(1); iv0Var2.l(z21Var, "/..."); iv0Var = iv0Var2; } catch (IllegalArgumentException unused) { } iv0Var.getClass(); iv0Var.d = z21.a("", 0, 0, " \"':;<=>@[]^`{}|/\\?#", false, false, false, true); iv0Var.e = z21.a("", 0, 0, " \"':;<=>@[]^`{}|/\\?#", false, false, false, true); str = iv0Var.a().h; } else { str = "unknown"; } throw z90.i("unexpected end of stream on " + str, e); } } @Override public nk2 h() { return (nk2) this.d; } public void i(w42 w42Var) { synchronized (((List) this.d)) { ((List) this.d).add(0, w42Var); } } public void j(w42 w42Var) { d52 d52Var = (d52) this.f; if (d52Var != null && d52Var.isTerminating()) { xv1.d("QueueHelper", "Thread pool is terminating, why?!!"); try { ((d52) this.f).awaitTermination(10L, TimeUnit.SECONDS); } catch (InterruptedException unused) { this.f = null; } } d52 d52Var2 = (d52) this.f; if (d52Var2 == null || d52Var2.isShutdown() || ((d52) this.f).isTerminated()) { synchronized (((Set) this.e)) { ((Set) this.e).clear(); } this.f = new d52(this); } w42Var.E2 = ((d52) this.f).submit(w42Var); synchronized (((Set) this.e)) { ((Set) this.e).add(w42Var.E2); } } public void l(Context context, w42 w42Var) { Bitmap a; if (w42Var.A()) { return; } int i = w42Var.a2; zt1.h(i); Intent intent = new Intent(context, (Class<?>) BrowseActivity.class); intent.setPackage(tw0.j()); intent.setAction("action_thread_operation_dialog"); intent.putExtra("thread_id", i); PendingIntent activity = PendingIntent.getActivity(context, i, intent, z90.b(1073741824)); String str = w42Var.o2; Object c = zt1.c(context, R.drawable.notification_task, str, str, null, null, false, true, false, activity, R.layout.notification_progress, true, true, "CH_COMMON"); w42Var.c2 = c; if (zt1.f(c)) { B(context, w42Var, 0, true); } else if (vf3.i()) { Intent intent2 = new Intent(context, (Class<?>) OperationService.class); intent2.setPackage(tw0.j()); intent2.setAction("action_thread_pause_resume"); intent2.putExtra("thread_id", i); ((Notification) w42Var.c2).contentView.setViewVisibility(R.id.notification_pause_resume, 0); RemoteViews remoteViews = ((Notification) w42Var.c2).contentView; if (w42Var.F2) { a = d93.a(R.drawable.ntf_resume, null); } else { a = d93.a(R.drawable.ntf_pause, null); } remoteViews.setImageViewBitmap(R.id.notification_pause_resume, a); ((Notification) w42Var.c2).contentView.setOnClickPendingIntent(R.id.notification_pause_resume, PendingIntent.getService(context, i, intent2, z90.b(134217728))); Intent intent3 = new Intent(context, (Class<?>) OperationService.class); intent3.setPackage(tw0.j()); intent3.setAction("action_thread_stop"); intent3.putExtra("thread_id", i); ((Notification) w42Var.c2).contentView.setImageViewBitmap(R.id.notification_stop, d93.a(R.drawable.ntf_stop, null)); ((Notification) w42Var.c2).contentView.setOnClickPendingIntent(R.id.notification_stop, PendingIntent.getService(context, i, intent3, z90.b(134217728))); } else { ((Notification) w42Var.c2).contentView.setViewVisibility(R.id.notification_pause_resume, 8); ((Notification) w42Var.c2).contentView.setImageViewBitmap(R.id.notification_stop, d93.a(R.drawable.notification_task, null)); } x(context, w42Var); } public synchronized void m(OperationService operationService, int i) { Object obj; so0 g; so0 g2; w42 p = p(i); if (p != null && !p.A()) { if (!ui3.x(p.t2) && ((g2 = hp1.g(p.t2)) == null || !g2.n0())) { return; } if (!ui3.x(p.u2) && ((g = hp1.g(p.u2)) == null || !so0.o0(g))) { return; } if (operationService != null && (obj = p.c2) != null) { if (zt1.f(obj)) { zt1.a(p.c2, q(operationService, p.a2, !p.F2), r(operationService, p.a2)); } else if (!p.F2) { ((Notification) p.c2).contentView.setImageViewBitmap(R.id.notification_pause_resume, d93.a(R.drawable.ntf_resume, null)); } else { ((Notification) p.c2).contentView.setImageViewBitmap(R.id.notification_pause_resume, d93.a(R.drawable.ntf_pause, null)); } zt1.j(p.a2, p.c2); } if (p.F2) { p.G(); } else { p.E(); } } } public void n(bw1 bw1Var, is0 is0Var, is0 is0Var2, w42 w42Var) { int i; if (t() <= 0) { return; } zt1.h(w42Var.a2); Intent intent = new Intent(bw1Var, (Class<?>) BrowseActivity.class); intent.setPackage(tw0.j()); intent.setAction("action_thread_file_exists"); wv1.l(intent, ll.T(is0Var.L(), false)); int i2 = w42Var.a2; intent.putExtra("thread_id", i2); intent.putExtra("thread_dir", is0Var.a2); intent.putExtra("thread_src", is0Var.c2); intent.putExtra("thread_dst", is0Var2.c2); if (is0Var.a2) { i = R.string.folder_exists; } else { i = R.string.file_exists; } String V = dn2.V(i); zt1.j(i2, zt1.c(bw1Var, R.drawable.notification_task, V, V, dn2.V(R.string.click_to_see_options_dialog), null, false, true, true, PendingIntent.getActivity(bw1Var, i2, intent, z90.b(0)), 0, true, true, "CH_COMMON")); } public w42 p(int i) { synchronized (((List) this.d)) { try { for (w42 w42Var : (List) this.d) { if (w42Var.a2 == i) { return w42Var; } } return null; } catch (Throwable th) { throw th; } } } public ArrayList s(int i) { ArrayList arrayList = new ArrayList(); synchronized (((List) this.d)) { try { for (w42 w42Var : (List) this.d) { if (w42Var.V1 == i && w42Var.Z <= 0) { arrayList.add(w42Var); } } } catch (Throwable th) { throw th; } } return arrayList; } public synchronized int t() { int i; d52 d52Var = (d52) this.f; if (d52Var != null) { i = d52Var.getQueue().size() + ((d52) this.f).getActiveCount(); } else { i = 0; } return i; } public synchronized void u(int i) { w42 p = p(i); if (p != null) { synchronized (((Set) this.e)) { try { Future future = p.E2; if (future != null) { ((Set) this.e).remove(future); } } catch (Throwable th) { throw th; } } p.z(); } } public p11 v(long j) { if (this.a == 4) { this.a = 5; return new p11(this, j); } throw new IllegalStateException("state: " + this.a); } public void x(Context context, w42 w42Var) { int i; if (w42Var != null && !w42Var.A() && w42Var.c2 != null) { long j = w42Var.d2; boolean z = false; if (j > 0) { i = (int) ((w42Var.g2 * 100) / j); } else { i = 0; } long currentTimeMillis = System.currentTimeMillis(); if (this.b + 1000 >= currentTimeMillis) { return; } this.b = currentTimeMillis; if (i > 100) { i = 100; } try { if (zt1.f(w42Var.c2)) { if (i > 0) { if (w42Var.d2 == 0) { z = true; } B(context, w42Var, i, z); } } else { Object obj = w42Var.c2; if (((Notification) obj).contentView != null) { if (w42Var.v2) { ((Notification) obj).contentView.setViewVisibility(R.id.notification_pause_resume, 0); } else { ((Notification) obj).contentView.setViewVisibility(R.id.notification_pause_resume, 8); } RemoteViews remoteViews = ((Notification) w42Var.c2).contentView; if (i == 0 || w42Var.d2 == 0) { z = true; } remoteViews.setProgressBar(R.id.notification_progress, 100, i, z); ((Notification) w42Var.c2).contentView.setTextViewText(R.id.notification_percent, Math.max(1, i) + "%"); } else { xv1.d("QueueHelper", "contentView is null, why?!!"); } } } catch (Throwable th) { xv1.h("QueueHelper", ui3.A(th)); } zt1.j(w42Var.a2, w42Var.c2); } } public String y() { String s = ((lk2) this.e).s(this.b); this.b -= s.length(); return s; } public zz0 z() { c3 c3Var = new c3(10); while (true) { String y = y(); if (y.length() != 0) { l63.O1.getClass(); int indexOf = y.indexOf(":", 1); if (indexOf != -1) { c3Var.s(y.substring(0, indexOf), y.substring(indexOf + 1)); } else if (y.startsWith(":")) { c3Var.s("", y.substring(1)); } else { c3Var.s("", y); } } else { return new zz0(c3Var); } } } public s11(a32 a32Var, nk2 nk2Var, lk2 lk2Var, kk2 kk2Var) { this.a = 0; this.b = 262144L; this.c = a32Var; this.d = nk2Var; this.e = lk2Var; this.f = kk2Var; } }