正在查看: Uptodown App Store v6.80 应用的 MyDownloads.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Uptodown App Store v6.80 应用的 MyDownloads.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.uptodown.activities;
import M1.C0447b;
import N1.k;
import S2.AbstractC0525o;
import W1.C0536h;
import W1.G;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.ResultReceiver;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.activity.OnBackPressedCallback;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.core.widget.NestedScrollView;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import c2.C0597o;
import com.google.android.material.R;
import com.uptodown.UptodownApp;
import com.uptodown.activities.C0757s;
import com.uptodown.activities.MyDownloads;
import com.uptodown.core.activities.FileExplorerActivity;
import com.uptodown.workers.DownloadWorker;
import f2.InterfaceC0928k;
import g2.C0955f;
import g2.C0965p;
import g2.C0966q;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import kotlin.jvm.internal.AbstractC1009g;
import u2.H;
public final class MyDownloads extends AbstractC0740a {
public static final a Q = new a(null);
private C0447b L;
private boolean N;
private final R2.g J = R2.h.a(new d3.a() {
@Override
public final Object invoke() {
c2.T N3;
N3 = MyDownloads.N3(MyDownloads.this);
return N3;
}
});
private final R2.g K = new ViewModelLazy(kotlin.jvm.internal.D.b(C0757s.class), new l(this), new k(this), new m(null, this));
private C0757s.b M = C0757s.b.b;
private final i O = new i();
private final f P = new f();
public static final class a {
public a(AbstractC1009g abstractC1009g) {
this();
}
private a() {
}
}
public final class b implements Runnable {
private final int a;
public b(int i) {
this.a = i;
}
@Override
public void run() {
int i = this.a;
if (i == 302 || i == 352) {
MyDownloads.this.z4(false);
} else {
MyDownloads.this.y4();
}
}
}
static final class c extends kotlin.coroutines.jvm.internal.l implements d3.p {
int a;
final boolean c;
c(boolean z, V2.d dVar) {
super(2, dVar);
this.c = z;
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return MyDownloads.this.new c(this.c, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
W2.b.c();
if (this.a != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
R2.n.b(obj);
if (MyDownloads.this.L != null) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.d().size() > 0) {
if (this.c) {
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
Iterator it = c0447b2.d().iterator();
kotlin.jvm.internal.m.d(it, "iterator(...)");
while (it.hasNext()) {
Object next = it.next();
kotlin.jvm.internal.m.d(next, "next(...)");
MyDownloads myDownloads = MyDownloads.this;
C0447b c0447b3 = myDownloads.L;
kotlin.jvm.internal.m.b(c0447b3);
myDownloads.Q3(c0447b3.d().indexOf((C0965p) next));
}
} else {
C0447b c0447b4 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b4);
Iterator it2 = c0447b4.d().iterator();
kotlin.jvm.internal.m.d(it2, "iterator(...)");
while (it2.hasNext()) {
Object next2 = it2.next();
kotlin.jvm.internal.m.d(next2, "next(...)");
C0965p c0965p = (C0965p) next2;
if (!c0965p.L() && !DownloadWorker.d.k(c0965p.h(), c0965p.E())) {
MyDownloads myDownloads2 = MyDownloads.this;
C0447b c0447b5 = myDownloads2.L;
kotlin.jvm.internal.m.b(c0447b5);
myDownloads2.Q3(c0447b5.d().indexOf(c0965p));
}
}
}
MyDownloads.this.E4();
MyDownloads.this.z4(false);
}
}
return R2.s.a;
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((c) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
static final class d extends kotlin.coroutines.jvm.internal.l implements d3.p {
Object a;
int b;
final int d;
d(int i, V2.d dVar) {
super(2, dVar);
this.d = i;
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return MyDownloads.this.new d(this.d, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
C0965p c0965p;
Parcelable parcelableExtra;
Object parcelableExtra2;
Object c = W2.b.c();
int i = this.b;
if (i == 0) {
R2.n.b(obj);
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
Object obj2 = c0447b.d().get(this.d);
kotlin.jvm.internal.m.d(obj2, "get(...)");
C0965p c0965p2 = (C0965p) obj2;
C0757s m4 = MyDownloads.this.m4();
AppCompatActivity appCompatActivity = MyDownloads.this;
this.a = c0965p2;
this.b = 1;
Object i4 = m4.i(appCompatActivity, c0965p2, this);
if (i4 == c) {
return c;
}
c0965p = c0965p2;
obj = i4;
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
c0965p = (C0965p) this.a;
R2.n.b(obj);
}
if (((Boolean) obj).booleanValue()) {
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
c0447b2.d().remove(c0965p);
C0447b c0447b3 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b3);
c0447b3.notifyItemRemoved(this.d);
C0447b c0447b4 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b4);
if (c0447b4.d().isEmpty()) {
MyDownloads.this.k4().h.setVisibility(0);
}
}
Intent intent = MyDownloads.this.getIntent();
kotlin.jvm.internal.m.d(intent, "getIntent(...)");
if (Build.VERSION.SDK_INT >= 33) {
parcelableExtra2 = intent.getParcelableExtra("downloadResultReceiver", ResultReceiver.class);
parcelableExtra = (Parcelable) parcelableExtra2;
} else {
parcelableExtra = intent.getParcelableExtra("downloadResultReceiver");
}
ResultReceiver resultReceiver = (ResultReceiver) parcelableExtra;
if (resultReceiver != null) {
Bundle bundle = new Bundle();
bundle.putParcelable("download", c0965p);
R2.s sVar = R2.s.a;
resultReceiver.send(207, bundle);
}
return R2.s.a;
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((d) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
static final class e extends kotlin.coroutines.jvm.internal.l implements d3.p {
Object a;
int b;
e(V2.d dVar) {
super(2, dVar);
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return MyDownloads.this.new e(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Iterator it;
Object c = W2.b.c();
int i = this.b;
if (i == 0) {
R2.n.b(obj);
if (MyDownloads.this.L != null) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
Iterator it2 = c0447b.f().iterator();
kotlin.jvm.internal.m.d(it2, "iterator(...)");
it = it2;
}
MyDownloads.this.z4(false);
MyDownloads.this.E4();
return R2.s.a;
}
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
it = (Iterator) this.a;
R2.n.b(obj);
while (it.hasNext()) {
Object next = it.next();
kotlin.jvm.internal.m.d(next, "next(...)");
C0757s m4 = MyDownloads.this.m4();
AppCompatActivity appCompatActivity = MyDownloads.this;
this.a = it;
this.b = 1;
if (m4.i(appCompatActivity, (C0965p) next, this) == c) {
return c;
}
}
MyDownloads.this.z4(false);
MyDownloads.this.E4();
return R2.s.a;
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((e) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
public static final class f implements InterfaceC0928k {
f() {
}
@Override
public void a(int i) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.g()) {
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
c0447b2.l(i);
MyDownloads.this.B4();
return;
}
if (UptodownApp.F.a0()) {
C0447b c0447b3 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b3);
Object obj = c0447b3.d().get(i);
kotlin.jvm.internal.m.d(obj, "get(...)");
MyDownloads.this.b4((C0965p) obj, i);
}
}
@Override
public void b(int i) {
if (UptodownApp.F.a0()) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
Object obj = c0447b.d().get(i);
kotlin.jvm.internal.m.d(obj, "get(...)");
C0965p c0965p = (C0965p) obj;
if (c0965p.h() >= 0) {
MyDownloads.this.D2(c0965p.h());
}
}
}
@Override
public void c(int i) {
if (UptodownApp.F.a0()) {
MyDownloads.this.U3(i);
}
}
@Override
public void d(int i) {
if (MyDownloads.this.L != null) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.g()) {
return;
}
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
kotlin.jvm.internal.m.b(MyDownloads.this.L);
c0447b2.m(!r1.g());
C0447b c0447b3 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b3);
c0447b3.l(i);
MyDownloads.this.D4();
MyDownloads.this.N = true;
MyDownloads.this.k4().e.smoothScrollToPosition(i);
}
}
@Override
public void e(int i) {
if (UptodownApp.F.a0()) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.d().size() > 0) {
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
if (i < c0447b2.d().size()) {
C0447b c0447b3 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b3);
Object obj = c0447b3.d().get(i);
kotlin.jvm.internal.m.d(obj, "get(...)");
DownloadWorker.a aVar = DownloadWorker.d;
if (aVar.l((C0965p) obj) && aVar.h()) {
aVar.o();
}
}
}
}
}
}
public static final class g implements SearchView.OnQueryTextListener {
g() {
}
public boolean onQueryTextChange(String newText) {
kotlin.jvm.internal.m.e(newText, "newText");
MyDownloads.this.M3(newText);
return false;
}
public boolean onQueryTextSubmit(String query) {
kotlin.jvm.internal.m.e(query, "query");
MyDownloads.this.M3(query);
return true;
}
}
public static final class h implements RecyclerView.OnItemTouchListener {
h() {
}
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
kotlin.jvm.internal.m.e(rv, "rv");
kotlin.jvm.internal.m.e(e, "e");
int action = e.getAction();
if (action == 0) {
MyDownloads.this.N = false;
} else if (action == 2 && MyDownloads.this.N) {
return true;
}
return false;
}
public void onRequestDisallowInterceptTouchEvent(boolean z) {
}
public void onTouchEvent(RecyclerView rv, MotionEvent e) {
kotlin.jvm.internal.m.e(rv, "rv");
kotlin.jvm.internal.m.e(e, "e");
}
}
public static final class i extends OnBackPressedCallback {
i() {
super(true);
}
public void handleOnBackPressed() {
C0447b c0447b = MyDownloads.this.L;
if (c0447b == null || !c0447b.g()) {
MyDownloads.this.finish();
} else {
MyDownloads.this.E4();
}
}
}
static final class j extends kotlin.coroutines.jvm.internal.l implements d3.p {
int a;
static final class a implements r3.f {
final MyDownloads a;
a(MyDownloads myDownloads) {
this.a = myDownloads;
}
public final Object emit(u2.H h, V2.d dVar) {
if (h instanceof H.a) {
this.a.k4().b.setVisibility(0);
} else if (h instanceof H.c) {
this.a.k4().b.setVisibility(8);
this.a.k4().c.getRoot().setVisibility(0);
H.c cVar = (H.c) h;
this.a.A4(((C0757s.a) cVar.a()).a(), ((C0757s.a) cVar.a()).b());
if (!this.a.isFinishing()) {
if (((C0757s.a) cVar.a()).a().size() == 0 && ((C0757s.a) cVar.a()).b().size() == 0) {
this.a.k4().h.setVisibility(0);
this.a.k4().e.setVisibility(8);
} else {
this.a.k4().h.setVisibility(8);
this.a.k4().e.setVisibility(0);
}
this.a.k4().b.setVisibility(8);
}
} else if (!(h instanceof H.b)) {
throw new R2.k();
}
return R2.s.a;
}
}
j(V2.d dVar) {
super(2, dVar);
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return MyDownloads.this.new j(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object c = W2.b.c();
int i = this.a;
if (i == 0) {
R2.n.b(obj);
r3.I l = MyDownloads.this.m4().l();
a aVar = new a(MyDownloads.this);
this.a = 1;
if (l.collect(aVar, this) == c) {
return c;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
R2.n.b(obj);
}
throw new R2.d();
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((j) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
public static final class k extends kotlin.jvm.internal.n implements d3.a {
final ComponentActivity a;
public k(ComponentActivity componentActivity) {
super(0);
this.a = componentActivity;
}
@Override
public final ViewModelProvider.Factory invoke() {
return this.a.getDefaultViewModelProviderFactory();
}
}
public static final class l extends kotlin.jvm.internal.n implements d3.a {
final ComponentActivity a;
public l(ComponentActivity componentActivity) {
super(0);
this.a = componentActivity;
}
@Override
public final ViewModelStore invoke() {
return this.a.getViewModelStore();
}
}
public static final class m extends kotlin.jvm.internal.n implements d3.a {
final d3.a a;
final ComponentActivity b;
public m(d3.a aVar, ComponentActivity componentActivity) {
super(0);
this.a = aVar;
this.b = componentActivity;
}
@Override
public final CreationExtras invoke() {
CreationExtras creationExtras;
d3.a aVar = this.a;
return (aVar == null || (creationExtras = (CreationExtras) aVar.invoke()) == null) ? this.b.getDefaultViewModelCreationExtras() : creationExtras;
}
}
static final class n extends kotlin.coroutines.jvm.internal.l implements d3.p {
int a;
final int c;
final C0965p d;
n(int i, C0965p c0965p, V2.d dVar) {
super(2, dVar);
this.c = i;
this.d = c0965p;
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return MyDownloads.this.new n(this.c, this.d, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
W2.b.c();
if (this.a != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
R2.n.b(obj);
if (MyDownloads.this.L != null) {
int i = this.c;
if (i == 202 || i == 203) {
MyDownloads.this.z4(false);
} else if (i != 207) {
C0965p c0965p = this.d;
if (c0965p != null) {
int l4 = MyDownloads.this.l4(c0965p.w());
if (l4 > -1) {
C0447b c0447b = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b);
c0447b.d().set(l4, this.d);
C0447b c0447b2 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b2);
c0447b2.notifyItemChanged(l4);
} else {
MyDownloads.this.z4(false);
}
}
} else {
C0447b c0447b3 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b3);
if (AbstractC0525o.B(c0447b3.d(), this.d)) {
C0447b c0447b4 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b4);
C0447b c0447b5 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b5);
c0447b4.notifyItemRemoved(AbstractC0525o.K(c0447b5.d(), this.d));
C0447b c0447b6 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b6);
ArrayList d = c0447b6.d();
kotlin.jvm.internal.G.a(d).remove(this.d);
C0447b c0447b7 = MyDownloads.this.L;
kotlin.jvm.internal.m.b(c0447b7);
if (c0447b7.d().isEmpty()) {
MyDownloads.this.k4().h.setVisibility(0);
}
}
}
}
return R2.s.a;
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((n) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
public final void A4(ArrayList arrayList, ArrayList arrayList2) {
if (isFinishing()) {
return;
}
if (this.L == null) {
this.L = new C0447b(this.P);
k4().e.setAdapter(this.L);
}
C0447b c0447b = this.L;
kotlin.jvm.internal.m.b(c0447b);
c0447b.j(arrayList, arrayList2);
}
public final void B4() {
int i4;
C0447b c0447b = this.L;
if (c0447b != null) {
kotlin.jvm.internal.m.b(c0447b);
i4 = c0447b.c();
TextView textView = k4().c.d;
C0447b c0447b2 = this.L;
kotlin.jvm.internal.m.b(c0447b2);
textView.setEnabled(c0447b2.d().size() > 0);
} else {
i4 = 0;
}
if (i4 > 0) {
k4().c.e.setEnabled(true);
k4().c.e.setBackground(ContextCompat.getDrawable(this, 2131231248));
} else {
k4().c.e.setEnabled(false);
k4().c.e.setBackground(ContextCompat.getDrawable(this, 2131231255));
}
k4().c.f.setText(getString(N1.i.y, String.valueOf(i4)));
}
private final void C4(String str) {
if (str != null) {
Intent intent = new Intent("android.intent.action.SEND");
Uri uriForFile = FileProvider.getUriForFile(this, getPackageName() + ".provider", new File(str));
intent.setType(getContentResolver().getType(uriForFile));
intent.putExtra("android.intent.extra.STREAM", uriForFile);
startActivity(Intent.createChooser(intent, getString(2131952097)));
}
}
public final void D4() {
k4().c.getRoot().setVisibility(0);
k4().c.c.setVisibility(0);
k4().c.b.getRoot().setVisibility(4);
B4();
}
public final void E4() {
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.m(false);
}
k4().c.getRoot().setVisibility(0);
k4().c.b.getRoot().setVisibility(0);
k4().c.c.setVisibility(4);
}
public final void M3(String str) {
m4().p(str);
z4(false);
}
public static final c2.T N3(MyDownloads myDownloads) {
return c2.T.c(myDownloads.getLayoutInflater());
}
private final void O3(File file) {
G.a aVar = W1.G.b;
String name = file.getName();
kotlin.jvm.internal.m.d(name, "getName(...)");
if (!aVar.a(name)) {
AbstractC0740a.z2(this, file, null, 2, null);
return;
}
W1.G g4 = new W1.G();
boolean f4 = g4.f(file);
if (g4.c(file) && !new C0536h().e().canWrite()) {
if (U()) {
Y2(0L);
} else {
l0();
}
f4 = false;
}
if (f4) {
AbstractC0740a.z2(this, file, null, 2, null);
}
}
private final void P3(boolean z) {
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), (V2.g) null, (o3.L) null, new c(z, null), 3, (Object) null);
}
public final void Q3(int i4) {
C0447b c0447b = this.L;
if (c0447b != null) {
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.d().size() > 0) {
C0447b c0447b2 = this.L;
kotlin.jvm.internal.m.b(c0447b2);
if (i4 < c0447b2.d().size()) {
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), (V2.g) null, (o3.L) null, new d(i4, null), 3, (Object) null);
}
}
}
}
private final void R3() {
String format;
DownloadWorker.d.n();
if (new u2.p().i(this).size() > 1) {
kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.a;
String string = getString(2131951918);
kotlin.jvm.internal.m.d(string, "getString(...)");
format = String.format(string, Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.m.d(format, "format(...)");
} else {
kotlin.jvm.internal.F f5 = kotlin.jvm.internal.F.a;
String string2 = getString(2131951917);
kotlin.jvm.internal.m.d(string2, "getString(...)");
format = String.format(string2, Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.m.d(format, "format(...)");
}
Q1(format, new d3.a() {
@Override
public final Object invoke() {
R2.s S3;
S3 = MyDownloads.S3(MyDownloads.this);
return S3;
}
}, new d3.a() {
@Override
public final Object invoke() {
R2.s T3;
T3 = MyDownloads.T3(MyDownloads.this);
return T3;
}
});
}
public static final R2.s S3(MyDownloads myDownloads) {
myDownloads.P3(true);
return R2.s.a;
}
public static final R2.s T3(MyDownloads myDownloads) {
myDownloads.P3(false);
DownloadWorker.d.o();
return R2.s.a;
}
public final void U3(final int i4) {
C0447b c0447b = this.L;
if (c0447b != null) {
kotlin.jvm.internal.m.b(c0447b);
Object obj = c0447b.d().get(i4);
kotlin.jvm.internal.m.d(obj, "get(...)");
C0965p c0965p = (C0965p) obj;
DownloadWorker.a aVar = DownloadWorker.d;
if (aVar.k(c0965p.h(), c0965p.E())) {
aVar.n();
}
String string = getString(2131951957);
kotlin.jvm.internal.m.d(string, "getString(...)");
Q1(string, new d3.a() {
@Override
public final Object invoke() {
R2.s V3;
V3 = MyDownloads.V3(MyDownloads.this, i4);
return V3;
}
}, new d3.a() {
@Override
public final Object invoke() {
R2.s W3;
W3 = MyDownloads.W3();
return W3;
}
});
}
}
public static final R2.s V3(MyDownloads myDownloads, int i4) {
myDownloads.Q3(i4);
return R2.s.a;
}
public static final R2.s W3() {
DownloadWorker.d.o();
return R2.s.a;
}
private final void X3() {
kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.a;
String string = getString(2131951922);
kotlin.jvm.internal.m.d(string, "getString(...)");
String format = String.format(string, Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.m.d(format, "format(...)");
P1(format, new d3.a() {
@Override
public final Object invoke() {
R2.s Y3;
Y3 = MyDownloads.Y3(MyDownloads.this);
return Y3;
}
});
}
public static final R2.s Y3(MyDownloads myDownloads) {
if (UptodownApp.F.U("downloadApkWorker", myDownloads)) {
myDownloads.R3();
} else {
myDownloads.P3(false);
}
return R2.s.a;
}
private final void Z3() {
kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.a;
String string = getString(2131951924);
kotlin.jvm.internal.m.d(string, "getString(...)");
String format = String.format(string, Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.m.d(format, "format(...)");
P1(format, new d3.a() {
@Override
public final Object invoke() {
R2.s a4;
a4 = MyDownloads.a4(MyDownloads.this);
return a4;
}
});
}
public static final R2.s a4(MyDownloads myDownloads) {
o3.g.d(LifecycleOwnerKt.getLifecycleScope(myDownloads), (V2.g) null, (o3.L) null, myDownloads.new e(null), 3, (Object) null);
return R2.s.a;
}
public final void b4(final C0965p c0965p, final int i4) {
Object obj;
final kotlin.jvm.internal.C c4 = new kotlin.jvm.internal.C();
C0597o c5 = C0597o.c(getLayoutInflater());
kotlin.jvm.internal.m.d(c5, "inflate(...)");
TextView textView = c5.l;
k.a aVar = N1.k.g;
textView.setTypeface(aVar.w());
c5.m.setTypeface(aVar.w());
String D = c0965p.D();
if (D != null && D.length() != 0) {
com.squareup.picasso.s.h().l(c0965p.D()).n(UptodownApp.F.h0(this)).i(c5.b);
} else if (c0965p.p() != null) {
c5.b.setImageDrawable(c0965p.p());
} else if (c0965p.o().size() != 1) {
c5.b.setImageDrawable(ContextCompat.getDrawable(this, N1.e.d));
} else if (((C0966q) c0965p.o().get(0)).a() != null) {
String a4 = ((C0966q) c0965p.o().get(0)).a();
kotlin.jvm.internal.m.b(a4);
if (m3.m.o(a4, ".apk", false, 2, null)) {
C0536h c0536h = new C0536h();
String a5 = ((C0966q) c0965p.o().get(0)).a();
kotlin.jvm.internal.m.b(a5);
if (c0536h.h(this, a5) != null) {
c5.b.setImageDrawable(c0965p.p());
} else {
c5.b.setImageResource(N1.e.b);
}
} else {
G.a aVar2 = W1.G.b;
String a6 = ((C0966q) c0965p.o().get(0)).a();
kotlin.jvm.internal.m.b(a6);
if (aVar2.a(a6)) {
c5.b.setImageResource(N1.e.s);
} else {
c5.b.setImageDrawable(ContextCompat.getDrawable(this, N1.e.d));
}
}
} else {
c5.b.setImageDrawable(ContextCompat.getDrawable(this, N1.e.d));
}
c5.e.setText(c0965p.i());
c5.e.setTypeface(aVar.w());
if (j4(c0965p) || c0965p.L()) {
c5.h.setVisibility(8);
} else {
c5.h.setTypeface(aVar.x());
c5.h.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.i4(kotlin.jvm.internal.C.this, c0965p, this, view);
}
});
}
c5.j.setTypeface(aVar.x());
c5.j.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.c4(MyDownloads.this, i4, c4, view);
}
});
c5.i.setTypeface(aVar.x());
DownloadWorker.a aVar3 = DownloadWorker.d;
if (aVar3.l(c0965p)) {
c5.i.setVisibility(0);
if (aVar3.h()) {
c5.i.setText(getString(2131952771));
} else {
c5.i.setText(getString(2131951655));
}
c5.i.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.d4(kotlin.jvm.internal.C.this, view);
}
});
} else {
c5.i.setVisibility(8);
}
c5.k.setTypeface(aVar.x());
c5.k.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.e4(kotlin.jvm.internal.C.this, c0965p, this, view);
}
});
if (c0965p.o().size() > 0) {
c5.k.setVisibility(8);
c5.m.setVisibility(8);
}
if (c0965p.h() >= 0) {
c5.d.setTypeface(aVar.x());
c5.d.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.f4(kotlin.jvm.internal.C.this, this, c0965p, view);
}
});
} else {
c5.d.setVisibility(8);
}
c5.f.setTypeface(aVar.x());
c5.f.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.g4(kotlin.jvm.internal.C.this, this, i4, view);
}
});
C0447b c0447b = this.L;
kotlin.jvm.internal.m.b(c0447b);
if (((C0965p) c0447b.d().get(i4)).o().size() > 0) {
C0447b c0447b2 = this.L;
kotlin.jvm.internal.m.b(c0447b2);
if (((C0966q) ((C0965p) c0447b2.d().get(i4)).o().get(0)).a() != null) {
c5.g.setTypeface(aVar.x());
c5.g.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.h4(kotlin.jvm.internal.C.this, this, i4, view);
}
});
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(c5.getRoot());
builder.setCancelable(true);
c4.a = builder.create();
if (!isFinishing() || (obj = c4.a) == null) {
}
Window window = ((AlertDialog) obj).getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(0));
}
((AlertDialog) c4.a).show();
return;
}
}
c5.g.setVisibility(8);
AlertDialog.Builder builder2 = new AlertDialog.Builder(this);
builder2.setView(c5.getRoot());
builder2.setCancelable(true);
c4.a = builder2.create();
if (isFinishing()) {
}
}
public static final void c4(MyDownloads myDownloads, int i4, kotlin.jvm.internal.C c4, View view) {
C0447b c0447b = myDownloads.L;
kotlin.jvm.internal.m.b(c0447b);
c0447b.m(true);
C0447b c0447b2 = myDownloads.L;
kotlin.jvm.internal.m.b(c0447b2);
c0447b2.l(i4);
myDownloads.D4();
myDownloads.B4();
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
public static final void d4(kotlin.jvm.internal.C c4, View view) {
DownloadWorker.a aVar = DownloadWorker.d;
if (aVar.h()) {
aVar.o();
} else {
aVar.n();
}
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
public static final void e4(kotlin.jvm.internal.C c4, C0965p c0965p, MyDownloads myDownloads, View view) {
if (UptodownApp.F.a0()) {
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
if (c0965p.f() && c0965p.o().size() == 1) {
myDownloads.C4(((C0966q) c0965p.o().get(0)).a());
}
}
}
public static final void f4(kotlin.jvm.internal.C c4, MyDownloads myDownloads, C0965p c0965p, View view) {
if (UptodownApp.F.a0()) {
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
myDownloads.D2(c0965p.h());
}
}
public static final void g4(kotlin.jvm.internal.C c4, MyDownloads myDownloads, int i4, View view) {
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
myDownloads.Q3(i4);
}
public static final void h4(kotlin.jvm.internal.C c4, MyDownloads myDownloads, int i4, View view) {
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
C0447b c0447b = myDownloads.L;
kotlin.jvm.internal.m.b(c0447b);
if (((C0966q) ((C0965p) c0447b.d().get(i4)).o().get(0)).a() != null) {
C0447b c0447b2 = myDownloads.L;
kotlin.jvm.internal.m.b(c0447b2);
String a4 = ((C0966q) ((C0965p) c0447b2.d().get(i4)).o().get(0)).a();
kotlin.jvm.internal.m.b(a4);
File parentFile = new File(a4).getParentFile();
String absolutePath = parentFile != null ? parentFile.getAbsolutePath() : null;
if (absolutePath != null) {
Intent intent = new Intent(myDownloads.getApplicationContext(), (Class<?>) FileExplorerActivity.class);
intent.putExtra("subdir", absolutePath);
myDownloads.startActivity(intent);
} else {
String string = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string, "getString(...)");
myDownloads.r0(string);
}
}
}
public static final void i4(kotlin.jvm.internal.C c4, C0965p c0965p, MyDownloads myDownloads, View view) {
String a4;
AlertDialog alertDialog = (AlertDialog) c4.a;
if (alertDialog != null) {
alertDialog.dismiss();
}
if (!kotlin.jvm.internal.m.a(c0965p.w(), myDownloads.getPackageName())) {
if (c0965p.o().size() != 1 || (a4 = ((C0966q) c0965p.o().get(0)).a()) == null || a4.length() == 0) {
File n4 = c0965p.n();
if (n4 != null) {
AbstractC0740a.z2(myDownloads, n4, null, 2, null);
return;
}
String string = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string, "getString(...)");
myDownloads.r0(string);
return;
}
String a5 = ((C0966q) c0965p.o().get(0)).a();
kotlin.jvm.internal.m.b(a5);
File file = new File(a5);
if (file.exists()) {
myDownloads.O3(file);
return;
}
String string2 = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string2, "getString(...)");
myDownloads.r0(string2);
return;
}
if (c0965p.o().isEmpty() || ((C0966q) c0965p.o().get(0)).a() == null) {
String string3 = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string3, "getString(...)");
myDownloads.r0(string3);
return;
}
String a6 = ((C0966q) c0965p.o().get(0)).a();
kotlin.jvm.internal.m.b(a6);
File file2 = new File(a6);
if (!file2.exists()) {
String string4 = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string4, "getString(...)");
myDownloads.r0(string4);
return;
}
PackageManager packageManager = myDownloads.getPackageManager();
kotlin.jvm.internal.m.d(packageManager, "getPackageManager(...)");
String absolutePath = file2.getAbsolutePath();
kotlin.jvm.internal.m.d(absolutePath, "getAbsolutePath(...)");
PackageInfo c5 = W1.s.c(packageManager, absolutePath, 128);
if (c5 == null) {
String string5 = myDownloads.getString(N1.i.M);
kotlin.jvm.internal.m.d(string5, "getString(...)");
myDownloads.r0(string5);
return;
}
u2.y yVar = new u2.y();
String name = file2.getName();
kotlin.jvm.internal.m.d(name, "getName(...)");
String h4 = yVar.h(name);
if (h4 == null) {
AbstractC0740a.z2(myDownloads, file2, null, 2, null);
} else if (new C0536h().m(c5) > 680) {
AbstractC0740a.z2(myDownloads, file2, null, 2, null);
} else {
myDownloads.E2(h4, null);
}
}
private final boolean j4(C0965p c0965p) {
return c0965p != null && c0965p.x() > 0 && c0965p.x() < 100;
}
public final c2.T k4() {
return (c2.T) this.J.getValue();
}
public final int l4(String str) {
if (str != null && str.length() != 0) {
C0447b c0447b = this.L;
kotlin.jvm.internal.m.b(c0447b);
ArrayList d4 = c0447b.d();
int size = d4.size();
for (int i4 = 0; i4 < size; i4++) {
Object obj = d4.get(i4);
kotlin.jvm.internal.m.d(obj, "get(...)");
if (m3.m.p(((C0965p) obj).w(), str, true)) {
return i4;
}
}
}
return -1;
}
public final C0757s m4() {
return (C0757s) this.K.getValue();
}
private final void n4() {
setContentView(k4().getRoot());
Drawable drawable = ContextCompat.getDrawable(this, N1.e.c);
if (drawable != null) {
k4().g.setNavigationIcon(drawable);
k4().g.setNavigationContentDescription(getString(2131951721));
}
TextView textView = (TextView) findViewById(2131364305);
k.a aVar = N1.k.g;
textView.setTypeface(aVar.w());
k4().g.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.o4(MyDownloads.this, view);
}
});
k4().g.inflateMenu(2131689479);
k4().g.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
public final boolean onMenuItemClick(MenuItem menuItem) {
boolean p4;
p4 = MyDownloads.p4(MyDownloads.this, menuItem);
return p4;
}
});
k4().f.setOnQueryTextListener(new g());
k4().f.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.q4(MyDownloads.this, view);
}
});
((ImageView) k4().f.findViewById(R.id.search_close_btn)).setBackgroundResource(N1.e.a);
EditText editText = (EditText) k4().f.findViewById(R.id.search_src_text);
editText.setTypeface(aVar.x());
editText.setTextColor(ContextCompat.getColor(this, N1.c.b));
editText.setHintTextColor(ContextCompat.getColor(this, N1.c.a));
k4().c.b.c.setTypeface(aVar.x());
k4().c.b.d.setTypeface(aVar.w());
k4().c.b.d.setText(getString(2131952458));
final HashMap hashMap = new HashMap();
hashMap.put(0, getString(2131952461));
hashMap.put(1, getString(2131952458));
hashMap.put(2, getString(2131952463));
k4().c.b.getRoot().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.r4(MyDownloads.this, hashMap, view);
}
});
k4().e.setLayoutManager(new LinearLayoutManager(this, 1, false));
int dimension = (int) getResources().getDimension(2131166020);
k4().e.addItemDecoration(new w2.l(dimension, dimension));
k4().e.setItemAnimator((RecyclerView.ItemAnimator) null);
k4().e.addOnItemTouchListener(new h());
k4().h.setTypeface(aVar.x());
TextView textView2 = k4().c.e;
k4().c.f.setTypeface(aVar.x());
k4().c.d.setTypeface(aVar.w());
k4().c.d.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.t4(MyDownloads.this, view);
}
});
k4().c.e.setTypeface(aVar.w());
k4().c.e.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.u4(MyDownloads.this, view);
}
});
k4().b.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyDownloads.v4(view);
}
});
E4();
NestedScrollView nsvMyDownloads = k4().d;
kotlin.jvm.internal.m.d(nsvMyDownloads, "nsvMyDownloads");
hideKeyboardOnScroll(nsvMyDownloads);
m0();
getOnBackPressedDispatcher().addCallback(this, this.O);
}
public static final void o4(MyDownloads myDownloads, View view) {
myDownloads.getOnBackPressedDispatcher().onBackPressed();
}
public static final boolean p4(MyDownloads myDownloads, MenuItem menuItem) {
if (menuItem.getItemId() == 2131361874) {
myDownloads.startActivity(new Intent((Context) myDownloads, (Class<?>) FileExplorerActivity.class));
}
if (menuItem.getItemId() != 2131361887) {
return true;
}
SearchView searchViewMyDownloads = myDownloads.k4().f;
kotlin.jvm.internal.m.d(searchViewMyDownloads, "searchViewMyDownloads");
if (searchViewMyDownloads.getVisibility() == 0) {
myDownloads.k4().f.setVisibility(8);
myDownloads.k4().f.clearFocus();
return true;
}
myDownloads.k4().f.setVisibility(0);
myDownloads.k4().f.requestFocus();
SearchView searchViewMyDownloads2 = myDownloads.k4().f;
kotlin.jvm.internal.m.d(searchViewMyDownloads2, "searchViewMyDownloads");
myDownloads.showKeyboard(searchViewMyDownloads2);
return true;
}
public static final void q4(MyDownloads myDownloads, View view) {
myDownloads.k4().f.setIconified(false);
}
public static final void r4(final MyDownloads myDownloads, HashMap hashMap, View view) {
kotlin.jvm.internal.m.b(view);
new y2.q(myDownloads, view, hashMap, new d3.p() {
@Override
public final Object invoke(Object obj, Object obj2) {
R2.s s4;
s4 = MyDownloads.s4(MyDownloads.this, ((Integer) obj).intValue(), (String) obj2);
return s4;
}
}).c();
}
public static final R2.s s4(MyDownloads myDownloads, int i4, String selectedOption) {
kotlin.jvm.internal.m.e(selectedOption, "selectedOption");
if (i4 == 0) {
C0757s.b bVar = myDownloads.M;
C0757s.b bVar2 = C0757s.b.a;
if (bVar != bVar2) {
myDownloads.M = bVar2;
}
} else if (i4 == 1) {
C0757s.b bVar3 = myDownloads.M;
C0757s.b bVar4 = C0757s.b.b;
if (bVar3 != bVar4) {
myDownloads.M = bVar4;
}
} else if (i4 == 2) {
C0757s.b bVar5 = myDownloads.M;
C0757s.b bVar6 = C0757s.b.c;
if (bVar5 != bVar6) {
myDownloads.M = bVar6;
}
}
if (((Number) myDownloads.m4().m().getValue()).intValue() != i4) {
myDownloads.m4().m().setValue(Integer.valueOf(i4));
myDownloads.k4().c.b.d.setText(selectedOption);
myDownloads.M3(myDownloads.k4().f.getQuery().toString());
}
return R2.s.a;
}
public static final void t4(MyDownloads myDownloads, View view) {
myDownloads.X3();
}
public static final void u4(MyDownloads myDownloads, View view) {
myDownloads.Z3();
}
public static final void v4(View view) {
}
public final void y4() {
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.notifyDataSetChanged();
}
}
public final void F4(int i4, C0965p c0965p) {
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new n(i4, c0965p, null), 2, (Object) null);
}
@Override
public void I2() {
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.i();
}
}
@Override
public void R2(File xapkFile) {
kotlin.jvm.internal.m.e(xapkFile, "xapkFile");
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.i();
}
C0447b c0447b2 = this.L;
if (c0447b2 != null) {
c0447b2.h(xapkFile, this);
}
}
@Override
public void S2(File file, int i4) {
kotlin.jvm.internal.m.e(file, "file");
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.h(file, this);
}
}
@Override
public void V2(File xapkFile) {
kotlin.jvm.internal.m.e(xapkFile, "xapkFile");
C0447b c0447b = this.L;
if (c0447b != null) {
c0447b.k(xapkFile, this);
}
}
@Override
public void a3(C0955f appInfo) {
kotlin.jvm.internal.m.e(appInfo, "appInfo");
if (isFinishing()) {
return;
}
Intent intent = new Intent((Context) this, (Class<?>) AppDetailActivity.class);
intent.putExtra("appInfo", appInfo);
startActivity(intent, UptodownApp.F.a(this));
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Bundle extras = getIntent().getExtras();
if (extras != null && extras.containsKey("remoteInstallPath")) {
Bundle extras2 = getIntent().getExtras();
String string = extras2 != null ? extras2.getString("remoteInstallPath") : null;
kotlin.jvm.internal.m.b(string);
File file = new File(string);
if (file.exists()) {
AbstractC0740a.z2(this, file, null, 2, null);
}
u2.F.a.c(this);
}
n4();
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new j(null), 2, (Object) null);
}
protected void onPause() {
try {
u2.v a4 = u2.v.v.a(this);
a4.a();
a4.p1();
a4.i();
} catch (Exception e4) {
e4.printStackTrace();
}
super/*androidx.fragment.app.FragmentActivity*/.onPause();
}
@Override
protected void onResume() {
super.onResume();
u2.F.a.h(this);
z4(true);
}
public final void w4() {
C0447b c0447b;
C0447b c0447b2 = this.L;
Integer valueOf = c0447b2 != null ? Integer.valueOf(c0447b2.e()) : null;
if (valueOf != null && valueOf.intValue() >= 0 && (c0447b = this.L) != null) {
c0447b.notifyItemChanged(valueOf.intValue());
}
C0447b c0447b3 = this.L;
if (c0447b3 != null) {
c0447b3.i();
}
}
public final void x4(String str) {
C0447b c0447b = this.L;
if (c0447b != null) {
kotlin.jvm.internal.m.b(c0447b);
if (c0447b.d().isEmpty()) {
return;
}
C0447b c0447b2 = this.L;
kotlin.jvm.internal.m.b(c0447b2);
int e4 = c0447b2.e();
if (e4 >= 0) {
C0447b c0447b3 = this.L;
if (c0447b3 != null) {
c0447b3.notifyItemChanged(e4);
}
String string = getString(2131952082, str);
kotlin.jvm.internal.m.d(string, "getString(...)");
r0(string);
}
C0447b c0447b4 = this.L;
if (c0447b4 != null) {
c0447b4.i();
}
}
}
public final void z4(boolean z) {
m4().j(this, this.M, z);
}
}