导航菜单

页面标题

页面副标题

Tasker v6.5.11 - a.java 源代码

正在查看: Tasker v6.5.11 应用的 a.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.joaomgcd.taskerm.dialog;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.NotificationChannel;
import android.app.TimePickerDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.UriPermission;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.net.Uri;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Message;
import android.widget.DatePicker;
import android.widget.TimePicker;
import com.joaomgcd.oldtaskercompat.matter.MatterDevice;
import com.joaomgcd.oldtaskercompat.matter.MatterDevices;
import com.joaomgcd.taskerm.action.system.KeyboardApps;
import com.joaomgcd.taskerm.contacts.ContactData;
import com.joaomgcd.taskerm.dialog.a;
import com.joaomgcd.taskerm.dialog.l;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityPickShortcut;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestCallScreeningAccess;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestDigitalAssistantPermission;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestDoNotDisturbAccess;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestManageExternalStorageAccess;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestMissingPermissions;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityRequestNotificationAccess;
import com.joaomgcd.taskerm.genericaction.GenericActionActivitySelectApp;
import com.joaomgcd.taskerm.genericaction.GenericActionPickContact;
import com.joaomgcd.taskerm.genericaction.GenericActionPickContactWithMimeType;
import com.joaomgcd.taskerm.navigationbar.IconProvider;
import com.joaomgcd.taskerm.settings.ComponentNameList;
import com.joaomgcd.taskerm.util.AppBasic;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import com.joaomgcd.taskerm.util.GenericActionActivityGrantUriPermission;
import com.joaomgcd.taskerm.util.e5;
import com.joaomgcd.taskerm.util.g8;
import com.joaomgcd.taskerm.util.h6;
import com.joaomgcd.taskerm.util.k8;
import com.joaomgcd.taskerm.util.r5;
import com.joaomgcd.taskerm.util.r6;
import com.joaomgcd.taskerm.util.s6;
import com.joaomgcd.taskerm.util.t6;
import com.joaomgcd.taskerm.util.u6;
import com.joaomgcd.taskerm.util.v6;
import com.joaomgcd.taskerm.util.w3;
import com.joaomgcd.taskerm.util.w6;
import com.joaomgcd.taskerm.util.x2;
import com.joaomgcd.taskerm.util.x3;
import com.joaomgcd.taskerm.util.x6;
import com.joaomgcd.taskerm.util.z2;
import java.io.File;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import ji.v;
import kotlin.Pair;
import net.dinglisch.android.taskerm.ActionEdit;
import net.dinglisch.android.taskerm.Expr;
import net.dinglisch.android.taskerm.FileSelect;
import net.dinglisch.android.taskerm.Kid;
import net.dinglisch.android.taskerm.TextBoxDialogFragment;
import net.dinglisch.android.taskerm.bh;
import net.dinglisch.android.taskerm.br;
import net.dinglisch.android.taskerm.dk;
import net.dinglisch.android.taskerm.dq;
import net.dinglisch.android.taskerm.e5;
import net.dinglisch.android.taskerm.eh;
import net.dinglisch.android.taskerm.h4;
import net.dinglisch.android.taskerm.i5;
import net.dinglisch.android.taskerm.ri;
import net.dinglisch.android.taskerm.s1;
import net.dinglisch.android.taskerm.s5;
import net.dinglisch.android.taskerm.sd;
import net.dinglisch.android.taskerm.sp;
import net.dinglisch.android.taskerm.th;
import net.dinglisch.android.taskerm.tn;
import net.dinglisch.android.taskerm.to;
import net.dinglisch.android.taskerm.tp;
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 net.dinglisch.android.taskerm.yd;
import rg.v0;
import we.k2;
import we.l0;
import we.l2;

public final class a {
    private static rg.v0 a;

    static final class C0221a extends yj.q implements xj.a<ji.r<we.l0>> {
        public static final C0221a i = new C0221a();

        C0221a() {
            super(0);
        }

        public final ji.r<we.l0> invoke() {
            ji.r<we.l0> w = ji.r.w(new we.l0(1, null, 2, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class a0 extends yj.q implements xj.a<ji.r<we.l0>> {
        final Activity i;
        final int q;
        final String r;

        a0(Activity activity, int i, String str) {
            super(0);
            this.i = activity;
            this.q = i;
            this.r = str;
        }

        public final ji.r<we.l0> invoke() {
            return a.o1(this.i, this.q, this.r, 2131886902, false, null, 48, null);
        }
    }

    static final class a1 extends yj.q implements xj.a<String> {
        final Activity i;
        final String q;

        static final class C0222a extends yj.q implements xj.l<ResolveInfo, we.k0> {
            final PackageManager i;

            C0222a(PackageManager packageManager) {
                super(1);
                this.i = packageManager;
            }

            public final we.k0 invoke(ResolveInfo resolveInfo) {
                yj.p.i(resolveInfo, "it");
                return new we.k0(this.i.getApplicationLabel(resolveInfo.activityInfo.applicationInfo).toString(), null, false, 6, null);
            }
        }

        a1(Activity activity, String str) {
            super(0);
            this.i = activity;
            this.q = str;
        }

        public final String invoke() {
            ActivityInfo activityInfo;
            PackageManager packageManager = this.i.getPackageManager();
            List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(new Intent("android.speech.tts.engine.CHECK_TTS_DATA"), 0);
            yj.p.h(queryIntentActivities, "queryIntentActivities(...)");
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = queryIntentActivities.iterator();
            while (true) {
                ApplicationInfo applicationInfo = null;
                if (!it.hasNext()) {
                    break;
                }
                Object next = it.next();
                ResolveInfo resolveInfo = (ResolveInfo) next;
                if (resolveInfo != null && (activityInfo = resolveInfo.activityInfo) != null) {
                    applicationInfo = activityInfo.applicationInfo;
                }
                if (applicationInfo != null) {
                    arrayList.add(next);
                }
            }
            ResolveInfo resolveInfo2 = arrayList.size() == 1 ? (ResolveInfo) arrayList.get(0) : (ResolveInfo) ((we.w1) we.x.C(new we.v1(this.i, this.q, arrayList, true, new C0222a(packageManager), null, null, null, null, null, null, null, null, null, null, null, null, null, 262112, null)).f()).c();
            ActivityInfo activityInfo2 = resolveInfo2 != null ? resolveInfo2.activityInfo : null;
            if (activityInfo2 == null) {
                throw new RuntimeException("Could not get TTS engine");
            }
            String str = activityInfo2.packageName;
            Intent intent = new Intent();
            intent.setComponent(new ComponentName(str, activityInfo2.name));
            intent.setAction("android.speech.tts.engine.CHECK_TTS_DATA");
            ArrayList<String> stringArrayListExtra = ((Intent) x2.w4(intent, this.i, (Integer) null, (Integer) null, (Long) null, 14, (Object) null).f()).getStringArrayListExtra("availableVoices");
            if (stringArrayListExtra == null) {
                throw new RuntimeException("Could not available TTS voices or no voices available");
            }
            String str2 = (String) ((we.w1) we.x.C(new we.v1(this.i, this.q, kotlin.collections.r.N0(stringArrayListExtra), true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 262128, null)).f()).c();
            if (str2 == null) {
                throw new RuntimeException("Could not get TTS engine");
            }
            return str + ":" + str2;
        }
    }

    static final class a2 extends yj.q implements xj.l<we.l0, lj.e0> {
        public static final a2 i = new a2();

        a2() {
            super(1);
        }

        public final void a(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
        }

        public Object invoke(Object obj) {
            a((we.l0) obj);
            return lj.e0.a;
        }
    }

    static final class b extends yj.q implements xj.l<we.l0, Boolean> {
        public static final b i = new b();

        b() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return Boolean.valueOf(l0Var.n());
        }
    }

    static final class b0 extends yj.q implements xj.a<ji.r<we.l0>> {
        public static final b0 i = new b0();

        b0() {
            super(0);
        }

        public final ji.r<we.l0> invoke() {
            ji.r<we.l0> w = ji.r.w(new we.l0(1, null, 2, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class b1 extends yj.q implements xj.a<lj.e0> {
        final Activity i;
        final xj.q<TimePicker, Integer, Integer, lj.e0> q;
        final we.i2 r;
        final Calendar s;
        final String t;
        final String u;
        final ij.d<we.i2> v;

        b1(Activity activity, xj.q<? super TimePicker, ? super Integer, ? super Integer, lj.e0> qVar, we.i2 i2Var, Calendar calendar, String str, String str2, ij.d<we.i2> dVar) {
            super(0);
            this.i = activity;
            this.q = qVar;
            this.r = i2Var;
            this.s = calendar;
            this.t = str;
            this.u = str2;
            this.v = dVar;
        }

        public static final void g(xj.q qVar, TimePicker timePicker, int i, int i2) {
            yj.p.i(qVar, "$tmp0");
            qVar.e(timePicker, Integer.valueOf(i), Integer.valueOf(i2));
        }

        public static final void i(ij.d dVar, DialogInterface dialogInterface) {
            yj.p.i(dVar, "$result");
            pg.w0.n1(dVar, new RuntimeException("Cancelled"));
        }

        public static final void k(ij.d dVar, DialogInterface dialogInterface) {
            yj.p.i(dVar, "$result");
            pg.w0.n1(dVar, new RuntimeException("Dismissed"));
        }

        public final void f() {
            Activity activity = this.i;
            final xj.q<TimePicker, Integer, Integer, lj.e0> qVar = this.q;
            TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
                @Override
                public final void onTimeSet(TimePicker timePicker, int i, int i2) {
                    a.b1.g(qVar, timePicker, i, i2);
                }
            };
            we.i2 i2Var = this.r;
            int a = i2Var != null ? i2Var.a() : this.s.get(11);
            we.i2 i2Var2 = this.r;
            TimePickerDialog timePickerDialog = new TimePickerDialog(activity, onTimeSetListener, a, i2Var2 != null ? i2Var2.b() : this.s.get(12), true);
            if (z2.h0(this.t)) {
                timePickerDialog.setTitle(this.t);
            }
            if (z2.h0(this.u)) {
                timePickerDialog.setMessage(this.u);
            }
            final ij.d<we.i2> dVar = this.v;
            timePickerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public final void onCancel(DialogInterface dialogInterface) {
                    a.b1.i(dVar, dialogInterface);
                }
            });
            final ij.d<we.i2> dVar2 = this.v;
            timePickerDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    a.b1.k(dVar2, dialogInterface);
                }
            });
            timePickerDialog.show();
        }

        public Object invoke() {
            f();
            return lj.e0.a;
        }
    }

    static final class b2 extends yj.q implements xj.l<Integer, String> {
        final Activity i;

        b2(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final String invoke(Integer num) {
            yj.p.i(num, "it");
            return (String) kotlin.collections.l.C0(nf.h.a.k(this.i)).get(num.intValue());
        }
    }

    static final class c extends yj.q implements xj.a<ji.r<we.l0>> {
        final Activity i;
        final com.joaomgcd.taskerm.util.q q;
        final com.joaomgcd.taskerm.util.q r;
        final com.joaomgcd.taskerm.util.q s;
        final com.joaomgcd.taskerm.util.q t;
        final com.joaomgcd.taskerm.util.q u;

        c(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, com.joaomgcd.taskerm.util.q qVar4, com.joaomgcd.taskerm.util.q qVar5) {
            super(0);
            this.i = activity;
            this.q = qVar;
            this.r = qVar2;
            this.s = qVar3;
            this.t = qVar4;
            this.u = qVar5;
        }

        public final ji.r<we.l0> invoke() {
            return a.e3(new we.k(this.i, this.q, this.r, this.s, this.t, this.u, false, 0, null, 0, null, null, null, 8128, null));
        }
    }

    static final class c0 extends yj.q implements xj.l<we.l0, Boolean> {
        public static final c0 i = new c0();

        c0() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return Boolean.valueOf(l0Var.n());
        }
    }

    static final class c1 extends yj.q implements xj.q<TimePicker, Integer, Integer, lj.e0> {
        final ij.d<we.i2> i;

        c1(ij.d<we.i2> dVar) {
            super(3);
            this.i = dVar;
        }

        public final void a(TimePicker timePicker, int i, int i2) {
            yj.p.i(timePicker, "view");
            this.i.b(new we.i2(i, i2));
        }

        public Object e(Object obj, Object obj2, Object obj3) {
            a((TimePicker) obj, ((Number) obj2).intValue(), ((Number) obj3).intValue());
            return lj.e0.a;
        }
    }

    static final class c2 extends yj.q implements xj.a<Integer> {
        final Activity i;

        c2(Activity activity) {
            super(0);
            this.i = activity;
        }

        public final Integer invoke() {
            if (!((s6) new e5(this.i, 0, kotlin.collections.r.d("android.permission.READ_PHONE_STATE"), 2, (yj.h) null).r(this.i).f()).b()) {
                throw new RuntimeException("Need permission");
            }
            Activity activity = this.i;
            Integer b = ((we.w1) we.x.C(new we.v1(activity, 2131889952, kotlin.collections.l.C0(nf.h.a.k(activity)), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null)).f()).b();
            if (b != null) {
                return b;
            }
            throw new RuntimeException("No SIM card selected");
        }
    }

    static final class d extends yj.q implements xj.l<Boolean, ji.v<? extends we.w1<ie.l>>> {
        final ie.l i;
        final Activity q;

        static final class C0223a extends yj.q implements xj.l<ie.l, we.k0> {
            final Activity i;

            C0223a(Activity activity) {
                super(1);
                this.i = activity;
            }

            public final we.k0 invoke(ie.l lVar) {
                yj.p.i(lVar, "it");
                return new we.k0(lVar.getName().a(this.i), null, false, 6, null);
            }
        }

        d(ie.l lVar, Activity activity) {
            super(1);
            this.i = lVar;
            this.q = activity;
        }

        public final ji.v<? extends we.w1<ie.l>> invoke(Boolean bool) {
            yj.p.i(bool, "it");
            if (this.i == null) {
                return we.x.C(new we.v1(this.q, 2131889516, (List) ie.l.a.a(), true, (xj.l) new C0223a(this.q), (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65504, (yj.h) null));
            }
            ji.r w = ji.r.w(new we.w1(new we.u1(null, null, 3, null), this.i, null, 4, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class d0 extends yj.q implements xj.a<ji.r<we.l0>> {
        final Activity i;
        final int q;
        final int r;

        d0(Activity activity, int i, int i2) {
            super(0);
            this.i = activity;
            this.q = i;
            this.r = i2;
        }

        public final ji.r<we.l0> invoke() {
            return a.n1(this.i, this.q, this.r, 2131886902, false, null, 48, null);
        }
    }

    static final class d1 extends yj.q implements xj.l<we.w1<String>, String> {
        public static final d1 i = new d1();

        d1() {
            super(1);
        }

        public final String invoke(we.w1<String> w1Var) {
            yj.p.i(w1Var, "it");
            String c = w1Var.c();
            return c == null ? "" : c;
        }
    }

    static final class d2 extends yj.q implements xj.l<we.z1<ij.d<we.l0>>, lj.e0> {
        final we.k i;

        d2(we.k kVar) {
            super(1);
            this.i = kVar;
        }

        public final void a(we.z1<ij.d<we.l0>> z1Var) {
            yj.p.i(z1Var, "it");
            com.joaomgcd.taskerm.util.q m = this.i.m();
            String b = m != null ? m.b() : null;
            com.joaomgcd.taskerm.util.q k = this.i.k();
            String b2 = k != null ? k.b() : null;
            com.joaomgcd.taskerm.util.q i = this.i.i();
            String b3 = i != null ? i.b() : null;
            com.joaomgcd.taskerm.util.q g = this.i.g();
            String b4 = g != null ? g.b() : null;
            com.joaomgcd.taskerm.util.q h = this.i.h();
            TextBoxDialogFragment I = TextBoxDialogFragment.I(z1Var, b, b2, b3, b4, h != null ? h.b() : null, this.i.e(), this.i.j(), this.i.d(), this.i.l(), this.i.f());
            I.E(this.i.a());
            this.i.n(I);
        }

        public Object invoke(Object obj) {
            a((we.z1) obj);
            return lj.e0.a;
        }
    }

    static final class e extends yj.q implements xj.l<we.w1<ie.l>, ji.v<? extends String>> {
        final Activity i;
        final int q;
        final String r;
        final boolean s;

        e(Activity activity, int i, String str, boolean z) {
            super(1);
            this.i = activity;
            this.q = i;
            this.r = str;
            this.s = z;
        }

        public final ji.v<? extends String> invoke(we.w1<ie.l> w1Var) {
            yj.p.i(w1Var, "it");
            ie.l c = w1Var.c();
            if (c != null) {
                return c.a(this.i, this.q, this.r, this.s, true);
            }
            throw new RuntimeException("No command type selected");
        }
    }

    static final class e0 extends yj.q implements xj.a<ji.r<we.l0>> {
        public static final e0 i = new e0();

        e0() {
            super(0);
        }

        public final ji.r<we.l0> invoke() {
            ji.r<we.l0> w = ji.r.w(new we.l0(1, null, 2, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class e1 extends yj.q implements xj.l<ScanResult, String> {
        public static final e1 i = new e1();

        e1() {
            super(1);
        }

        public final String invoke(ScanResult scanResult) {
            yj.p.i(scanResult, "$this$null");
            return x2.N2(scanResult);
        }
    }

    static final class e2 extends yj.q implements xj.l<we.l0, lj.e0> {
        final Activity i;
        final String q;

        e2(Activity activity, String str) {
            super(1);
            this.i = activity;
            this.q = str;
        }

        public final void a(we.l0 l0Var) {
            if (l0Var.k()) {
                ExtensionsContextKt.q(this.i, this.q, false, false, true, 6, (Object) null);
            }
        }

        public Object invoke(Object obj) {
            a((we.l0) obj);
            return lj.e0.a;
        }
    }

    static final class f extends yj.q implements xj.l<String, lj.e0> {
        final Activity i;

        f(Activity activity) {
            super(1);
            this.i = activity;
        }

        public Object invoke(Object obj) {
            invoke((String) obj);
            return lj.e0.a;
        }

        public final void invoke(String str) {
            pg.w0.E1(a.g3(this.i, 2131890835), this.i, new oi.d() {
                public final void accept(Object obj) {
                    a.f.c((l0) obj);
                }
            });
        }

        public static final void c(we.l0 l0Var) {
        }
    }

    static final class f0 extends yj.q implements xj.l<we.l0, Boolean> {
        public static final f0 i = new f0();

        f0() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return Boolean.valueOf(l0Var.n());
        }
    }

    static final class f1 extends yj.q implements xj.a<ScanResult> {
        final Activity i;
        final xj.l<ScanResult, String> q;

        static final class C0224a extends yj.q implements xj.l<ScanResult, we.k0> {
            final xj.l<ScanResult, String> i;

            C0224a(xj.l<? super ScanResult, String> lVar) {
                super(1);
                this.i = lVar;
            }

            public final we.k0 invoke(ScanResult scanResult) {
                xj.l<ScanResult, String> lVar = this.i;
                yj.p.f(scanResult);
                return new we.k0((String) lVar.invoke(scanResult), null, false, 6, null);
            }
        }

        f1(Activity activity, xj.l<? super ScanResult, String> lVar) {
            super(0);
            this.i = activity;
            this.q = lVar;
        }

        public final ScanResult invoke() {
            if (!ExtensionsContextKt.A2(this.i)) {
                if (!((we.l0) a.t3(this.i, 2131891085, 2131887266, 0, 8, null).f()).o()) {
                    throw new RuntimeException("Didn't want enable location");
                }
                s6 s6Var = (s6) new GenericActionActivityEnableLocation().run(this.i).f();
                if (!s6Var.b()) {
                    throw new RuntimeException(s6Var.a());
                }
            }
            WifiManager k2 = ExtensionsContextKt.k2(this.i);
            if (k2 == null || !k2.isWifiEnabled()) {
                throw new RuntimeException("Wifi is disabled on your device");
            }
            List m1 = ExtensionsContextKt.m1(this.i);
            xj.l<ScanResult, String> lVar = this.q;
            HashSet hashSet = new HashSet();
            ArrayList arrayList = new ArrayList();
            for (Object obj : m1) {
                ScanResult scanResult = (ScanResult) obj;
                yj.p.f(scanResult);
                if (hashSet.add((String) lVar.invoke(scanResult))) {
                    arrayList.add(obj);
                }
            }
            xj.l<ScanResult, String> lVar2 = this.q;
            ArrayList arrayList2 = new ArrayList();
            for (Object obj2 : arrayList) {
                ScanResult scanResult2 = (ScanResult) obj2;
                yj.p.f(scanResult2);
                if (z2.h0((String) lVar2.invoke(scanResult2))) {
                    arrayList2.add(obj2);
                }
            }
            ScanResult scanResult3 = (ScanResult) ((we.w1) we.x.C(new we.v1(this.i, 2131890078, (List) arrayList2, false, (xj.l) new C0224a(this.q), (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65512, (yj.h) null)).f()).c();
            if (scanResult3 != null) {
                return scanResult3;
            }
            throw new RuntimeException("No network selected");
        }
    }

    static final class f2 extends yj.q implements xj.a<ji.r<we.l0>> {
        public static final f2 i = new f2();

        f2() {
            super(0);
        }

        public final ji.r<we.l0> invoke() {
            ji.r<we.l0> w = ji.r.w(new we.l0(1, null, 2, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class g extends yj.q implements xj.l<Boolean, ji.v<? extends we.l0>> {
        final Activity i;

        g(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final ji.v<? extends we.l0> invoke(Boolean bool) {
            yj.p.i(bool, "isRootGiven");
            if (bool.booleanValue()) {
                return a.v1(this.i, 2131886233, 2131887117, 0, 0, null, 56, null);
            }
            Activity activity = this.i;
            return a.t2(activity, "adb_wifi", "android.permission.ADB_WIFI", x2.Q4(2131887116, activity, new Object[]{ExtensionsContextKt.Z(activity)}), false, false, false, 80, null);
        }
    }

    static final class g0 extends yj.q implements xj.a<ji.r<we.l0>> {
        final Activity i;
        final int q;
        final String r;
        final int s;
        final int t;

        g0(Activity activity, int i, String str, int i2, int i3) {
            super(0);
            this.i = activity;
            this.q = i;
            this.r = str;
            this.s = i2;
            this.t = i3;
        }

        public final ji.r<we.l0> invoke() {
            return a.e3(new we.k(this.i, this.q, this.r, this.s, this.t, 2131886902, false, 0, (String) null, 0, (Integer) null, 1984, (yj.h) null));
        }
    }

    static final class g1 extends yj.q implements xj.l<ScanResult, String> {
        public static final g1 i = new g1();

        g1() {
            super(1);
        }

        public final String invoke(ScanResult scanResult) {
            yj.p.i(scanResult, "$this$null");
            return x2.N2(scanResult);
        }
    }

    static final class g2 extends yj.q implements xj.l<we.l0, Boolean> {
        public static final g2 i = new g2();

        g2() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return Boolean.valueOf(l0Var.n());
        }
    }

    static final class h extends yj.q implements xj.l<we.l0, pe.g> {
        public static final h i = new h();

        h() {
            super(1);
        }

        public final pe.g invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return !l0Var.k() ? new pe.g(false) : new pe.g(true);
        }
    }

    static final class h0 extends yj.q implements xj.l<we.l0, lj.e0> {
        final xj.a<lj.e0> i;
        final Activity q;

        h0(xj.a<lj.e0> aVar, Activity activity) {
            super(1);
            this.i = aVar;
            this.q = activity;
        }

        public final void a(we.l0 l0Var) {
            xj.a<lj.e0> aVar;
            yj.p.i(l0Var, "it");
            if (l0Var.o() && (aVar = this.i) != null) {
                aVar.invoke();
            }
            if (l0Var.k()) {
                xj.a<lj.e0> aVar2 = this.i;
                if (aVar2 != null) {
                    aVar2.invoke();
                }
                ExtensionsContextKt.q(this.q, "https://tasker.joaoapps.com/userguide/en/variables.html#json", false, false, false, 14, (Object) null);
            }
        }

        public Object invoke(Object obj) {
            a((we.l0) obj);
            return lj.e0.a;
        }
    }

    static final class h1 extends yj.q implements xj.l<ScanResult, ji.v<? extends String>> {
        final Activity i;

        static final class C0225a extends yj.q implements xj.l<we.l0, String> {
            final ScanResult i;

            C0225a(ScanResult scanResult) {
                super(1);
                this.i = scanResult;
            }

            public final String invoke(we.l0 l0Var) {
                yj.p.i(l0Var, "it");
                return l0Var.k() ? this.i.BSSID : this.i.SSID;
            }
        }

        h1(Activity activity) {
            super(1);
            this.i = activity;
        }

        public static final String d(xj.l lVar, Object obj) {
            yj.p.i(lVar, "$tmp0");
            yj.p.i(obj, "p0");
            return (String) lVar.invoke(obj);
        }

        public final ji.v<? extends String> invoke(ScanResult scanResult) {
            yj.p.i(scanResult, "scanResult");
            Activity activity = this.i;
            ji.r<we.l0> K = a.K(activity, x2.H4(2131889796, activity), x2.H4(2131889797, this.i), x2.H4(2131889790, this.i), x2.H4(2131889742, this.i));
            final C0225a c0225a = new C0225a(scanResult);
            return K.x(new oi.e() {
                public final Object a(Object obj) {
                    String d;
                    d = a.h1.d(c0225a, obj);
                    return d;
                }
            });
        }
    }

    static final class h2 extends yj.q implements xj.a<ji.r<we.l0>> {
        final Activity i;
        final int q;
        final int r;

        h2(Activity activity, int i, int i2) {
            super(0);
            this.i = activity;
            this.q = i;
            this.r = i2;
        }

        public final ji.r<we.l0> invoke() {
            return a.p3(this.i, this.q, this.r, 2131886902);
        }
    }

    static final class i extends yj.q implements xj.l<we.z1<ij.d<we.l0>>, lj.e0> {
        final Activity i;

        i(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final void a(we.z1<ij.d<we.l0>> z1Var) {
            yj.p.i(z1Var, "it");
            sp.t0(this.i, z1Var).E(this.i);
        }

        public Object invoke(Object obj) {
            a((we.z1) obj);
            return lj.e0.a;
        }
    }

    static final class i0 extends yj.q implements xj.l<BluetoothDevice, we.k0> {
        public static final i0 i = new i0();

        i0() {
            super(1);
        }

        public final we.k0 invoke(BluetoothDevice bluetoothDevice) {
            yj.p.i(bluetoothDevice, "it");
            return new we.k0(x2.E1(bluetoothDevice), null, false, 6, null);
        }
    }

    static final class i1 extends yj.q implements xj.l<we.l0, ji.v<? extends we.l0>> {
        final Activity i;

        i1(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final ji.v<? extends we.l0> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return !l0Var.o() ? ji.r.w(l0Var) : a.m2(this.i);
        }
    }

    static final class i2 extends yj.q implements xj.l<Message, we.l0> {
        public static final i2 i = new i2();

        i2() {
            super(1);
        }

        public final we.l0 invoke(Message message) {
            yj.p.i(message, "it");
            return new we.l0(message);
        }
    }

    static final class j extends yj.q implements xj.l<we.w1<String>, String> {
        public static final j i = new j();

        j() {
            super(1);
        }

        public final String invoke(we.w1<String> w1Var) {
            yj.p.i(w1Var, "it");
            String c = w1Var.c();
            if (c == null) {
                throw new RuntimeException("Nothing selected");
            }
            String lowerCase = c.toLowerCase();
            yj.p.h(lowerCase, "toLowerCase(...)");
            return String.valueOf(Boolean.parseBoolean(lowerCase));
        }
    }

    static final class j0 extends yj.q implements xj.l<we.l0, ComponentNameList> {
        public static final j0 i = new j0();

        j0() {
            super(1);
        }

        public final ComponentNameList invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return new ComponentNameList();
        }
    }

    static final class j1 extends yj.q implements xj.a<s6> {
        final Activity i;
        final boolean q;
        final rg.u r;

        j1(Activity activity, boolean z, rg.u uVar) {
            super(0);
            this.i = activity;
            this.q = z;
            this.r = uVar;
        }

        private static final rg.v0 c(Activity activity, rg.u uVar, boolean z) {
            com.joaomgcd.taskerm.dialog.l e = l.a.e(com.joaomgcd.taskerm.dialog.l.c, activity, 2131887198, false, 4, null);
            v0.a aVar = rg.v0.i;
            if (!z) {
                uVar = null;
            }
            rg.v0 v0Var = (rg.v0) aVar.a(activity, uVar).f();
            com.joaomgcd.taskerm.dialog.l.e(e, null, 1, null);
            yj.p.f(v0Var);
            return v0Var;
        }

        static rg.v0 d(Activity activity, rg.u uVar, boolean z, int i, Object obj) {
            if ((i & 4) != 0) {
                z = false;
            }
            return c(activity, uVar, z);
        }

        public final s6 invoke() {
            rg.v0 v0Var = a.a;
            if (v0Var == null) {
                if (((we.l0) a.e3(new we.k(this.i, 2131887416, 2131887359, 2131888863, 2131887416, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null)).f()).k()) {
                    Activity activity = this.i;
                    rg.w wVar = (rg.w) ((we.w1) we.x.C(new we.v1(activity, 2131887416, (List) c(activity, this.r, true), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null)).f()).c();
                    return wVar == null ? new t6("no setting selected") : new w6(wVar);
                }
                a.a = d(this.i, this.r, false, 4, null);
                a.e3(new we.k(this.i, 2131887416, 2131887289, 0, 0, 0, false, 0, (String) null, 0, (Integer) null, 2040, (yj.h) null)).f();
                return new v6();
            }
            a.a = null;
            rg.w0 w0Var = (rg.w0) d(this.i, this.r, false, 4, null).t(v0Var).f();
            if (w0Var.size() == 0) {
                a.e3(new we.k(this.i, 2131887416, 2131889251, 0, 0, 0, false, 0, (String) null, 0, (Integer) null, 2040, (yj.h) null)).f();
                return new t6("no differences found");
            }
            Activity activity2 = this.i;
            yj.p.f(w0Var);
            rg.x xVar = (rg.x) ((we.w1) we.x.C(new we.v1(activity2, 2131887416, (List) w0Var, false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null)).f()).c();
            if (xVar == null) {
                return new t6("no setting selected");
            }
            if (this.q && xVar.b().h() && xVar.a().h() && ((we.l0) a.t3(this.i, 2131887416, 2131887235, 0, 8, null).f()).o()) {
                xVar.a().j(rg.j0.a);
            }
            return new w6(xVar.a());
        }
    }

    static final class j2<TDialogMessage> extends yj.q implements xj.a<ji.r<TDialogMessage>> {
        final xj.l<we.z1<ij.d<TDialogMessage>>, lj.e0> i;
        final xj.l<Message, TDialogMessage> q;
        final xj.l<TDialogMessage, Boolean> r;

        static final class C0226a extends yj.q implements xj.p<ij.d<TDialogMessage>, Message, lj.e0> {
            final xj.l<Message, TDialogMessage> i;
            final xj.l<TDialogMessage, Boolean> q;

            C0226a(xj.l<? super Message, ? extends TDialogMessage> lVar, xj.l<? super TDialogMessage, Boolean> lVar2) {
                super(2);
                this.i = lVar;
                this.q = lVar2;
            }

            public final void a(ij.d<TDialogMessage> dVar, Message message) {
                yj.p.i(dVar, "singleSubject");
                yj.p.i(message, "message");
                we.l0 l0Var = (we.l0) this.i.invoke(message);
                xj.l<TDialogMessage, Boolean> lVar = this.q;
                if (lVar == null || !((Boolean) lVar.invoke(l0Var)).booleanValue()) {
                    dVar.b(l0Var);
                }
            }

            public Object l(Object obj, Object obj2) {
                a((ij.d) obj, (Message) obj2);
                return lj.e0.a;
            }
        }

        j2(xj.l<? super we.z1<ij.d<TDialogMessage>>, lj.e0> lVar, xj.l<? super Message, ? extends TDialogMessage> lVar2, xj.l<? super TDialogMessage, Boolean> lVar3) {
            super(0);
            this.i = lVar;
            this.q = lVar2;
            this.r = lVar3;
        }

        public final ji.r<TDialogMessage> invoke() {
            ij.d V = ij.d.V();
            yj.p.h(V, "create(...)");
            this.i.invoke(new we.z1(V, new C0226a(this.q, this.r)));
            return V;
        }
    }

    static final class k extends yj.q implements xj.l<we.z1<ij.d<we.l0>>, lj.e0> {
        final Activity i;
        final e5.l q;
        final boolean r;

        k(Activity activity, e5.l lVar, boolean z) {
            super(1);
            this.i = activity;
            this.q = lVar;
            this.r = z;
        }

        public final void a(we.z1<ij.d<we.l0>> z1Var) {
            yj.p.i(z1Var, "it");
            net.dinglisch.android.taskerm.e5.D(this.i, z1Var, this.q, this.r, false).C(this.i);
        }

        public Object invoke(Object obj) {
            a((we.z1) obj);
            return lj.e0.a;
        }
    }

    static final class k0 extends yj.q implements xj.a<ComponentNameList> {
        final Activity i;
        final List<ComponentName> q;

        static final class C0227a extends yj.q implements xj.l<com.joaomgcd.taskerm.util.a, we.k0> {
            final List<ComponentName> i;

            C0227a(List<ComponentName> list) {
                super(1);
                this.i = list;
            }

            public final we.k0 invoke(com.joaomgcd.taskerm.util.a aVar) {
                yj.p.i(aVar, "it");
                String c = aVar.c();
                if (c == null) {
                    c = "Unknown Service";
                }
                return new we.k0(c, null, this.i.contains(aVar.d()), 2, null);
            }
        }

        k0(Activity activity, List<ComponentName> list) {
            super(0);
            this.i = activity;
            this.q = list;
        }

        public final ComponentNameList invoke() {
            List B = ExtensionsContextKt.B(this.i);
            Activity activity = this.i;
            List c = ((k2) we.x.n(new we.h(activity, x2.H4(2131886230, activity), B, false, new C0227a(this.q), null, null, null, null, null, null, null, null, null, null, null, 65512, null)).f()).c();
            ArrayList arrayList = new ArrayList(kotlin.collections.r.v(c, 10));
            Iterator it = c.iterator();
            while (it.hasNext()) {
                arrayList.add(((com.joaomgcd.taskerm.util.a) it.next()).d());
            }
            return new ComponentNameList(arrayList);
        }
    }

    static final class k1 extends yj.q implements xj.l<we.l0, ji.v<? extends we.l0>> {
        final boolean i;
        final Activity q;
        final boolean r;
        final String s;
        final boolean t;
        final String u;

        static final class C0228a extends yj.q implements xj.a<we.l0> {
            final boolean i;
            final Activity q;
            final boolean r;
            final String s;
            final boolean t;
            final String u;

            static final class C0229a extends yj.q implements xj.l<Throwable, ji.v<? extends we.l0>> {
                public static final C0229a i = new C0229a();

                C0229a() {
                    super(1);
                }

                public final ji.v<? extends we.l0> invoke(Throwable th) {
                    yj.p.i(th, "<anonymous parameter 0>");
                    return ji.r.w(new we.l0(0, null, 2, null));
                }
            }

            C0228a(boolean z, Activity activity, boolean z2, String str, boolean z3, String str2) {
                super(0);
                this.i = z;
                this.q = activity;
                this.r = z2;
                this.s = str;
                this.t = z3;
                this.u = str2;
            }

            private static final we.l0 d(Activity activity, String str) {
                com.joaomgcd.taskerm.util.e5 H = e5.a.H(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null);
                if (!H.A()) {
                    ji.r<we.l0> d1 = a.d1(activity, 2131887551, 2131887350);
                    final C0229a c0229a = C0229a.i;
                    d1.C(new oi.e() {
                        public final Object a(Object obj) {
                            v f;
                            f = a.k1.C0228a.f(c0229a, obj);
                            return f;
                        }
                    }).f();
                }
                if (!((s6) H.r(activity).f()).b()) {
                    return new we.l0(1, null, 2, null);
                }
                ActionEdit.q5(activity, str, (String) null);
                return new we.l0(0, null, 2, null);
            }

            public static final ji.v f(xj.l lVar, Object obj) {
                yj.p.i(lVar, "$tmp0");
                yj.p.i(obj, "p0");
                return (ji.v) lVar.invoke(obj);
            }

            public final we.l0 invoke() {
                StringBuilder sb2;
                if (!this.i || !((Boolean) s5.r(this.q).f()).booleanValue()) {
                    return d(this.q, this.u);
                }
                if (!((we.l0) a.e3(new we.k(this.q, 2131890048, 2131887328, 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null)).f()).o()) {
                    return d(this.q, this.u);
                }
                if (this.r) {
                    String packageName = this.q.getPackageName();
                    String str = this.s;
                    sb2 = new StringBuilder();
                    sb2.append("appops set ");
                    sb2.append(packageName);
                    sb2.append(" ");
                    sb2.append(str);
                    sb2.append(" allow");
                } else {
                    String packageName2 = this.q.getPackageName();
                    String str2 = this.s;
                    sb2 = new StringBuilder();
                    sb2.append("pm grant ");
                    sb2.append(packageName2);
                    sb2.append(" ");
                    sb2.append(str2);
                }
                String sb3 = sb2.toString();
                r6.b bVar = r6.a;
                if (((h6) bVar.d(new com.joaomgcd.taskerm.util.y(sb3, true, 10000L, false, 8, (yj.h) null)).f()).f()) {
                    a.e3(new we.k(this.q, 2131886873, 2131887295, 2131886891, 0, 0, false, 0, (String) null, 0, (Integer) null, 2032, (yj.h) null)).f();
                }
                if (this.t) {
                    a.d1(this.q, 2131887528, 2131887311).f();
                    bVar.d(new com.joaomgcd.taskerm.util.y("am force-stop " + this.q.getPackageName(), true, 10000L, false, 8, (yj.h) null)).f();
                }
                return new we.l0(0, null, 2, null);
            }
        }

        k1(boolean z, Activity activity, boolean z2, String str, boolean z3, String str2) {
            super(1);
            this.i = z;
            this.q = activity;
            this.r = z2;
            this.s = str;
            this.t = z3;
            this.u = str2;
        }

        public final ji.v<? extends we.l0> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return l0Var.o() ? pg.w0.K0(new C0228a(this.i, this.q, this.r, this.s, this.t, this.u)) : ji.r.w(l0Var);
        }
    }

    static final class l extends yj.q implements xj.l<we.l0, String> {
        final Activity i;

        l(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final String invoke(we.l0 l0Var) {
            Integer g;
            String uri;
            yj.p.i(l0Var, "it");
            Bundle b = l0Var.b();
            if (b == null || (g = l0Var.g()) == null || g.intValue() != 1) {
                throw new RuntimeException("Not selected");
            }
            String string = b.getString("name");
            int i = b.getInt("tint", 0);
            net.dinglisch.android.taskerm.g gVar = new net.dinglisch.android.taskerm.g(string);
            if (i != 0) {
                gVar.v0(i);
            }
            Uri y0 = gVar.y0(this.i);
            if (y0 == null || (uri = y0.toString()) == null) {
                throw new RuntimeException("Invalid icon");
            }
            return uri;
        }
    }

    static final class l0 extends yj.q implements xj.l<we.z1<ij.d<we.l0>>, lj.e0> {
        final Activity i;
        final int q;

        l0(Activity activity, int i) {
            super(1);
            this.i = activity;
            this.q = i;
        }

        public final void a(we.z1<ij.d<we.l0>> z1Var) {
            yj.p.i(z1Var, "it");
            net.dinglisch.android.taskerm.b1.y(this.i, z1Var, this.q).x(this.i);
        }

        public Object invoke(Object obj) {
            a((we.z1) obj);
            return lj.e0.a;
        }
    }

    static final class l1 extends yj.q implements xj.l<s6, x6<String, com.joaomgcd.taskerm.util.r1>> {
        public static final l1 i = new l1();

        l1() {
            super(1);
        }

        public final x6<String, com.joaomgcd.taskerm.util.r1> invoke(s6 s6Var) {
            yj.p.i(s6Var, "it");
            return s6Var instanceof x6 ? (x6) s6Var : s6Var instanceof t6 ? new x6<>(false, (Object) null, new com.joaomgcd.taskerm.util.r1(((t6) s6Var).c())) : new x6<>(false, (Object) null, new com.joaomgcd.taskerm.util.r1("Unknown error"));
        }
    }

    static final class m extends yj.q implements xj.a<jf.d> {
        final Activity i;

        static final class C0230a extends yj.q implements xj.l<String, we.k0> {
            public static final C0230a i = new C0230a();

            C0230a() {
                super(1);
            }

            public final we.k0 invoke(String str) {
                yj.p.f(str);
                return new we.k0(str, null, false, 6, null);
            }
        }

        static final class b extends yj.q implements xj.l<String, we.k0> {
            final Activity i;

            b(Activity activity) {
                super(1);
                this.i = activity;
            }

            public final we.k0 invoke(String str) {
                yj.p.i(str, "path");
                return new we.k0(g8.I(g8.d0(this.i, str), this.i, str), null, false, 6, null);
            }
        }

        m(Activity activity) {
            super(0);
            this.i = activity;
        }

        private static final jf.d c(jf.d dVar, Activity activity) {
            yj.j0 j0Var = new yj.j0();
            j0Var.i = dVar.z().getAbsoluteFile();
            String d = d(activity, j0Var);
            if (d != null) {
                j0Var.i = new File(d);
            }
            if (h4.E(activity, (File) j0Var.i, true, true)) {
                Object obj = j0Var.i;
                yj.p.h(obj, "element");
                return jf.a.d(activity, (File) obj, false, 2, (Object) null);
            }
            if (!((we.l0) a.n1(activity, 2131888876, 2131887263, 0, false, null, 56, null).f()).o()) {
                throw new RuntimeException("Doesn't have needed permission");
            }
            x6 x6Var = (s6) new GenericActionActivityGrantUriPermission(dVar.z()).run(activity).f();
            if (!x6Var.b()) {
                throw new RuntimeException(x6Var.a());
            }
            x6 x6Var2 = x6Var instanceof x6 ? x6Var : null;
            jf.d dVar2 = x6Var2 != null ? (jf.d) x6Var2.d() : null;
            if (dVar2 != null) {
                return dVar2;
            }
            if (h4.E(activity, (File) j0Var.i, true, true)) {
                return dVar;
            }
            throw new RuntimeException("Doesn't have access to " + j0Var.i);
        }

        private static final String d(Activity activity, yj.j0<File> j0Var) {
            Uri uri;
            List<UriPermission> a = yd.z.a(activity.getContentResolver());
            if (a != null && !a.isEmpty()) {
                String absolutePath = ((File) j0Var.i).getAbsolutePath();
                yj.p.f(a);
                for (UriPermission uriPermission : a) {
                    if (uriPermission != null && (uri = uriPermission.getUri()) != null) {
                        yj.p.f(uri);
                        String W = g8.W(uri, activity);
                        if (W == null) {
                            continue;
                        } else {
                            yj.p.f(absolutePath);
                            if (hk.o.N(W, absolutePath, false, 2, (Object) null)) {
                                return W;
                            }
                        }
                    }
                }
            }
            return null;
        }

        public final jf.d invoke() {
            ArrayList t = h4.t(this.i);
            if (t.size() == 1) {
                Activity activity = this.i;
                yj.p.f(t);
                Object d0 = kotlin.collections.r.d0(t);
                yj.p.h(d0, "first(...)");
                return c(jf.a.e(activity, (String) d0, false, 2, (Object) null), this.i);
            }
            Activity activity2 = this.i;
            yj.p.f(t);
            we.w1 w1Var = (we.w1) we.x.C(new we.v1(activity2, 2131887755, (List) t, true, com.joaomgcd.taskerm.util.k.a.o() ? C0230a.i : new b(this.i), (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, Boolean.FALSE, 32736, (yj.h) null)).f();
            Activity activity3 = this.i;
            String str = (String) w1Var.c();
            if (str != null) {
                return c(jf.a.e(activity3, str, false, 2, (Object) null), this.i);
            }
            throw new RuntimeException("Nothing selected");
        }
    }

    static final class m0 extends yj.q implements xj.a<ContactData> {
        final String i;
        final com.joaomgcd.taskerm.genericaction.b q;
        final Long r;
        final Context s;

        m0(String str, com.joaomgcd.taskerm.genericaction.b bVar, Long l, Context context) {
            super(0);
            this.i = str;
            this.q = bVar;
            this.r = l;
            this.s = context;
        }

        public final ContactData invoke() {
            ContactData contactData;
            String str = this.i;
            x6 x6Var = (s6) ((str == null || str.length() == 0) ? new GenericActionPickContact(this.q, this.r) : new GenericActionPickContactWithMimeType(this.i)).run(this.s).f();
            if (!x6Var.b()) {
                throw new RuntimeException(x6Var.a());
            }
            x6 x6Var2 = x6Var instanceof x6 ? x6Var : null;
            if (x6Var2 == null || (contactData = (ContactData) x6Var2.d()) == null) {
                throw new RuntimeException("Couldn't get contact");
            }
            return contactData;
        }
    }

    static final class m1 extends yj.q implements xj.a<String> {
        final Activity i;

        static final class C0231a extends yj.q implements xj.a<String> {
            final Activity i;

            C0231a(Activity activity) {
                super(0);
                this.i = activity;
            }

            public final String invoke() {
                return ((we.l0) a.o1(this.i, 2131887225, "1", 0, true, null, 40, null).f()).c();
            }
        }

        static final class b extends yj.q implements xj.a<String> {
            final Activity i;

            b(Activity activity) {
                super(0);
                this.i = activity;
            }

            public final String invoke() {
                String c = ((we.l0) a.o1(this.i, 2131887225, "0", 0, true, null, 40, null).f()).c();
                if (c == null || c.length() == 0) {
                    return "";
                }
                String c2 = ((we.l0) a.o1(this.i, 2131887333, "", 0, true, null, 40, null).f()).c();
                return bg.b.m.a(c, c2 != null ? c2 : "");
            }
        }

        m1(Activity activity) {
            super(0);
            this.i = activity;
        }

        public final String invoke() {
            String str;
            Activity activity = this.i;
            we.l lVar = new we.l(activity, 2131887358, new C0231a(activity));
            Activity activity2 = this.i;
            we.l lVar2 = (we.l) ((we.w1) we.x.C(new we.v1(this.i, 2131887545, (List) kotlin.collections.r.f(new we.l[]{lVar, new we.l(activity2, 2131887351, new b(activity2))}), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65520, (yj.h) null)).f()).c();
            return (lVar2 == null || (str = (String) lVar2.a().invoke()) == null) ? "" : str;
        }
    }

    static final class n extends yj.q implements xj.a<we.l0> {
        final we.c i;

        n(we.c cVar) {
            super(0);
            this.i = cVar;
        }

        public final we.l0 invoke() {
            try {
                new ActionDialogHTML(this.i.b(), this.i.c()).run(this.i.a()).f();
                return new we.l0(0, null, 2, null);
            } catch (Exception unused) {
                return new we.l0(1, null, 2, null);
            }
        }
    }

    static final class n0 extends yj.q implements xj.a<String> {
        final Activity i;
        final Long q;

        n0(Activity activity, Long l) {
            super(0);
            this.i = activity;
            this.q = l;
        }

        public final String invoke() {
            Activity activity = this.i;
            String[] i = vh.i(activity, 2130903082);
            yj.p.h(i, "getStringArray(...)");
            Integer b = ((we.w1) we.x.C(new we.v1(activity, 2131886279, kotlin.collections.l.C0(i), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null)).f()).b();
            if (b == null) {
                throw new RuntimeException("Did not select a group");
            }
            int intValue = b.intValue();
            if (intValue == 0) {
                String name = ((ContactData) a.I1(this.i, null, com.joaomgcd.taskerm.genericaction.b.q, this.q, 2, null).f()).getName();
                if (name != null) {
                    return name;
                }
                throw new RuntimeException("Contact doesn't have a name");
            }
            if (intValue == 1) {
                return "C:FAV";
            }
            if (intValue != 2) {
                return "C:ANY";
            }
            String[] g = eh.g(this.i, false);
            Activity activity2 = this.i;
            yj.p.f(g);
            String str = (String) ((we.w1) we.x.C(new we.v1(activity2, 2131886279, kotlin.collections.l.C0(g), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null)).f()).c();
            if (str != null) {
                String str2 = "CG:" + str;
                if (str2 != null) {
                    return str2;
                }
            }
            throw new RuntimeException("No contact group selected");
        }
    }

    static final class n1 extends yj.q implements xj.a<String> {
        final Context i;
        final boolean q;
        final String r;
        final Long s;
        final boolean t;
        final boolean u;

        n1(Context context, boolean z, String str, Long l, boolean z2, boolean z3) {
            super(0);
            this.i = context;
            this.q = z;
            this.r = str;
            this.s = l;
            this.t = z2;
            this.u = z3;
        }

        public final String invoke() {
            Intent intent;
            ji.r z4;
            Context context = this.i;
            if ((context instanceof Activity) && ((Boolean) e5.a.q1(com.joaomgcd.taskerm.util.e5.f, (Activity) context, 0, 2, (Object) null).f()).booleanValue()) {
                throw new RuntimeException("No file read permissions");
            }
            if (this.q) {
                intent = FileSelect.u0(this.i, (String) null, this.r, FileSelect.e.q, (String) null, true, true);
            } else {
                Intent w = h4.w(true);
                w.putExtra("android.provider.extra.INITIAL_URI", z2.n(this.r));
                w.putExtra("android.intent.extra.LOCAL_ONLY", true);
                intent = w;
            }
            if (this.q) {
                yj.p.f(intent);
                z4 = x2.w4(intent, this.i, (Integer) null, (Integer) null, this.s, 6, (Object) null);
            } else {
                yj.p.f(intent);
                z4 = x2.z4(intent, this.i, (Integer) null, (Integer) null, this.s, 6, (Object) null);
            }
            return (String) kotlin.collections.l.Q(g8.F((Intent) z4.f(), this.i, this.q, this.t, this.u).toArray(new String[0]));
        }
    }

    static final class o extends yj.q implements xj.l<we.l0, String> {
        public static final o i = new o();

        o() {
            super(1);
        }

        public final String invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            String c = l0Var.c();
            if (c != null) {
                return c;
            }
            throw new RuntimeException("No text entered");
        }
    }

    static final class o0 extends yj.q implements xj.a<lj.e0> {
        final Activity i;
        final xj.r<DatePicker, Integer, Integer, Integer, lj.e0> q;
        final we.h2 r;
        final Calendar s;
        final String t;
        final String u;
        final ij.d<we.h2> v;

        o0(Activity activity, xj.r<? super DatePicker, ? super Integer, ? super Integer, ? super Integer, lj.e0> rVar, we.h2 h2Var, Calendar calendar, String str, String str2, ij.d<we.h2> dVar) {
            super(0);
            this.i = activity;
            this.q = rVar;
            this.r = h2Var;
            this.s = calendar;
            this.t = str;
            this.u = str2;
            this.v = dVar;
        }

        public static final void g(xj.r rVar, DatePicker datePicker, int i, int i2, int i3) {
            yj.p.i(rVar, "$tmp0");
            rVar.h(datePicker, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3));
        }

        public static final void i(ij.d dVar, DialogInterface dialogInterface) {
            yj.p.i(dVar, "$result");
            pg.w0.n1(dVar, new RuntimeException("Cancelled"));
        }

        public static final void k(ij.d dVar, DialogInterface dialogInterface) {
            yj.p.i(dVar, "$result");
            pg.w0.n1(dVar, new RuntimeException("Dismissed"));
        }

        public final void f() {
            Activity activity = this.i;
            final xj.r<DatePicker, Integer, Integer, Integer, lj.e0> rVar = this.q;
            DatePickerDialog.OnDateSetListener onDateSetListener = new DatePickerDialog.OnDateSetListener() {
                @Override
                public final void onDateSet(DatePicker datePicker, int i, int i2, int i3) {
                    a.o0.g(rVar, datePicker, i, i2, i3);
                }
            };
            we.h2 h2Var = this.r;
            int c = h2Var != null ? h2Var.c() : this.s.get(1);
            we.h2 h2Var2 = this.r;
            int b = h2Var2 != null ? h2Var2.b() - 1 : this.s.get(2);
            we.h2 h2Var3 = this.r;
            DatePickerDialog datePickerDialog = new DatePickerDialog(activity, onDateSetListener, c, b, h2Var3 != null ? h2Var3.a() : this.s.get(5));
            String str = this.t;
            String str2 = this.u;
            final ij.d<we.h2> dVar = this.v;
            if (z2.h0(str)) {
                datePickerDialog.setTitle(str);
            }
            if (z2.h0(str2)) {
                datePickerDialog.setMessage(str2);
            }
            datePickerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public final void onCancel(DialogInterface dialogInterface) {
                    a.o0.i(dVar, dialogInterface);
                }
            });
            datePickerDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    a.o0.k(dVar, dialogInterface);
                }
            });
            datePickerDialog.show();
        }

        public Object invoke() {
            f();
            return lj.e0.a;
        }
    }

    static final class o1 extends yj.q implements xj.a<String[]> {
        final Context i;
        final boolean q;
        final boolean r;
        final String s;
        final Long t;
        final boolean u;
        final boolean v;
        final String w;

        o1(Context context, boolean z, boolean z2, String str, Long l, boolean z3, boolean z4, String str2) {
            super(0);
            this.i = context;
            this.q = z;
            this.r = z2;
            this.s = str;
            this.t = l;
            this.u = z3;
            this.v = z4;
            this.w = str2;
        }

        public final String[] invoke() {
            Intent intent;
            ji.r y4;
            Context context = this.i;
            if ((context instanceof Activity) && ((Boolean) e5.a.q1(com.joaomgcd.taskerm.util.e5.f, (Activity) context, 0, 2, (Object) null).f()).booleanValue()) {
                throw new RuntimeException("No file read permissions");
            }
            if (!this.q || this.r) {
                intent = new Intent("android.intent.action.OPEN_DOCUMENT");
                String str = this.w;
                boolean z = this.r;
                String str2 = this.s;
                intent.setType(str);
                intent.putExtra("android.intent.extra.ALLOW_MULTIPLE", z);
                intent.putExtra("android.provider.extra.INITIAL_URI", z2.n(str2));
                intent.putExtra("android.intent.extra.LOCAL_ONLY", true);
            } else {
                intent = FileSelect.u0(this.i, (String) null, this.s, FileSelect.e.i, (String) null, true, true);
            }
            Pair pair = this.q ? null : new Pair(2131889418, 2131889419);
            if (this.q) {
                yj.p.f(intent);
                y4 = x2.v4(intent, this.i, pair != null ? (Integer) pair.getFirst() : null, pair != null ? (Integer) pair.getSecond() : null, this.t);
            } else {
                yj.p.f(intent);
                y4 = x2.y4(intent, this.i, pair != null ? (Integer) pair.getFirst() : null, pair != null ? (Integer) pair.getSecond() : null, this.t);
            }
            return (String[]) g8.F((Intent) y4.f(), this.i, this.q, this.u, this.v).toArray(new String[0]);
        }
    }

    static final class p extends yj.q implements xj.l<we.l0, Boolean> {
        public static final p i = new p();

        p() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "dialogMessage");
            return Boolean.valueOf(l0Var.o() || l0Var.n());
        }
    }

    static final class p0 extends yj.q implements xj.r<DatePicker, Integer, Integer, Integer, lj.e0> {
        final ij.d<we.h2> i;

        p0(ij.d<we.h2> dVar) {
            super(4);
            this.i = dVar;
        }

        public final void a(DatePicker datePicker, int i, int i2, int i3) {
            yj.p.i(datePicker, "view");
            this.i.b(new we.h2(i, i2 + 1, i3));
        }

        public Object h(Object obj, Object obj2, Object obj3, Object obj4) {
            a((DatePicker) obj, ((Number) obj2).intValue(), ((Number) obj3).intValue(), ((Number) obj4).intValue());
            return lj.e0.a;
        }
    }

    @qj.f(c = "com.joaomgcd.taskerm.dialog.DialogMessageKt", f = "DialogMessage.kt", l = {1614}, m = "dialogSelectFileSuspend")
    static final class p1 extends qj.d {
        Object s;
        int t;

        p1(oj.d<? super p1> dVar) {
            super(dVar);
        }

        public final Object r(Object obj) {
            this.s = obj;
            this.t |= Integer.MIN_VALUE;
            return a.D2(null, null, null, this);
        }
    }

    static final class q extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        q(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (l0Var.o()) {
                return new GenericActionActivityRequestMissingPermissions(new String[]{"android.permission.BODY_SENSORS_BACKGROUND"}, (String) null, 2, (yj.h) null).run(this.i);
            }
            ji.r w = ji.r.w(this.q);
            yj.p.f(w);
            return w;
        }
    }

    static final class q0 extends yj.q implements xj.l<Locale, we.k0> {
        public static final q0 i = new q0();

        q0() {
            super(1);
        }

        public final we.k0 invoke(Locale locale) {
            return new we.k0(locale.getDisplayLanguage() + "/" + locale.getDisplayCountry(), null, false, 6, null);
        }
    }

    static final class q1 extends yj.q implements xj.a<String[]> {
        final Activity i;
        final boolean q;
        final String r;
        final Long s;
        final boolean t;
        final boolean u;
        final boolean v;
        final boolean w;
        final boolean x;
        final boolean y;

        static final class C0232a extends yj.q implements xj.l<Integer, we.k0> {
            final Activity i;

            C0232a(Activity activity) {
                super(1);
                this.i = activity;
            }

            public final we.k0 a(int i) {
                return new we.k0(x2.Q4(i, this.i, new Object[0]), null, false, 6, null);
            }

            public Object invoke(Object obj) {
                return a(((Number) obj).intValue());
            }
        }

        static final class b extends yj.q implements xj.l<Pair<? extends Integer, ? extends Integer>, we.k0> {
            final Activity i;

            b(Activity activity) {
                super(1);
                this.i = activity;
            }

            public final we.k0 invoke(Pair<Integer, Integer> pair) {
                yj.p.i(pair, "it");
                return new we.k0(x2.Q4(((Number) pair.getFirst()).intValue(), this.i, new Object[0]), new net.dinglisch.android.taskerm.g(this.i.getResources(), ((Number) pair.getSecond()).intValue()), false, 4, null);
            }
        }

        q1(Activity activity, boolean z, String str, Long l, boolean z2, boolean z3, boolean z4, boolean z5, boolean z10, boolean z11) {
            super(0);
            this.i = activity;
            this.q = z;
            this.r = str;
            this.s = l;
            this.t = z2;
            this.u = z3;
            this.v = z4;
            this.w = z5;
            this.x = z10;
            this.y = z11;
        }

        public final String[] invoke() {
            int i;
            List d;
            String j;
            ArrayList arrayList = new ArrayList();
            boolean z = this.t;
            boolean z2 = this.u;
            boolean z3 = this.v;
            boolean z4 = this.w;
            boolean z5 = this.x;
            boolean z10 = this.y;
            if (z) {
                arrayList.add(new Pair(2131886704, 2131232020));
            }
            if (!Kid.a()) {
                kotlin.collections.r.B(arrayList, new Pair[]{new Pair(2131891177, 2131231414), new Pair(2131891195, 2131231755), new Pair(2131890545, 2131230922)});
            }
            if (z2) {
                arrayList.add(new Pair(2131889608, 2131232021));
            }
            if (z3) {
                arrayList.add(new Pair(2131890039, 2131232022));
            }
            if (z4) {
                arrayList.add(new Pair(2131887102, 2131232166));
            }
            if (z5) {
                arrayList.add(new Pair(2131886978, 2131231113));
            }
            if (z10) {
                arrayList.add(new Pair(2131886749, 2131231779));
            }
            Activity activity = this.i;
            Pair pair = (Pair) ((we.w1) we.x.C(new we.v1(activity, 2131886994, (List) arrayList, false, (xj.l) new b(activity), (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65504, (yj.h) null)).f()).c();
            if (pair == null) {
                throw new RuntimeException("Didn't select image type");
            }
            int intValue = ((Number) pair.getFirst()).intValue();
            switch (intValue) {
                case 2131886704:
                    String b2 = IconProvider.a.b(IconProvider.i, (String) ((x6) a.w2(this.i, null, null, false, null, 30, null).f()).d(), (String) null, 2, (Object) null);
                    if (b2 != null) {
                        return new String[]{b2};
                    }
                    throw new RuntimeException("Didn't select an app");
                case 2131886749:
                    String c = ((we.l0) a.e3(new we.k(this.i, x2.H4(2131886749, this.i), null, null, null, null, true, 0, x2.Q4(2131886750, this.i, new Object[0]), 0, null, null, null, 7868, null)).f()).c();
                    if (c == null) {
                        throw new RuntimeException("Didn't enter anything");
                    }
                    return new String[]{tf.e.w() + tf.c.a.n(c)};
                case 2131886978:
                    return new String[]{IconProvider.i.d()};
                case 2131887102:
                    List o = kotlin.collections.r.o(new Integer[]{2131888369, 2131888428});
                    C0232a c0232a = new C0232a(this.i);
                    if (this.q) {
                        d = ((k2) we.x.n(new we.h(this.i, new com.joaomgcd.taskerm.util.t(this.i, intValue, new Object[0]), o, false, c0232a, null, null, null, null, null, null, null, null, null, null, null, 65512, null)).f()).c();
                        i = 2131888428;
                    } else {
                        i = 2131888428;
                        Integer num = (Integer) ((we.w1) we.x.C(new we.v1(this.i, intValue, o, false, (xj.l) c0232a, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65512, (yj.h) null)).f()).c();
                        if (num == null) {
                            throw new RuntimeException("Type of wallpaper not selected");
                        }
                        d = kotlin.collections.r.d(num);
                    }
                    ArrayList arrayList2 = new ArrayList(kotlin.collections.r.v(d, 10));
                    Iterator it = d.iterator();
                    while (it.hasNext()) {
                        int intValue2 = ((Number) it.next()).intValue();
                        if (intValue2 == 2131888369) {
                            j = IconProvider.i.j(br.a.i);
                        } else {
                            if (intValue2 != i) {
                                throw new RuntimeException("Invalid type of wallpaper");
                            }
                            j = IconProvider.i.j(br.a.q);
                        }
                        arrayList2.add(j);
                    }
                    return (String[]) arrayList2.toArray(new String[0]);
                case 2131889608:
                    Object f = a.C2(this.i, "image/*", this.q, this.r, false, false, false, this.s, 112, null).f();
                    yj.p.h(f, "blockingGet(...)");
                    return (String[]) f;
                case 2131890039:
                    String c2 = ((we.l0) a.e3(new we.k(this.i, 2131890039, (String) null, 0, 0, 0, true, 0, (String) null, 0, (Integer) null, 1976, (yj.h) null)).f()).c();
                    if (c2 != null) {
                        return new String[]{c2};
                    }
                    throw new RuntimeException("Didn't enter a URL");
                case 2131890545:
                    Object f2 = a.h0(this.i, false, 2, null).f();
                    yj.p.h(f2, "blockingGet(...)");
                    return new String[]{f2};
                case 2131891177:
                    Object f3 = a.d0(this.i, false, 2, null).f();
                    yj.p.h(f3, "blockingGet(...)");
                    return new String[]{f3};
                case 2131891195:
                    Object f4 = a.f0(this.i, false, 2, null).f();
                    yj.p.h(f4, "blockingGet(...)");
                    return new String[]{f4};
                default:
                    throw new RuntimeException("Not a valid type of image selection");
            }
        }
    }

    static final class r extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        r(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (l0Var.o()) {
                return new GenericActionActivityRequestMissingPermissions(new String[]{"android.permission.ACCESS_BACKGROUND_LOCATION"}, (String) null, 2, (yj.h) null).run(this.i);
            }
            ji.r w = ji.r.w(this.q);
            yj.p.f(w);
            return w;
        }
    }

    static final class r0 extends yj.q implements xj.l<we.w1<Locale>, String> {
        public static final r0 i = new r0();

        r0() {
            super(1);
        }

        public final String invoke(we.w1<Locale> w1Var) {
            yj.p.i(w1Var, "dialogResult");
            Locale c = w1Var.c();
            if (c != null) {
                String str = c.getLanguage() + "-" + c.getCountry();
                if (str != null) {
                    return str;
                }
            }
            throw new RuntimeException("No language selected");
        }
    }

    @qj.f(c = "com.joaomgcd.taskerm.dialog.DialogMessageKt", f = "DialogMessage.kt", l = {1610}, m = "dialogSelectImageSuspend")
    static final class r1 extends qj.d {
        Object s;
        int t;

        r1(oj.d<? super r1> dVar) {
            super(dVar);
        }

        public final Object r(Object obj) {
            this.s = obj;
            this.t |= Integer.MIN_VALUE;
            return a.H2(null, null, this);
        }
    }

    static final class s extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        s(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (l0Var.o()) {
                return new GenericActionActivityRequestCallScreeningAccess().run(this.i);
            }
            ji.r w = ji.r.w(this.q);
            yj.p.f(w);
            return w;
        }
    }

    static final class s0 extends yj.q implements xj.a<String> {
        final Activity i;

        static final class C0233a extends yj.q implements xj.l<MatterDevice, we.k0> {
            public static final C0233a i = new C0233a();

            C0233a() {
                super(1);
            }

            public final we.k0 invoke(MatterDevice matterDevice) {
                yj.p.i(matterDevice, "it");
                return new we.k0(matterDevice.getName() + " (ID: " + matterDevice.getId() + ")", null, false, 6, null);
            }
        }

        s0(Activity activity) {
            super(0);
            this.i = activity;
        }

        public final String invoke() {
            MatterDevices w = id.i.w(this.i);
            if (w.isEmpty()) {
                Activity activity = this.i;
                we.l0 l0Var = (we.l0) a.h1(activity, x2.Q4(2131886996, activity, new Object[0]), x2.Q4(2131888243, this.i, new Object[0]), x2.H4(2131891060, this.i), x2.H4(2131886173, this.i)).f();
                if (l0Var.k()) {
                    ExtensionsContextKt.q(this.i, "https://youtube.com/shorts/y1fCUgTc6Wc", false, false, false, 14, (Object) null);
                    throw new RuntimeException("Watching tutorial");
                }
                if (l0Var.n()) {
                    id.i.l(this.i);
                    throw new RuntimeException(x2.Q4(2131886180, this.i, new Object[0]));
                }
            }
            we.w1 w1Var = (we.w1) we.x.C(new we.v1(this.i, 2131889562, (List) w, false, (xj.l) C0233a.i, (Integer) 2131890891, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) x2.H4(2131886172, this.i), (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 63432, (yj.h) null)).f();
            if (w1Var.a().o()) {
                id.i.l(this.i);
                throw new RuntimeException(x2.Q4(2131886180, this.i, new Object[0]));
            }
            MatterDevice matterDevice = (MatterDevice) w1Var.c();
            if (matterDevice == null) {
                throw new RuntimeException("No device selected");
            }
            if (!w1Var.a().r()) {
                Activity activity2 = this.i;
                return ((we.l0) a.K(activity2, x2.H4(2131889213, activity2), x2.H4(2131891066, this.i), x2.H4(2131889790, this.i), x2.H4(2131889665, this.i)).f()).k() ? String.valueOf(matterDevice.getId()) : matterDevice.getName();
            }
            z2.M0(x2.Q4(2131888711, this.i, new Object[0]), this.i);
            a.v1(this.i, 2131886996, 2131887170, 0, 0, null, 56, null).f();
            id.i.o(this.i, matterDevice);
            Object f = a.O1(this.i).f();
            yj.p.h(f, "blockingGet(...)");
            return (String) f;
        }
    }

    static final class s1<T> extends yj.q implements xj.l<T, we.k0> {
        public static final s1 i = new s1();

        s1() {
            super(1);
        }

        public final we.k0 invoke(i5 i5Var) {
            yj.p.i(i5Var, "it");
            String name = i5Var.getName();
            yj.p.h(name, "getName(...)");
            return new we.k0(name, i5Var.getIcon(), false, 4, null);
        }
    }

    static final class t extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;

        t(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "dialogMessage");
            if (!l0Var.k()) {
                return l0Var.o() ? new GenericActionActivityRequestDigitalAssistantPermission().run(this.i) : ji.r.w(u6.c("missing digital assistant permission"));
            }
            ActionEdit.q5(this.i, "secure_setting_grant", (String) null);
            return ji.r.w(new v6());
        }
    }

    static final class t0 extends yj.q implements xj.l<we.w1<xi>, Pair<? extends Integer, ? extends xi>> {
        public static final t0 i = new t0();

        t0() {
            super(1);
        }

        public final Pair<Integer, xi> invoke(we.w1<xi> w1Var) {
            yj.p.i(w1Var, "it");
            Integer b = w1Var.b();
            if (b == null) {
                throw new RuntimeException("No project selected");
            }
            xi c = w1Var.c();
            if (c != null) {
                return new Pair<>(b, c);
            }
            throw new RuntimeException("No project selected");
        }
    }

    static final class t1 extends yj.q implements xj.l<com.joaomgcd.taskerm.action.system.f2, we.k0> {
        public static final t1 i = new t1();

        t1() {
            super(1);
        }

        public final we.k0 invoke(com.joaomgcd.taskerm.action.system.f2 f2Var) {
            yj.p.i(f2Var, "it");
            String name = f2Var.getName();
            if (name == null) {
                name = "Unknown App";
            }
            return new we.k0(name, null, false, 6, null);
        }
    }

    static final class u extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        static final class C0234a extends yj.q implements xj.l<Throwable, ji.v<? extends s6>> {
            final t6 i;

            C0234a(t6 t6Var) {
                super(1);
                this.i = t6Var;
            }

            public final ji.v<? extends s6> invoke(Throwable th) {
                yj.p.i(th, "it");
                return ji.r.w(this.i);
            }
        }

        u(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public static final ji.v d(xj.l lVar, Object obj) {
            yj.p.i(lVar, "$tmp0");
            yj.p.i(obj, "p0");
            return (ji.v) lVar.invoke(obj);
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (!l0Var.o()) {
                ji.r w = ji.r.w(this.q);
                yj.p.f(w);
                return w;
            }
            ji.r run = new GenericActionActivityRequestDoNotDisturbAccess().run(this.i);
            final C0234a c0234a = new C0234a(this.q);
            ji.r C = run.C(new oi.e() {
                public final Object a(Object obj) {
                    v d;
                    d = a.u.d(c0234a, obj);
                    return d;
                }
            });
            yj.p.f(C);
            return C;
        }
    }

    static final class u0 extends yj.q implements xj.l<xi, we.k0> {
        public static final u0 i = new u0();

        u0() {
            super(1);
        }

        public final we.k0 invoke(xi xiVar) {
            yj.p.i(xiVar, "project");
            String name = xiVar.getName();
            yj.p.h(name, "getName(...)");
            return new we.k0(name, xiVar.getIcon(), false, 4, null);
        }
    }

    static final class u1 extends yj.q implements xj.a<we.w1<NotificationChannel>> {
        final Activity i;
        final String q;

        static final class C0235a extends yj.q implements xj.l<NotificationChannel, we.k0> {
            public static final C0235a i = new C0235a();

            C0235a() {
                super(1);
            }

            public final we.k0 a(NotificationChannel notificationChannel) {
                CharSequence name;
                yj.p.i(notificationChannel, "it");
                name = notificationChannel.getName();
                return new we.k0(name.toString(), null, false, 6, null);
            }

            public Object invoke(Object obj) {
                return a(androidx.core.app.i.a(obj));
            }
        }

        u1(Activity activity, String str) {
            super(0);
            this.i = activity;
            this.q = str;
        }

        public final we.w1<NotificationChannel> invoke() {
            we.w1<NotificationChannel> w1Var = new we.w1<>();
            if (com.joaomgcd.taskerm.util.k.a.p()) {
                return w1Var;
            }
            List i = hg.r1.i(this.i, this.q);
            if (i == null) {
                return w1Var;
            }
            if (i.isEmpty()) {
                a.d1(this.i, 2131887284, 2131887364).f();
                return w1Var;
            }
            we.w1<NotificationChannel> w1Var2 = (we.w1) we.x.C(new we.v1(this.i, 2131887284, i, false, (xj.l) C0235a.i, (Integer) 2131890893, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65480, (yj.h) null)).f();
            if (!w1Var2.a().r()) {
                yj.p.f(w1Var2);
                return w1Var2;
            }
            z2.M0(x2.Q4(2131888711, this.i, new Object[0]), this.i);
            a.v1(this.i, 2131887284, 2131887168, 0, 0, null, 56, null).f();
            Activity activity = this.i;
            NotificationChannel a = androidx.core.app.i.a(w1Var2.c());
            hg.r1.b(activity, a != null ? a.getId() : null);
            Object f = a.M2(this.i, null, 2, null).f();
            yj.p.h(f, "blockingGet(...)");
            return (we.w1) f;
        }
    }

    static final class v extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        v(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (l0Var.o()) {
                return new GenericActionActivityRequestManageExternalStorageAccess().run(this.i);
            }
            ji.r w = ji.r.w(this.q);
            yj.p.f(w);
            return w;
        }
    }

    @qj.f(c = "com.joaomgcd.taskerm.dialog.DialogMessageKt", f = "DialogMessage.kt", l = {1565, 1567, 1568, 1577, 1581, 1584}, m = "dialogPickRemoteDevice")
    static final class v0 extends qj.d {
        Object s;
        Object t;
        Object u;
        int v;

        v0(oj.d<? super v0> dVar) {
            super(dVar);
        }

        public final Object r(Object obj) {
            this.u = obj;
            this.v |= Integer.MIN_VALUE;
            return a.S1(null, this);
        }
    }

    static final class v1 extends yj.q implements xj.l<we.w1<w1>, String> {
        public static final v1 i = new v1();

        v1() {
            super(1);
        }

        public final String invoke(we.w1<w1> w1Var) {
            String id2;
            yj.p.i(w1Var, "it");
            w1 c = w1Var.c();
            if (c == null || (id2 = c.getId()) == null) {
                throw new RuntimeException("No permission selected");
            }
            return id2;
        }
    }

    static final class w extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final Activity i;
        final t6 q;

        w(Activity activity, t6 t6Var) {
            super(1);
            this.i = activity;
            this.q = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            if (l0Var.o()) {
                return new GenericActionActivityRequestNotificationAccess().run(this.i);
            }
            ji.r w = ji.r.w(this.q);
            yj.p.f(w);
            return w;
        }
    }

    static final class w0 extends yj.q implements xj.l<Sensor, we.k0> {
        public static final w0 i = new w0();

        w0() {
            super(1);
        }

        public final we.k0 invoke(Sensor sensor) {
            yj.p.f(sensor);
            return new we.k0(x2.u2(sensor), null, false, 6, null);
        }
    }

    public static final class w1 implements pf.n1 {
        private final Context a;
        private final String b;

        public w1(Context context, String str) {
            yj.p.i(context, "context");
            yj.p.i(str, "id");
            this.a = context;
            this.b = str;
        }

        public String getId() {
            return this.b;
        }

        public String toString() {
            return r5.A(getId(), this.a) + " (" + hk.o.q0(getId(), "android.permission.") + ")";
        }
    }

    static final class x extends yj.q implements xj.l<we.l0, ji.v<? extends s6>> {
        final t6 i;

        x(t6 t6Var) {
            super(1);
            this.i = t6Var;
        }

        public final ji.v<? extends s6> invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return ji.r.w(this.i);
        }
    }

    static final class x0 extends yj.q implements xj.l<Sensor, lj.e0> {
        final Activity i;

        static final class C0236a extends yj.q implements xj.l<we.l0, lj.e0> {
            public static final C0236a i = new C0236a();

            C0236a() {
                super(1);
            }

            public final void a(we.l0 l0Var) {
                yj.p.i(l0Var, "it");
            }

            public Object invoke(Object obj) {
                a((we.l0) obj);
                return lj.e0.a;
            }
        }

        x0(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final void a(Sensor sensor) {
            Activity activity = this.i;
            yj.p.f(sensor);
            pg.w0.F1(a.e1(activity, 2131887005, x2.q1(sensor, this.i)), this.i, C0236a.i);
        }

        public Object invoke(Object obj) {
            a((Sensor) obj);
            return lj.e0.a;
        }
    }

    static final class x1 extends yj.q implements xj.l<we.w1<String>, String> {
        public static final x1 i = new x1();

        x1() {
            super(1);
        }

        public final String invoke(we.w1<String> w1Var) {
            yj.p.i(w1Var, "it");
            String c = w1Var.c();
            if (c != null) {
                return !hk.o.I(c, "%", false, 2, (Object) null) ? ri.r(c) : c;
            }
            throw new RuntimeException("No variable selected");
        }
    }

    static final class y extends yj.q implements xj.a<ji.r<we.l0>> {
        public static final y i = new y();

        y() {
            super(0);
        }

        public final ji.r<we.l0> invoke() {
            ji.r<we.l0> w = ji.r.w(new we.l0(1, null, 2, null));
            yj.p.h(w, "just(...)");
            return w;
        }
    }

    static final class y0 extends yj.q implements xj.l<we.w1<Sensor>, ji.v<? extends l2>> {
        final Activity i;

        static final class C0237a extends yj.q implements xj.a<l2> {
            final we.w1<Sensor> i;
            final Activity q;

            C0237a(we.w1<Sensor> w1Var, Activity activity) {
                super(0);
                this.i = w1Var;
                this.q = activity;
            }

            public final l2 invoke() {
                Sensor c = this.i.c();
                if (c == null) {
                    throw new RuntimeException(x2.Q4(2131891134, this.q, new Object[0]));
                }
                we.l0 l0Var = (we.l0) a.e3(new we.k(this.q, 2131887501, 2131887255, 2131889790, 2131890036, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null)).f();
                if (l0Var.j()) {
                    throw new RuntimeException(x2.Q4(2131891134, this.q, new Object[0]));
                }
                return new l2(c, l0Var.o() ? x2.u2(c) : String.valueOf(c.getType()));
            }
        }

        y0(Activity activity) {
            super(1);
            this.i = activity;
        }

        public final ji.v<? extends l2> invoke(we.w1<Sensor> w1Var) {
            yj.p.i(w1Var, "it");
            return pg.w0.K0(new C0237a(w1Var, this.i));
        }
    }

    static final class y1 extends yj.q implements xj.l<String, we.k0> {
        public static final y1 i = new y1();

        y1() {
            super(1);
        }

        public final we.k0 invoke(String str) {
            yj.p.i(str, "it");
            return new we.k0(str, null, false, 6, null);
        }
    }

    static final class z extends yj.q implements xj.l<we.l0, Boolean> {
        public static final z i = new z();

        z() {
            super(1);
        }

        public final Boolean invoke(we.l0 l0Var) {
            yj.p.i(l0Var, "it");
            return Boolean.valueOf(l0Var.n());
        }
    }

    static final class z0 extends yj.q implements xj.l<s6, ji.v<? extends String>> {
        public static final z0 i = new z0();

        z0() {
            super(1);
        }

        public final ji.v<? extends String> invoke(s6 s6Var) {
            yj.p.i(s6Var, "it");
            if (!s6Var.b()) {
                return ji.r.r(new RuntimeException("Couldn't get shortcut"));
            }
            Intent intent = (Intent) ((x6) s6Var).d();
            return intent == null ? ji.r.r(new RuntimeException("No shortcut data")) : ji.r.w(intent.toUri(0));
        }
    }

    static final class z1 extends yj.q implements xj.a<net.dinglisch.android.taskerm.s1> {
        final Activity i;
        final Sensor q;
        final String r;

        public static final class C0238a implements SensorEventListener {
            final yj.f0 i;
            final yj.j0<float[]> q;
            final yj.j0<float[]> r;
            final yj.j0<we.k> s;

            C0238a(yj.f0 f0Var, yj.j0<float[]> j0Var, yj.j0<float[]> j0Var2, yj.j0<we.k> j0Var3) {
                this.i = f0Var;
                this.q = j0Var;
                this.r = j0Var2;
                this.s = j0Var3;
            }

            @Override
            public void onAccuracyChanged(Sensor sensor, int i) {
            }

            @Override
            public void onSensorChanged(SensorEvent sensorEvent) {
                float[] fArr;
                String str;
                float[] fArr2;
                if (sensorEvent == null || (fArr2 = sensorEvent.values) == null) {
                    fArr = null;
                } else {
                    ArrayList arrayList = new ArrayList();
                    int length = fArr2.length;
                    for (int i = 0; i < length; i++) {
                        float f = fArr2[i];
                        if (!(f == 0.0f)) {
                            arrayList.add(Float.valueOf(f));
                        }
                    }
                    fArr = kotlin.collections.r.L0(arrayList);
                }
                float[] fArr3 = fArr;
                if (this.i.i) {
                    this.q.i = fArr3;
                } else {
                    this.r.i = fArr3;
                }
                we.k kVar = (we.k) this.s.i;
                if (fArr3 == null || (str = kotlin.collections.l.k0(fArr3, "\n", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (xj.l) null, 62, (Object) null)) == null) {
                    str = "No Value";
                }
                kVar.b(str);
            }
        }

        static final class b extends yj.q implements xj.l<Float, CharSequence> {
            public static final b i = new b();

            b() {
                super(1);
            }

            public final CharSequence a(float f) {
                return x2.M2(f, 5);
            }

            public Object invoke(Object obj) {
                return a(((Number) obj).floatValue());
            }
        }

        public static final class c implements SensorEventListener {
            final ArrayList<float[]> i;
            final int q;
            final yj.j0<we.k> r;

            static final class C0239a extends yj.q implements xj.l<float[], CharSequence> {
                public static final C0239a i = new C0239a();

                C0239a() {
                    super(1);
                }

                public final CharSequence invoke(float[] fArr) {
                    yj.p.i(fArr, "it");
                    return kotlin.collections.l.k0(fArr, ",", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (xj.l) null, 62, (Object) null);
                }
            }

            c(ArrayList<float[]> arrayList, int i, yj.j0<we.k> j0Var) {
                this.i = arrayList;
                this.q = i;
                this.r = j0Var;
            }

            @Override
            public void onAccuracyChanged(Sensor sensor, int i) {
            }

            @Override
            public void onSensorChanged(SensorEvent sensorEvent) {
                float[] fArr;
                Object obj;
                if (sensorEvent == null || (fArr = sensorEvent.values) == null) {
                    return;
                }
                float[] copyOf = Arrays.copyOf(fArr, fArr.length);
                yj.p.h(copyOf, "copyOf(...)");
                if (copyOf == null) {
                    return;
                }
                Iterator<T> it = this.i.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        obj = null;
                        break;
                    } else {
                        obj = it.next();
                        if (Arrays.equals((float[]) obj, copyOf)) {
                            break;
                        }
                    }
                }
                if (((float[]) obj) != null) {
                    return;
                }
                this.i.add(copyOf);
                if (this.i.size() > this.q) {
                    ((we.k) this.r.i).c();
                } else {
                    ((we.k) this.r.i).b(kotlin.collections.r.m0(this.i, " or ", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, C0239a.i, 30, (Object) null));
                }
            }
        }

        z1(Activity activity, Sensor sensor, String str) {
            super(0);
            this.i = activity;
            this.q = sensor;
            this.r = str;
        }

        private static final net.dinglisch.android.taskerm.s1 c(Activity activity, Sensor sensor, SensorManager sensorManager, w3 w3Var, String str) {
            String c2;
            Float l;
            Float Z;
            yj.f0 f0Var = new yj.f0();
            f0Var.i = true;
            yj.j0 j0Var = new yj.j0();
            yj.j0 j0Var2 = new yj.j0();
            yj.j0 j0Var3 = new yj.j0();
            int i = 0;
            int i2 = 0;
            List list = null;
            j0Var3.i = new we.k(activity, sensor.getName() + " - First Situation", "", 0, i, i2, false, 0, null, 0, null, list, 4088, null);
            C0238a c0238a = new C0238a(f0Var, j0Var, j0Var2, j0Var3);
            sensorManager.registerListener(c0238a, sensor, 2, 200, w3Var.c());
            a.e3((we.k) j0Var3.i).f();
            f0Var.i = false;
            int i3 = 0;
            int i4 = 0;
            Integer num = null;
            we.k kVar = new we.k(activity, sensor.getName() + " - Second Situation", "", i, i2, 0 == true ? 1 : 0, 0 == true ? 1 : 0, i3, null, i4, num, null, 4088, list);
            j0Var3.i = kVar;
            a.e3(kVar).f();
            sensorManager.unregisterListener(c0238a);
            w3Var.f();
            we.l0 l0Var = (we.l0) a.e3(new we.k(activity, 2131887005, "0", i, i2, (int) (0 == true ? 1 : 0), true, i3, "- First State: " + f((float[]) j0Var.i) + "\n\n- Second State: " + f((float[]) j0Var2.i) + "\n\nWhat margin of error do you want to give these values?", i4, num, 1720, (yj.h) null)).f();
            if (l0Var == null || (c2 = l0Var.c()) == null || (l = hk.o.l(c2)) == null) {
                return new net.dinglisch.android.taskerm.s1();
            }
            float floatValue = l.floatValue();
            float[] fArr = (float[]) j0Var.i;
            if (fArr != null) {
                ArrayList arrayList = new ArrayList(fArr.length);
                int length = fArr.length;
                int i5 = 0;
                int i6 = 0;
                while (i5 < length) {
                    float f = fArr[i5];
                    int i10 = i6 + 1;
                    float[] fArr2 = (float[]) j0Var2.i;
                    arrayList.add((fArr2 == null || (Z = kotlin.collections.l.Z(fArr2, i6)) == null) ? null : x2.O0(sensor, d(str, i6), f, Z.floatValue(), floatValue));
                    i5++;
                    i6 = i10;
                }
                List<net.dinglisch.android.taskerm.s1> a0 = kotlin.collections.r.a0(arrayList);
                if (a0 != null) {
                    net.dinglisch.android.taskerm.s1 s1Var = new net.dinglisch.android.taskerm.s1();
                    int i11 = 0;
                    for (net.dinglisch.android.taskerm.s1 s1Var2 : a0) {
                        s1Var.addAll(s1Var2);
                        s1Var.k0(i11, i11 + 1, s1Var2.L(0, 1));
                        i11 += s1Var2.size();
                    }
                    return s1Var;
                }
            }
            return new net.dinglisch.android.taskerm.s1();
        }

        private static final String d(String str, int i) {
            return "%" + str + (i + 1);
        }

        private static final String f(float[] fArr) {
            return "\n" + (fArr != null ? kotlin.collections.l.k0(fArr, "\n", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, b.i, 30, (Object) null) : null);
        }

        public final net.dinglisch.android.taskerm.s1 invoke() {
            SensorManager M1 = ExtensionsContextKt.M1(this.i);
            if (M1 == null) {
                return new net.dinglisch.android.taskerm.s1();
            }
            w3 b2 = x3.b("setup");
            int i = 0;
            try {
                if (x2.p3(this.q)) {
                    net.dinglisch.android.taskerm.s1 c2 = c(this.i, this.q, M1, b2, this.r);
                    b2.f();
                    ExtensionsContextKt.l3(this.i, false);
                    return c2;
                }
                yj.j0 j0Var = new yj.j0();
                j0Var.i = new we.k(this.i, "", "", 0, 0, 0, false, 0, null, 0, null, null, 4088, null);
                ArrayList arrayList = new ArrayList();
                c cVar = new c(arrayList, 5, j0Var);
                com.joaomgcd.taskerm.dialog.l e = l.a.e(com.joaomgcd.taskerm.dialog.l.c, this.i, 2131887197, false, 4, null);
                M1.registerListener(cVar, this.q, 2, 200, b2.c());
                int i2 = 0;
                do {
                    try {
                        if (!arrayList.isEmpty()) {
                            com.joaomgcd.taskerm.dialog.l.e(e, null, 1, null);
                            we.k kVar = new we.k(this.i, String.valueOf(this.q.getName()), f((float[]) kotlin.collections.r.g0(arrayList, 0)), 0, 0, 0, false, 0, null, 0, null, null, 4088, null);
                            j0Var.i = kVar;
                            a.e3(kVar).f();
                            M1.unregisterListener(cVar);
                            if (arrayList.size() > 5) {
                                net.dinglisch.android.taskerm.s1 c3 = c(this.i, this.q, M1, b2, this.r);
                                b2.f();
                                ExtensionsContextKt.l3(this.i, false);
                                return c3;
                            }
                            String str = this.r;
                            ArrayList arrayList2 = new ArrayList(kotlin.collections.r.v(arrayList, 10));
                            Iterator it = arrayList.iterator();
                            while (it.hasNext()) {
                                arrayList2.add(new Pair(new net.dinglisch.android.taskerm.r1(Expr.Op.Matches, d(str, i), kotlin.collections.l.k0((float[]) it.next(), ",", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (xj.l) null, 62, (Object) null)), s1.a.r));
                                i = 0;
                            }
                            ArrayList arrayList3 = new ArrayList(kotlin.collections.r.v(arrayList2, 10));
                            Iterator it2 = arrayList2.iterator();
                            while (it2.hasNext()) {
                                arrayList3.add((net.dinglisch.android.taskerm.r1) ((Pair) it2.next()).getFirst());
                            }
                            ArrayList arrayList4 = new ArrayList(kotlin.collections.r.v(arrayList2, 10));
                            Iterator it3 = arrayList2.iterator();
                            while (it3.hasNext()) {
                                arrayList4.add((s1.a) ((Pair) it3.next()).getSecond());
                            }
                            net.dinglisch.android.taskerm.s1 s1Var = new net.dinglisch.android.taskerm.s1(arrayList3, arrayList4);
                            b2.f();
                            ExtensionsContextKt.l3(this.i, false);
                            return s1Var;
                        }
                        k8.P(100L);
                        i2++;
                    } catch (Throwable th) {
                        try {
                            z2.K0(th.getMessage(), this.i);
                            net.dinglisch.android.taskerm.s1 s1Var2 = new net.dinglisch.android.taskerm.s1();
                            b2.f();
                            ExtensionsContextKt.l3(this.i, false);
                            return s1Var2;
                        } finally {
                            com.joaomgcd.taskerm.dialog.l.e(e, null, 1, null);
                        }
                    }
                } while (i2 <= 30);
                throw new RuntimeException("Couldn't get sensor value");
            } catch (Throwable th2) {
                b2.f();
                ExtensionsContextKt.l3(this.i, false);
                throw th2;
            }
        }
    }

    public static final ji.r<we.l0> A0(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, 2131891085, com.joaomgcd.taskerm.util.k.a.f(activity, i3), 0, 0, 0, false, 0, (String) null, 0, (Integer) null, 2040, (yj.h) null));
    }

    public static ji.r A1(Activity activity, String str, String str2, int i3, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            i3 = -1;
        }
        return z1(activity, str, str2, i3);
    }

    public static ji.r A2(Context context, boolean z2, String str, boolean z3, boolean z4, Long l2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = true;
        }
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            z3 = false;
        }
        if ((i3 & 16) != 0) {
            z4 = true;
        }
        if ((i3 & 32) != 0) {
            l2 = null;
        }
        return z2(context, z2, str, z3, z4, l2);
    }

    public static final String A3() {
        return "DialogMessage";
    }

    public static final ji.r<s6> B0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.p(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131886739, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final q qVar = new q(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v D0;
                D0 = com.joaomgcd.taskerm.dialog.a.D0(qVar, obj);
                return D0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    @SuppressLint({"MissingPermission"})
    public static final ji.r<we.w1<BluetoothDevice>> B1(Activity activity) {
        yj.p.i(activity, "activity");
        if (!com.joaomgcd.taskerm.util.e5.f.P0(activity)) {
            ji.r<we.w1<BluetoothDevice>> r2 = ji.r.r(new RuntimeException("Need Nearby devices permission"));
            yj.p.h(r2, "error(...)");
            return r2;
        }
        if (BluetoothAdapter.getDefaultAdapter().isEnabled()) {
            return we.x.C(new we.v1(activity, 2131886255, k8.o(), true, (xj.l) i0.i, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65504, (yj.h) null));
        }
        ji.r<we.w1<BluetoothDevice>> r3 = ji.r.r(new RuntimeException("Bluetooth is disabled on your device"));
        yj.p.h(r3, "error(...)");
        return r3;
    }

    public static final ji.r<String[]> B2(Context context, String str, boolean z2, String str2, boolean z3, boolean z4, boolean z5, Long l2) {
        yj.p.i(context, "context");
        yj.p.i(str, "type");
        return pg.w0.K0(new o1(context, z3, z2, str2, l2, z4, z5, str));
    }

    public static final Object B3(Class<?> cls, Activity activity, String str, int i3, String str2, String str3) {
        String str4;
        Integer m2;
        Class<?> cls2 = cls;
        String str5 = str2;
        yj.p.i(activity, "activity");
        yj.p.i(str, "methodName");
        int i4 = i3 + 1;
        String str6 = "Parameter " + i4;
        if (str3 == null) {
            str4 = z2.K(str) + ": " + str6;
        } else {
            str4 = str3;
        }
        if (yj.p.d(cls2, String.class) || yj.p.d(cls2, String[].class)) {
            String lowerCase = str4.toLowerCase();
            yj.p.h(lowerCase, "toLowerCase(...)");
            if (hk.o.N(lowerCase, "package", false, 2, (Object) null)) {
                cls2 = AppBasic.class;
            }
        }
        if (yj.p.d(cls2, int[].class)) {
            cls2 = Integer.TYPE;
        } else if (yj.p.d(cls2, long[].class)) {
            cls2 = Long.TYPE;
        } else if (yj.p.d(cls2, float[].class)) {
            cls2 = Float.TYPE;
        }
        if (yj.p.d(cls2, List.class) ? true : yj.p.d(cls2, Object[].class)) {
            String str7 = (String) u0(activity, z2.m(str4), z2.m(x2.Q4(2131887686, activity, new Object[]{str5 != null ? str5 : ""})), null, null, null, null, 120, null).f();
            if (str7 != null) {
                return str7;
            }
            throw new RuntimeException("No values entered for parameter " + i4);
        }
        if (yj.p.d(cls2, Boolean.class) ? true : yj.p.d(cls2, Boolean.TYPE)) {
            return Boolean.valueOf(((we.l0) k3(activity, str4, str5, 2131886867).f()).o());
        }
        if (yj.p.d(cls2, Integer.TYPE) ? true : yj.p.d(cls2, Integer.class) ? true : yj.p.d(cls2, Long.TYPE) ? true : yj.p.d(cls2, Long.class)) {
            if (str5 == null) {
                str5 = x2.Q4(2131887924, activity, new Object[]{str6});
            }
            String c3 = ((we.l0) e3(new we.k(activity, str4, null, 0, 0, 0, true, 0, str5, 2, null, null, 3256, null)).f()).c();
            if (c3 != null && (m2 = hk.o.m(c3)) != null) {
                return m2;
            }
            throw new RuntimeException("No number entered for parameter " + i4);
        }
        if (yj.p.d(cls2, String.class) ? true : yj.p.d(cls2, CharSequence.class)) {
            String c4 = ((we.l0) e3(new we.k(activity, str4, null, 0, 0, 0, true, 0, str2, 0, null, null, 3768, null)).f()).c();
            if (c4 != null) {
                return c4;
            }
            throw new RuntimeException("No text entered for parameter " + i4);
        }
        if (yj.p.d(cls2, AppBasic.class)) {
            String str8 = (String) ((x6) w2(activity, null, null, false, null, 30, null).f()).d();
            if (str8 != null) {
                return str8;
            }
            throw new RuntimeException("No app selected for parameter " + i4);
        }
        if (!yj.p.d(cls2, Bitmap.class)) {
            return "";
        }
        Object f3 = G2(activity, false, false, false, false, false, false, true, null, null, 894, null).f();
        yj.p.h(f3, "blockingGet(...)");
        String str9 = (String) kotlin.collections.l.R((Object[]) f3);
        if (str9 != null) {
            return str9;
        }
        throw new RuntimeException("No app selected for parameter " + i4);
    }

    public static ji.r C0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return B0(activity, t6Var);
    }

    public static final ji.r<ComponentNameList> C1(Activity activity, List<ComponentName> list) {
        yj.p.i(activity, "context");
        yj.p.i(list, "alreadySelected");
        if (ExtensionsContextKt.k0(activity)) {
            return pg.w0.K0(new k0(activity, list));
        }
        ji.r s2 = s2(activity, null, null, 0, false, false, false, 126, null);
        final j0 j0Var = j0.i;
        ji.r<ComponentNameList> x2 = s2.x(new oi.e() {
            public final Object a(Object obj) {
                ComponentNameList D1;
                D1 = com.joaomgcd.taskerm.dialog.a.D1(j0Var, obj);
                return D1;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static ji.r C2(Context context, String str, boolean z2, String str2, boolean z3, boolean z4, boolean z5, Long l2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            str = "*/*";
        }
        return B2(context, str, (i3 & 4) != 0 ? false : z2, (i3 & 8) != 0 ? null : str2, (i3 & 16) == 0 ? z3 : false, (i3 & 32) != 0 ? true : z4, (i3 & 64) != 0 ? true : z5, (i3 & 128) == 0 ? l2 : null);
    }

    public static final ji.v D0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ComponentNameList D1(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ComponentNameList) lVar.invoke(obj);
    }

    public static final java.lang.Object D2(android.app.Activity r15, java.lang.String r16, java.lang.String r17, oj.d<? super java.lang.String> r18) {
        throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.dialog.a.D2(android.app.Activity, java.lang.String, java.lang.String, oj.d):java.lang.Object");
    }

    public static final ji.r<we.l0> D3(xj.l<? super we.z1<ij.d<we.l0>>, lj.e0> lVar, xj.l<? super we.l0, Boolean> lVar2) {
        yj.p.i(lVar, "block");
        return E3(lVar, lVar2, i2.i);
    }

    public static final ji.r<s6> E0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.y1(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131886742, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final r rVar = new r(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v G0;
                G0 = com.joaomgcd.taskerm.dialog.a.G0(rVar, obj);
                return G0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<we.w1<String>> E1(Activity activity, com.joaomgcd.taskerm.util.q qVar) {
        yj.p.i(activity, "context");
        yj.p.i(qVar, "title");
        return we.x.C(new we.v1(activity, qVar.b(), kotlin.collections.r.N0(bh.u(activity.getContentResolver(), -1, true, true).keySet()), false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 262136, null));
    }

    public static Object E2(Activity activity, String str, String str2, oj.d dVar, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            str = null;
        }
        if ((i3 & 4) != 0) {
            str2 = "*/*";
        }
        return D2(activity, str, str2, dVar);
    }

    public static final <TDialogMessage extends we.l0> ji.r<TDialogMessage> E3(xj.l<? super we.z1<ij.d<TDialogMessage>>, lj.e0> lVar, xj.l<? super TDialogMessage, Boolean> lVar2, xj.l<? super Message, ? extends TDialogMessage> lVar3) {
        yj.p.i(lVar, "block");
        yj.p.i(lVar3, "getDialogMessage");
        return pg.w0.G0(new j2(lVar, lVar3, lVar2));
    }

    public static ji.r F0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return E0(activity, t6Var);
    }

    public static final ji.r<we.w1<String>> F1(Activity activity, com.joaomgcd.taskerm.util.q qVar) {
        yj.p.i(activity, "context");
        yj.p.i(qVar, "title");
        String b3 = qVar.b();
        List K = bh.K(activity.getContentResolver(), (String) null);
        yj.p.h(K, "getTitleList(...)");
        return we.x.C(new we.v1(activity, b3, K, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 262136, null));
    }

    public static final ji.r<String[]> F2(Activity activity, boolean z2, boolean z3, boolean z4, boolean z5, boolean z10, boolean z11, boolean z12, String str, Long l2) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new q1(activity, z2, str, l2, z4, z5, z10, z3, z12, z11));
    }

    public static ji.r F3(xj.l lVar, xj.l lVar2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            lVar2 = null;
        }
        return D3(lVar, lVar2);
    }

    public static final ji.v G0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<we.l0> G1(Activity activity, int i3) {
        yj.p.i(activity, "context");
        return F3(new l0(activity, i3), null, 2, null);
    }

    public static ji.r G2(Activity activity, boolean z2, boolean z3, boolean z4, boolean z5, boolean z10, boolean z11, boolean z12, String str, Long l2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = false;
        }
        if ((i3 & 4) != 0) {
            z3 = true;
        }
        if ((i3 & 8) != 0) {
            z4 = true;
        }
        if ((i3 & 16) != 0) {
            z5 = true;
        }
        if ((i3 & 32) != 0) {
            z10 = true;
        }
        if ((i3 & 64) != 0) {
            z11 = false;
        }
        if ((i3 & 128) != 0) {
            z12 = false;
        }
        if ((i3 & 256) != 0) {
            str = null;
        }
        if ((i3 & 512) != 0) {
            l2 = null;
        }
        return F2(activity, z2, z3, z4, z5, z10, z11, z12, str, l2);
    }

    public static final ji.r<s6> H0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (com.joaomgcd.taskerm.util.k.a.s()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        if (e5.a.x(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w3 = ji.r.w(new v6());
            yj.p.h(w3, "just(...)");
            return w3;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131887146, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final s sVar = new s(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v J0;
                J0 = com.joaomgcd.taskerm.dialog.a.J0(sVar, obj);
                return J0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<ContactData> H1(Context context, String str, com.joaomgcd.taskerm.genericaction.b bVar, Long l2) {
        yj.p.i(context, "context");
        return pg.w0.K0(new m0(str, bVar, l2, context));
    }

    public static final java.lang.Object H2(android.app.Activity r17, java.lang.String r18, oj.d<? super java.lang.String> r19) {
        throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.dialog.a.H2(android.app.Activity, java.lang.String, oj.d):java.lang.Object");
    }

    public static ji.r I0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return H0(activity, t6Var);
    }

    public static ji.r I1(Context context, String str, com.joaomgcd.taskerm.genericaction.b bVar, Long l2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            str = null;
        }
        if ((i3 & 4) != 0) {
            bVar = null;
        }
        if ((i3 & 8) != 0) {
            l2 = null;
        }
        return H1(context, str, bVar, l2);
    }

    private static final <T extends i5> ji.r<we.w1<T>> I2(Activity activity, int i3, uo uoVar, String str, List<? extends T> list, boolean z2) {
        Integer num = null;
        if (list == null) {
            return null;
        }
        int i4 = 0;
        if (z2 && list.size() == 1) {
            return ji.r.w(new we.w1(new we.u1(3, null, 2, null), list.get(0), null, 4, null));
        }
        if (str != null && str.length() != 0) {
            Iterator<? extends T> it = list.iterator();
            while (true) {
                if (!it.hasNext()) {
                    i4 = -1;
                    break;
                }
                T next = it.next();
                if (next.getName() != null) {
                    String name = next.getName();
                    yj.p.h(name, "getName(...)");
                    if (yj.p.d(z2.E(name), z2.E(str))) {
                        break;
                    }
                }
                i4++;
            }
            num = Integer.valueOf(i4);
        }
        return we.x.C(new we.v1(activity, i3, (List) list, true, (xj.l) s1.i, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, num, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 64480, (yj.h) null));
    }

    public static final ji.v J0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<String> J1(Activity activity, Long l2) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new n0(activity, l2));
    }

    public static final ji.r<we.w1<com.joaomgcd.taskerm.action.system.f2>> J2(Activity activity) {
        xj.a aVar;
        com.joaomgcd.taskerm.dialog.l lVar;
        int i3;
        yj.p.i(activity, "activity");
        com.joaomgcd.taskerm.dialog.l e3 = l.a.e(com.joaomgcd.taskerm.dialog.l.c, activity, 2131887195, false, 4, null);
        try {
            KeyboardApps keyboardApps = new KeyboardApps(activity);
            com.joaomgcd.taskerm.dialog.l.e(e3, null, 1, null);
            try {
                ji.r<we.w1<com.joaomgcd.taskerm.action.system.f2>> C = we.x.C(new we.v1(activity, 2131886548, (List) keyboardApps, true, (xj.l) t1.i, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65504, (yj.h) null));
                com.joaomgcd.taskerm.dialog.l.e(e3, null, 1, null);
                return C;
            } catch (Throwable th) {
                th = th;
                lVar = e3;
                i3 = 1;
                aVar = null;
                com.joaomgcd.taskerm.dialog.l.e(lVar, aVar, i3, aVar);
                throw th;
            }
        } catch (Throwable th2) {
            th = th2;
            aVar = null;
            lVar = e3;
            i3 = 1;
        }
    }

    public static final ji.r<we.l0> K(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, com.joaomgcd.taskerm.util.q qVar4) {
        yj.p.i(activity, "activity");
        yj.p.i(qVar, "title");
        yj.p.i(qVar2, "text");
        yj.p.i(qVar3, "positiveLabel");
        yj.p.i(qVar4, "negativeLabel");
        return e3(new we.k(activity, qVar, qVar2, qVar3, qVar4, null, false, 0, null, 0, null, null, null, 8160, null));
    }

    public static final ji.r<s6> K0(Activity activity) {
        yj.p.i(activity, "activity");
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, 2131890230, 2131888744, 2131887517, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final t tVar = new t(activity);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v L0;
                L0 = com.joaomgcd.taskerm.dialog.a.L0(tVar, obj);
                return L0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<we.h2> K1(Activity activity, we.h2 h2Var, String str, String str2) {
        yj.p.i(activity, "activity");
        Calendar calendar = Calendar.getInstance();
        ij.d V = ij.d.V();
        yj.p.h(V, "create(...)");
        pg.w0.q0(new o0(activity, new p0(V), h2Var, calendar, str, str2, V));
        return V;
    }

    public static final ji.r<x6<String, com.joaomgcd.taskerm.util.r1>> K2(Context context) {
        yj.p.i(context, "context");
        return w2(context, th.p(), null, false, null, 28, null);
    }

    public static final ji.r<we.l0> L(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, com.joaomgcd.taskerm.util.q qVar4, com.joaomgcd.taskerm.util.q qVar5) {
        yj.p.i(activity, "activity");
        yj.p.i(qVar, "title");
        yj.p.i(qVar2, "text");
        yj.p.i(qVar3, "positiveLabel");
        yj.p.i(qVar4, "negativeLabel");
        yj.p.i(qVar5, "overrideStopRemindingKey");
        return N(activity, qVar, qVar2, qVar3, qVar4, qVar5, null, null, 192, null);
    }

    public static final ji.v L0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static ji.r L1(Activity activity, we.h2 h2Var, String str, String str2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            h2Var = null;
        }
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            str2 = null;
        }
        return K1(activity, h2Var, str, str2);
    }

    @TargetApi(26)
    public static final ji.r<we.w1<NotificationChannel>> L2(Activity activity, String str) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new u1(activity, str));
    }

    public static final ji.r<we.l0> M(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, com.joaomgcd.taskerm.util.q qVar4, com.joaomgcd.taskerm.util.q qVar5, com.joaomgcd.taskerm.util.q qVar6, SharedPreferences sharedPreferences) {
        yj.p.i(activity, "activity");
        yj.p.i(qVar, "title");
        yj.p.i(qVar2, "text");
        yj.p.i(qVar3, "positiveLabel");
        yj.p.i(qVar4, "negativeLabel");
        yj.p.i(qVar5, "overrideStopRemindingKey");
        yj.p.i(qVar6, "stopRemindingLabel");
        yj.p.i(sharedPreferences, "preferencesForStopReminding");
        return jg.c.b(activity, qVar5, C0221a.i, b.i, sharedPreferences, new c(activity, qVar, qVar2, qVar3, qVar4, qVar6));
    }

    public static final ji.r<s6> M0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.E(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131887262, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final u uVar = new u(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v O0;
                O0 = com.joaomgcd.taskerm.dialog.a.O0(uVar, obj);
                return O0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<String> M1(Activity activity, String str) {
        yj.p.i(activity, "context");
        yj.p.i(str, "title");
        Locale[] availableLocales = Locale.getAvailableLocales();
        yj.p.h(availableLocales, "getAvailableLocales(...)");
        ArrayList arrayList = new ArrayList();
        for (Locale locale : availableLocales) {
            if (z2.h0(locale.getLanguage()) && z2.h0(locale.getCountry())) {
                arrayList.add(locale);
            }
        }
        ji.r C = we.x.C(new we.v1(activity, str, kotlin.collections.r.N0(arrayList), true, q0.i, null, null, null, null, null, null, null, null, null, null, null, null, null, 262112, null));
        final r0 r0Var = r0.i;
        ji.r<String> x2 = C.x(new oi.e() {
            public final Object a(Object obj) {
                String N1;
                N1 = com.joaomgcd.taskerm.dialog.a.N1(r0Var, obj);
                return N1;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static ji.r M2(Activity activity, String str, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            str = hg.z1.A.f().a();
        }
        return L2(activity, str);
    }

    public static ji.r N(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, com.joaomgcd.taskerm.util.q qVar4, com.joaomgcd.taskerm.util.q qVar5, com.joaomgcd.taskerm.util.q qVar6, SharedPreferences sharedPreferences, int i3, Object obj) {
        SharedPreferences sharedPreferences2;
        com.joaomgcd.taskerm.util.q qVar7 = (i3 & 32) != 0 ? qVar2 : qVar5;
        com.joaomgcd.taskerm.util.q tVar = (i3 & 64) != 0 ? new com.joaomgcd.taskerm.util.t(activity, 2131886902, new Object[0]) : qVar6;
        if ((i3 & 128) != 0) {
            SharedPreferences p2 = jg.c.p(activity);
            yj.p.h(p2, "<get-preferencesState>(...)");
            sharedPreferences2 = p2;
        } else {
            sharedPreferences2 = sharedPreferences;
        }
        return M(activity, qVar, qVar2, qVar3, qVar4, qVar7, tVar, sharedPreferences2);
    }

    public static ji.r N0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return M0(activity, t6Var);
    }

    public static final String N1(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static final ji.r<String> N2(Activity activity, List<String> list) {
        List<String> list2;
        yj.p.i(activity, "activity");
        if (list == null) {
            String[] strArr = sd.h;
            yj.p.h(strArr, "KNOWN_PERMS");
            list2 = kotlin.collections.l.E0(strArr);
            kotlin.collections.r.B(list2, com.joaomgcd.taskerm.util.e5.f.K());
        } else {
            list2 = list;
        }
        ArrayList arrayList = new ArrayList(kotlin.collections.r.v(list2, 10));
        Iterator<T> it = list2.iterator();
        while (it.hasNext()) {
            arrayList.add(new w1(activity, (String) it.next()));
        }
        HashSet hashSet = new HashSet();
        ArrayList arrayList2 = new ArrayList();
        for (Object obj : arrayList) {
            if (hashSet.add(((w1) obj).toString())) {
                arrayList2.add(obj);
            }
        }
        ji.r C = we.x.C(new we.v1(activity, 2131886684, (List) arrayList2, false, (xj.l) null, (Integer) null, (xj.l) null, Boolean.TRUE, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65400, (yj.h) null));
        final v1 v1Var = v1.i;
        ji.r<String> x2 = C.x(new oi.e() {
            public final Object a(Object obj2) {
                String O2;
                O2 = com.joaomgcd.taskerm.dialog.a.O2(v1Var, obj2);
                return O2;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<String> O(Activity activity, int i3, String str, boolean z2, ie.l lVar) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "host");
        if (z2 && !s5.p(activity, Boolean.TRUE)) {
            ji.r<String> r2 = ji.r.r(new RuntimeException("Sorry, this only works with a rooted device"));
            yj.p.h(r2, "error(...)");
            return r2;
        }
        ji.r I = ExtensionsContextKt.E3(activity, 375).I(Boolean.TRUE);
        final d dVar = new d(lVar, activity);
        ji.r t2 = I.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v Q;
                Q = com.joaomgcd.taskerm.dialog.a.Q(dVar, obj);
                return Q;
            }
        });
        final e eVar = new e(activity, i3, str, z2);
        ji.r t3 = t2.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v R;
                R = com.joaomgcd.taskerm.dialog.a.R(eVar, obj);
                return R;
            }
        });
        final f fVar = new f(activity);
        ji.r<String> q2 = t3.q(new oi.d() {
            public final void accept(Object obj) {
                com.joaomgcd.taskerm.dialog.a.S(fVar, obj);
            }
        });
        yj.p.h(q2, "doOnSuccess(...)");
        return q2;
    }

    public static final ji.v O0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<String> O1(Activity activity) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new s0(activity));
    }

    public static final String O2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static ji.r P(Activity activity, int i3, String str, boolean z2, ie.l lVar, int i4, Object obj) {
        if ((i4 & 2) != 0) {
            i3 = com.joaomgcd.taskerm.settings.q0.l(activity);
        }
        if ((i4 & 4) != 0) {
            str = "localhost";
        }
        if ((i4 & 8) != 0) {
            z2 = false;
        }
        if ((i4 & 16) != 0) {
            lVar = null;
        }
        return O(activity, i3, str, z2, lVar);
    }

    public static final ji.r<s6> P0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.y1(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131887249, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final v vVar = new v(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v R0;
                R0 = com.joaomgcd.taskerm.dialog.a.R0(vVar, obj);
                return R0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<Pair<Integer, xi>> P1(Activity activity, to toVar, int i3, List<? extends xi> list) {
        yj.p.i(activity, "context");
        yj.p.i(toVar, "taskerData");
        yj.p.i(list, "projects");
        int k2 = com.joaomgcd.taskerm.settings.q0.k(activity);
        ji.r C = we.x.C(new we.v1(activity, i3, (List) list, false, (xj.l) u0.i, (Integer) null, (xj.l) null, Boolean.TRUE, (Boolean) null, Integer.valueOf(tp.X(activity)), Integer.valueOf(k2), (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 63840, (yj.h) null));
        final t0 t0Var = t0.i;
        ji.r<Pair<Integer, xi>> x2 = C.x(new oi.e() {
            public final Object a(Object obj) {
                Pair R1;
                R1 = com.joaomgcd.taskerm.dialog.a.R1(t0Var, obj);
                return R1;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<we.w1<wo>> P2(Activity activity, uo uoVar, String str, List<? extends wo> list, boolean z2) {
        yj.p.i(activity, "activity");
        return I2(activity, 2131887414, uoVar, str, list, z2);
    }

    public static final ji.v Q(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static ji.r Q0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return P0(activity, t6Var);
    }

    public static ji.r Q1(Activity activity, to toVar, int i3, List list, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            List x2 = toVar.x2();
            yj.p.h(x2, "getProjects(...)");
            list = kotlin.collections.r.N0(x2);
        }
        return P1(activity, toVar, i3, list);
    }

    public static ji.r Q2(Activity activity, uo uoVar, String str, List list, boolean z2, int i3, Object obj) {
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            list = uoVar != null ? uoVar.j() : null;
        }
        if ((i3 & 16) != 0) {
            z2 = false;
        }
        return P2(activity, uoVar, str, list, z2);
    }

    public static final ji.v R(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.v R0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final Pair R1(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (Pair) lVar.invoke(obj);
    }

    public static final ji.r<we.w1<xi>> R2(Activity activity, uo uoVar, String str, List<? extends xi> list, boolean z2) {
        yj.p.i(activity, "activity");
        return I2(activity, 2131890314, uoVar, str, list, z2);
    }

    public static final void S(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        lVar.invoke(obj);
    }

    public static final ji.r<s6> S0(Activity activity) {
        yj.p.i(activity, "activity");
        return U0(activity, null, 2, null);
    }

    public static final java.lang.Object S1(android.app.Activity r29, oj.d<? super java.lang.String> r30) {
        throw new UnsupportedOperationException("Method not decompiled: com.joaomgcd.taskerm.dialog.a.S1(android.app.Activity, oj.d):java.lang.Object");
    }

    public static ji.r S2(Activity activity, uo uoVar, String str, List list, boolean z2, int i3, Object obj) {
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            list = uoVar != null ? uoVar.e() : null;
        }
        if ((i3 & 16) != 0) {
            z2 = false;
        }
        return R2(activity, uoVar, str, list, z2);
    }

    public static final ji.r<we.l0> T(Activity activity) {
        yj.p.i(activity, "activity");
        ji.r w2 = s5.w();
        final g gVar = new g(activity);
        ji.r<we.l0> t2 = w2.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v U;
                U = com.joaomgcd.taskerm.dialog.a.U(gVar, obj);
                return U;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<s6> T0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.X0(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131887283, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final w wVar = new w(activity, t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v V0;
                V0 = com.joaomgcd.taskerm.dialog.a.V0(wVar, obj);
                return V0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    private static final com.joaomgcd.taskerm.util.t T1(int i3, Activity activity) {
        return x2.H4(i3, activity);
    }

    public static final ji.r<we.w1<dk>> T2(Activity activity, uo uoVar, String str, List<? extends dk> list, boolean z2) {
        yj.p.i(activity, "activity");
        return I2(activity, 2131887542, uoVar, str, list, z2);
    }

    public static final ji.v U(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static ji.r U0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return T0(activity, t6Var);
    }

    private static final com.joaomgcd.taskerm.util.s U1(String str) {
        return new com.joaomgcd.taskerm.util.s(str);
    }

    public static ji.r U2(Activity activity, uo uoVar, String str, List list, boolean z2, int i3, Object obj) {
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            list = uoVar != null ? uoVar.a(-2, dk.i.r, false) : null;
        }
        if ((i3 & 16) != 0) {
            z2 = false;
        }
        return T2(activity, uoVar, str, list, z2);
    }

    public static final ji.r<pe.g> V(Activity activity) {
        yj.p.i(activity, "activity");
        if (!com.joaomgcd.taskerm.settings.q0.s(activity)) {
            ji.r<pe.g> w2 = ji.r.w(new pe.g(false));
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131891284, 2131890585, 2131888042, 2131886743, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final h hVar = h.i;
        ji.r<pe.g> x2 = e3.x(new oi.e() {
            public final Object a(Object obj) {
                pe.g W;
                W = com.joaomgcd.taskerm.dialog.a.W(hVar, obj);
                return W;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.v V0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<l2> V1(Activity activity, boolean z2) {
        yj.p.i(activity, "activity");
        List L1 = ExtensionsContextKt.L1(activity);
        if (L1 == null) {
            ji.r<l2> r2 = ji.r.r(new RuntimeException("Device has no sensors"));
            yj.p.h(r2, "error(...)");
            return r2;
        }
        ArrayList arrayList = new ArrayList();
        for (Object obj : L1) {
            Sensor sensor = (Sensor) obj;
            if (!z2) {
                yj.p.f(sensor);
                if (!x2.A3(sensor)) {
                }
            }
            arrayList.add(obj);
        }
        ji.r C = we.x.C(new we.v1(activity, 2131887005, (List) arrayList, false, (xj.l) w0.i, (Integer) 2131890945, (xj.l) new x0(activity), Boolean.TRUE, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65288, (yj.h) null));
        final y0 y0Var = new y0(activity);
        ji.r<l2> t2 = C.t(new oi.e() {
            public final Object a(Object obj2) {
                ji.v X1;
                X1 = com.joaomgcd.taskerm.dialog.a.X1(y0Var, obj2);
                return X1;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<we.w1<tn>> V2(Activity activity, uo uoVar, String str, List<? extends tn> list, boolean z2) {
        yj.p.i(activity, "activity");
        return I2(activity, 2131890732, uoVar, str, list, z2);
    }

    public static final pe.g W(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (pe.g) lVar.invoke(obj);
    }

    public static final ji.r<we.l0> W0(Activity activity) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, 2131887500, x2.Q4(2131887184, activity, new Object[0]), 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
    }

    public static ji.r W1(Activity activity, boolean z2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = true;
        }
        return V1(activity, z2);
    }

    public static ji.r W2(Activity activity, uo uoVar, String str, List list, boolean z2, int i3, Object obj) {
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            list = uoVar != null ? uoVar.K(-2, tn.f.r) : null;
        }
        if ((i3 & 16) != 0) {
            z2 = false;
        }
        return V2(activity, uoVar, str, list, z2);
    }

    public static final ji.r<we.l0> X(Activity activity) {
        yj.p.i(activity, "activity");
        return F3(new i(activity), null, 2, null);
    }

    public static final ji.r<s6> X0(Activity activity, t6 t6Var) {
        yj.p.i(activity, "activity");
        yj.p.i(t6Var, "error");
        if (e5.a.s1(com.joaomgcd.taskerm.util.e5.f, activity, 0, 2, (Object) null).B()) {
            ji.r<s6> w2 = ji.r.w(new v6());
            yj.p.h(w2, "just(...)");
            return w2;
        }
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, x2.Q4(2131887268, activity, new Object[0]), 2131886891, 0, 0, false, 0, (String) null, 0, (Integer) null, 2032, (yj.h) null));
        final x xVar = new x(t6Var);
        ji.r<s6> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v Z0;
                Z0 = com.joaomgcd.taskerm.dialog.a.Z0(xVar, obj);
                return Z0;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.v X1(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<String> X2(Activity activity, List<String> list) {
        yj.p.i(activity, "activity");
        yj.p.i(list, "dataVars");
        ji.r C = we.x.C(new we.v1(activity, 2131887420, (List) list, false, (xj.l) y1.i, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65504, (yj.h) null));
        final x1 x1Var = x1.i;
        ji.r<String> x2 = C.x(new oi.e() {
            public final Object a(Object obj) {
                String Y2;
                Y2 = com.joaomgcd.taskerm.dialog.a.Y2(x1Var, obj);
                return Y2;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<String> Y(Activity activity, com.joaomgcd.taskerm.util.r rVar) {
        yj.p.i(activity, "activity");
        yj.p.i(rVar, "title");
        String a3 = rVar.a(activity);
        Integer[] numArr = {2131891267, 2131891172};
        ArrayList arrayList = new ArrayList(2);
        for (int i3 = 0; i3 < 2; i3++) {
            arrayList.add(x2.Q4(numArr[i3].intValue(), activity, new Object[0]));
        }
        ji.r C = we.x.C(new we.v1(activity, a3, arrayList, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 262136, null));
        final j jVar = j.i;
        ji.r<String> x2 = C.x(new oi.e() {
            public final Object a(Object obj) {
                String Z;
                Z = com.joaomgcd.taskerm.dialog.a.Z(jVar, obj);
                return Z;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static ji.r Y0(Activity activity, t6 t6Var, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            t6Var = com.joaomgcd.taskerm.util.e5.f.P(activity);
        }
        return X0(activity, t6Var);
    }

    public static final ji.r<String> Y1(Context context) {
        yj.p.i(context, "context");
        ji.r run = new GenericActionActivityPickShortcut().run(context);
        final z0 z0Var = z0.i;
        ji.r<String> t2 = run.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v Z1;
                Z1 = com.joaomgcd.taskerm.dialog.a.Z1(z0Var, obj);
                return Z1;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final String Y2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static final String Z(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static final ji.v Z0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.v Z1(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<net.dinglisch.android.taskerm.s1> Z2(Activity activity, Sensor sensor, String str) {
        yj.p.i(activity, "activity");
        yj.p.i(sensor, "sensor");
        yj.p.i(str, "variableName");
        ExtensionsContextKt.l3(activity, true);
        return pg.w0.K0(new z1(activity, sensor, str));
    }

    private static final ji.r<String> a0(Activity activity, e5.l lVar, boolean z2) {
        ji.r F3 = F3(new k(activity, lVar, z2), null, 2, null);
        final l lVar2 = new l(activity);
        ji.r<String> x2 = F3.x(new oi.e() {
            public final Object a(Object obj) {
                String b02;
                b02 = com.joaomgcd.taskerm.dialog.a.b0(lVar2, obj);
                return b02;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<we.l0> a1(final Activity activity) {
        yj.p.i(activity, "activity");
        if (!com.joaomgcd.taskerm.util.k.a.r()) {
            return s2(activity, "work_profile", "android.permission.MODIFY_QUIET_MODE", 2131887306, false, false, false, 112, null);
        }
        ji.r<we.l0> l2 = ji.r.l(new ji.u() {
            public final void a(ji.s sVar) {
                com.joaomgcd.taskerm.dialog.a.b1(activity, sVar);
            }
        });
        yj.p.h(l2, "create(...)");
        return l2;
    }

    public static final ji.r<String> a2(Activity activity, String str) {
        yj.p.i(activity, "context");
        yj.p.i(str, "title");
        return pg.w0.K0(new a1(activity, str));
    }

    public static final mi.b a3(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return pg.w0.F1(v1(activity, 2131891085, i3, 0, 0, null, 56, null), activity, a2.i);
    }

    public static final String b0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static final void b1(Activity activity, ji.s sVar) {
        yj.p.i(activity, "$activity");
        yj.p.i(sVar, "it");
        z2.K0("Need at least Android 10 to toggle work profile", activity);
        sVar.b(new we.l0(1, null, 2, null));
    }

    public static final ji.r<we.i2> b2(Activity activity, we.i2 i2Var, String str, String str2) {
        yj.p.i(activity, "activity");
        Calendar calendar = Calendar.getInstance();
        ij.d V = ij.d.V();
        yj.p.h(V, "create(...)");
        pg.w0.q0(new b1(activity, new c1(V), i2Var, calendar, str, str2, V));
        return V;
    }

    public static final ji.r<String> b3(Activity activity) {
        yj.p.i(activity, "activity");
        ji.r<Integer> d3 = d3(activity);
        final b2 b2Var = new b2(activity);
        ji.r<String> x2 = d3.x(new oi.e() {
            public final Object a(Object obj) {
                String c3;
                c3 = com.joaomgcd.taskerm.dialog.a.c3(b2Var, obj);
                return c3;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<String> c0(Activity activity, boolean z2) {
        yj.p.i(activity, "activity");
        return a0(activity, e5.l.i, z2);
    }

    public static final ji.r<we.l0> c1(Activity activity) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, 2131887506, 2131887267, 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
    }

    public static ji.r c2(Activity activity, we.i2 i2Var, String str, String str2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            i2Var = null;
        }
        if ((i3 & 4) != 0) {
            str = null;
        }
        if ((i3 & 8) != 0) {
            str2 = null;
        }
        return b2(activity, i2Var, str, str2);
    }

    public static final String c3(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static ji.r d0(Activity activity, boolean z2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = false;
        }
        return c0(activity, z2);
    }

    public static final ji.r<we.l0> d1(Activity activity, int i3, int i4) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, i4, 2131886891, 0, 0, false, 0, (String) null, 0, (Integer) null, 2032, (yj.h) null));
    }

    public static final ji.r<String> d2(Activity activity) {
        Set availableZoneIds;
        yj.p.i(activity, "activity");
        availableZoneIds = ZoneId.getAvailableZoneIds();
        yj.p.h(availableZoneIds, "getAvailableZoneIds(...)");
        ji.r C = we.x.C(new we.v1(activity, 2131890813, kotlin.collections.r.N0(availableZoneIds), false, (xj.l) null, (Integer) null, (xj.l) null, (Boolean) null, (Boolean) null, (Integer) null, (Integer) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (com.joaomgcd.taskerm.util.q) null, (Boolean) null, (Boolean) null, 65528, (yj.h) null));
        final d1 d1Var = d1.i;
        ji.r<String> x2 = C.x(new oi.e() {
            public final Object a(Object obj) {
                String e22;
                e22 = com.joaomgcd.taskerm.dialog.a.e2(d1Var, obj);
                return e22;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<Integer> d3(Activity activity) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new c2(activity));
    }

    public static final ji.r<String> e0(Activity activity, boolean z2) {
        yj.p.i(activity, "activity");
        return a0(activity, e5.l.q, z2);
    }

    public static final ji.r<we.l0> e1(Activity activity, int i3, String str) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, str, 2131886891, 0, 0, false, 0, (String) null, 0, (Integer) null, 2032, (yj.h) null));
    }

    public static final String e2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static final ji.r<we.l0> e3(we.k kVar) {
        yj.p.i(kVar, "args");
        return F3(new d2(kVar), null, 2, null);
    }

    public static ji.r f0(Activity activity, boolean z2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = false;
        }
        return e0(activity, z2);
    }

    public static final ji.r<we.l0> f1(Activity activity, int i3, String str, Integer num, Integer num2) {
        yj.p.i(activity, "activity");
        return h1(activity, x2.Q4(i3, activity, new Object[0]), str, num != null ? new com.joaomgcd.taskerm.util.t(activity, num.intValue(), new Object[0]) : null, num2 != null ? new com.joaomgcd.taskerm.util.t(activity, num2.intValue(), new Object[0]) : null);
    }

    public static final ji.r<ScanResult> f2(Activity activity, xj.l<? super ScanResult, String> lVar) {
        yj.p.i(activity, "context");
        yj.p.i(lVar, "scanResultToString");
        return pg.w0.K0(new f1(activity, lVar));
    }

    public static final ji.r<we.l0> f3(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return d1(activity, 2131890864, i3);
    }

    public static final ji.r<String> g0(Activity activity, boolean z2) {
        yj.p.i(activity, "activity");
        return a0(activity, e5.l.r, z2);
    }

    public static final ji.r<we.l0> g1(Activity activity, String str, String str2, com.joaomgcd.taskerm.util.q qVar) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return j1(activity, str, str2, qVar, null, 16, null);
    }

    public static ji.r g2(Activity activity, xj.l lVar, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            lVar = e1.i;
        }
        return f2(activity, lVar);
    }

    public static final ji.r<we.l0> g3(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return v1(activity, 2131890864, i3, 0, 0, null, 56, null);
    }

    public static ji.r h0(Activity activity, boolean z2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            z2 = false;
        }
        return g0(activity, z2);
    }

    public static final ji.r<we.l0> h1(Activity activity, String str, String str2, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, new com.joaomgcd.taskerm.util.s(str), str2 != null ? new com.joaomgcd.taskerm.util.s(str2) : null, new com.joaomgcd.taskerm.util.t(activity, 2131886891, new Object[0]), qVar, qVar2, false, 0, null, 0, null, null, null, 8128, null));
    }

    public static final ji.r<String> h2(Activity activity, xj.l<? super ScanResult, String> lVar) {
        yj.p.i(activity, "context");
        yj.p.i(lVar, "scanResultToString");
        ji.r g22 = g2(activity, null, 2, null);
        final h1 h1Var = new h1(activity);
        ji.r<String> t2 = g22.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v j22;
                j22 = com.joaomgcd.taskerm.dialog.a.j2(h1Var, obj);
                return j22;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<we.l0> h3(Activity activity, String str) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "text");
        return w1(activity, 2131890864, str, 0, 0, null, 56, null);
    }

    public static final ji.r<we.l0> i0(Activity activity, int i3, int i4, int i5, boolean z2) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, i4, -1, 2131886867, i5, z2, 0, (String) null, 0, (Integer) null, 1920, (yj.h) null));
    }

    public static ji.r i1(Activity activity, int i3, String str, Integer num, Integer num2, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            num = null;
        }
        if ((i4 & 16) != 0) {
            num2 = null;
        }
        return f1(activity, i3, str, num, num2);
    }

    public static ji.r i2(Activity activity, xj.l lVar, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            lVar = g1.i;
        }
        return h2(activity, lVar);
    }

    public static final ji.r<we.l0> i3(Activity activity, int i3, String str) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "learnMoreUrl");
        ji.r v12 = v1(activity, 2131890864, i3, 2131888370, 0, null, 48, null);
        final e2 e2Var = new e2(activity, str);
        ji.r<we.l0> q2 = v12.q(new oi.d() {
            public final void accept(Object obj) {
                com.joaomgcd.taskerm.dialog.a.j3(e2Var, obj);
            }
        });
        yj.p.h(q2, "doOnSuccess(...)");
        return q2;
    }

    public static ji.r j0(Activity activity, int i3, int i4, int i5, boolean z2, int i6, Object obj) {
        if ((i6 & 8) != 0) {
            i5 = -1;
        }
        if ((i6 & 16) != 0) {
            z2 = false;
        }
        return i0(activity, i3, i4, i5, z2);
    }

    public static ji.r j1(Activity activity, String str, String str2, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, int i3, Object obj) {
        if ((i3 & 8) != 0) {
            qVar = null;
        }
        if ((i3 & 16) != 0) {
            qVar2 = null;
        }
        return h1(activity, str, str2, qVar, qVar2);
    }

    public static final ji.v j2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final void j3(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        lVar.invoke(obj);
    }

    public static final ji.r<we.l0> k0(Activity activity) {
        yj.p.i(activity, "activity");
        return s2(activity, "device_owner", "android.permission.DEVICE_OWNER", 2131887181, false, false, false, 80, null);
    }

    public static final ji.r<we.l0> k1(Activity activity, int i3, int i4, int i5, boolean z2, String str) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, i4, 2131886891, 2131886867, i5, z2, 0, str, 0, (Integer) null, 1664, (yj.h) null));
    }

    public static final ji.r<we.l0> k2(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return s2(activity, "read_logs_grant", "android.permission.READ_LOGS", i3, true, false, false, 96, null);
    }

    public static final ji.r<we.l0> k3(Activity activity, String str, String str2, int i3) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, str, str2, 2131891267, 2131891172, i3, false, 0, null, 0, null, null, 4032, null));
    }

    public static final ji.r<we.l0> l0(Activity activity) {
        yj.p.i(activity, "activity");
        return s2(activity, "dump_grant", "android.permission.DUMP", 2131887185, false, false, false, 112, null);
    }

    public static final ji.r<we.l0> l1(Activity activity, int i3, String str, int i4, boolean z2, String str2) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, str, 2131886891, 2131886867, i4, z2, 0, str2, 0, (Integer) null, 1664, (yj.h) null));
    }

    public static final ji.r<we.l0> l2(Activity activity) {
        yj.p.i(activity, "activity");
        return k2(activity, 2131887308);
    }

    public static ji.r l3(Activity activity, String str, String str2, int i3, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            i3 = -1;
        }
        return k3(activity, str, str2, i3);
    }

    public static final ji.r<we.l0> m0(Activity activity, String str, String str2, int i3) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, str, str2, 2131889591, 2131888819, i3, false, 0, null, 0, null, null, 4032, null));
    }

    public static final ji.r<we.l0> m1(Activity activity, String str, String str2, int i3, boolean z2, String str3, Integer num, int i4, Integer num2, List<String> list) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, str, str2, 2131886891, 2131886867, i3, z2, num != null ? num.intValue() | z3(z2) : z3(z2), str3, i4, num2, list));
    }

    public static final ji.r<we.l0> m2(Activity activity) {
        yj.p.i(activity, "activity");
        return s2(activity, "screencapture_grant", "PROJECT_MEDIA", 2131887320, false, false, true, 48, null);
    }

    public static final ji.r<we.l0> m3(final Activity activity) {
        yj.p.i(activity, "activity");
        if (!com.joaomgcd.taskerm.util.k.a.p()) {
            return s2(activity, "volume_long_press_grant", "android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER", 2131887356, false, false, false, 112, null);
        }
        ji.r<we.l0> l2 = ji.r.l(new ji.u() {
            public final void a(ji.s sVar) {
                com.joaomgcd.taskerm.dialog.a.n3(activity, sVar);
            }
        });
        yj.p.h(l2, "create(...)");
        return l2;
    }

    public static ji.r n0(Activity activity, String str, String str2, int i3, int i4, Object obj) {
        if ((i4 & 4) != 0) {
            str2 = x2.Q4(2131887679, activity, new Object[]{str});
        }
        if ((i4 & 8) != 0) {
            i3 = -1;
        }
        return m0(activity, str, str2, i3);
    }

    public static ji.r n1(Activity activity, int i3, int i4, int i5, boolean z2, String str, int i6, Object obj) {
        int i10 = (i6 & 8) != 0 ? -1 : i5;
        boolean z3 = (i6 & 16) != 0 ? false : z2;
        if ((i6 & 32) != 0) {
            str = null;
        }
        return k1(activity, i3, i4, i10, z3, str);
    }

    public static final ji.r<we.l0> n2(Activity activity) {
        yj.p.i(activity, "activity");
        ji.r<we.l0> q12 = q1(activity, 2131886534, 2131887321);
        final i1 i1Var = new i1(activity);
        ji.r<we.l0> t2 = q12.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v o2;
                o2 = com.joaomgcd.taskerm.dialog.a.o2(i1Var, obj);
                return o2;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final void n3(Activity activity, ji.s sVar) {
        yj.p.i(activity, "$activity");
        yj.p.i(sVar, "it");
        z2.K0("Need at least Android 8 to handle long volume press events", activity);
        sVar.b(new we.l0(1, null, 2, null));
    }

    @TargetApi(30)
    public static final ji.r<jf.d> o0(Activity activity) {
        yj.p.i(activity, "context");
        return pg.w0.K0(new m(activity));
    }

    public static ji.r o1(Activity activity, int i3, String str, int i4, boolean z2, String str2, int i5, Object obj) {
        int i6 = (i5 & 8) != 0 ? -1 : i4;
        boolean z3 = (i5 & 16) != 0 ? false : z2;
        if ((i5 & 32) != 0) {
            str2 = null;
        }
        return l1(activity, i3, str, i6, z3, str2);
    }

    public static final ji.v o2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static final ji.r<we.l0> o3(Activity activity, int i3, int i4) {
        yj.p.i(activity, "activity");
        return t3(activity, i3, i4, 0, 8, null);
    }

    public static final ji.r<we.l0> p0(we.c cVar) {
        yj.p.i(cVar, "args");
        return pg.w0.K0(new n(cVar));
    }

    public static ji.r p1(Activity activity, String str, String str2, int i3, boolean z2, String str3, Integer num, int i4, Integer num2, List list, int i5, Object obj) {
        return m1(activity, str, str2, (i5 & 8) != 0 ? -1 : i3, (i5 & 16) != 0 ? false : z2, (i5 & 32) != 0 ? null : str3, (i5 & 64) != 0 ? null : num, (i5 & 128) != 0 ? 0 : i4, (i5 & 256) != 0 ? Integer.valueOf(tp.X(activity)) : num2, (i5 & 512) != 0 ? null : list);
    }

    public static final ji.r<s6> p2(Activity activity, rg.u uVar, boolean z2) {
        yj.p.i(activity, "activity");
        yj.p.i(uVar, "selectedSecureSettingType");
        return pg.w0.K0(new j1(activity, z2, uVar));
    }

    public static final ji.r<we.l0> p3(Activity activity, int i3, int i4, int i5) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, i4, 2131886907, 2131886889, i5, false, 0, (String) null, 0, (Integer) null, 1984, (yj.h) null));
    }

    public static final ji.r<String> q0(Activity activity, int i3) {
        yj.p.i(activity, "activity");
        return t0(activity, i3, null, null, null, null, null, 124, null);
    }

    public static final ji.r<we.l0> q1(Activity activity, int i3, int i4) {
        yj.p.i(activity, "activity");
        return jg.c.c(activity, new com.joaomgcd.taskerm.util.t(activity, i4, new Object[0]), b0.i, c0.i, (SharedPreferences) null, new d0(activity, i3, i4), 8, (Object) null);
    }

    public static final ji.r<we.l0> q2(Activity activity, String str, String str2, int i3, boolean z2, boolean z3, boolean z4) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "helpId");
        yj.p.i(str2, "permission");
        return r2(activity, str, str2, x2.Q4(i3, activity, new Object[0]), z2, z3, z4);
    }

    public static final ji.r<we.l0> q3(Activity activity, int i3, String str, int i4) {
        yj.p.i(activity, "activity");
        return e3(new we.k(activity, i3, str, 2131886907, 2131886889, i4, false, 0, (String) null, 0, (Integer) null, 1984, (yj.h) null));
    }

    public static final ji.r<String> r0(Activity activity, int i3, Integer num, com.joaomgcd.taskerm.util.q qVar, Integer num2, Integer num3, List<String> list) {
        yj.p.i(activity, "activity");
        return s0(activity, new com.joaomgcd.taskerm.util.t(activity, i3, new Object[0]), num != null ? new com.joaomgcd.taskerm.util.t(activity, num.intValue(), new Object[0]) : null, qVar, num2, num3, list);
    }

    public static final ji.r<we.l0> r1(Activity activity, int i3, String str) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "text");
        return jg.c.c(activity, new com.joaomgcd.taskerm.util.s(str), y.i, z.i, (SharedPreferences) null, new a0(activity, i3, str), 8, (Object) null);
    }

    public static final ji.r<we.l0> r2(Activity activity, String str, String str2, String str3, boolean z2, boolean z3, boolean z4) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "helpId");
        yj.p.i(str2, "permission");
        yj.p.i(str3, "dialogMessage");
        ji.r<we.l0> e3 = e3(new we.k(activity, 2131887500, str3, 2131886891, 2131886889, 0, false, 0, (String) null, 0, (Integer) null, 2016, (yj.h) null));
        final k1 k1Var = new k1(z3, activity, z4, str2, z2, str);
        ji.r<we.l0> t2 = e3.t(new oi.e() {
            public final Object a(Object obj) {
                ji.v u2;
                u2 = com.joaomgcd.taskerm.dialog.a.u2(k1Var, obj);
                return u2;
            }
        });
        yj.p.h(t2, "flatMap(...)");
        return t2;
    }

    public static final ji.r<we.l0> r3(Activity activity, String str, String str2) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return v3(activity, str, str2, 0, 8, null);
    }

    public static final ji.r<String> s0(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, Integer num, Integer num2, List<String> list) {
        yj.p.i(activity, "activity");
        yj.p.i(qVar, "title");
        ji.r p12 = p1(activity, qVar.b(), qVar3 != null ? qVar3.b() : null, 0, true, qVar2 != null ? qVar2.b() : null, num, num2 != null ? num2.intValue() : 0, null, list, 264, null);
        final o oVar = o.i;
        ji.r<String> x2 = p12.x(new oi.e() {
            public final Object a(Object obj) {
                String v02;
                v02 = com.joaomgcd.taskerm.dialog.a.v0(oVar, obj);
                return v02;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static final ji.r<we.l0> s1(Activity activity, int i3, int i4) {
        yj.p.i(activity, "activity");
        return v1(activity, i3, i4, 0, 0, null, 56, null);
    }

    public static ji.r s2(Activity activity, String str, String str2, int i3, boolean z2, boolean z3, boolean z4, int i4, Object obj) {
        if ((i4 & 2) != 0) {
            str = "secure_setting_grant";
        }
        if ((i4 & 4) != 0) {
            str2 = "android.permission.WRITE_SECURE_SETTINGS";
        }
        return q2(activity, str, str2, (i4 & 8) != 0 ? 2131887324 : i3, (i4 & 16) != 0 ? false : z2, (i4 & 32) != 0 ? true : z3, (i4 & 64) != 0 ? false : z4);
    }

    public static final ji.r<we.l0> s3(Activity activity, String str, String str2, int i3) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, str, str2, 2131886907, 2131886889, i3, false, 0, null, 0, null, null, 4032, null));
    }

    public static ji.r t0(Activity activity, int i3, Integer num, com.joaomgcd.taskerm.util.q qVar, Integer num2, Integer num3, List list, int i4, Object obj) {
        return r0(activity, i3, (i4 & 4) != 0 ? null : num, (i4 & 8) != 0 ? null : qVar, (i4 & 16) != 0 ? null : num2, (i4 & 32) != 0 ? null : num3, (i4 & 64) == 0 ? list : null);
    }

    public static final ji.r<we.l0> t1(Activity activity, int i3, int i4, int i5, int i6, String str) {
        yj.p.i(activity, "activity");
        String Q4 = x2.Q4(i4, activity, new Object[0]);
        return u1(activity, i3, Q4, i5, i6, str == null ? Q4 : str);
    }

    public static ji.r t2(Activity activity, String str, String str2, String str3, boolean z2, boolean z3, boolean z4, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            str = "secure_setting_grant";
        }
        String str4 = str;
        if ((i3 & 4) != 0) {
            str2 = "android.permission.WRITE_SECURE_SETTINGS";
        }
        return r2(activity, str4, str2, str3, (i3 & 16) != 0 ? false : z2, (i3 & 32) != 0 ? true : z3, (i3 & 64) != 0 ? false : z4);
    }

    public static ji.r t3(Activity activity, int i3, int i4, int i5, int i6, Object obj) {
        if ((i6 & 8) != 0) {
            i5 = -1;
        }
        return p3(activity, i3, i4, i5);
    }

    public static ji.r u0(Activity activity, com.joaomgcd.taskerm.util.q qVar, com.joaomgcd.taskerm.util.q qVar2, com.joaomgcd.taskerm.util.q qVar3, Integer num, Integer num2, List list, int i3, Object obj) {
        return s0(activity, qVar, (i3 & 4) != 0 ? null : qVar2, (i3 & 8) != 0 ? null : qVar3, (i3 & 16) != 0 ? null : num, (i3 & 32) != 0 ? null : num2, (i3 & 64) == 0 ? list : null);
    }

    public static final ji.r<we.l0> u1(Activity activity, int i3, String str, int i4, int i5, String str2) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "text");
        yj.p.i(str2, "tipKey");
        return jg.c.c(activity, new com.joaomgcd.taskerm.util.s(str2), e0.i, f0.i, (SharedPreferences) null, new g0(activity, i3, str, i5, i4), 8, (Object) null);
    }

    public static final ji.v u2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (ji.v) lVar.invoke(obj);
    }

    public static ji.r u3(Activity activity, int i3, String str, int i4, int i5, Object obj) {
        if ((i5 & 8) != 0) {
            i4 = -1;
        }
        return q3(activity, i3, str, i4);
    }

    public static final String v0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (String) lVar.invoke(obj);
    }

    public static ji.r v1(Activity activity, int i3, int i4, int i5, int i6, String str, int i10, Object obj) {
        int i11 = (i10 & 8) != 0 ? -1 : i5;
        int i12 = (i10 & 16) != 0 ? 2131886891 : i6;
        if ((i10 & 32) != 0) {
            str = null;
        }
        return t1(activity, i3, i4, i11, i12, str);
    }

    public static final ji.r<x6<String, com.joaomgcd.taskerm.util.r1>> v2(Context context, Intent intent, List<String> list, boolean z2, List<String> list2) {
        yj.p.i(context, "context");
        ji.r run = new GenericActionActivitySelectApp(intent, list, z2, list2).run(context);
        final l1 l1Var = l1.i;
        ji.r<x6<String, com.joaomgcd.taskerm.util.r1>> x2 = run.x(new oi.e() {
            public final Object a(Object obj) {
                x6 x22;
                x22 = com.joaomgcd.taskerm.dialog.a.x2(l1Var, obj);
                return x22;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static ji.r v3(Activity activity, String str, String str2, int i3, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            i3 = -1;
        }
        return s3(activity, str, str2, i3);
    }

    public static final ji.r<Boolean> w0(Activity activity) {
        yj.p.i(activity, "activity");
        com.joaomgcd.taskerm.util.t tVar = new com.joaomgcd.taskerm.util.t(activity, 2131888311, new Object[0]);
        com.joaomgcd.taskerm.util.t tVar2 = new com.joaomgcd.taskerm.util.t(activity, 2131888312, new Object[0]);
        com.joaomgcd.taskerm.util.t tVar3 = new com.joaomgcd.taskerm.util.t(activity, 2131890231, new Object[0]);
        com.joaomgcd.taskerm.util.t tVar4 = new com.joaomgcd.taskerm.util.t(activity, 2131887445, new Object[0]);
        com.joaomgcd.taskerm.util.s sVar = new com.joaomgcd.taskerm.util.s("PREF_ALLOW_INSECURE_TASK_RUN_REQUESTS");
        com.joaomgcd.taskerm.util.t tVar5 = new com.joaomgcd.taskerm.util.t(activity, 2131886227, new Object[0]);
        SharedPreferences R0 = dq.R0(activity);
        yj.p.h(R0, "getMyPrefs(...)");
        ji.r<we.l0> M = M(activity, tVar, tVar2, tVar3, tVar4, sVar, tVar5, R0);
        final p pVar = p.i;
        ji.r<Boolean> x2 = M.x(new oi.e() {
            public final Object a(Object obj) {
                Boolean x02;
                x02 = com.joaomgcd.taskerm.dialog.a.x0(pVar, obj);
                return x02;
            }
        });
        yj.p.h(x2, "map(...)");
        return x2;
    }

    public static ji.r w1(Activity activity, int i3, String str, int i4, int i5, String str2, int i6, Object obj) {
        return u1(activity, i3, str, (i6 & 8) != 0 ? -1 : i4, (i6 & 16) != 0 ? 2131886891 : i5, (i6 & 32) != 0 ? str : str2);
    }

    public static ji.r w2(Context context, Intent intent, List list, boolean z2, List list2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            intent = null;
        }
        if ((i3 & 4) != 0) {
            list = null;
        }
        if ((i3 & 8) != 0) {
            z2 = false;
        }
        if ((i3 & 16) != 0) {
            list2 = null;
        }
        return v2(context, intent, list, z2, list2);
    }

    public static final ji.r<we.l0> w3(Activity activity, int i3, int i4) {
        yj.p.i(activity, "activity");
        return y3(activity, i3, i4, null, 8, null);
    }

    public static final Boolean x0(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (Boolean) lVar.invoke(obj);
    }

    public static final mi.b x1(Activity activity, int i3, com.joaomgcd.taskerm.util.q qVar, xj.a<lj.e0> aVar) {
        yj.p.i(activity, "activity");
        yj.p.i(qVar, "text");
        return pg.w0.F1(i1(activity, i3, qVar.b(), 2131888370, null, 16, null), activity, new h0(aVar, activity));
    }

    public static final x6 x2(xj.l lVar, Object obj) {
        yj.p.i(lVar, "$tmp0");
        yj.p.i(obj, "p0");
        return (x6) lVar.invoke(obj);
    }

    public static final ji.r<we.l0> x3(Activity activity, int i3, int i4, com.joaomgcd.taskerm.util.q qVar) {
        yj.p.i(activity, "activity");
        if (qVar == null) {
            qVar = new com.joaomgcd.taskerm.util.t(activity, i4, new Object[0]);
        }
        return jg.c.c(activity, qVar, f2.i, g2.i, (SharedPreferences) null, new h2(activity, i3, i4), 8, (Object) null);
    }

    public static final ji.r<we.l0> y0(Activity activity) {
        yj.p.i(activity, "activity");
        return d1(activity, 2131888311, 2131888322);
    }

    public static mi.b y1(Activity activity, int i3, com.joaomgcd.taskerm.util.q qVar, xj.a aVar, int i4, Object obj) {
        if ((i4 & 8) != 0) {
            aVar = null;
        }
        return x1(activity, i3, qVar, aVar);
    }

    public static final ji.r<String> y2(Activity activity) {
        yj.p.i(activity, "activity");
        return pg.w0.K0(new m1(activity));
    }

    public static ji.r y3(Activity activity, int i3, int i4, com.joaomgcd.taskerm.util.q qVar, int i5, Object obj) {
        if ((i5 & 8) != 0) {
            qVar = null;
        }
        return x3(activity, i3, i4, qVar);
    }

    public static final ji.r<we.l0> z0(Activity activity) {
        yj.p.i(activity, "activity");
        if (!com.joaomgcd.taskerm.util.k.a.p()) {
            return s2(activity, "media_key_listener_grant", "android.permission.SET_MEDIA_KEY_LISTENER", 2131887251, false, false, false, 112, null);
        }
        ji.r<we.l0> w2 = ji.r.w(new we.l0(0, null, 2, null));
        yj.p.h(w2, "just(...)");
        return w2;
    }

    public static final ji.r<we.l0> z1(Activity activity, String str, String str2, int i3) {
        yj.p.i(activity, "activity");
        yj.p.i(str, "title");
        return e3(new we.k(activity, str, str2, 2131886876, 2131886875, i3, false, 0, null, 0, null, null, 4032, null));
    }

    public static final ji.r<String> z2(Context context, boolean z2, String str, boolean z3, boolean z4, Long l2) {
        yj.p.i(context, "context");
        return pg.w0.K0(new n1(context, z3, str, l2, z2, z4));
    }

    public static final int z3(boolean z2) {
        return z2 ? 1 : 0;
    }
}