257 lines
8.7 KiB
Java
257 lines
8.7 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.os.Build;
|
|
import android.os.ext.SdkExtensions;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
import o.AbstractC6423cSf;
|
|
|
|
/* renamed from: o.ehe, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public final class C11560ehe {
|
|
|
|
/* renamed from: o.ehe$Sts */
|
|
/* loaded from: classes.dex */
|
|
public static final class Sts extends AbstractC6423cSf<Intent, Heg> {
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Intent YF_(Context context, Intent intent) {
|
|
Intent intent2 = intent;
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(intent2, "");
|
|
return intent2;
|
|
}
|
|
|
|
/* renamed from: o.ehe$Sts$HBt */
|
|
/* loaded from: classes.dex */
|
|
public static final class HBt {
|
|
private HBt() {
|
|
}
|
|
|
|
public /* synthetic */ HBt(byte b) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Heg YG_(int i, Intent intent) {
|
|
return new Heg(i, intent);
|
|
}
|
|
|
|
static {
|
|
new HBt((byte) 0);
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.ehe$HBt */
|
|
/* loaded from: classes.dex */
|
|
public static final class HBt extends AbstractC6423cSf<String[], Map<String, Boolean>> {
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Intent YF_(Context context, String[] strArr) {
|
|
String[] strArr2 = strArr;
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(strArr2, "");
|
|
C14957gcv.e(strArr2, "");
|
|
Intent putExtra = new Intent("androidx.activity.result.contract.action.REQUEST_PERMISSIONS").putExtra("androidx.activity.result.contract.extra.PERMISSIONS", strArr2);
|
|
C14957gcv.c(putExtra, "");
|
|
return putExtra;
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Map<String, Boolean> YG_(int i, Intent intent) {
|
|
if (i == -1 && intent != null) {
|
|
String[] stringArrayExtra = intent.getStringArrayExtra("androidx.activity.result.contract.extra.PERMISSIONS");
|
|
int[] intArrayExtra = intent.getIntArrayExtra("androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS");
|
|
if (intArrayExtra != null && stringArrayExtra != null) {
|
|
ArrayList arrayList = new ArrayList(intArrayExtra.length);
|
|
for (int i2 : intArrayExtra) {
|
|
arrayList.add(Boolean.valueOf(i2 == 0));
|
|
}
|
|
C14957gcv.e(stringArrayExtra, "");
|
|
List list = (List) C14875gap.d((Object[]) stringArrayExtra, new ArrayList());
|
|
ArrayList arrayList2 = arrayList;
|
|
C14957gcv.e(list, "");
|
|
C14957gcv.e(arrayList2, "");
|
|
Iterator it = list.iterator();
|
|
Iterator it2 = arrayList2.iterator();
|
|
C14957gcv.e(list, "");
|
|
int size = list instanceof Collection ? list.size() : 10;
|
|
C14957gcv.e(arrayList2, "");
|
|
ArrayList arrayList3 = new ArrayList(Math.min(size, arrayList2.size()));
|
|
while (it.hasNext() && it2.hasNext()) {
|
|
arrayList3.add(new C13396fZU(it.next(), it2.next()));
|
|
}
|
|
return C14856gaP.c(arrayList3);
|
|
}
|
|
}
|
|
C14854gaM c14854gaM = C14854gaM.c;
|
|
C14957gcv.d(c14854gaM, "");
|
|
return c14854gaM;
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ AbstractC6423cSf.RVV<Map<String, Boolean>> e(Context context, String[] strArr) {
|
|
String[] strArr2 = strArr;
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(strArr2, "");
|
|
if (strArr2.length != 0) {
|
|
for (String str : strArr2) {
|
|
if (nMh.checkSelfPermission(context, str) != 0) {
|
|
return null;
|
|
}
|
|
}
|
|
int a = C14856gaP.a(strArr2.length);
|
|
if (a < 16) {
|
|
a = 16;
|
|
}
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap(a);
|
|
for (String str2 : strArr2) {
|
|
C13396fZU c13396fZU = new C13396fZU(str2, Boolean.TRUE);
|
|
linkedHashMap.put(c13396fZU.d, c13396fZU.e);
|
|
}
|
|
return new AbstractC6423cSf.RVV<>(linkedHashMap);
|
|
}
|
|
C14854gaM c14854gaM = C14854gaM.c;
|
|
C14957gcv.d(c14854gaM, "");
|
|
return new AbstractC6423cSf.RVV<>(c14854gaM);
|
|
}
|
|
|
|
/* renamed from: o.ehe$HBt$Sts */
|
|
/* loaded from: classes.dex */
|
|
public static final class Sts {
|
|
private Sts() {
|
|
}
|
|
|
|
public /* synthetic */ Sts(byte b) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
static {
|
|
new Sts((byte) 0);
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS */
|
|
/* loaded from: classes.dex */
|
|
public static class IeS extends AbstractC6423cSf<zJl, Uri> {
|
|
|
|
/* renamed from: o.ehe$IeS$Sts */
|
|
/* loaded from: classes.dex */
|
|
public static final class Sts implements tOB {
|
|
final String c;
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS$tOB */
|
|
/* loaded from: classes.dex */
|
|
public interface tOB {
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS$IeS, reason: collision with other inner class name */
|
|
/* loaded from: classes.dex */
|
|
public static final class C0109IeS {
|
|
private C0109IeS() {
|
|
}
|
|
|
|
public static String c(tOB tob) {
|
|
C14957gcv.e(tob, "");
|
|
if (tob instanceof RVV) {
|
|
return "image/*";
|
|
}
|
|
if (tob instanceof LWm) {
|
|
return "video/*";
|
|
}
|
|
if (!(tob instanceof Sts)) {
|
|
if (tob instanceof HBt) {
|
|
return null;
|
|
}
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
return ((Sts) tob).c;
|
|
}
|
|
|
|
public /* synthetic */ C0109IeS(byte b) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Intent YF_(Context context, zJl zjl) {
|
|
zJl zjl2 = zjl;
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(zjl2, "");
|
|
if (Build.VERSION.SDK_INT >= 33 || (Build.VERSION.SDK_INT >= 30 && SdkExtensions.getExtensionVersion(30) >= 2)) {
|
|
Intent intent = new Intent("android.provider.action.PICK_IMAGES");
|
|
intent.setType(C0109IeS.c(zjl2.c));
|
|
return intent;
|
|
}
|
|
Intent intent2 = new Intent("android.intent.action.OPEN_DOCUMENT");
|
|
intent2.setType(C0109IeS.c(zjl2.c));
|
|
if (intent2.getType() != null) {
|
|
return intent2;
|
|
}
|
|
intent2.setType("*/*");
|
|
intent2.putExtra("android.intent.extra.MIME_TYPES", new String[]{"image/*", "video/*"});
|
|
return intent2;
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* bridge */ /* synthetic */ AbstractC6423cSf.RVV<Uri> e(Context context, zJl zjl) {
|
|
C14957gcv.e(context, "");
|
|
C14957gcv.e(zjl, "");
|
|
return null;
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS$RVV */
|
|
/* loaded from: classes.dex */
|
|
public static final class RVV implements tOB {
|
|
public static final RVV a = new RVV();
|
|
|
|
private RVV() {
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS$LWm */
|
|
/* loaded from: classes.dex */
|
|
public static final class LWm implements tOB {
|
|
private LWm() {
|
|
}
|
|
|
|
static {
|
|
new LWm();
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.ehe$IeS$HBt */
|
|
/* loaded from: classes.dex */
|
|
public static final class HBt implements tOB {
|
|
public static final HBt e = new HBt();
|
|
|
|
private HBt() {
|
|
}
|
|
}
|
|
|
|
@Override // o.AbstractC6423cSf
|
|
public final /* synthetic */ Uri YG_(int i, Intent intent) {
|
|
if (i != -1) {
|
|
intent = null;
|
|
}
|
|
if (intent != null) {
|
|
return intent.getData();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static {
|
|
new C0109IeS((byte) 0);
|
|
}
|
|
}
|
|
}
|