正在查看: Tasker v6.5.11 应用的 x2.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.5.11 应用的 x2.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.joaomgcd.taskerm.util;
import ag.d;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Notification;
import android.app.Service;
import android.app.usage.UsageEvents;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothProfile;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.hardware.Sensor;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
import android.media.MediaPlayer;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.Uri;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.BaseBundle;
import android.os.Bundle;
import android.os.ParcelUuid;
import android.os.Parcelable;
import android.service.notification.StatusBarNotification;
import android.telephony.TelephonyDisplayInfo;
import android.text.Editable;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewManager;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.widget.EditText;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityForResultForIntent;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityForResultForIntentGrantFilePermission;
import com.joaomgcd.taskerm.navigationbar.IconProvider;
import com.joaomgcd.taskerm.structuredoutput.StructureType;
import com.joaomgcd.taskerm.util.e1;
import com.joaomgcd.taskerservercommon.ConstantsCommonTaskerServer;
import cyanogenmod.app.ProfileManager;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Writer;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import kg.w0;
import kotlin.Pair;
import lj.r;
import net.dinglisch.android.taskerm.Expr;
import net.dinglisch.android.taskerm.dk;
import net.dinglisch.android.taskerm.dq;
import net.dinglisch.android.taskerm.ho;
import net.dinglisch.android.taskerm.kq;
import net.dinglisch.android.taskerm.kr;
import net.dinglisch.android.taskerm.lq;
import net.dinglisch.android.taskerm.on;
import net.dinglisch.android.taskerm.pi;
import net.dinglisch.android.taskerm.pn;
import net.dinglisch.android.taskerm.qi;
import net.dinglisch.android.taskerm.s1;
import net.dinglisch.android.taskerm.th;
import net.dinglisch.android.taskerm.tn;
import net.dinglisch.android.taskerm.to;
import net.dinglisch.android.taskerm.uo;
import net.dinglisch.android.taskerm.vh;
import net.dinglisch.android.taskerm.wo;
import net.dinglisch.android.taskerm.xi;
import org.json.JSONException;
import org.json.JSONObject;
public final class x2 {
static final class a extends yj.q implements xj.a<Object> {
final Object i;
a(Object obj) {
super(0);
this.i = obj;
}
@Override
public final Object invoke() {
Object obj = this.i;
return obj instanceof Bundle ? x2.w0((BaseBundle) obj) : obj;
}
}
public static final class a0 implements BluetoothProfile.ServiceListener {
final ij.d<com.joaomgcd.taskerm.util.x0> a;
a0(ij.d<com.joaomgcd.taskerm.util.x0> dVar) {
this.a = dVar;
}
@Override
public void onServiceConnected(int i, BluetoothProfile bluetoothProfile) {
yj.p.i(bluetoothProfile, "bluetoothProfile");
this.a.b(new com.joaomgcd.taskerm.util.x0(i, bluetoothProfile));
}
@Override
public void onServiceDisconnected(int i) {
}
}
static final class b extends yj.q implements xj.a<Object> {
final BaseBundle i;
final String q;
b(BaseBundle baseBundle, String str) {
super(0);
this.i = baseBundle;
this.q = str;
}
@Override
public final Object invoke() {
return this.i.get(this.q);
}
}
static final class b0 extends yj.q implements xj.a<xi> {
final to i;
final yj.h0 q;
b0(to toVar, yj.h0 h0Var) {
super(0);
this.i = toVar;
this.q = h0Var;
}
@Override
public final xi invoke() {
return this.i.w(this.q.i);
}
}
static final class c extends yj.q implements xj.a<lj.e0> {
final EditText i;
final String q;
c(EditText editText, String str) {
super(0);
this.i = editText;
this.q = str;
}
public final void a() {
String str;
Editable text = this.i.getText();
String obj = text != null ? text.toString() : null;
if (obj == null || obj.length() == 0) {
str = this.q;
} else {
if (hk.o.t(obj, "/", false, 2, null)) {
obj = obj.substring(0, obj.length() - 1);
yj.p.h(obj, "substring(...)");
}
str = obj + "/" + this.q;
}
this.i.setText(str);
}
@Override
public lj.e0 invoke() {
a();
return lj.e0.a;
}
}
static final class c0 extends yj.q implements xj.a<xi> {
final to i;
final yj.h0 q;
c0(to toVar, yj.h0 h0Var) {
super(0);
this.i = toVar;
this.q = h0Var;
}
@Override
public final xi invoke() {
return this.i.w(this.q.i);
}
}
static final class d<T> extends yj.q implements xj.l<T, lj.e0> {
final oj.d<T> i;
d(oj.d<? super T> dVar) {
super(1);
this.i = dVar;
}
public final void a(T t) {
this.i.y(lj.r.a(t));
}
@Override
public lj.e0 invoke(Object obj) {
a(obj);
return lj.e0.a;
}
}
public static final class d0 extends BluetoothGattCallback {
final ij.d<Integer> a;
final yj.j0<BluetoothGatt> b;
d0(ij.d<Integer> dVar, yj.j0<BluetoothGatt> j0Var) {
this.a = dVar;
this.b = j0Var;
}
@Override
public void onConnectionStateChange(BluetoothGatt bluetoothGatt, int i, int i2) {
yj.p.i(bluetoothGatt, "gatt");
super.onConnectionStateChange(bluetoothGatt, i, i2);
this.b.i = bluetoothGatt;
bluetoothGatt.readRemoteRssi();
}
@Override
public void onReadRemoteRssi(BluetoothGatt bluetoothGatt, int i, int i2) {
yj.p.i(bluetoothGatt, "gatt");
this.a.b(Integer.valueOf(i));
x2.W(bluetoothGatt);
}
}
static final class e implements ca.e {
final oj.d<T> a;
e(oj.d<? super T> dVar) {
this.a = dVar;
}
public final void onFailure(Exception exc) {
yj.p.i(exc, "error");
oj.d<T> dVar = this.a;
r.a aVar = lj.r.i;
dVar.y(lj.r.a(lj.s.a(exc)));
}
}
static final class e0 extends yj.q implements xj.l<tn, Boolean> {
public static final e0 i = new e0();
e0() {
super(1);
}
@Override
public final Boolean invoke(tn tnVar) {
yj.p.i(tnVar, "it");
return Boolean.TRUE;
}
}
static final class f extends yj.q implements xj.l<Void, lj.e0> {
final oj.d<lj.e0> i;
f(oj.d<? super lj.e0> dVar) {
super(1);
this.i = dVar;
}
public final void a(Void r2) {
oj.d<lj.e0> dVar = this.i;
r.a aVar = lj.r.i;
dVar.y(lj.r.a(lj.e0.a));
}
@Override
public lj.e0 invoke(Void r1) {
a(r1);
return lj.e0.a;
}
}
static final class f0 extends yj.q implements xj.a<List<? extends wo>> {
final to i;
final Integer q;
f0(to toVar, Integer num) {
super(0);
this.i = toVar;
this.q = num;
}
@Override
public final List<? extends wo> invoke() {
List<Integer> d0 = this.i.d0(this.q.intValue());
yj.p.h(d0, "getProfilesReferencingTask(...)");
to toVar = this.i;
ArrayList arrayList = new ArrayList();
for (Integer num : d0) {
yj.p.f(num);
wo c = toVar.c(num.intValue());
if (c != null) {
arrayList.add(c);
}
}
return arrayList;
}
}
static final class g implements ca.e {
final oj.d<lj.e0> a;
g(oj.d<? super lj.e0> dVar) {
this.a = dVar;
}
public final void onFailure(Exception exc) {
yj.p.i(exc, "error");
oj.d<lj.e0> dVar = this.a;
r.a aVar = lj.r.i;
dVar.y(lj.r.a(lj.s.a(exc)));
}
}
static final class g0 extends yj.q implements xj.p<NetworkCapabilities, Integer, Boolean> {
public static final g0 i = new g0();
g0() {
super(2);
}
public final Boolean a(NetworkCapabilities networkCapabilities, int i2) {
yj.p.i(networkCapabilities, "$this$getPropStrings");
return Boolean.valueOf(networkCapabilities.hasTransport(i2));
}
@Override
public Boolean l(NetworkCapabilities networkCapabilities, Integer num) {
return a(networkCapabilities, num.intValue());
}
}
public static final class h implements vk.f {
final oj.d<vk.d0> i;
h(oj.d<? super vk.d0> dVar) {
this.i = dVar;
}
@Override
public void a(vk.e eVar, IOException iOException) {
yj.p.i(eVar, net.dinglisch.android.taskerm.c6.CALL_LABEL);
yj.p.i(iOException, "e");
oj.d<vk.d0> dVar = this.i;
r.a aVar = lj.r.i;
dVar.y(lj.r.a(lj.s.a(iOException)));
}
@Override
public void c(vk.e eVar, vk.d0 d0Var) {
yj.p.i(eVar, net.dinglisch.android.taskerm.c6.CALL_LABEL);
yj.p.i(d0Var, "response");
this.i.y(lj.r.a(d0Var));
}
}
static final class h0 extends yj.q implements xj.l<net.dinglisch.android.taskerm.k2, Boolean> {
public static final h0 i = new h0();
h0() {
super(1);
}
@Override
public final Boolean invoke(net.dinglisch.android.taskerm.k2 k2Var) {
yj.p.i(k2Var, "it");
return Boolean.TRUE;
}
}
static final class i extends yj.q implements xj.l<String, Boolean> {
final String[] i;
i(String[] strArr) {
super(1);
this.i = strArr;
}
@Override
public final Boolean invoke(String str) {
yj.p.i(str, "it");
String[] strArr = this.i;
return Boolean.valueOf((strArr == null || kotlin.collections.l.L(strArr, str)) ? false : true);
}
}
static final class i0 extends yj.q implements xj.a<Boolean> {
final BluetoothDevice i;
i0(BluetoothDevice bluetoothDevice) {
super(0);
this.i = bluetoothDevice;
}
@Override
public final Boolean invoke() {
Set<BluetoothDevice> bondedDevices;
BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
Object obj = null;
if (defaultAdapter != null && (bondedDevices = defaultAdapter.getBondedDevices()) != null) {
BluetoothDevice bluetoothDevice = this.i;
Iterator<T> it = bondedDevices.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Object next = it.next();
if (yj.p.d((BluetoothDevice) next, bluetoothDevice)) {
obj = next;
break;
}
}
obj = (BluetoothDevice) obj;
}
return Boolean.valueOf(obj != null);
}
}
static final class j extends yj.q implements xj.l<String, Boolean> {
final String i;
j(String str) {
super(1);
this.i = str;
}
@Override
public final Boolean invoke(String str) {
yj.p.i(str, "it");
return Boolean.valueOf(z2.h0(this.i) && !Expr.l(this.i, str));
}
}
static final class j0 extends yj.q implements xj.a<Boolean> {
final StatusBarNotification i;
j0(StatusBarNotification statusBarNotification) {
super(0);
this.i = statusBarNotification;
}
@Override
public final Boolean invoke() {
Bundle bundle;
Notification notification = this.i.getNotification();
Object obj = (notification == null || (bundle = notification.extras) == null) ? null : bundle.get("android.template");
if (!(obj instanceof String)) {
obj = null;
}
String str = (String) obj;
if (str != null) {
return Boolean.valueOf(hk.o.N(str, "MediaStyle", false, 2, null));
}
return null;
}
}
static final class k extends yj.q implements xj.l<String, Boolean> {
final String[] i;
k(String[] strArr) {
super(1);
this.i = strArr;
}
@Override
public final Boolean invoke(String str) {
yj.p.i(str, "it");
String[] strArr = this.i;
return Boolean.valueOf((strArr == null || kotlin.collections.l.L(strArr, str)) ? false : true);
}
}
static final class k0 extends yj.q implements xj.l<File, File> {
public static final k0 i = new k0();
k0() {
super(1);
}
@Override
public final File invoke(File file) {
yj.p.i(file, "it");
return file.getParentFile();
}
}
static final class l extends yj.q implements xj.l<String, Boolean> {
final String i;
l(String str) {
super(1);
this.i = str;
}
@Override
public final Boolean invoke(String str) {
yj.p.i(str, "it");
return Boolean.valueOf(z2.h0(this.i) && !Expr.l(this.i, str));
}
}
static final class l0 extends yj.q implements xj.l<Pair<? extends Object, ? extends Object>, CharSequence> {
public static final l0 i = new l0();
l0() {
super(1);
}
@Override
public final CharSequence invoke(Pair<? extends Object, ? extends Object> pair) {
yj.p.i(pair, "it");
return pair.getFirst() + "=" + z2.Y(pair.getSecond().toString());
}
}
@qj.f(c = "com.joaomgcd.taskerm.util.ExtensionsKt$doInMainSuspend$2", f = "Extensions.kt", l = {}, m = "invokeSuspend")
static final class m<T> extends qj.l implements xj.p<jk.n0, oj.d<? super T>, Object> {
int t;
final xj.a<T> u;
m(xj.a<? extends T> aVar, oj.d<? super m> dVar) {
super(2, dVar);
this.u = aVar;
}
@Override
public final oj.d<lj.e0> k(Object obj, oj.d<?> dVar) {
return new m(this.u, dVar);
}
@Override
public final Object r(Object obj) {
pj.b.c();
if (this.t != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
lj.s.b(obj);
return this.u.invoke();
}
@Override
public final Object l(jk.n0 n0Var, oj.d<? super T> dVar) {
return ((m) k(n0Var, dVar)).r(lj.e0.a);
}
}
public static final class m0 implements ViewTreeObserver.OnPreDrawListener {
final View i;
final xj.l<View, lj.e0> q;
m0(View view, xj.l<? super View, lj.e0> lVar) {
this.i = view;
this.q = lVar;
}
@Override
public boolean onPreDraw() {
this.i.getViewTreeObserver().removeOnPreDrawListener(this);
this.q.invoke(this.i);
return true;
}
}
public static final class n extends yj.q implements xj.l {
public static final n i = new n();
n() {
super(1);
}
@Override
public final String invoke(Object obj) {
return String.valueOf(obj);
}
}
static final class n0 implements ca.f {
private final xj.l a;
n0(xj.l lVar) {
yj.p.i(lVar, "function");
this.a = lVar;
}
public final void b(Object obj) {
this.a.invoke(obj);
}
}
static final class o extends yj.q implements xj.l<net.dinglisch.android.taskerm.i5, Boolean> {
public static final o i = new o();
o() {
super(1);
}
@Override
public final Boolean invoke(net.dinglisch.android.taskerm.i5 i5Var) {
yj.p.i(i5Var, "it");
return Boolean.TRUE;
}
}
static final class o0 extends yj.q implements xj.l<s6, ji.v<? extends Intent>> {
public static final o0 i = new o0();
o0() {
super(1);
}
@Override
public final ji.v<? extends Intent> invoke(s6 s6Var) {
yj.p.i(s6Var, "it");
if (s6Var.b() && (s6Var instanceof x6)) {
Object d = ((x6) s6Var).d();
yj.p.g(d, "null cannot be cast to non-null type android.content.Intent");
return ji.r.w((Intent) d);
}
return ji.r.r(new RuntimeException("Couldn't get result (error: " + s6Var.a()));
}
}
static final class p extends yj.q implements xj.l<net.dinglisch.android.taskerm.i5, Boolean> {
public static final p i = new p();
p() {
super(1);
}
@Override
public final Boolean invoke(net.dinglisch.android.taskerm.i5 i5Var) {
yj.p.i(i5Var, "it");
return Boolean.TRUE;
}
}
static final class p0 extends yj.q implements xj.l<s6, ji.v<? extends Intent>> {
public static final p0 i = new p0();
p0() {
super(1);
}
@Override
public final ji.v<? extends Intent> invoke(s6 s6Var) {
yj.p.i(s6Var, "it");
if (!s6Var.b() || !(s6Var instanceof x6)) {
return ji.r.r(new RuntimeException("Couldn't get result"));
}
Object d = ((x6) s6Var).d();
yj.p.g(d, "null cannot be cast to non-null type android.content.Intent");
return ji.r.w((Intent) d);
}
}
static final class q extends yj.q implements xj.l<tn, Boolean> {
public static final q i = new q();
q() {
super(1);
}
@Override
public final Boolean invoke(tn tnVar) {
yj.p.i(tnVar, "it");
return Boolean.valueOf(!tnVar.u());
}
}
static final class q0 extends yj.q implements xj.a<xi> {
final to i;
final int q;
q0(to toVar, int i) {
super(0);
this.i = toVar;
this.q = i;
}
@Override
public final xi invoke() {
return this.i.w(this.q);
}
}
static final class r extends yj.q implements xj.p<NetworkCapabilities, Integer, Boolean> {
public static final r i = new r();
r() {
super(2);
}
public final Boolean a(NetworkCapabilities networkCapabilities, int i2) {
yj.p.i(networkCapabilities, "$this$getPropStrings");
return Boolean.valueOf(networkCapabilities.hasCapability(i2));
}
@Override
public Boolean l(NetworkCapabilities networkCapabilities, Integer num) {
return a(networkCapabilities, num.intValue());
}
}
static final class r0 extends yj.q implements xj.l<Byte, CharSequence> {
public static final r0 i = new r0();
r0() {
super(1);
}
public final CharSequence a(byte b) {
yj.n0 n0Var = yj.n0.a;
String format = String.format("%02X", Arrays.copyOf(new Object[]{Byte.valueOf(b)}, 1));
yj.p.h(format, "format(...)");
return format;
}
@Override
public CharSequence invoke(Byte b) {
return a(b.byteValue());
}
}
static final class s extends yj.q implements xj.a<List<? extends kg.g>> {
final Integer i;
final uo q;
s(Integer num, uo uoVar) {
super(0);
this.i = num;
this.q = uoVar;
}
@Override
public final List<? extends kg.g> invoke() {
Integer num = this.i;
if (num == null) {
return null;
}
uo uoVar = this.q;
List<kg.w0> X1 = x2.X1(uoVar, uoVar.R(num.intValue()));
if (X1 != null) {
return kotlin.collections.r.w(X1);
}
return null;
}
}
@qj.f(c = "com.joaomgcd.taskerm.util.ExtensionsKt", f = "Extensions.kt", l = {2399}, m = "tryOrHandleErrorSuspend")
static final class s0 extends qj.d {
Object s;
Object t;
int u;
s0(oj.d<? super s0> dVar) {
super(dVar);
}
@Override
public final Object r(Object obj) {
this.t = obj;
this.u |= Integer.MIN_VALUE;
return x2.S4(null, null, this);
}
}
static final class t extends yj.q implements xj.a<kg.w0> {
final Integer i;
final uo q;
t(Integer num, uo uoVar) {
super(0);
this.i = num;
this.q = uoVar;
}
@Override
public final kg.w0 invoke() {
xi w;
Integer num = this.i;
if (num == null || (w = this.q.w(num.intValue())) == null) {
return null;
}
return w.M();
}
}
@qj.f(c = "com.joaomgcd.taskerm.util.ExtensionsKt", f = "Extensions.kt", l = {2380}, m = "tryOrNullSuspend")
static final class t0<T> extends qj.d {
Object s;
Object t;
int u;
t0(oj.d<? super t0> dVar) {
super(dVar);
}
@Override
public final Object r(Object obj) {
this.t = obj;
this.u |= Integer.MIN_VALUE;
return x2.V4(null, null, this);
}
}
static final class u extends yj.q implements xj.a<kg.w0> {
final Integer i;
final uo q;
u(Integer num, uo uoVar) {
super(0);
this.i = num;
this.q = uoVar;
}
@Override
public final kg.w0 invoke() {
tn R;
Integer num = this.i;
if (num == null || (R = this.q.R(num.intValue())) == null) {
return null;
}
return R.M();
}
}
static final class u0<T> extends yj.q implements xj.l<Throwable, T> {
public static final u0 i = new u0();
u0() {
super(1);
}
@Override
public final T invoke(Throwable th2) {
yj.p.i(th2, "it");
return null;
}
}
static final class v extends yj.q implements xj.l<Integer, Integer> {
public static final v i = new v();
v() {
super(1);
}
public final Integer a(int i2) {
return Integer.valueOf(net.dinglisch.android.taskerm.j2.q(i2));
}
@Override
public Integer invoke(Integer num) {
return a(num.intValue());
}
}
@qj.f(c = "com.joaomgcd.taskerm.util.ExtensionsKt", f = "Extensions.kt", l = {2675, 2677}, m = "waitTilTrue")
static final class v0 extends qj.d {
Object s;
long t;
Object u;
int v;
v0(oj.d<? super v0> dVar) {
super(dVar);
}
@Override
public final Object r(Object obj) {
this.u = obj;
this.v |= Integer.MIN_VALUE;
return x2.b5(null, 0L, 0L, this);
}
}
static final class w extends yj.q implements xj.l<Integer, Integer> {
public static final w i = new w();
w() {
super(1);
}
public final Integer a(int i2) {
return Integer.valueOf(on.j(i2));
}
@Override
public Integer invoke(Integer num) {
return a(num.intValue());
}
}
static final class w0<T> extends yj.q implements xj.l<T, lj.e0> {
final xj.p<TExtra, T, lj.e0> i;
final TExtra q;
w0(xj.p<? super TExtra, ? super T, lj.e0> pVar, TExtra textra) {
super(1);
this.i = pVar;
this.q = textra;
}
public final void a(T t) {
this.i.l(this.q, t);
}
@Override
public lj.e0 invoke(Object obj) {
a(obj);
return lj.e0.a;
}
}
static final class x extends yj.q implements xj.l<Integer, Integer> {
public static final x i = new x();
x() {
super(1);
}
public final Integer a(int i2) {
Integer M = net.dinglisch.android.taskerm.a1.M(i2);
yj.p.h(M, "getCatCodeByActionCode(...)");
return M;
}
@Override
public Integer invoke(Integer num) {
return a(num.intValue());
}
}
static final class x0<T> extends yj.q implements xj.l<T, lj.e0> {
final xj.q<TExtra, TExtra1, T, lj.e0> i;
final TExtra q;
final TExtra1 r;
x0(xj.q<? super TExtra, ? super TExtra1, ? super T, lj.e0> qVar, TExtra textra, TExtra1 textra1) {
super(1);
this.i = qVar;
this.q = textra;
this.r = textra1;
}
public final void a(T t) {
this.i.e(this.q, this.r, t);
}
@Override
public lj.e0 invoke(Object obj) {
a(obj);
return lj.e0.a;
}
}
static final class y extends yj.q implements xj.p<Integer, String, String> {
final Context i;
y(Context context) {
super(2);
this.i = context;
}
public final String a(int i, String str) {
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
Integer M = net.dinglisch.android.taskerm.a1.M(i);
if (M == null || M.intValue() != 51) {
return (M == null || M.intValue() != 30 || i == 235 || i == 338) ? str : x2.Q4(2131889313, this.i, new Object[0]);
}
return hk.o.C(str, "GD ", x2.Q4(2131886992, this.i, new Object[0]) + " ", false, 4, null);
}
@Override
public String l(Integer num, String str) {
return a(num.intValue(), str);
}
}
static final class z extends yj.q implements xj.l<String, CharSequence> {
final Context i;
z(Context context) {
super(1);
this.i = context;
}
@Override
public final CharSequence invoke(String str) {
yj.p.i(str, "it");
return " - " + r5.A(str, this.i);
}
}
public static final boolean A(net.dinglisch.android.taskerm.c cVar, int i2, Object obj) {
yj.p.i(cVar, "<this>");
if (obj == null) {
return !cVar.G(i2).k();
}
if (obj instanceof String) {
return yj.p.d(cVar.N(i2).w(), obj);
}
if (obj instanceof Boolean) {
return yj.p.d(Boolean.valueOf(cVar.i(i2).R()), obj);
}
boolean z2 = obj instanceof Integer;
if (z2) {
return z2 && cVar.x(i2).v() == ((Number) obj).intValue();
}
return false;
}
private static final Object[] A0(String str, Context context, Class<?> cls) {
return x2(str, context, cls).toArray(new Object[0]);
}
private static final boolean A1(int i2, Integer[] numArr, Integer[] numArr2, xj.l<? super Integer, Integer> lVar) {
return (kotlin.collections.l.L(numArr, Integer.valueOf(lVar.invoke(Integer.valueOf(i2)).intValue())) || kotlin.collections.l.L(numArr2, Integer.valueOf(i2))) ? false : true;
}
public static final String A2(double d2, Integer num) {
String P = dq.P(d2, num != null ? num.intValue() : 3);
yj.p.h(P, "doubleToString(...)");
return P;
}
public static final boolean A3(Sensor sensor) {
yj.p.i(sensor, "<this>");
return sensor.getReportingMode() == 2;
}
public static final ji.v A4(xj.l lVar, Object obj) {
yj.p.i(lVar, "$tmp0");
yj.p.i(obj, "p0");
return (ji.v) lVar.invoke(obj);
}
public static final <T> Object B(ca.i<T> iVar, oj.d<? super T> dVar) {
if (iVar.o()) {
return iVar.k();
}
oj.i iVar2 = new oj.i(pj.b.b(dVar));
iVar.f(new n0(new d(iVar2))).d(new e(iVar2));
Object a2 = iVar2.a();
if (a2 == pj.b.c()) {
qj.h.c(dVar);
}
return a2;
}
public static final <T> List<T> B0(Iterator<? extends T> it) {
gk.h c2;
if (it == null || (c2 = gk.k.c(it)) == null) {
return null;
}
return gk.k.y(c2);
}
private static final boolean B1(net.dinglisch.android.taskerm.k2 k2Var, Integer[] numArr) {
return A1(k2Var.j(), numArr, new Integer[0], v.i);
}
public static final String B2(float f2, Integer num) {
return A2(f2, num);
}
public static final <T> String B3(Iterable<? extends T> iterable) {
yj.p.i(iterable, "<this>");
return E3(iterable, null, null, 3, null);
}
public static final <T extends Service> boolean B4(Class<T> cls, Context context) {
yj.p.i(cls, "<this>");
yj.p.i(context, "context");
return context.stopService(new Intent(context, (Class<?>) cls));
}
public static final Object C(vk.e eVar, oj.d<? super vk.d0> dVar) {
oj.i iVar = new oj.i(pj.b.b(dVar));
eVar.O(new h(iVar));
Object a2 = iVar.a();
if (a2 == pj.b.c()) {
qj.h.c(dVar);
}
return a2;
}
public static final boolean C0(ek.f fVar) {
yj.p.i(fVar, "<this>");
return fVar.G().intValue() <= fVar.F().intValue();
}
private static final boolean C1(pn pnVar, Integer[] numArr) {
return A1(pnVar.j(), numArr, new Integer[0], w.i);
}
public static final String C2(Object obj, Integer num) {
yj.p.i(obj, "<this>");
return obj instanceof Double ? A2(((Number) obj).doubleValue(), num) : obj instanceof Float ? B2(((Number) obj).floatValue(), num) : obj.toString();
}
public static final <T> String C3(Iterable<? extends T> iterable, CharSequence charSequence) {
yj.p.i(iterable, "<this>");
yj.p.i(charSequence, "separator");
return E3(iterable, charSequence, null, 2, null);
}
public static final void C4(to toVar, Integer num, Integer[] numArr, Integer num2, String str, String str2) {
kg.w0 M;
xi xiVar;
kg.w0 M2;
tn R;
yj.p.i(toVar, "<this>");
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
if (num2 != null && (R = toVar.R(num2.intValue())) != null) {
yj.p.f(R);
F4(toVar, R, str, str2, false, 8, null);
}
if (num != null) {
int intValue = num.intValue();
if (num.intValue() != -1 && (xiVar = (xi) U4(null, new q0(toVar, intValue), 1, null)) != null && (M2 = xiVar.M()) != null) {
yj.p.f(M2);
kg.w0.T(M2, str, str2, false, 4, null);
}
}
if (numArr != null) {
ArrayList arrayList = new ArrayList();
for (Integer num3 : numArr) {
if (num3 == null || num3.intValue() != -1) {
arrayList.add(num3);
}
}
List a02 = kotlin.collections.r.a0(arrayList);
if (a02 != null) {
Iterator it = a02.iterator();
while (it.hasNext()) {
wo c2 = toVar.c(((Number) it.next()).intValue());
if (c2 != null && (M = c2.M()) != null) {
yj.p.f(M);
kg.w0.T(M, str, str2, false, 4, null);
}
}
}
}
}
public static final Object D(ca.i<Void> iVar, oj.d<? super lj.e0> dVar) {
if (iVar.o()) {
return lj.e0.a;
}
oj.i iVar2 = new oj.i(pj.b.b(dVar));
iVar.f(new n0(new f(iVar2))).d(new g(iVar2));
Object a2 = iVar2.a();
if (a2 == pj.b.c()) {
qj.h.c(dVar);
}
return a2 == pj.b.c() ? a2 : lj.e0.a;
}
public static final String D0(byte[] bArr) {
yj.p.i(bArr, "<this>");
byte[] encode = Base64.encode(bArr, 2);
yj.p.h(encode, "encode(...)");
return new String(encode, hk.d.b);
}
private static final boolean D1(net.dinglisch.android.taskerm.c cVar, Integer[] numArr, Integer[] numArr2) {
return A1(cVar.j(), numArr, numArr2, x.i);
}
public static final String D2(JSONObject jSONObject, String str) {
yj.p.i(jSONObject, "<this>");
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
try {
return jSONObject.getString(str);
} catch (JSONException unused) {
return null;
}
}
public static final <T> String D3(Iterable<? extends T> iterable, CharSequence charSequence, xj.l<? super T, ? extends CharSequence> lVar) {
yj.p.i(iterable, "<this>");
yj.p.i(charSequence, "separator");
return kotlin.collections.r.m0(iterable, charSequence, null, null, 0, null, lVar, 30, null);
}
public static final void D4(to toVar, dk dkVar, String str, String str2) {
yj.p.i(toVar, "<this>");
yj.p.i(dkVar, "scene");
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
kg.w0 e2 = e2(toVar, dkVar);
if (e2 != null) {
kg.w0.T(e2, str, str2, false, 4, null);
}
}
public static final float E(float f2, float f3, float f4) {
return Math.min(Math.max(f2, f3), f4);
}
public static final Integer E0(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
try {
return (Integer) o8.d(bluetoothDevice, "getBatteryLevel", null, false, 6, null).a();
} catch (Exception unused) {
return null;
}
}
public static final String E1(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
String name = bluetoothDevice.getName();
String k2 = k(name, bluetoothDevice.getAddress());
if (com.joaomgcd.taskerm.util.k.a.t()) {
return k2;
}
String a2 = ef.b.a(bluetoothDevice);
if (a2 == null) {
return k2;
}
if (yj.p.d(a2, name)) {
return k2;
}
return k2 + " (" + a2 + ")";
}
public static final String E2(Sensor sensor) {
yj.p.i(sensor, "<this>");
String stringType = sensor.getStringType();
yj.p.h(stringType, "getStringType(...)");
return z2.d0(hk.o.C(z2.x0(z2.x0(z2.x0(z2.x0(stringType, "android."), "com.google."), "com.samsung."), "sensor."), "_", " ", false, 4, null));
}
public static String E3(Iterable iterable, CharSequence charSequence, xj.l lVar, int i2, Object obj) {
if ((i2 & 1) != 0) {
charSequence = ", ";
}
if ((i2 & 2) != 0) {
lVar = null;
}
return D3(iterable, charSequence, lVar);
}
public static final void E4(to toVar, tn tnVar, String str, String str2, boolean z2) throws w0.b {
List<wo> Y1;
boolean z3;
kg.w0 f2;
kg.w0 M;
yj.p.i(toVar, "<this>");
yj.p.i(tnVar, "task");
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
kg.w0 M2 = tnVar.M();
if (M2 == null || !M2.S(str, str2, z2)) {
int Y0 = tnVar.Y0();
if (Y0 != -1) {
Y1 = kotlin.collections.r.d(toVar.c(Y0));
} else {
Y1 = Y1(toVar, tnVar);
if (Y1 == null || Y1.size() != 1) {
Y1 = kotlin.collections.r.l();
}
}
loop0: while (true) {
z3 = false;
for (wo woVar : kotlin.collections.r.a0(Y1)) {
kg.w0 M3 = woVar.M();
if (M3 != null) {
M3.S(str, str2, z2);
}
if (!z3) {
xi d2 = d2(toVar, woVar);
if ((d2 == null || (M = d2.M()) == null) ? false : M.S(str, str2, z2)) {
}
}
z3 = true;
}
}
if (z3 || (f2 = f2(toVar, tnVar)) == null) {
return;
}
f2.S(str, str2, z2);
}
}
public static final int F(int i2, int i3, int i4) {
return Math.min(Math.max(i2, i3), i4);
}
public static final File F0(byte[] bArr, Context context, String str, String str2) {
yj.p.i(bArr, "<this>");
yj.p.i(context, "context");
if (str == null && (str = t1(bArr)) == null) {
str = "cachebitmap";
}
File v2 = g8.v(context, str + ".png", str2);
if (!v2.exists()) {
L4(bArr, v2);
}
return v2;
}
public static final ArrayList<tn> F1(to toVar, int i2, boolean z2) {
yj.p.i(toVar, "<this>");
ArrayList<tn> q2 = toVar.q(i2, z2);
yj.p.h(q2, "getNamedTasksInProject(...)");
return new ArrayList<>(kotlin.collections.r.z0(q2));
}
public static final String F2(uo uoVar, String str) {
yj.p.i(uoVar, "<this>");
yj.p.i(str, "taskName");
return IconProvider.i.i(str);
}
public static final double F3(double d2, double d3, double d4, double d5, double d6, boolean z2, boolean z3) {
double d7 = (d6 - d5) * ((d2 - d3) / (d4 - d3));
double d8 = !z2 ? d7 + d5 : d6 - d7;
if (z3) {
if (d8 < d5) {
return d5;
}
if (d8 > d6) {
return d6;
}
}
return d8;
}
public static void F4(to toVar, tn tnVar, String str, String str2, boolean z2, int i2, Object obj) throws w0.b {
if ((i2 & 8) != 0) {
z2 = false;
}
E4(toVar, tnVar, str, str2, z2);
}
public static final boolean G(BluetoothProfile bluetoothProfile, BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothProfile, "<this>");
yj.p.i(bluetoothDevice, "bluetoothDevice");
return ((Boolean) o8.d(bluetoothProfile, "connect", "a2dpconnect", false, 4, null).b(bluetoothDevice)).booleanValue();
}
public static File G0(byte[] bArr, Context context, String str, String str2, int i2, Object obj) {
if ((i2 & 2) != 0) {
str = null;
}
if ((i2 & 4) != 0) {
str2 = null;
}
return F0(bArr, context, str, str2);
}
public static final <T> List<T> G1(List<? extends T> list) {
if (list == 0 || list.isEmpty()) {
return null;
}
return list;
}
public static final List<kg.g> G2(wo woVar, to toVar, xj.l<? super tn, Boolean> lVar) {
yj.p.i(woVar, "<this>");
yj.p.i(toVar, "data");
yj.p.i(lVar, "filter");
List<tn> Q2 = Q2(woVar, toVar);
ArrayList arrayList = new ArrayList();
for (Object obj : Q2) {
if (lVar.invoke(obj).booleanValue()) {
arrayList.add(obj);
}
}
ArrayList arrayList2 = new ArrayList();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
kg.w0 M = ((tn) it.next()).M();
if (M != null) {
arrayList2.add(M);
}
}
return kotlin.collections.r.w(arrayList2);
}
public static final double G3(Number number, Number number2, Number number3, Number number4, Number number5, boolean z2, boolean z3) {
yj.p.i(number, "<this>");
yj.p.i(number2, "inputMin");
yj.p.i(number3, "inputMax");
yj.p.i(number4, "outputMin");
yj.p.i(number5, "outputMax");
return F3(number.doubleValue(), number2.doubleValue(), number3.doubleValue(), number4.doubleValue(), number5.doubleValue(), z2, z3);
}
public static final com.joaomgcd.taskerm.util.t G4(int i2, Context context) {
yj.p.i(context, "context");
if (i2 <= 0) {
return null;
}
return H4(i2, context);
}
public static final <T> boolean H(T[] tArr, xj.l<? super T, Boolean> lVar) {
T t2;
yj.p.i(tArr, "<this>");
yj.p.i(lVar, "predicate");
int length = tArr.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
t2 = null;
break;
}
t2 = tArr[i2];
if (lVar.invoke(t2).booleanValue()) {
break;
}
i2++;
}
return t2 != null;
}
public static final NetworkCapabilities H0(Network network, Context context) {
yj.p.i(network, "<this>");
yj.p.i(context, "context");
ConnectivityManager t02 = ExtensionsContextKt.t0(context);
if (t02 != null) {
return t02.getNetworkCapabilities(network);
}
return null;
}
public static final <K, V> Map<K, V> H1(Map<K, ? extends V> map) {
if (map == 0 || map.isEmpty()) {
return null;
}
return map;
}
public static List H2(wo woVar, to toVar, xj.l lVar, int i2, Object obj) {
if ((i2 & 2) != 0) {
lVar = e0.i;
}
return G2(woVar, toVar, lVar);
}
public static final com.joaomgcd.taskerm.util.t H4(int i2, Context context) {
yj.p.i(context, "context");
return new com.joaomgcd.taskerm.util.t(context, i2, new Object[0]);
}
public static final <T> boolean I(T[] tArr, T[] tArr2) {
yj.p.i(tArr2, "other");
if (tArr == null) {
return false;
}
for (T t2 : tArr2) {
if (!kotlin.collections.l.L(tArr, t2)) {
return false;
}
}
return true;
}
public static final String[] I0(Network network, Context context) {
yj.p.i(network, "<this>");
yj.p.i(context, "context");
return h2(network, context, p0(), r.i);
}
public static final <T> T[] I1(T[] tArr) {
if (tArr == null || tArr.length == 0) {
return null;
}
return tArr;
}
public static final List<wo> I2(to toVar, Integer num) {
if (toVar == null || num == null) {
return kotlin.collections.r.l();
}
List<wo> list = (List) U4(null, new f0(toVar, num), 1, null);
return list == null ? kotlin.collections.r.l() : list;
}
public static final boolean I3(IntentFilter intentFilter, IntentFilter intentFilter2) {
yj.p.i(intentFilter, "<this>");
yj.p.i(intentFilter2, "other");
return (U(intentFilter.actionsIterator(), intentFilter2.actionsIterator()) || U(intentFilter.typesIterator(), intentFilter2.typesIterator()) || U(intentFilter.schemesIterator(), intentFilter2.schemesIterator()) || U(intentFilter.categoriesIterator(), intentFilter2.categoriesIterator())) ? false : true;
}
public static final <T> T I4(int i2, Class<T> cls) {
yj.p.i(cls, "clzz");
if (!cls.isEnum()) {
throw new ClassCastException(cls.getName() + " is not an enum");
}
T[] enumConstants = cls.getEnumConstants();
if (enumConstants == null || enumConstants.length == 0) {
throw new IndexOutOfBoundsException(cls.getName() + " enum doesn't have any elements");
}
if (i2 < 0) {
return enumConstants[0];
}
if (enumConstants.length > i2) {
return enumConstants[i2];
}
throw new IndexOutOfBoundsException(cls.getName() + " enum doesn't have " + (i2 + 1) + " elements");
}
public static final boolean J(ParcelUuid[] parcelUuidArr, ParcelUuid[] parcelUuidArr2) {
yj.p.i(parcelUuidArr, "<this>");
yj.p.i(parcelUuidArr2, "uuids");
int i2 = 0;
for (ParcelUuid parcelUuid : parcelUuidArr) {
if (e0(parcelUuid, Arrays.copyOf(parcelUuidArr2, parcelUuidArr2.length))) {
i2++;
}
}
return i2 > 0;
}
public static final List<View> J0(ViewGroup viewGroup) {
yj.p.i(viewGroup, "<this>");
ek.f s2 = ek.j.s(0, viewGroup.getChildCount());
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(s2, 10));
Iterator<Integer> it = s2.iterator();
while (it.hasNext()) {
arrayList.add(viewGroup.getChildAt(((kotlin.collections.h0) it).d()));
}
return arrayList;
}
public static final <R extends pi> ArrayList<R> J1(qi qiVar, String str, xj.l<? super qi, ? extends R> lVar) {
yj.p.i(str, "baseKey");
yj.p.i(lVar, "itemGetter");
ArrayList<R> arrayList = null;
if (qiVar == null) {
return null;
}
int i2 = 0;
while (true) {
qi w2 = qiVar.w(qi.F(str, i2));
if (w2 == null) {
return arrayList;
}
R invoke = lVar.invoke(w2);
if (invoke != null) {
if (arrayList == null) {
arrayList = new ArrayList<>();
}
arrayList.add(invoke);
}
i2++;
}
}
public static final List<wo> J2(to toVar, tn tnVar) {
return I2(toVar, tnVar != null ? Integer.valueOf(tnVar.P0()) : null);
}
public static final boolean J3(String str, String str2) {
if (str2 == null || str2.length() == 0 || str == null || str.length() == 0) {
return yj.p.d(str, str2);
}
ArrayList arrayList = new ArrayList();
o(arrayList, str2, new String[]{str});
return !arrayList.isEmpty();
}
public static final <T> List<T> J4(int i2, Class<T> cls, xj.l<? super T, Integer> lVar) {
yj.p.i(cls, "clzz");
yj.p.i(lVar, "flagSelector");
if (!cls.isEnum()) {
throw new ClassCastException(cls.getName() + " is not an enum");
}
T[] enumConstants = cls.getEnumConstants();
if (enumConstants == null) {
return kotlin.collections.r.l();
}
ArrayList arrayList = new ArrayList();
for (T t2 : enumConstants) {
if (h3(i2, lVar.invoke(t2).intValue())) {
arrayList.add(t2);
}
}
return arrayList;
}
public static final void K(Bundle bundle, Context context, tn tnVar, String str) {
yj.p.i(bundle, "<this>");
yj.p.i(context, "context");
yj.p.i(tnVar, "task");
N(bundle, context, tnVar, str, false, 8, null);
}
public static final Bundle K0(Bundle bundle) {
return (Bundle) (bundle != null ? bundle.clone() : null);
}
public static final <T> T K1(Collection<? extends T> collection, String str, xj.l<? super T, String> lVar) {
String str2;
yj.p.i(collection, "<this>");
yj.p.i(lVar, "transformer");
List<String> l02 = l0(collection, str, lVar);
if (l02.size() > 1 || (str2 = (String) kotlin.collections.r.f0(l02)) == null) {
return null;
}
for (T t2 : collection) {
if (yj.p.d(str2, lVar.invoke(t2))) {
return t2;
}
}
return null;
}
public static final String K2(File file) {
yj.p.i(file, "<this>");
return file.getAbsolutePath();
}
public static final boolean K3(BluetoothDevice bluetoothDevice, String str) {
yj.p.i(str, "deviceToConnect");
return bluetoothDevice != null && (L3(bluetoothDevice.getName(), str) || L3(bluetoothDevice.getAddress(), str));
}
public static final long K4(InputStream inputStream, File file) {
yj.p.i(inputStream, "<this>");
yj.p.i(file, "file");
if (file.exists() && !file.isFile()) {
throw new IllegalStateException("To write inputstream to file must pass file, was " + file.getAbsolutePath());
}
File parentFile = file.getParentFile();
if (!parentFile.exists() && !parentFile.mkdirs()) {
return 0L;
}
FileOutputStream fileOutputStream = new FileOutputStream(file);
long b2 = vj.a.b(inputStream, fileOutputStream, 0, 2, null);
fileOutputStream.close();
inputStream.close();
return b2;
}
public static final void L(Bundle bundle, Context context, tn tnVar, String str, boolean z2) {
yj.p.i(bundle, "<this>");
yj.p.i(context, "context");
yj.p.i(tnVar, "task");
xj.l jVar = (str == null || !hk.o.N(str, ",", false, 2, null)) ? new j(str) : new i(o1(str));
for (Pair pair : kotlin.collections.k0.t(n0(bundle))) {
Object second = pair.getSecond();
if (second instanceof String) {
String str2 = (String) pair.getFirst();
if (!z2 || !kg.w0.i.l(str2)) {
if (!((Boolean) jVar.invoke(str2)).booleanValue()) {
lq.a aVar = lq.a;
String z3 = aVar.z(str2);
StructureType x2 = aVar.x(bundle, str2);
if (x2 != null) {
tnVar.T(z3, x2.getValueForBundle());
}
tnVar.W(str2, (String) second);
}
}
}
}
}
public static final ComponentName L0(ComponentInfo componentInfo) {
yj.p.i(componentInfo, "<this>");
return new ComponentName(componentInfo.packageName, componentInfo.name);
}
public static final <K, V> V L1(HashMap<K, V> hashMap, K k2, xj.a<? extends V> aVar) {
yj.p.i(hashMap, "<this>");
yj.p.i(aVar, "getNewValue");
V v2 = hashMap.get(k2);
if (v2 != null) {
return v2;
}
V invoke = aVar.invoke();
hashMap.put(k2, invoke);
return invoke;
}
public static final String L2(double d2, int i2) {
return hk.o.C(String.valueOf(W3(d2, i2)), ",", ".", false, 4, null);
}
private static final boolean L3(String str, String str2) {
if (str == null) {
return false;
}
String lowerCase = str.toLowerCase();
yj.p.h(lowerCase, "toLowerCase(...)");
if (lowerCase == null) {
return false;
}
String lowerCase2 = str2.toLowerCase();
yj.p.h(lowerCase2, "toLowerCase(...)");
return hk.o.N(lowerCase, lowerCase2, false, 2, null);
}
public static final long L4(byte[] bArr, File file) {
yj.p.i(bArr, "<this>");
yj.p.i(file, "file");
return K4(f1(bArr), file);
}
public static final void M(Bundle bundle, HashMap<String, String> hashMap, boolean z2, String str, boolean z3) {
yj.p.i(bundle, "<this>");
yj.p.i(hashMap, "hashMap");
xj.l lVar = (str == null || !hk.o.N(str, ",", false, 2, null)) ? new l(str) : new k(o1(str));
for (Pair pair : kotlin.collections.k0.t(n0(bundle))) {
Object second = pair.getSecond();
if (second instanceof String) {
String str2 = (String) pair.getFirst();
if (!z3 || !kg.w0.i.l(str2)) {
if (z2 || !z2.h0((String) hashMap.get(str2))) {
if (!((Boolean) lVar.invoke(str2)).booleanValue()) {
hashMap.put(str2, second);
}
}
}
}
}
}
public static final ComponentName M0(ResolveInfo resolveInfo) {
yj.p.i(resolveInfo, "<this>");
ComponentInfo componentInfo = resolveInfo.activityInfo;
if (componentInfo == null) {
componentInfo = resolveInfo.serviceInfo;
}
yj.p.g(componentInfo, "null cannot be cast to non-null type android.content.pm.ComponentInfo");
return L0(componentInfo);
}
public static final <T> T M1(List<? extends T> list, int i2) {
T t2;
if (list != null && (t2 = (T) kotlin.collections.r.g0(list, i2)) != null) {
return t2;
}
if (list != null) {
return (T) kotlin.collections.r.p0(list);
}
return null;
}
public static final String M2(float f2, int i2) {
return L2(f2, i2);
}
public static final <T> T M3(List<T> list, int i2, int i3) {
yj.p.i(list, "<this>");
T remove = list.remove(i2);
list.add(i3, remove);
return remove;
}
@SuppressLint({"SimpleDateFormat"})
public static final String M4(long j2, String str) {
yj.p.i(str, "format");
String format = new SimpleDateFormat(str).format(new Date(j2));
yj.p.h(format, "format(...)");
return format;
}
public static void N(Bundle bundle, Context context, tn tnVar, String str, boolean z2, int i2, Object obj) {
if ((i2 & 4) != 0) {
str = null;
}
if ((i2 & 8) != 0) {
z2 = true;
}
L(bundle, context, tnVar, str, z2);
}
public static final ComponentName N0(UsageEvents.Event event) {
yj.p.i(event, "<this>");
return new ComponentName(event.getPackageName(), event.getClassName());
}
public static final List<ho> N1(wo woVar, ho hoVar) {
yj.p.i(woVar, "<this>");
yj.p.i(hoVar, "context");
List<ho> x02 = woVar.x0();
yj.p.h(x02, "getContexts(...)");
ArrayList arrayList = new ArrayList();
for (Object obj : x02) {
if (!yj.p.d((ho) obj, hoVar)) {
arrayList.add(obj);
}
}
return arrayList;
}
public static final String N2(ScanResult scanResult) {
yj.p.i(scanResult, "<this>");
StringBuilder sb = new StringBuilder();
sb.append(scanResult.SSID);
sb.append("\n");
sb.append("Mac: ");
sb.append(scanResult.BSSID);
sb.append("\n");
sb.append("Frequency: ");
sb.append(scanResult.frequency);
sb.append("\n");
sb.append("Cap: ");
sb.append(scanResult.capabilities);
sb.append("\n");
sb.append("Signal: " + WifiManager.calculateSignalLevel(scanResult.level, 10));
String sb2 = sb.toString();
yj.p.h(sb2, "toString(...)");
return sb2;
}
public static final <T> T N3(T t2, String str) {
yj.p.i(str, "errorMessage");
if (t2 != null) {
return t2;
}
throw new RuntimeException(str);
}
public static String N4(long j2, String str, int i2, Object obj) {
if ((i2 & 1) != 0) {
str = "yyyy-MM-dd HH:mm";
}
return M4(j2, str);
}
public static void O(Bundle bundle, HashMap hashMap, boolean z2, String str, boolean z3, int i2, Object obj) {
if ((i2 & 4) != 0) {
str = null;
}
if ((i2 & 8) != 0) {
z3 = true;
}
M(bundle, hashMap, z2, str, z3);
}
public static final net.dinglisch.android.taskerm.s1 O0(Sensor sensor, String str, float f2, float f3, float f4) {
Pair pair;
yj.p.i(sensor, "<this>");
yj.p.i(str, "variable");
if (f2 == f3) {
return new net.dinglisch.android.taskerm.s1(new net.dinglisch.android.taskerm.r1(Expr.Op.Matches, str, M2(f2, 5)));
}
boolean z2 = Math.min(f2, f3) == f2;
float abs = Math.abs(sensor.getMaximumRange());
float abs2 = (abs - Math.abs(f2)) + (abs - Math.abs(f3));
float abs3 = Math.abs(f2 - f3);
boolean z3 = Math.min(abs2, abs3) == abs3;
if (z3) {
pair = z2 ? new Pair(Float.valueOf(f2 - f4), Float.valueOf(f3 + f4)) : new Pair(Float.valueOf(f2 + f4), Float.valueOf(f3 - f4));
} else {
pair = z2 ? new Pair(Float.valueOf(f2 + f4), Float.valueOf(f3 - f4)) : new Pair(Float.valueOf(f2 - f4), Float.valueOf(f3 + f4));
}
float floatValue = ((Number) pair.component1()).floatValue();
float floatValue2 = ((Number) pair.component2()).floatValue();
Expr.Op op = z2 ? Expr.Op.LessThan : Expr.Op.MoreThan;
Expr.Op op2 = z2 ? Expr.Op.MoreThan : Expr.Op.LessThan;
String M2 = M2(floatValue, 5);
String M22 = M2(floatValue2, 5);
return z3 ? new net.dinglisch.android.taskerm.s1(kotlin.collections.r.o(new net.dinglisch.android.taskerm.r1(op2, str, M2), new net.dinglisch.android.taskerm.r1(op, str, M22)), kotlin.collections.r.d(s1.a.And)) : new net.dinglisch.android.taskerm.s1(kotlin.collections.r.o(new net.dinglisch.android.taskerm.r1(op, str, M2), new net.dinglisch.android.taskerm.r1(op2, str, M22)), kotlin.collections.r.d(s1.a.Or));
}
public static final List<pn> O1(wo woVar, ho hoVar) {
yj.p.i(woVar, "<this>");
yj.p.i(hoVar, "context");
List<ho> N1 = N1(woVar, hoVar);
ArrayList arrayList = new ArrayList();
for (Object obj : N1) {
if (obj instanceof pn) {
arrayList.add(obj);
}
}
return arrayList;
}
public static final String O2(Bundle bundle, String str, String str2) {
yj.p.i(str, "variableName");
if (bundle == null) {
return null;
}
String str3 = "";
String str4 = hk.o.I(str, "%", false, 2, null) ? "" : "%";
if (z2.h0(str2)) {
str3 = str2 + "_";
}
return bundle.getString(str4 + str3 + str);
}
public static final String O3(int i2, int i3) {
return hk.o.k0(String.valueOf(i2), i3, '0');
}
public static final int O4(int i2, int i3, int i4) {
return i2 == i3 ? i4 : (i3 <= i2 || i4 > i2) ? (i3 >= i2 || i4 < i2) ? i2 : i2 - 1 : i2 + 1;
}
public static final long P(InputStream inputStream, OutputStream outputStream, long j2, int i2) {
yj.p.i(inputStream, "<this>");
yj.p.i(outputStream, "out");
if (j2 < 0) {
return 0L;
}
byte[] bArr = new byte[i2];
long j3 = 0;
while (true) {
long j4 = j2 - j3;
if (j4 == 0) {
return j3;
}
if (j4 < i2) {
bArr = new byte[(int) j4];
}
int read = inputStream.read(bArr);
if (read < 0) {
return j3;
}
outputStream.write(bArr, 0, read);
j3 += read;
}
}
public static final String P0(double d2) {
return L2(d2, 7);
}
public static final String P1(int i2) {
return O3(i2, 2);
}
public static String P2(Bundle bundle, String str, String str2, int i2, Object obj) {
if ((i2 & 2) != 0) {
str2 = null;
}
return O2(bundle, str, str2);
}
public static final void P3(MediaPlayer mediaPlayer, String str, Integer num) {
yj.p.i(mediaPlayer, "<this>");
yj.p.i(str, "base64EncodedString");
String str2 = "data:audio/mp3;base64," + str;
mediaPlayer.setAudioAttributes(new AudioAttributes.Builder().setLegacyStreamType(num != null ? num.intValue() : 3).build());
mediaPlayer.setDataSource(str2);
mediaPlayer.prepare();
mediaPlayer.start();
}
public static final String P4(int i2, Context context, Locale locale, Object... objArr) {
yj.p.i(context, "context");
yj.p.i(locale, "locale");
yj.p.i(objArr, "paramsForFormat");
Configuration configuration = new Configuration(context.getResources().getConfiguration());
configuration.setLocale(locale);
Context createConfigurationContext = context.createConfigurationContext(configuration);
yj.p.h(createConfigurationContext, "createConfigurationContext(...)");
String g2 = vh.g(createConfigurationContext, i2, Arrays.copyOf(objArr, objArr.length));
yj.p.h(g2, "getString(...)");
return g2;
}
public static final long Q(InputStream inputStream, File file, String str, y5 y5Var) {
OutputStream fileOutputStream;
jf.d b2;
yj.p.i(inputStream, "<this>");
yj.p.i(file, "file");
yj.p.i(str, "contentType");
Context b3 = p7.b("copyToWithProgress");
if (b3 == null || (b2 = jf.a.b(b3, file, true)) == null || (fileOutputStream = b2.d0(str, false)) == null) {
fileOutputStream = new FileOutputStream(file);
}
return S(inputStream, fileOutputStream, y5Var, 0, 4, null);
}
public static final String Q0(Intent intent, Context context) {
ComponentName component;
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
Intent Y0 = Y0(intent, context);
if (Y0 == null || (component = Y0.getComponent()) == null) {
return null;
}
return component.getPackageName();
}
public static final String Q1(int i2) {
return O3(i2, 4);
}
public static final List<tn> Q2(wo woVar, to toVar) {
yj.p.i(woVar, "<this>");
yj.p.i(toVar, "data");
return V1(toVar, woVar);
}
public static final <K, V> Map<K, V> Q3(Map<K, ? extends V> map, Map<K, ? extends V> map2) {
if (map == 0 && map2 == 0) {
return null;
}
if (map == 0) {
return map2;
}
if (map2 == 0) {
return map;
}
LinkedHashMap linkedHashMap = new LinkedHashMap(map.size() + map2.size());
linkedHashMap.putAll(map);
linkedHashMap.putAll(map2);
return linkedHashMap;
}
public static final String Q4(int i2, Context context, Object... objArr) {
yj.p.i(context, "context");
yj.p.i(objArr, "paramsForFormat");
String g2 = vh.g(context, i2, Arrays.copyOf(objArr, objArr.length));
yj.p.h(g2, "getString(...)");
return g2;
}
public static final long R(InputStream inputStream, OutputStream outputStream, y5 y5Var, int i2) {
yj.p.i(inputStream, "<this>");
yj.p.i(outputStream, "out");
if (y5Var == null) {
return vj.a.a(inputStream, outputStream, i2);
}
byte[] bArr = new byte[i2];
int read = inputStream.read(bArr);
int b2 = y5Var.b();
long currentTimeMillis = System.currentTimeMillis();
long j2 = 0;
while (read >= 0) {
outputStream.write(bArr, 0, read);
j2 += read;
if (System.currentTimeMillis() - currentTimeMillis > b2) {
currentTimeMillis = System.currentTimeMillis();
y5Var.e(j2);
}
read = inputStream.read(bArr);
}
return j2;
}
public static final String R0(Context context) {
yj.p.i(context, "<this>");
Intent p2 = th.p();
yj.p.h(p2, "getLauncherIntent(...)");
return Q0(p2, context);
}
public static final com.joaomgcd.taskerm.inputoutput.a R1(net.dinglisch.android.taskerm.k2 k2Var, Context context) {
yj.p.i(k2Var, "<this>");
yj.p.i(context, "context");
int j2 = k2Var.j();
com.joaomgcd.taskerm.inputoutput.a aVar = new com.joaomgcd.taskerm.inputoutput.a();
ek.f s2 = ek.j.s(0, net.dinglisch.android.taskerm.j2.J(j2));
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(s2, 10));
Iterator<Integer> it = s2.iterator();
while (it.hasNext()) {
int d2 = ((kotlin.collections.h0) it).d();
String m2 = net.dinglisch.android.taskerm.j2.m(context.getResources(), j2, d2);
int i2 = d2 + 1;
arrayList.add(new uf.e(null, "evtprm" + i2, i2 + ". " + m2, "2131889600: " + m2, false, 0, 0, false, 240, null));
}
aVar.addAll(arrayList);
return aVar;
}
public static final String R2(byte[] bArr) {
yj.p.i(bArr, "<this>");
return new String(bArr, hk.d.b);
}
public static final <T> List<T> R3(T t2, Collection<? extends T> collection) {
yj.p.i(collection, "list");
ArrayList arrayList = new ArrayList(collection.size() + 1);
arrayList.add(t2);
arrayList.addAll(collection);
return arrayList;
}
public static final void R4(Context context, xj.a<lj.e0> aVar) {
yj.p.i(context, "context");
yj.p.i(aVar, "block");
try {
aVar.invoke();
} catch (Throwable th2) {
pg.w0.X0(context, th2);
}
}
public static long S(InputStream inputStream, OutputStream outputStream, y5 y5Var, int i2, int i3, Object obj) {
if ((i3 & 4) != 0) {
i2 = 8192;
}
return R(inputStream, outputStream, y5Var, i2);
}
public static final String S0(float f2, boolean z2) {
return i2(f2, z2, 1);
}
public static final gk.h<File> S1(File file) {
yj.p.i(file, "<this>");
return gk.k.h(file.getParentFile(), k0.i);
}
public static final long S2(long j2) {
return k8.v() - j2;
}
public static final boolean S3(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
return ((Boolean) o8.d(bluetoothDevice, "removeBond", "btdeviceremovebond", false, 4, null).a()).booleanValue();
}
public static final java.lang.Object S4(android.content.Context r4, xj.l<? super oj.d<? super lj.e0>, ? extends java.lang.Object> r5, oj.d<? super lj.e0> r6) {
throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.util.x2.S4(android.content.Context, xj.l, oj.d):java.lang.Object");
}
public static final <T> boolean T(Collection<? extends T> collection, Collection<? extends T> collection2) {
return !Z3(collection, collection2);
}
public static final String T0(BluetoothClass bluetoothClass, Context context) {
yj.p.i(context, "context");
if (bluetoothClass == null) {
return null;
}
switch (bluetoothClass.getDeviceClass()) {
case 256:
case 512:
case 1024:
case 1792:
case 2048:
case 2304:
break;
case 260:
break;
case 264:
break;
case 268:
break;
case 272:
break;
case 276:
break;
case 280:
break;
case 516:
break;
case 520:
break;
case 524:
break;
case 528:
break;
case 532:
break;
case 1028:
break;
case 1032:
break;
case 1040:
break;
case 1044:
break;
case 1048:
break;
case 1052:
break;
case 1056:
break;
case 1060:
break;
case 1064:
break;
case 1068:
break;
case 1072:
break;
case 1076:
break;
case 1080:
break;
case 1084:
break;
case 1088:
break;
case 1096:
break;
case 1796:
break;
case 1800:
break;
case 1804:
break;
case 1808:
break;
case 1812:
break;
case 2052:
break;
case 2056:
break;
case 2060:
break;
case 2064:
break;
case 2068:
break;
case 2308:
break;
case 2312:
break;
case 2316:
break;
case 2320:
break;
case 2324:
break;
case 2328:
break;
case 2332:
break;
}
return null;
}
public static final String T1(to toVar, Context context, String str) {
yj.p.i(toVar, "<this>");
yj.p.i(context, "context");
yj.p.i(str, ProfileManager.EXTRA_PROFILE_NAME);
HashMap<String, List<String>> R1 = toVar.R1(context, new HashSet(), true);
yj.p.h(R1, "getNeededPermissions(...)");
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Map.Entry<String, List<String>> entry : R1.entrySet()) {
if (!yj.p.d(entry.getKey(), "android.permission.SCHEDULE_EXACT_ALARM")) {
linkedHashMap.put(entry.getKey(), entry.getValue());
}
}
String string = !linkedHashMap.isEmpty() ? context.getString(2131891289, str, kotlin.collections.r.m0(r5.C(linkedHashMap.keySet(), context), "\n", null, null, 0, null, new z(context), 30, null)) : context.getString(2131891291, str);
yj.p.f(string);
return string + "\n\n" + y1(t0(toVar, null, 1, null), context);
}
public static final String T2(byte[] bArr) {
yj.p.i(bArr, "<this>");
StringBuilder sb = new StringBuilder();
for (byte b2 : bArr) {
yj.n0 n0Var = yj.n0.a;
String format = String.format("%02X", Arrays.copyOf(new Object[]{Byte.valueOf(b2)}, 1));
yj.p.h(format, "format(...)");
sb.append(format);
}
String sb2 = sb.toString();
yj.p.h(sb2, "toString(...)");
return sb2;
}
public static final Intent T3(Intent intent) {
Set<String> keySet;
if (intent == null) {
return null;
}
Bundle extras = intent.getExtras();
if (extras == null || (keySet = extras.keySet()) == null) {
return intent;
}
yj.p.f(keySet);
Iterator<T> it = keySet.iterator();
while (it.hasNext()) {
intent.removeExtra((String) it.next());
}
return intent;
}
public static final <T> T T4(xj.l<? super Throwable, ? extends T> lVar, xj.a<? extends T> aVar) {
yj.p.i(aVar, "block");
try {
return aVar.invoke();
} catch (Throwable th2) {
net.dinglisch.android.taskerm.r7.g("TRYORNULL", "Error", th2);
if (lVar != null) {
return lVar.invoke(th2);
}
return null;
}
}
public static final <T> boolean U(Iterator<? extends T> it, Iterator<? extends T> it2) {
return T(B0(it), B0(it2));
}
public static final List<net.dinglisch.android.taskerm.k2> U0(to toVar, int i2) {
yj.p.i(toVar, "<this>");
List<wo> M1 = toVar.M1();
yj.p.h(M1, "getEnabledProfileList(...)");
ArrayList arrayList = new ArrayList();
Iterator<T> it = M1.iterator();
while (it.hasNext()) {
net.dinglisch.android.taskerm.k2 z0 = ((wo) it.next()).z0();
if (z0 == null || z0.j() != i2) {
z0 = null;
}
if (z0 != null) {
arrayList.add(z0);
}
}
return arrayList;
}
public static final ji.r<com.joaomgcd.taskerm.util.x0> U1(BluetoothAdapter bluetoothAdapter, Context context, int i2) {
yj.p.i(bluetoothAdapter, "<this>");
yj.p.i(context, "context");
ij.d V = ij.d.V();
yj.p.h(V, "create(...)");
bluetoothAdapter.getProfileProxy(context, new a0(V), i2);
return V;
}
public static final String U2(byte[] bArr) {
yj.p.i(bArr, "<this>");
return kotlin.collections.l.j0(bArr, ConstantsCommonTaskerServer.ID_SEPARATOR, null, null, 0, null, r0.i, 30, null);
}
public static final void U3(View view) {
yj.p.i(view, "<this>");
ViewParent parent = view.getParent();
yj.p.g(parent, "null cannot be cast to non-null type android.view.ViewManager");
((ViewManager) parent).removeView(view);
}
public static Object U4(xj.l lVar, xj.a aVar, int i2, Object obj) {
if ((i2 & 1) != 0) {
lVar = null;
}
return T4(lVar, aVar);
}
public static final boolean V(BluetoothProfile bluetoothProfile, BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothProfile, "<this>");
yj.p.i(bluetoothDevice, "bluetoothDevice");
return ((Boolean) o8.c(bluetoothProfile, "disconnect", "a2dpdisconnect", true).b(bluetoothDevice)).booleanValue();
}
public static final List<File> V0(File file) {
yj.p.i(file, "<this>");
return f0(file, true);
}
public static final List<tn> V1(to toVar, wo woVar) {
yj.p.i(toVar, "<this>");
yj.p.i(woVar, "profile");
int[] R0 = woVar.R0();
yj.p.h(R0, "getTaskIDs(...)");
ArrayList arrayList = new ArrayList(R0.length);
for (int i2 : R0) {
arrayList.add(toVar.R(i2));
}
return kotlin.collections.r.a0(arrayList);
}
public static final String[] V2(Network network, Context context) {
yj.p.i(network, "<this>");
yj.p.i(context, "context");
return h2(network, context, x0(), g0.i);
}
public static final void V3(net.dinglisch.android.taskerm.c cVar, Context context, Bundle bundle) {
yj.p.i(cVar, "<this>");
yj.p.i(context, "context");
yj.p.i(bundle, "taskVars");
int j2 = cVar.j();
Iterator<Integer> it = ek.j.s(0, cVar.Y()).iterator();
while (it.hasNext()) {
int d2 = ((kotlin.collections.h0) it).d();
kr G = cVar.G(d2);
if (G.k() && !if.d.i.h(j2, d2)) {
G.n(context, bundle);
}
}
}
public static final <T> java.lang.Object V4(xj.l<? super java.lang.Throwable, ? extends T> r4, xj.l<? super oj.d<? super T>, ? extends java.lang.Object> r5, oj.d<? super T> r6) {
throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.util.x2.V4(xj.l, xj.l, oj.d):java.lang.Object");
}
public static final void W(BluetoothGatt bluetoothGatt) {
yj.p.i(bluetoothGatt, "<this>");
try {
bluetoothGatt.disconnect();
bluetoothGatt.close();
} catch (Throwable th2) {
net.dinglisch.android.taskerm.r7.l("Extensions", "Error disconnecting/closing BluetoothGatt", th2);
}
}
public static final List<File> W0(File file) {
yj.p.i(file, "<this>");
return f0(file, false);
}
public static final HashMap<Integer, Bundle> W1(to toVar, Context context, List<? extends wo> list, String str) {
yj.p.i(context, "context");
yj.p.i(list, "list");
yj.p.i(str, "tag");
HashMap<Integer, Bundle> hashMap = new HashMap<>();
if (toVar == null) {
return hashMap;
}
for (wo woVar : list) {
Integer valueOf = Integer.valueOf(woVar.C0());
Bundle t2 = t(toVar, context, woVar, null, str);
if (t2 != null) {
hashMap.put(valueOf, t2);
}
}
return hashMap;
}
public static final Boolean W2(Boolean bool) {
Boolean bool2 = Boolean.TRUE;
if (yj.p.d(bool, bool2)) {
return bool2;
}
return null;
}
public static final double W3(double d2, int i2) {
return new BigDecimal(d2).setScale(i2, 6).doubleValue();
}
public static Object W4(xj.l lVar, xj.l lVar2, oj.d dVar, int i2, Object obj) {
if ((i2 & 1) != 0) {
lVar = null;
}
return V4(lVar, lVar2, dVar);
}
public static final <T, K> List<T> X(Iterable<? extends T> iterable, xj.l<? super T, ? extends K> lVar, xj.p<? super T, ? super T, Boolean> pVar) {
yj.p.i(iterable, "<this>");
yj.p.i(lVar, "selector");
yj.p.i(pVar, "keepCriteria");
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (T t2 : iterable) {
K invoke = lVar.invoke(t2);
d.b.c cVar = (Object) linkedHashMap.get(invoke);
if (cVar == null || pVar.l(t2, cVar).booleanValue()) {
linkedHashMap.put(invoke, t2);
}
}
return kotlin.collections.r.N0(linkedHashMap.values());
}
public static final String X0(hk.k kVar, String str) {
List<String> a2;
yj.p.i(kVar, "<this>");
yj.p.i(str, "inString");
hk.i c2 = hk.k.c(kVar, str, 0, 2, null);
if (c2 == null || (a2 = c2.a()) == null) {
return null;
}
return a2.get(1);
}
public static final List<kg.w0> X1(uo uoVar, tn tnVar) {
yj.p.i(uoVar, "<this>");
List<wo> Y1 = Y1(uoVar, tnVar);
if (Y1 == null) {
return null;
}
ArrayList arrayList = new ArrayList();
Iterator<T> it = Y1.iterator();
while (it.hasNext()) {
kg.w0 M = ((wo) it.next()).M();
if (M != null) {
arrayList.add(M);
}
}
return arrayList;
}
public static final String X2(BluetoothDevice bluetoothDevice) {
if (bluetoothDevice == null) {
return null;
}
int type = bluetoothDevice.getType();
if (type == 1) {
return "classic";
}
if (type == 2) {
return "le";
}
if (type != 3) {
return null;
}
return "dual";
}
public static final double X3(float f2, int i2) {
return W3(f2, i2);
}
public static final <T> Object X4(xj.l<? super oj.d<? super T>, ? extends Object> lVar, oj.d<? super T> dVar) {
return V4(u0.i, lVar, dVar);
}
public static final <T, K> List<T> Y(Iterable<? extends T> iterable, xj.l<? super T, ? extends K> lVar) {
yj.p.i(iterable, "<this>");
yj.p.i(lVar, "selector");
List P = kotlin.collections.r.P(kotlin.collections.r.N0(iterable));
HashSet hashSet = new HashSet();
ArrayList arrayList = new ArrayList();
for (T t2 : P) {
if (hashSet.add(lVar.invoke(t2))) {
arrayList.add(t2);
}
}
return kotlin.collections.r.P(arrayList);
}
public static final Intent Y0(Intent intent, Context context) {
yj.p.i(intent, "<this>");
yj.p.i(context, "content");
ResolveInfo resolveActivity = context.getPackageManager().resolveActivity(intent, 65536);
if (resolveActivity == null) {
return intent;
}
if (resolveActivity.activityInfo.name.equals("com.android.internal.app.ResolverActivity")) {
return null;
}
Intent intent2 = new Intent(intent);
intent2.setComponent(M0(resolveActivity));
return intent2;
}
public static final List<wo> Y1(uo uoVar, tn tnVar) {
List<Integer> d02;
yj.p.i(uoVar, "<this>");
ArrayList arrayList = null;
if (tnVar != null && (d02 = uoVar.d0(tnVar.P0())) != null) {
arrayList = new ArrayList(kotlin.collections.r.v(d02, 10));
for (Integer num : d02) {
yj.p.f(num);
arrayList.add(uoVar.c(num.intValue()));
}
}
return arrayList;
}
public static final boolean Y2(to toVar) {
if (toVar == null || !toVar.q3(47)) {
return false;
}
List<net.dinglisch.android.taskerm.c> t1 = toVar.t1(47, false);
yj.p.f(t1);
if ((t1 instanceof Collection) && t1.isEmpty()) {
return false;
}
for (net.dinglisch.android.taskerm.c cVar : t1) {
yj.p.f(cVar);
Boolean bool = Boolean.TRUE;
if (A(cVar, 10, bool) || A(cVar, 9, bool)) {
return true;
}
}
return false;
}
public static final void Y3(View view, xj.l<? super View, lj.e0> lVar) {
yj.p.i(lVar, "block");
if (view == null) {
return;
}
view.getViewTreeObserver().addOnPreDrawListener(new m0(view, lVar));
}
public static final void Y4(Activity activity, int i2, String str) {
yj.p.i(activity, "<this>");
yj.p.i(str, "tag");
try {
activity.setRequestedOrientation(i2);
} catch (Exception e2) {
net.dinglisch.android.taskerm.r7.g(str, "Can't set orientation", e2);
}
}
public static final <T> Object Z(xj.a<? extends T> aVar, oj.d<? super T> dVar) {
return jk.i.g(jk.d1.c(), new m(aVar, null), dVar);
}
public static final String Z0(JSONObject jSONObject) {
yj.p.i(jSONObject, "<this>");
StringBuilder sb = new StringBuilder();
Iterator<String> keys = jSONObject.keys();
yj.p.h(keys, "keys(...)");
while (keys.hasNext()) {
String next = keys.next();
String optString = jSONObject.optString(next);
if (optString != null) {
yj.p.f(optString);
if (sb.length() > 0) {
sb.append("&");
}
sb.append(next);
sb.append("=");
sb.append(z2.Y(optString));
}
}
String sb2 = sb.toString();
yj.p.h(sb2, "toString(...)");
return sb2;
}
public static final Integer[] Z1(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
ParcelUuid[] uuids = bluetoothDevice.getUuids();
if (uuids == null) {
return new Integer[0];
}
ArrayList arrayList = new ArrayList();
e1.a aVar = e1.a;
if (J(aVar.l(), uuids)) {
arrayList.add(5);
}
if (J(aVar.a(), uuids) || J(aVar.b(), uuids)) {
arrayList.add(2);
}
if (J(aVar.f(), uuids)) {
arrayList.add(1);
}
if (J(aVar.g(), uuids)) {
arrayList.add(19);
}
return (Integer[]) arrayList.toArray(new Integer[0]);
}
public static final Object Z2(Class<?> cls, Context context, String str, Class<?> cls2) {
Object o2;
yj.p.i(cls, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "stringValue");
if (yj.p.d(cls, String.class) ? true : yj.p.d(cls, CharSequence.class)) {
return str;
}
if (yj.p.d(cls, Boolean.class) ? true : yj.p.d(cls, Boolean.TYPE)) {
return Boolean.valueOf(Boolean.parseBoolean(str));
}
Class cls3 = Integer.TYPE;
if (yj.p.d(cls, cls3) ? true : yj.p.d(cls, Integer.class)) {
o2 = hk.o.m(str);
if (o2 == null) {
throw new RuntimeException("Parameter " + str + " should be a number but cannot be converted to it");
}
} else {
if (!yj.p.d(cls, Long.TYPE)) {
if (yj.p.d(cls, AppBasic.class)) {
try {
return App.Companion.a(context, str);
} catch (Exception e2) {
throw new RuntimeException("Parameter " + str + " should be an app but cannot be converted to it: " + e2.getMessage());
}
}
if (yj.p.d(cls, List.class)) {
if (cls2 != null) {
return p1(str, context, cls2);
}
throw new RuntimeException("Value of type list must have generic type");
}
if (yj.p.d(cls, String[].class)) {
List<Object> x2 = x2(str, context, String.class);
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(x2, 10));
Iterator<T> it = x2.iterator();
while (it.hasNext()) {
arrayList.add(String.valueOf(it.next()));
}
return arrayList.toArray(new String[0]);
}
if (yj.p.d(cls, int[].class)) {
return A0(str, context, cls3);
}
if (yj.p.d(cls, boolean[].class)) {
return A0(str, context, Boolean.TYPE);
}
if (yj.p.d(cls, Bitmap.class)) {
return tf.e.k(str, context, null, null, 6, null);
}
return null;
}
o2 = hk.o.o(str);
if (o2 == null) {
throw new RuntimeException("Parameter " + str + " should be a number (long) but cannot be converted to it");
}
}
return o2;
}
public static final <T> boolean Z3(Collection<? extends T> collection, Collection<? extends T> collection2) {
return collection2 == null ? collection == null : collection != null && collection.size() == collection2.size() && collection.containsAll(collection2);
}
public static final ji.b Z4(MediaPlayer mediaPlayer) {
yj.p.i(mediaPlayer, "<this>");
if (!mediaPlayer.isPlaying()) {
ji.b k2 = ji.b.k();
yj.p.h(k2, "complete(...)");
return k2;
}
final ij.a L = ij.a.L();
yj.p.h(L, "create(...)");
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public final void onCompletion(MediaPlayer mediaPlayer2) {
x2.a5(ij.a.this, mediaPlayer2);
}
});
return L;
}
public static final boolean a0(net.dinglisch.android.taskerm.to r5, int r6, xj.l<? super net.dinglisch.android.taskerm.k2, java.lang.Boolean> r7) {
throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.util.x2.a0(net.dinglisch.android.taskerm.to, int, xj.l):boolean");
}
public static final String a1(long j2) {
yj.i0 i0Var = new yj.i0();
i0Var.i = j2 / 1000;
String j3 = j(i0Var, 60);
String j4 = j(i0Var, 60);
String j5 = j(i0Var, 12);
if (j3 == null) {
return "0";
}
if (j4 != null) {
j3 = j4 + ConstantsCommonTaskerServer.ID_SEPARATOR + j3;
}
if (j5 == null) {
return j3;
}
return j5 + ConstantsCommonTaskerServer.ID_SEPARATOR + j3;
}
public static final xi a2(to toVar, net.dinglisch.android.taskerm.i5 i5Var) {
yj.p.i(toVar, "<this>");
if (i5Var == null) {
return null;
}
if (i5Var instanceof wo) {
return d2(toVar, (wo) i5Var);
}
if (i5Var instanceof tn) {
return c2(toVar, (tn) i5Var);
}
if (i5Var instanceof dk) {
return b2(toVar, (dk) i5Var);
}
return null;
}
public static Object a3(Class cls, Context context, String str, Class cls2, int i2, Object obj) {
if ((i2 & 4) != 0) {
cls2 = null;
}
return Z2(cls, context, str, cls2);
}
public static final void a4(pn pnVar, Context context, String str, Object obj) {
Bundle a2;
yj.p.i(pnVar, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "tag");
a2 = vf.b.i.a(context, (r13 & 2) != 0 ? null : null, (r13 & 4) != 0 ? null : vf.c.a(context, obj), (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
pnVar.c1(str, a2);
}
public static final void a5(ij.a aVar, MediaPlayer mediaPlayer) {
yj.p.i(aVar, "$subject");
aVar.a();
}
public static final s6 b0(tn tnVar, Context context, String str, boolean z2, boolean z3) {
yj.p.i(tnVar, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "actionNameForLogs");
s6 t02 = tn.t0(context, str, null, null, Integer.valueOf(tnVar.P0()), z2, z3);
yj.p.h(t02, "edit(...)");
return t02;
}
public static final String b1(int i2) {
String hexString = Integer.toHexString(i2);
yj.p.h(hexString, "toHexString(...)");
String upperCase = hexString.toUpperCase();
yj.p.h(upperCase, "toUpperCase(...)");
return upperCase;
}
public static final xi b2(to toVar, dk dkVar) {
yj.p.i(toVar, "<this>");
if (dkVar == null) {
return null;
}
yj.h0 h0Var = new yj.h0();
int C2 = toVar.C2(dkVar.getName());
h0Var.i = C2;
if (C2 == -1) {
return null;
}
return (xi) U4(null, new c0(toVar, h0Var), 1, null);
}
public static final String b3(Boolean bool) {
return yj.p.d(bool, Boolean.TRUE) ? "true" : "false";
}
public static final void b4(to toVar, Context context) {
yj.p.i(toVar, "<this>");
yj.p.i(context, "context");
toVar.r4(context).B4(context, dq.R0(context), context.getResources(), new Date().getTime(), true, true);
}
public static final java.lang.Object b5(xj.a<java.lang.Boolean> r7, long r8, long r10, oj.d<? super lj.e0> r12) {
throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.util.x2.b5(xj.a, long, long, oj.d):java.lang.Object");
}
public static s6 c0(tn tnVar, Context context, String str, boolean z2, boolean z3, int i2, Object obj) {
if ((i2 & 4) != 0) {
z2 = true;
}
if ((i2 & 8) != 0) {
z3 = false;
}
return b0(tnVar, context, str, z2, z3);
}
public static final String c1(int i2) {
int i3 = (i2 >> 24) & 255;
int i4 = i2 & 16777215;
if (i3 != 255) {
String format = String.format("#%02X%06X", Integer.valueOf(i3), Integer.valueOf(i4));
yj.p.f(format);
return format;
}
String format2 = String.format("#%06X", Integer.valueOf(i4));
yj.p.f(format2);
return format2;
}
public static final xi c2(to toVar, tn tnVar) {
String string;
yj.p.i(toVar, "<this>");
if (tnVar == null) {
return null;
}
yj.h0 h0Var = new yj.h0();
int n1 = tnVar.n1(toVar);
h0Var.i = n1;
if (n1 == -1 && (string = tnVar.m().getString("%scene_name")) != null) {
h0Var.i = toVar.C2(string);
}
if (h0Var.i == -1) {
return null;
}
return (xi) U4(null, new b0(toVar, h0Var), 1, null);
}
public static final boolean c3(Sensor sensor) {
yj.p.i(sensor, "<this>");
return p3(sensor) || z3(sensor);
}
public static final void c4(HttpURLConnection httpURLConnection, String str) {
yj.p.i(httpURLConnection, "<this>");
yj.p.i(str, "auth");
Pair<String, String> f2 = dg.o0.f(str);
httpURLConnection.setRequestProperty(f2.getFirst(), f2.getSecond());
}
public static Object c5(xj.a aVar, long j2, long j3, oj.d dVar, int i2, Object obj) {
if ((i2 & 2) != 0) {
j3 = 0;
}
return b5(aVar, j2, j3, dVar);
}
public static final boolean d0(Object obj, Object... objArr) {
yj.p.i(objArr, "other");
for (Object obj2 : objArr) {
if (!yj.p.d(obj, obj2)) {
return false;
}
}
return true;
}
public static final String d1(int i2, Context context, boolean z2) {
yj.p.i(context, "context");
String c1 = c1(androidx.core.content.a.getColor(context, i2));
if (c1 != null) {
return z2 ? c1 : hk.o.q0(c1, "#");
}
return null;
}
public static final xi d2(to toVar, wo woVar) {
int E;
yj.p.i(toVar, "<this>");
if (woVar == null || (E = toVar.E(woVar.C0())) == -1) {
return null;
}
return toVar.w(E);
}
public static final List<ComponentName> d3(List<ComponentName> list) {
if (list == null) {
return kotlin.collections.r.l();
}
ArrayList arrayList = new ArrayList();
for (Object obj : list) {
ComponentName componentName = (ComponentName) obj;
if (z2.F(componentName.getPackageName()) != null && z2.F(componentName.getClassName()) != null) {
arrayList.add(obj);
}
}
return arrayList;
}
public static final int d4(int i2, float f2) {
return Color.argb(ak.a.d(Color.alpha(i2) * f2), Color.red(i2), Color.green(i2), Color.blue(i2));
}
public static final Intent d5(Intent intent, Context context, String str, boolean z2, Intent intent2, Boolean bool) {
Intent Y0;
Uri data;
String uri;
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "chooserTitle");
Intent createChooser = Intent.createChooser(intent, str);
PackageManager packageManager = context.getPackageManager();
if (yj.p.d(bool, Boolean.TRUE) && yj.p.d(intent.getAction(), "android.intent.action.VIEW") && com.joaomgcd.taskerm.util.k.a.F()) {
List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(intent, 131072);
yj.p.h(queryIntentActivities, "queryIntentActivities(...)");
?? f5 = f5(queryIntentActivities, intent);
if (yj.p.d(intent.getAction(), "android.intent.action.VIEW") && (data = intent.getData()) != null && (uri = data.toString()) != null && hk.o.I(uri, "http", false, 2, null)) {
List<ResolveInfo> queryIntentActivities2 = packageManager.queryIntentActivities(new Intent("android.intent.action.VIEW", Uri.parse("https://bla.com")), 131072);
yj.p.h(queryIntentActivities2, "queryIntentActivities(...)");
List x02 = kotlin.collections.r.x0(f5, f5(queryIntentActivities2, intent));
HashSet hashSet = new HashSet();
f5 = new ArrayList();
for (Object obj : x02) {
if (hashSet.add(((Intent) obj).getComponent())) {
f5.add(obj);
}
}
}
createChooser.putExtra("android.intent.extra.ALTERNATE_INTENTS", (Parcelable[]) f5.toArray(new Intent[0]));
yj.p.f(createChooser);
return createChooser;
}
if (intent2 == null) {
yj.p.f(createChooser);
return createChooser;
}
if (z2 && (Y0 = Y0(intent2, context)) != null) {
intent.setComponent(Y0.getComponent());
return intent;
}
List<ResolveInfo> queryIntentActivities3 = packageManager.queryIntentActivities(intent2, 0);
yj.p.h(queryIntentActivities3, "queryIntentActivities(...)");
List<Intent> f52 = f5(queryIntentActivities3, intent);
if (f52.isEmpty()) {
return intent;
}
List<ResolveInfo> queryIntentActivities4 = packageManager.queryIntentActivities(intent, 0);
yj.p.h(queryIntentActivities4, "queryIntentActivities(...)");
ArrayList<ResolveInfo> arrayList = new ArrayList();
for (Object obj2 : queryIntentActivities4) {
ResolveInfo resolveInfo = (ResolveInfo) obj2;
if (!f52.isEmpty()) {
Iterator it = f52.iterator();
while (it.hasNext()) {
ComponentName component = ((Intent) it.next()).getComponent();
yj.p.f(resolveInfo);
if (yj.p.d(component, M0(resolveInfo))) {
break;
}
}
}
arrayList.add(obj2);
}
ArrayList arrayList2 = new ArrayList(kotlin.collections.r.v(arrayList, 10));
for (ResolveInfo resolveInfo2 : arrayList) {
yj.p.f(resolveInfo2);
arrayList2.add(M0(resolveInfo2));
}
ComponentName[] componentNameArr = (ComponentName[]) arrayList2.toArray(new ComponentName[0]);
if (!(componentNameArr.length == 0)) {
createChooser.putExtra("android.intent.extra.EXCLUDE_COMPONENTS", componentNameArr);
}
yj.p.f(createChooser);
return createChooser;
}
public static final boolean e0(Object obj, Object... objArr) {
yj.p.i(objArr, "other");
for (Object obj2 : objArr) {
if (yj.p.d(obj, obj2)) {
return true;
}
}
return false;
}
public static final List<kg.g> e1(uo uoVar, Integer num, Integer num2) {
yj.p.i(uoVar, "<this>");
kg.w0 w0Var = (kg.w0) U4(null, new t(num, uoVar), 1, null);
if (w0Var == null) {
w0Var = new kg.w0();
}
Iterable iterable = (List) U4(null, new s(num2, uoVar), 1, null);
if (iterable == null) {
iterable = new kg.w0();
}
kg.w0 w0Var2 = (kg.w0) U4(null, new u(num2, uoVar), 1, null);
if (w0Var2 == null) {
w0Var2 = new kg.w0();
}
return kg.y0.w(kotlin.collections.r.x0(kotlin.collections.r.x0(w0Var, iterable), w0Var2));
}
public static final kg.w0 e2(to toVar, dk dkVar) {
yj.p.i(toVar, "<this>");
yj.p.i(dkVar, "scene");
xi b2 = b2(toVar, dkVar);
if (b2 != null) {
return b2.M();
}
return null;
}
public static final boolean e3(to toVar, int i2) {
yj.p.i(toVar, "<this>");
return a0(toVar, i2, h0.i);
}
public static final void e4(View view, int i2) {
yj.p.i(view, "<this>");
GradientDrawable gradientDrawable = (GradientDrawable) view.getBackground();
if (gradientDrawable != null) {
gradientDrawable.setColor(i2);
}
}
public static Intent e5(Intent intent, Context context, String str, boolean z2, Intent intent2, Boolean bool, int i2, Object obj) {
return d5(intent, context, str, (i2 & 4) != 0 ? false : z2, (i2 & 8) != 0 ? null : intent2, (i2 & 16) != 0 ? null : bool);
}
public static final List<File> f0(File file, boolean z2) {
yj.p.i(file, "<this>");
ArrayList arrayList = new ArrayList();
g0(arrayList, z2, file);
return arrayList;
}
public static final ByteArrayInputStream f1(byte[] bArr) {
yj.p.i(bArr, "<this>");
return new ByteArrayInputStream(bArr);
}
public static final kg.w0 f2(to toVar, tn tnVar) {
yj.p.i(toVar, "<this>");
xi c2 = c2(toVar, tnVar);
if (c2 != null) {
return c2.M();
}
return null;
}
public static final boolean f3(to toVar, tn tnVar) {
yj.p.i(toVar, "<this>");
yj.p.i(tnVar, "task");
List<wo> Y1 = Y1(toVar, tnVar);
if (Y1 == null || Y1.isEmpty()) {
return false;
}
Iterator<T> it = Y1.iterator();
while (it.hasNext()) {
if (((wo) it.next()).h1()) {
return true;
}
}
return false;
}
public static final void f4(HttpURLConnection httpURLConnection, String str) {
yj.p.i(httpURLConnection, "<this>");
yj.p.i(str, "contentType");
httpURLConnection.setRequestProperty(dg.o0.q(), str);
}
private static final List<Intent> f5(List<? extends ResolveInfo> list, Intent intent) {
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
for (ResolveInfo resolveInfo : list) {
Intent intent2 = new Intent(intent);
ActivityInfo activityInfo = resolveInfo.activityInfo;
intent2.setComponent(new ComponentName(activityInfo.packageName, activityInfo.name));
arrayList.add(intent2);
}
return arrayList;
}
private static final void g0(ArrayList<File> arrayList, boolean z2, File file) {
Collection<? extends File> arrayList2;
File[] listFiles = file.listFiles();
if (listFiles == null) {
listFiles = new File[0];
}
if (z2) {
arrayList2 = kotlin.collections.l.C0(listFiles);
} else {
arrayList2 = new ArrayList<>();
for (File file2 : listFiles) {
if (file2.isFile()) {
arrayList2.add(file2);
}
}
}
arrayList.addAll(arrayList2);
ArrayList<File> arrayList3 = new ArrayList();
for (File file3 : listFiles) {
if (file3.isDirectory()) {
arrayList3.add(file3);
}
}
for (File file4 : arrayList3) {
yj.p.f(file4);
g0(arrayList, z2, file4);
}
}
public static final Integer g1(Bundle bundle, String str) {
yj.p.i(str, "key");
if (bundle != null && bundle.containsKey(str)) {
return Integer.valueOf(bundle.getInt(str));
}
return null;
}
public static final kg.w0 g2(to toVar, wo woVar) {
yj.p.i(toVar, "<this>");
xi d2 = d2(toVar, woVar);
if (d2 != null) {
return d2.M();
}
return null;
}
public static final boolean g3(StatusBarNotification statusBarNotification, String str) {
Bundle bundle;
yj.p.i(statusBarNotification, "<this>");
yj.p.i(str, "key");
Notification notification = statusBarNotification.getNotification();
if (notification == null || (bundle = notification.extras) == null) {
return false;
}
return bundle.containsKey(str);
}
public static final Intent g4(Intent intent, Context context, String str, boolean z2) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "packageName");
return m4(intent, context, "https://play.google.com/store/apps/details?id=" + str, z2);
}
public static final <TExtra, T> xj.l<T, lj.e0> g5(xj.p<? super TExtra, ? super T, lj.e0> pVar, TExtra textra) {
if (pVar == null) {
return null;
}
return new w0(pVar, textra);
}
public static final Sensor h(Context context, Integer num) {
yj.p.i(context, "context");
return i(context, num != null ? num.toString() : null);
}
public static final boolean h0(Writer writer) {
if (writer == null) {
return true;
}
try {
writer.flush();
writer.close();
return true;
} catch (IOException e2) {
Log.e("Extensions", "failed to close output stream", e2);
return false;
}
}
public static final <T1, T2> Map<T2, T1> h1(Map<T1, ? extends T2> map) {
yj.p.i(map, "<this>");
List<Pair> t2 = kotlin.collections.k0.t(map);
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(t2, 10));
for (Pair pair : t2) {
arrayList.add(new Pair(pair.getSecond(), pair.getFirst()));
}
return kotlin.collections.k0.n(arrayList);
}
private static final String[] h2(Network network, Context context, HashMap<Integer, String> hashMap, xj.p<? super NetworkCapabilities, ? super Integer, Boolean> pVar) {
NetworkCapabilities H0 = H0(network, context);
if (H0 == null) {
return null;
}
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Map.Entry<Integer, String> entry : hashMap.entrySet()) {
if (pVar.l(H0, entry.getKey()).booleanValue()) {
linkedHashMap.put(entry.getKey(), entry.getValue());
}
}
ArrayList arrayList = new ArrayList(linkedHashMap.size());
Iterator it = linkedHashMap.entrySet().iterator();
while (it.hasNext()) {
arrayList.add((String) ((Map.Entry) it.next()).getValue());
}
return (String[]) arrayList.toArray(new String[0]);
}
public static final boolean h3(int i2, int i3) {
return (i2 & i3) != 0;
}
public static final <T> boolean h4(AtomicReference<T> atomicReference, T t2) {
yj.p.i(atomicReference, "<this>");
return a.a(atomicReference, (Object) null, t2);
}
public static final <TExtra, TExtra1, T> xj.l<T, lj.e0> h5(xj.q<? super TExtra, ? super TExtra1, ? super T, lj.e0> qVar, TExtra textra, TExtra1 textra1) {
if (qVar == null) {
return null;
}
return new x0(qVar, textra, textra1);
}
public static final Sensor i(Context context, String str) {
boolean d2;
yj.p.i(context, "context");
Object obj = null;
if (str == null) {
return null;
}
Integer m2 = hk.o.m(str);
List<Sensor> L1 = ExtensionsContextKt.L1(context);
if (L1 == null) {
return null;
}
Iterator<T> it = L1.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Object next = it.next();
Sensor sensor = (Sensor) next;
if (m2 != null) {
d2 = sensor.getType() == m2.intValue();
} else {
yj.p.f(sensor);
d2 = yj.p.d(u2(sensor), str);
}
if (d2) {
obj = next;
break;
}
}
return (Sensor) obj;
}
public static final String i0(int i2, int i3) {
yj.n0 n0Var = yj.n0.a;
String format = String.format("%0" + i3 + "d", Arrays.copyOf(new Object[]{Integer.valueOf(i2)}, 1));
yj.p.h(format, "format(...)");
return format;
}
public static final String i1(Object obj) {
yj.p.i(obj, "<this>");
return wf.c.a().r(obj);
}
public static final String i2(double d2, boolean z2, int i2) {
if (z2) {
return L2(d2, i2);
}
return null;
}
public static final void i3(EditText editText, String str) {
yj.p.i(editText, "<this>");
yj.p.i(str, "value");
Editable text = editText.getText();
int selectionStart = editText.getSelectionStart();
int selectionEnd = editText.getSelectionEnd();
if (selectionEnd > selectionStart) {
text.delete(selectionStart, selectionEnd);
}
text.insert(selectionStart, str);
}
public static final void i4(View view, int i2) {
yj.p.i(view, "<this>");
view.getLayoutParams().height = i2;
view.getLayoutParams().width = i2;
}
private static final String j(yj.i0 i0Var, int i2) {
long j2 = i2;
String valueOf = String.valueOf(i0Var.i % j2);
i0Var.i /= j2;
if (yj.p.d(valueOf, "0")) {
return null;
}
if (valueOf.length() != 1) {
return valueOf;
}
return "0" + valueOf;
}
public static final <TError extends p1> x6<?, ?> j0(InputStream inputStream, Class<TError> cls) {
yj.p.i(inputStream, "<this>");
yj.p.i(cls, "clzz");
try {
try {
x6<?, ?> k02 = k0(inputStream, cls);
if (!k02.b()) {
inputStream.close();
return k02;
}
Object d2 = k02.d();
yj.p.g(d2, "null cannot be cast to non-null type com.joaomgcd.taskerm.util.ErrorPayload");
x6<?, ?> f2 = u6.f((p1) d2);
inputStream.close();
return f2;
} catch (IOException e2) {
e2.printStackTrace();
x6<?, r1> c2 = u6.c("Error getting error: " + e2);
if (inputStream != null) {
inputStream.close();
}
return c2;
}
} catch (Throwable th2) {
if (inputStream != null) {
inputStream.close();
}
throw th2;
}
}
public static final String j1(Object obj) {
yj.p.i(obj, "<this>");
return wf.c.b().r(obj);
}
public static final HashMap<String, String> j2(Uri uri) {
if (uri == null) {
return new HashMap<>();
}
Set<String> queryParameterNames = uri.getQueryParameterNames();
yj.p.h(queryParameterNames, "getQueryParameterNames(...)");
ArrayList arrayList = new ArrayList();
for (String str : queryParameterNames) {
Pair pair = null;
if (str != null) {
yj.p.f(str);
String queryParameter = uri.getQueryParameter(str);
if (queryParameter != null) {
yj.p.f(queryParameter);
pair = new Pair(str, queryParameter);
}
}
if (pair != null) {
arrayList.add(pair);
}
}
Pair[] pairArr = (Pair[]) arrayList.toArray(new Pair[0]);
return kotlin.collections.k0.g((Pair[]) Arrays.copyOf(pairArr, pairArr.length));
}
@TargetApi(30)
public static final boolean j3(TelephonyDisplayInfo telephonyDisplayInfo) {
int overrideNetworkType;
if (telephonyDisplayInfo == null || com.joaomgcd.taskerm.util.k.a.t()) {
return false;
}
overrideNetworkType = telephonyDisplayInfo.getOverrideNetworkType();
return e0(Integer.valueOf(overrideNetworkType), 2, 3, 4);
}
public static final void j4(Bundle bundle, Context context, String str, String str2, String str3, Integer num, Integer[] numArr, Integer num2, StructureType structureType) {
yj.p.i(bundle, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "key");
if (str2 == null || str2.length() == 0) {
kq.H(context, str, false, true, false, true, bundle, false, num2, num);
} else {
kq.X1(context, str, str2, true, bundle, str3, num, numArr, num2, structureType);
}
}
private static final String k(String str, String str2) {
if (str == null && str2 == null) {
return "Unkown";
}
if (str == null) {
yj.p.f(str2);
return str2;
}
if (str2 == null) {
return str;
}
return str + "/" + str2;
}
public static final <T> x6<?, ?> k0(InputStream inputStream, Class<T> cls) {
yj.p.i(inputStream, "<this>");
yj.p.i(cls, "clazz");
try {
String f2 = vj.i.f(new BufferedReader(new InputStreamReader(inputStream, hk.d.b), 8192));
try {
return u6.f(yj.p.d(cls, String.class) ? f2 : yj.p.d(cls, r1.class) ? new r1(f2) : wf.c.a().h(f2, cls));
} catch (Exception unused) {
return u6.c(f2);
}
} catch (Exception e2) {
return u6.e(e2);
}
}
public static final String[] k1(List<ComponentName> list, Context context) {
yj.p.i(context, "context");
if (list != null) {
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
arrayList.add(ExtensionsContextKt.h1(context, (ComponentName) it.next()));
}
String[] strArr = (String[]) arrayList.toArray(new String[0]);
if (strArr != null) {
return strArr;
}
}
return new String[0];
}
public static final String k2(HashMap<? extends Object, ? extends Object> hashMap) {
List t2;
if (hashMap == null || (t2 = kotlin.collections.k0.t(hashMap)) == null) {
return null;
}
return kotlin.collections.r.m0(t2, "&", null, null, 0, null, l0.i, 30, null);
}
public static final boolean k3(UsageEvents.Event event) {
yj.p.i(event, "<this>");
return e0(Integer.valueOf(event.getEventType()), 1);
}
public static final void l(ij.d dVar, ca.i iVar) {
yj.p.i(dVar, "$subject");
yj.p.i(iVar, "it");
try {
iVar.l(x8.b.class);
dVar.b(new v6());
} catch (Exception e2) {
dVar.onError(e2);
}
}
public static final <T> List<String> l0(Collection<? extends T> collection, String str, xj.l<? super T, String> lVar) {
yj.p.i(collection, "<this>");
yj.p.i(lVar, "transformer");
if (str == null || str.length() == 0) {
return kotlin.collections.r.l();
}
ArrayList arrayList = new ArrayList();
Collection<? extends T> collection2 = collection;
ArrayList arrayList2 = new ArrayList(kotlin.collections.r.v(collection2, 10));
Iterator<T> it = collection2.iterator();
while (it.hasNext()) {
arrayList2.add(lVar.invoke(it.next()));
}
o(arrayList, str, (String[]) arrayList2.toArray(new String[0]));
return kotlin.collections.r.N0(arrayList);
}
public static final wo l1(to toVar, tn tnVar) {
yj.p.i(toVar, "<this>");
if (tnVar == null || tnVar.Y0() == -1) {
return null;
}
return toVar.c(tnVar.Y0());
}
public static final long l2(int i2) {
if (i2 == 0) {
return 3000L;
}
if (i2 != 1) {
return i2;
}
return 4500L;
}
public static final boolean l3(UsageEvents.Event event) {
yj.p.i(event, "<this>");
return e0(Integer.valueOf(event.getEventType()), 2, 23);
}
public static final Intent l4(Intent intent, Context context, Uri uri, boolean z2) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
yj.p.i(uri, "uri");
intent.setAction("android.intent.action.VIEW");
intent.setData(uri);
if (z2) {
ComponentName D0 = ExtensionsContextKt.D0(context);
if (D0 == null) {
return e5(intent, context, Q4(2131886625, context, new Object[0]), false, null, Boolean.TRUE, 12, null);
}
intent.setComponent(D0);
}
return intent;
}
public static final void m(ij.d dVar, ca.i iVar) {
yj.p.i(dVar, "$subject");
yj.p.i(iVar, "it");
try {
Object l2 = iVar.l(x8.b.class);
if (l2 != null) {
dVar.b(l2);
} else {
dVar.onError(new RuntimeException("Result was empty"));
}
} catch (Exception e2) {
dVar.onError(e2);
}
}
public static List m0(Collection collection, String str, xj.l lVar, int i2, Object obj) {
if ((i2 & 2) != 0) {
lVar = n.i;
}
return l0(collection, str, lVar);
}
public static final LinkProperties m1(Network network, Context context) {
yj.p.i(network, "<this>");
yj.p.i(context, "context");
ConnectivityManager t02 = ExtensionsContextKt.t0(context);
if (t02 != null) {
return t02.getLinkProperties(network);
}
return null;
}
public static final String m2(Sensor sensor, Context context) {
yj.p.i(sensor, "<this>");
yj.p.i(context, "context");
return Q4(n2(sensor), context, new Object[0]);
}
public static final boolean m3(int i2, int i3, int i4) {
return i2 >= i3 && i2 <= i4;
}
public static final Intent m4(Intent intent, Context context, String str, boolean z2) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
yj.p.i(str, "url");
Uri parse = Uri.parse(str);
yj.p.h(parse, "parse(...)");
return l4(intent, context, parse, z2);
}
public static final <T> Boolean n(Collection<T> collection, T... tArr) {
yj.p.i(tArr, "items");
if (collection != null) {
return Boolean.valueOf(kotlin.collections.r.B(collection, tArr));
}
return null;
}
public static final HashMap<String, Object> n0(BaseBundle baseBundle) {
HashMap<String, Object> hashMap = new HashMap<>();
if (baseBundle == null) {
return hashMap;
}
Set<String> keySet = baseBundle.keySet();
if (keySet != null) {
for (String str : keySet) {
if (str != null) {
hashMap.put(str, baseBundle.get(str));
}
}
}
return hashMap;
}
public static final ArrayList<UsageEvents.Event> n1(UsageEvents usageEvents, Integer num) {
if (usageEvents == null) {
return new ArrayList<>();
}
ArrayList<UsageEvents.Event> arrayList = new ArrayList<>();
while (usageEvents.hasNextEvent()) {
UsageEvents.Event event = new UsageEvents.Event();
if (usageEvents.getNextEvent(event) && (num == null || event.getEventType() == num.intValue())) {
arrayList.add(event);
}
}
return arrayList;
}
public static final int n2(Sensor sensor) {
yj.p.i(sensor, "<this>");
int reportingMode = sensor.getReportingMode();
if (reportingMode == 0) {
return 2131889533;
}
if (reportingMode == 1) {
return 2131889299;
}
if (reportingMode != 2) {
return reportingMode != 3 ? 2131891270 : 2131890664;
}
return 2131889309;
}
public static final boolean n3(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
Boolean bool = (Boolean) U4(null, new i0(bluetoothDevice), 1, null);
if (bool != null) {
return bool.booleanValue();
}
return false;
}
public static Intent n4(Intent intent, Context context, Uri uri, boolean z2, int i2, Object obj) {
if ((i2 & 4) != 0) {
z2 = false;
}
return l4(intent, context, uri, z2);
}
public static final void o(List<String> list, String str, String[] strArr) {
yj.p.i(list, "<this>");
yj.p.i(str, "match");
yj.p.i(strArr, "names");
w(list, str, strArr);
o4(list, str);
}
public static final Map<String, Object> o0(MediaMetadata mediaMetadata, Context context) {
yj.p.i(mediaMetadata, "<this>");
yj.p.i(context, "context");
Set<String> keySet = mediaMetadata.keySet();
yj.p.h(keySet, "keySet(...)");
Set<String> set = keySet;
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(set, 10));
for (String str : set) {
Object string = mediaMetadata.getString(str);
if (string == null) {
Bitmap bitmap = mediaMetadata.getBitmap(str);
if (bitmap != null) {
yj.p.f(bitmap);
string = tf.e.p(bitmap, context, (r13 & 2) != 0 ? null : null, (r13 & 4) != 0 ? null : "metadata", (r13 & 8) != 0 ? null : null, (r13 & 16) != 0 ? null : null);
} else {
string = null;
}
if (string == null) {
string = Long.valueOf(mediaMetadata.getLong(str));
}
}
arrayList.add(new Pair(str, string));
}
return kotlin.collections.k0.n(arrayList);
}
public static final String[] o1(String str) {
if (str == null || str.length() == 0) {
return null;
}
List A0 = hk.o.A0(str, new String[]{","}, false, 0, 6, null);
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(A0, 10));
Iterator it = A0.iterator();
while (it.hasNext()) {
String obj = hk.o.Z0((String) it.next()).toString();
if (!kq.c1(obj)) {
throw new RuntimeException(obj + " is not a valid variable name");
}
arrayList.add(obj);
}
return (String[]) arrayList.toArray(new String[0]);
}
public static final ji.r<Integer> o2(BluetoothDevice bluetoothDevice, Context context, long j2) {
yj.p.i(bluetoothDevice, "<this>");
yj.p.i(context, "context");
ij.d V = ij.d.V();
yj.p.h(V, "create(...)");
final yj.j0 j0Var = new yj.j0();
bluetoothDevice.connectGatt(context, true, new d0(V, j0Var));
ji.r<Integer> n2 = V.L(j2, TimeUnit.MILLISECONDS).n(new oi.a() {
@Override
public final void run() {
x2.q2(yj.j0.this);
}
});
yj.p.h(n2, "doFinally(...)");
return n2;
}
public static final boolean o3(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
return ((Boolean) o8.d(bluetoothDevice, "isConnected", "btisconnected", false, 4, null).a()).booleanValue();
}
public static final void o4(List<String> list, String str) {
yj.p.i(list, "<this>");
yj.p.i(str, "match");
final String lowerCase = str.toLowerCase();
yj.p.h(lowerCase, "toLowerCase(...)");
kotlin.collections.r.y(list, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int p4;
p4 = x2.p4(lowerCase, (String) obj, (String) obj2);
return p4;
}
});
}
public static final <T> boolean p(Collection<T> collection, T t2) {
if (collection == null || collection.contains(t2)) {
return false;
}
return collection.add(t2);
}
private static final HashMap<Integer, String> p0() {
return kotlin.collections.k0.g(new Pair(0, "mms"), new Pair(1, "supl"), new Pair(2, "dun"), new Pair(3, "fota"), new Pair(4, "ims"), new Pair(5, "cbs"), new Pair(6, "wifi_p2p"), new Pair(7, "ia"), new Pair(8, "rcs"), new Pair(9, "xcap"), new Pair(10, "eims"), new Pair(11, "not_metered"), new Pair(12, "internet"), new Pair(13, "not_restricted"), new Pair(14, "trusted"), new Pair(15, "not_vpn"), new Pair(16, "validated"), new Pair(17, "captive_portal"), new Pair(18, "not_roaming"), new Pair(19, "foreground"), new Pair(20, "not_congested"), new Pair(21, "not_suspended"), new Pair(22, "oem_paid"), new Pair(23, "mcx"), new Pair(24, "partial_connectivity"));
}
private static final List<Object> p1(String str, Context context, Class<?> cls) {
return kotlin.collections.r.N0(x2(str, context, cls));
}
public static ji.r p2(BluetoothDevice bluetoothDevice, Context context, long j2, int i2, Object obj) {
if ((i2 & 2) != 0) {
j2 = 1000;
}
return o2(bluetoothDevice, context, j2);
}
public static final boolean p3(Sensor sensor) {
yj.p.i(sensor, "<this>");
return sensor.getReportingMode() == 0;
}
public static final int p4(String str, String str2, String str3) {
yj.p.i(str, "$matchLower");
yj.p.f(str2);
if (q4(str, str2)) {
return -1;
}
yj.p.f(str3);
return q4(str, str3) ? 1 : 0;
}
public static final Bundle q(to toVar, Context context, Integer num, Bundle bundle, String str) {
Bundle s2;
yj.p.i(context, "context");
yj.p.i(str, "tag");
return (toVar == null || num == null || (s2 = s(toVar, context, toVar.R(num.intValue()), bundle, str)) == null) ? bundle : s2;
}
public static final HashMap<String, Object> q0(Intent intent) {
return w0(intent != null ? intent.getExtras() : null);
}
public static final String q1(Sensor sensor, Context context) {
yj.p.i(sensor, "<this>");
yj.p.i(context, "context");
return "Name: " + sensor.getName() + "\nType: " + sensor.getType() + " - " + sensor.getStringType() + "\nVendor: " + sensor.getVendor() + "\nMode: " + m2(sensor, context) + "\nWake Up: " + sensor.isWakeUpSensor() + "\nPower: " + sensor.getPower() + " mA\nResolution: " + sensor.getResolution() + "\nMin Delay: " + w1(sensor.getMinDelay()) + "\nMax Delay: " + w1(sensor.getMaxDelay()) + "\nMax Range: " + sensor.getMaximumRange();
}
public static final void q2(yj.j0 j0Var) {
yj.p.i(j0Var, "$gattOuter");
BluetoothGatt bluetoothGatt = (BluetoothGatt) j0Var.i;
if (bluetoothGatt != null) {
W(bluetoothGatt);
}
}
public static final boolean q3(to toVar, int i2) {
Object obj;
if (toVar == null) {
return false;
}
ArrayList<tn> P2 = toVar.P2(-2);
yj.p.h(P2, "getTasksInProject(...)");
Iterator<T> it = P2.iterator();
while (true) {
obj = null;
if (!it.hasNext()) {
break;
}
Object next = it.next();
List<net.dinglisch.android.taskerm.c> D0 = ((tn) next).D0();
yj.p.h(D0, "getActions(...)");
Iterator<T> it2 = D0.iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
Object next2 = it2.next();
net.dinglisch.android.taskerm.c cVar = (net.dinglisch.android.taskerm.c) next2;
if (cVar.L() && cVar.j() == i2) {
obj = next2;
break;
}
}
if (obj != null) {
obj = next;
break;
}
}
return ((tn) obj) != null;
}
private static final boolean q4(String str, String str2) {
String lowerCase = str2.toLowerCase();
yj.p.h(lowerCase, "toLowerCase(...)");
return yj.p.d(str, lowerCase) || hk.o.I(lowerCase, str, false, 2, null);
}
public static final void r(uo uoVar, Context context, Collection<String> collection, wo woVar, Integer num) {
Integer num2;
yj.p.i(uoVar, "<this>");
yj.p.i(context, "context");
yj.p.i(collection, "globalUserVars");
if (woVar != null) {
kg.w0 M = woVar.M();
if (M != null) {
M.t(context, collection, 2131891221);
}
int E = uoVar.E(woVar.C0());
num2 = Integer.valueOf(E);
uoVar.Q(context, collection, E, 2131891221);
} else {
num2 = null;
}
if (num == null || yj.p.d(num, num2)) {
return;
}
uoVar.Q(context, collection, num.intValue(), null);
}
public static final List<net.dinglisch.android.taskerm.i5> r0(xi xiVar, to toVar, xj.l<? super net.dinglisch.android.taskerm.i5, Boolean> lVar) {
Object obj;
yj.p.i(xiVar, "<this>");
yj.p.i(toVar, "taskerData");
Integer w2 = toVar.w2(xiVar.getName());
if (w2 == null) {
return kotlin.collections.r.l();
}
int intValue = w2.intValue();
if (lVar == null) {
lVar = o.i;
}
ArrayList<tn> P2 = toVar.P2(intValue);
yj.p.h(P2, "getTasksInProject(...)");
ArrayList arrayList = new ArrayList();
for (Object obj2 : P2) {
if (lVar.invoke(obj2).booleanValue()) {
arrayList.add(obj2);
}
}
List Q0 = kotlin.collections.r.Q0(arrayList);
List<wo> q2 = toVar.q2(intValue);
yj.p.h(q2, "getProfilesInProject(...)");
ArrayList<wo> arrayList2 = new ArrayList();
for (Object obj3 : q2) {
if (lVar.invoke(obj3).booleanValue()) {
arrayList2.add(obj3);
}
}
for (wo woVar : arrayList2) {
yj.p.f(woVar);
for (tn tnVar : Q2(woVar, toVar)) {
if (lVar.invoke(tnVar).booleanValue()) {
Iterator it = Q0.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (((tn) obj).P0() == tnVar.P0()) {
break;
}
}
if (obj == null) {
Q0.add(tnVar);
}
}
}
}
return kotlin.collections.r.x0(arrayList2, Q0);
}
public static final String r1(BluetoothClass bluetoothClass, Context context) {
yj.p.i(context, "context");
if (bluetoothClass == null) {
return null;
}
return net.dinglisch.android.taskerm.j1.l(context.getResources(), bluetoothClass.getMajorDeviceClass());
}
public static final Integer r2(BluetoothDevice bluetoothDevice, Context context, long j2, boolean z2) {
yj.p.i(bluetoothDevice, "<this>");
yj.p.i(context, "context");
if (!z2) {
return null;
}
try {
return o2(bluetoothDevice, context, j2).f();
} catch (Exception unused) {
return null;
}
}
public static final boolean r3(BluetoothDevice bluetoothDevice) {
yj.p.i(bluetoothDevice, "<this>");
try {
return ((Boolean) o8.d(bluetoothDevice, "isEncrypted", "btdeviceenctrypted", false, 4, null).a()).booleanValue();
} catch (Exception unused) {
return false;
}
}
public static final <T extends Service> ComponentName r4(Class<T> cls, Context context, Bundle bundle) {
yj.p.i(cls, "<this>");
yj.p.i(context, "context");
Intent intent = new Intent(context, (Class<?>) cls);
if (bundle != null) {
intent.putExtras(bundle);
}
return context.startService(intent);
}
public static final Bundle s(to toVar, Context context, tn tnVar, Bundle bundle, String str) {
yj.p.i(context, "context");
yj.p.i(str, "tag");
if (toVar == null) {
return bundle;
}
if (tnVar == null) {
return bundle;
}
kg.w0 M = tnVar.M();
kg.w0 f2 = f2(toVar, tnVar);
if (M == null && f2 == null) {
return bundle;
}
if (bundle == null) {
bundle = new Bundle();
}
if (M != null) {
M.s(context, bundle);
}
if (f2 != null) {
f2.s(context, bundle);
}
return bundle;
}
public static final List<net.dinglisch.android.taskerm.i5> s0(to toVar, xj.l<? super net.dinglisch.android.taskerm.i5, Boolean> lVar) {
yj.p.i(toVar, "<this>");
List<xi> x2 = toVar.x2();
xj.l<? super net.dinglisch.android.taskerm.i5, Boolean> lVar2 = lVar == null ? p.i : lVar;
yj.p.f(x2);
ArrayList arrayList = new ArrayList();
for (Object obj : x2) {
if (lVar2.invoke(obj).booleanValue()) {
arrayList.add(obj);
}
}
ArrayList arrayList2 = new ArrayList(kotlin.collections.r.v(x2, 10));
for (xi xiVar : x2) {
yj.p.f(xiVar);
arrayList2.add(r0(xiVar, toVar, lVar));
}
return kotlin.collections.r.x0(arrayList, kotlin.collections.r.w(arrayList2));
}
public static final String s1(InputStream inputStream) {
yj.p.i(inputStream, "<this>");
return z3.b(inputStream);
}
public static Integer s2(BluetoothDevice bluetoothDevice, Context context, long j2, boolean z2, int i2, Object obj) {
if ((i2 & 2) != 0) {
j2 = 1000;
}
if ((i2 & 4) != 0) {
z2 = o3(bluetoothDevice);
}
return r2(bluetoothDevice, context, j2, z2);
}
public static final boolean s3(int i2) {
return i2 % 2 != 1;
}
public static final <T extends Activity> void s4(Class<T> cls, Context context, Bundle bundle) {
yj.p.i(cls, "<this>");
yj.p.i(context, "context");
ExtensionsContextKt.s3(context, new y6(context, cls, bundle));
}
public static final Bundle t(to toVar, Context context, wo woVar, Bundle bundle, String str) {
yj.p.i(context, "context");
yj.p.i(str, "tag");
if (toVar == null) {
return bundle;
}
if (woVar == null) {
return bundle;
}
kg.w0 M = woVar.M();
kg.w0 g2 = g2(toVar, woVar);
if ((M != null && !M.isEmpty()) || (g2 != null && !g2.isEmpty())) {
if (bundle == null) {
bundle = new Bundle();
}
if (M != null) {
M.s(context, bundle);
}
if (g2 != null) {
g2.s(context, bundle);
}
}
return bundle;
}
public static List t0(to toVar, xj.l lVar, int i2, Object obj) {
if ((i2 & 1) != 0) {
lVar = null;
}
return s0(toVar, lVar);
}
public static final String t1(byte[] bArr) {
yj.p.i(bArr, "<this>");
return s1(f1(bArr));
}
public static final long t2(int i2) {
return i2 * 1000;
}
public static final boolean t3(File file) {
yj.p.i(file, "<this>");
Iterator<File> it = S1(file).iterator();
while (it.hasNext()) {
if (it.next().isHidden()) {
return true;
}
}
return false;
}
public static void t4(Class cls, Context context, Bundle bundle, int i2, Object obj) {
if ((i2 & 2) != 0) {
bundle = null;
}
s4(cls, context, bundle);
}
public static final <T> List<T> u(Collection<? extends T> collection, Iterable<? extends T> iterable) {
if (collection != null) {
return iterable == null ? kotlin.collections.r.N0(collection) : kotlin.collections.r.x0(collection, iterable);
}
if (iterable != null) {
return kotlin.collections.r.N0(iterable);
}
return null;
}
public static final <T> boolean u0(Iterable<? extends T> iterable) {
yj.p.i(iterable, "<this>");
if ((iterable instanceof Collection) && ((Collection) iterable).isEmpty()) {
return true;
}
Iterator<? extends T> it = iterable.iterator();
while (it.hasNext()) {
if (it.next() != null) {
return false;
}
}
return true;
}
public static final String u1(double d2, boolean z2) {
return i2(d2, z2, 2);
}
public static final String u2(Sensor sensor) {
yj.p.i(sensor, "<this>");
String name = sensor.getName();
String E2 = E2(sensor);
yj.p.f(name);
String lowerCase = name.toLowerCase();
yj.p.h(lowerCase, "toLowerCase(...)");
String lowerCase2 = E2.toLowerCase();
yj.p.h(lowerCase2, "toLowerCase(...)");
if (hk.o.N(lowerCase, lowerCase2, false, 2, null)) {
return name;
}
return name + " - " + E2(sensor);
}
public static final boolean u3(StatusBarNotification statusBarNotification) {
yj.p.i(statusBarNotification, "<this>");
Boolean bool = (Boolean) U4(null, new j0(statusBarNotification), 1, null);
if (bool != null) {
return bool.booleanValue();
}
return false;
}
public static final void u4(Intent intent, Context context) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
ExtensionsContextKt.s3(context, new y6(intent, false, 0, null, 14, null));
}
public static final <T> ArrayList<T> v(ArrayList<T> arrayList, T t2) {
if (arrayList == null) {
arrayList = new ArrayList<>();
}
arrayList.add(t2);
return arrayList;
}
public static final List<kg.g> v0(net.dinglisch.android.taskerm.i5 i5Var, to toVar) {
List l2;
yj.p.i(i5Var, "<this>");
yj.p.i(toVar, "data");
Collection M = i5Var.M();
if (M == null) {
M = kotlin.collections.r.l();
}
List H2 = i5Var instanceof wo ? H2((wo) i5Var, toVar, null, 2, null) : kotlin.collections.r.l();
if (i5Var instanceof xi) {
xi xiVar = (xi) i5Var;
List<wo> y2 = xiVar.y(toVar);
if (y2 == null) {
y2 = kotlin.collections.r.l();
}
ArrayList arrayList = new ArrayList();
Iterator<T> it = y2.iterator();
while (it.hasNext()) {
kg.w0 M2 = ((wo) it.next()).M();
if (M2 != null) {
arrayList.add(M2);
}
}
List w2 = kotlin.collections.r.w(arrayList);
ArrayList arrayList2 = new ArrayList();
for (wo woVar : y2) {
yj.p.f(woVar);
List<kg.g> G2 = G2(woVar, toVar, q.i);
if (G2 != null) {
arrayList2.add(G2);
}
}
List w3 = kotlin.collections.r.w(arrayList2);
List<tn> O = xiVar.O(toVar);
yj.p.h(O, "getTasks(...)");
ArrayList arrayList3 = new ArrayList();
for (Object obj : O) {
if (((tn) obj).u()) {
arrayList3.add(obj);
}
}
ArrayList arrayList4 = new ArrayList();
Iterator it2 = arrayList3.iterator();
while (it2.hasNext()) {
kg.w0 M3 = ((tn) it2.next()).M();
if (M3 != null) {
arrayList4.add(M3);
}
}
l2 = kotlin.collections.r.x0(kotlin.collections.r.x0(w2, w3), kotlin.collections.r.w(arrayList4));
} else {
l2 = kotlin.collections.r.l();
}
return kotlin.collections.r.x0(kotlin.collections.r.x0(M, H2), l2);
}
public static final String v1(float f2, boolean z2) {
return u1(f2, z2);
}
public static final <T> ji.r<T> v2(ca.i<T> iVar) {
yj.p.i(iVar, "<this>");
if (iVar.o()) {
ji.r<T> w2 = ji.r.w(iVar.k());
yj.p.h(w2, "just(...)");
return w2;
}
final ij.d V = ij.d.V();
yj.p.h(V, "create(...)");
iVar.b(new ca.d() {
public final void a(ca.i iVar2) {
x2.m(ij.d.this, iVar2);
}
});
return V;
}
public static final boolean v3(Boolean bool) {
return bool != null && bool.booleanValue();
}
public static final ji.r<Intent> v4(Intent intent, Context context, Integer num, Integer num2, Long l2) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
ji.r<s6> run = new GenericActionActivityForResultForIntent(intent, num, num2, l2).run(context);
final o0 o0Var = o0.i;
ji.r t2 = run.t(new oi.e() {
@Override
public final Object a(Object obj) {
ji.v x4;
x4 = x2.x4(xj.l.this, obj);
return x4;
}
});
yj.p.h(t2, "flatMap(...)");
return t2;
}
public static final void w(List<String> list, String str, String[] strArr) {
yj.p.i(list, "<this>");
yj.p.i(str, "match");
yj.p.i(strArr, "names");
String lowerCase = str.toLowerCase();
yj.p.h(lowerCase, "toLowerCase(...)");
List A0 = hk.o.A0(lowerCase, new String[]{" "}, false, 0, 6, null);
for (String str2 : strArr) {
String lowerCase2 = str2.toLowerCase();
yj.p.h(lowerCase2, "toLowerCase(...)");
if (!(A0 instanceof Collection) || !A0.isEmpty()) {
Iterator it = A0.iterator();
while (it.hasNext()) {
if (!hk.o.N(lowerCase2, (String) it.next(), false, 2, null)) {
break;
}
}
}
p(list, str2);
}
}
public static final HashMap<String, Object> w0(BaseBundle baseBundle) {
Object U4;
HashMap<String, Object> hashMap = new HashMap<>();
if (baseBundle == null) {
return hashMap;
}
Set<String> keySet = baseBundle.keySet();
if (keySet != null) {
for (String str : keySet) {
if (str != null && (U4 = U4(null, new a(U4(null, new b(baseBundle, str), 1, null)), 1, null)) != null) {
hashMap.put(str, U4);
}
}
}
return hashMap;
}
private static final String w1(int i2) {
if (1000000 <= i2 && i2 < 1000000000) {
return (i2 / 1000000) + " s";
}
if (1000 > i2 || i2 >= 1000000) {
return i2 + " μs";
}
return (i2 / 1000) + " ms";
}
public static final ji.r<v6> w2(ca.i<Void> iVar) {
yj.p.i(iVar, "<this>");
if (iVar.o()) {
ji.r<v6> w2 = ji.r.w(new v6());
yj.p.h(w2, "just(...)");
return w2;
}
final ij.d V = ij.d.V();
yj.p.h(V, "create(...)");
iVar.b(new ca.d() {
public final void a(ca.i iVar2) {
x2.l(ij.d.this, iVar2);
}
});
return V;
}
public static final boolean w3(Boolean bool) {
return bool == null || yj.p.d(bool, Boolean.FALSE);
}
public static ji.r w4(Intent intent, Context context, Integer num, Integer num2, Long l2, int i2, Object obj) {
if ((i2 & 2) != 0) {
num = null;
}
if ((i2 & 4) != 0) {
num2 = null;
}
if ((i2 & 8) != 0) {
l2 = null;
}
return v4(intent, context, num, num2, l2);
}
public static final void x(EditText editText, String str) {
yj.p.i(editText, "<this>");
if (str == null || str.length() == 0) {
return;
}
pg.w0.q0(new c(editText, str));
}
private static final HashMap<Integer, String> x0() {
return kotlin.collections.k0.g(new Pair(0, "cellular"), new Pair(1, "wifi"), new Pair(2, "bluetooth"), new Pair(3, "ethernet"), new Pair(4, "vpn"), new Pair(5, "wifi_aware"), new Pair(6, "lowpan"), new Pair(8, "usb"));
}
public static final long x1(long j2) {
return j2 * 60000;
}
private static final List<Object> x2(String str, Context context, Class<?> cls) {
List A0 = hk.o.A0(str, new String[]{","}, false, 0, 6, null);
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(A0, 10));
Iterator it = A0.iterator();
while (it.hasNext()) {
arrayList.add(a3(cls, context, (String) it.next(), null, 4, null));
}
return arrayList;
}
public static final boolean x3(Boolean bool) {
return bool == null || yj.p.d(bool, Boolean.TRUE);
}
public static final ji.v x4(xj.l lVar, Object obj) {
yj.p.i(lVar, "$tmp0");
yj.p.i(obj, "p0");
return (ji.v) lVar.invoke(obj);
}
public static final boolean y(wo woVar, ho hoVar) {
yj.p.i(woVar, "<this>");
yj.p.i(hoVar, "context");
List<pn> O1 = O1(woVar, hoVar);
if ((O1 instanceof Collection) && O1.isEmpty()) {
return true;
}
Iterator<T> it = O1.iterator();
while (it.hasNext()) {
if (!((pn) it.next()).G0()) {
return false;
}
}
return true;
}
public static final <T> boolean y0(Iterable<? extends T> iterable) {
yj.p.i(iterable, "<this>");
if ((iterable instanceof Collection) && ((Collection) iterable).isEmpty()) {
return false;
}
Iterator<? extends T> it = iterable.iterator();
while (it.hasNext()) {
if (it.next() == null) {
return true;
}
}
return false;
}
public static final java.lang.String y1(java.util.List<? extends net.dinglisch.android.taskerm.i5> r44, android.content.Context r45) {
throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.util.x2.y1(java.util.List, android.content.Context):java.lang.String");
}
public static final String[] y2(List<ComponentName> list) {
if (list != null) {
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
arrayList.add(((ComponentName) it.next()).flattenToString());
}
String[] strArr = (String[]) arrayList.toArray(new String[0]);
if (strArr != null) {
return strArr;
}
}
return new String[0];
}
public static final boolean y3(int i2) {
return i2 % 2 == 1;
}
public static final ji.r<Intent> y4(Intent intent, Context context, Integer num, Integer num2, Long l2) {
yj.p.i(intent, "<this>");
yj.p.i(context, "context");
ji.r<s6> run = new GenericActionActivityForResultForIntentGrantFilePermission(intent, num, num2, l2, false, 16, null).run(context);
final p0 p0Var = p0.i;
ji.r t2 = run.t(new oi.e() {
@Override
public final Object a(Object obj) {
ji.v A4;
A4 = x2.A4(xj.l.this, obj);
return A4;
}
});
yj.p.h(t2, "flatMap(...)");
return t2;
}
public static final boolean z(int[] iArr) {
yj.p.i(iArr, "<this>");
if (iArr.length < 2) {
return true;
}
List<Integer> v02 = kotlin.collections.l.v0(iArr);
int size = v02.size() - 1;
int i2 = 0;
while (i2 < size) {
int intValue = v02.get(i2).intValue() + 1;
i2++;
if (intValue != v02.get(i2).intValue()) {
return false;
}
}
return true;
}
public static final String[] z0(List<ComponentName> list, Context context) {
yj.p.i(context, "context");
if (list != null) {
ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
String b02 = ExtensionsContextKt.b0(context, ((ComponentName) it.next()).getPackageName(), null, 2, null);
if (b02 == null) {
b02 = "";
}
arrayList.add(b02);
}
String[] strArr = (String[]) arrayList.toArray(new String[0]);
if (strArr != null) {
return strArr;
}
}
return new String[0];
}
private static final Boolean z1(net.dinglisch.android.taskerm.b5 b5Var, HashSet<String> hashSet) {
String j02;
if (b5Var == null || (j02 = b5Var.j0()) == null) {
return null;
}
return Boolean.valueOf(hashSet.add(j02));
}
public static final String[] z2(float[] fArr) {
yj.p.i(fArr, "<this>");
ArrayList arrayList = new ArrayList(fArr.length);
for (float f2 : fArr) {
String valueOf = String.valueOf(f2);
if (hk.o.N(valueOf, "E", false, 2, null)) {
valueOf = new BigDecimal(f2).toPlainString();
}
arrayList.add(valueOf);
}
return (String[]) arrayList.toArray(new String[0]);
}
public static final boolean z3(Sensor sensor) {
yj.p.i(sensor, "<this>");
return sensor.getReportingMode() == 1;
}
public static ji.r z4(Intent intent, Context context, Integer num, Integer num2, Long l2, int i2, Object obj) {
if ((i2 & 2) != 0) {
num = null;
}
if ((i2 & 4) != 0) {
num2 = null;
}
if ((i2 & 8) != 0) {
l2 = null;
}
return y4(intent, context, num, num2, l2);
}
}