38 lines
1.0 KiB
Java
38 lines
1.0 KiB
Java
package com.ubt.jimu.controller.util;
|
|
|
|
import android.app.Activity;
|
|
import android.os.Build;
|
|
import androidx.core.app.ActivityCompat;
|
|
import androidx.core.content.ContextCompat;
|
|
import java.util.ArrayList;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class PermissionUtils {
|
|
public static boolean a(Activity activity, String[] strArr, int i) {
|
|
if (Build.VERSION.SDK_INT < 23) {
|
|
return true;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
for (String str : strArr) {
|
|
if (ContextCompat.a(activity, str) != 0) {
|
|
arrayList.add(str);
|
|
}
|
|
}
|
|
if (arrayList.size() <= 0) {
|
|
return true;
|
|
}
|
|
ActivityCompat.a(activity, (String[]) arrayList.toArray(new String[arrayList.size()]), i);
|
|
return false;
|
|
}
|
|
|
|
public static boolean a(String[] strArr, int[] iArr) {
|
|
boolean z = true;
|
|
for (int i = 0; i < strArr.length; i++) {
|
|
if (iArr[i] != 0) {
|
|
z = false;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
}
|