导航菜单

页面标题

页面副标题

Tasker v6.5.11 - ActionEdit.java 源代码

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

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


package net.dinglisch.android.taskerm;

import android.app.Activity;
import android.app.KeyguardManager;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.hardware.Camera;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SeekBar;
import android.widget.TextView;
import com.joaomgcd.taskerm.spawn.RFactory;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import com.joaomgcd.taskerservercommon.ConstantsCommonTaskerServer;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import net.dinglisch.android.taskerm.ActionEdit;
import net.dinglisch.android.taskerm.FileSelect;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.a1;
import net.dinglisch.android.taskerm.am;
import net.dinglisch.android.taskerm.d6;
import net.dinglisch.android.taskerm.dk;
import net.dinglisch.android.taskerm.hk;
import net.dinglisch.android.taskerm.j7;
import net.dinglisch.android.taskerm.mh;
import net.dinglisch.android.taskerm.qk;
import net.dinglisch.android.taskerm.ri;
import net.dinglisch.android.taskerm.sk;
import net.dinglisch.android.taskerm.vo;
import net.dinglisch.android.taskerm.yd;
import net.dinglisch.android.taskerm.yo;
import net.dinglisch.android.taskerm.zk;
import qf.d;

public class ActionEdit extends HasArgsEdit implements AdapterView.OnItemSelectedListener, TextWatcher, am.l, pf.a {
    private static List<ResolveInfo> Z0 = null;
    private static ArrayList<String> a1 = null;
    private static int b1 = -1;
    private ImageButton A0;
    private LinearLayout B0;
    private LinearLayout C0;
    private LinearLayout D0;
    private am E0;
    private MyScrollView F0;
    private LinearLayout G0;
    private ListView H0;
    private net.dinglisch.android.taskerm.c N0;
    private int O0;
    public Bundle Q0;
    private boolean U0;
    private ImageView n0;
    private String q0;
    private CheckBox r0;
    private LinearLayout s0;
    private EditText t0;
    private CheckBox u0;
    private EditText v0;
    private EditText w0;
    private ImageButton x0;
    private ImageButton y0;
    private ImageButton z0;
    public qf.e m0 = new qf.e(this);
    private Camera o0 = null;
    private c6 p0 = null;
    private String I0 = null;
    private ArrayList<String> J0 = null;
    private ArrayList<String> K0 = null;
    private boolean L0 = false;
    private int M0 = -1;
    private b0 P0 = b0.None;
    private List<String> R0 = null;
    private String S0 = null;
    private int T0 = 99;
    private CompoundButton.OnCheckedChangeListener V0 = new k();
    private int W0 = 11;
    boolean X0 = false;
    private wj Y0 = null;

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                ActionEdit.this.P3();
                return;
            }
            ActionEdit actionEdit = ActionEdit.this;
            actionEdit.C = true;
            actionEdit.M5(h4.w(true), 62);
        }
    }

    private static class a0 extends Handler {
        WeakReference<ActionEdit> a;
        int b;

        a0(ActionEdit actionEdit, int i) {
            this.a = new WeakReference<>(actionEdit);
            this.b = i;
        }

        @Override
        public void handleMessage(Message message) {
            ActionEdit actionEdit = this.a.get();
            int i = message.what;
            if (i == 1) {
                r7.F("ActionEdit", "ae exit");
                dq.j0(actionEdit, 2131886891, new Object[0]);
                actionEdit.Q5();
            } else {
                if (i != 2) {
                    return;
                }
                Bundle data = message.getData();
                int i2 = data.getInt("l");
                dq.b0(actionEdit, data.getString("m").replaceFirst("\\s*Uncaught\\s*SyntaxError:\\s*", ""), new Object[0]);
                dq.E1(actionEdit.v[this.b], i2);
                actionEdit.Q5();
            }
        }
    }

    class b extends Handler {
        b() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 0) {
                ActionEdit actionEdit = ActionEdit.this;
                dq.W2(actionEdit.v[actionEdit.D], dh.d(message.getData().getInt("colour")));
            }
        }
    }

    public enum b0 {
        None,
        UI,
        Exe
    }

    class c extends Handler {
        final int a;

        c(int i) {
            this.a = i;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                ActionEdit.this.v[this.a].setText(message.getData().getString("text"));
            }
        }
    }

    class d extends Handler {
        final int a;
        final oi.d b;

        d(int i, oi.d dVar) {
            this.a = i;
            this.b = dVar;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                ActionEdit.this.v[this.a].setText(message.getData().getString("text"));
                if (this.b != null) {
                    try {
                        this.b.accept(Integer.valueOf(message.getData().getInt("index")));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }

    class e extends Handler {
        e() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1 && ActionEdit.this.a5()) {
                ActionEdit.b1 = message.getData().getInt("index");
                ActivityInfo activityInfo = ((ResolveInfo) ActionEdit.Z0.get(ActionEdit.b1)).activityInfo;
                Intent intent = new Intent();
                intent.setComponent(new ComponentName(activityInfo.packageName, activityInfo.name));
                intent.setAction("android.speech.tts.engine.CHECK_TTS_DATA");
                ActionEdit.this.q0 = activityInfo.packageName;
                try {
                    ActionEdit.this.M5(intent, 50);
                    ActionEdit.this.C = true;
                } catch (ActivityNotFoundException unused) {
                    dq.a0(ActionEdit.this, 2131887787, new Object[0]);
                }
            }
        }
    }

    class f extends Handler {
        f() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1 && ActionEdit.this.a5()) {
                String string = message.getData().getString("text");
                String str = ((ResolveInfo) ActionEdit.Z0.get(ActionEdit.b1)).activityInfo.packageName;
                ActionEdit actionEdit = ActionEdit.this;
                actionEdit.v[actionEdit.D].setText(str + ConstantsCommonTaskerServer.ID_SEPARATOR + string);
            }
        }
    }

    class g extends Handler {
        g() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                String string = message.getData().getString("text");
                ActionEdit actionEdit = ActionEdit.this;
                actionEdit.v[actionEdit.D].setText(string);
                int parseInt = Integer.parseInt(string);
                SharedPreferences S0 = dq.S0(ActionEdit.this);
                int e4 = ActionEdit.this.e4();
                l1.q(S0, e4);
                int k = l1.k(S0, e4);
                if (k <= 0 || parseInt <= k) {
                    return;
                }
                lp.e(ActionEdit.this, 1, 2131890947, 1);
            }
        }
    }

    class h extends Handler {
        final int a;
        final int b;

        h(int i, int i2) {
            this.a = i;
            this.b = i2;
        }

        @Override
        public void handleMessage(Message message) {
            String string;
            hh hhVar;
            if (message.what != 1 || (string = message.getData().getString("text")) == null) {
                return;
            }
            String f = xl.f(ActionEdit.this, string);
            int j = ActionEdit.this.N0.j();
            if (!a1.X0(j, this.a) || a1.Y0(f, j, this.a)) {
                hhVar = null;
            } else {
                uo L0 = ActionEdit.this.L0();
                hhVar = L0.p(f) ? a1.G1(ActionEdit.this.getResources(), j, this.a, L0.c0(f)) : new hh(2131887911, new String[]{f});
            }
            if (hhVar != null) {
                hhVar.a(ActionEdit.this);
                return;
            }
            ActionEdit.this.v[this.a].setText(f);
            ActionEdit.this.R[this.a].setText(f);
            ActionEdit.this.N0.k0(this.a, f);
            ActionEdit.this.I3(this.a);
            if (this.b == 2131887542) {
                if (a1.j1(j)) {
                    ActionEdit.this.n5(1);
                } else {
                    ActionEdit.this.n5(this.a);
                }
            }
            if (ActionEdit.this.N0.j() == 51) {
                ActionEdit.this.N0.k0(4, dq.m1(ActionEdit.this.v[4]));
                ActionEdit.this.n5(4);
            }
        }
    }

    class i extends Handler {
        final int a;
        final EditText b;

        i(int i, EditText editText) {
            this.a = i;
            this.b = editText;
        }

        private void c(String str, int i) {
            EditText editText = this.b;
            if (editText == null) {
                ActionEdit actionEdit = ActionEdit.this;
                editText = actionEdit.N0(actionEdit.N0);
            }
            if (editText == null) {
                r7.k("ActionEdit", "no text focus on return from variable select");
                return;
            }
            boolean z = false;
            if (!kq.R0(ActionEdit.this, i)) {
                dq.a0(ActionEdit.this, 2131891051, new Object[0]);
                return;
            }
            int Q2 = ActionEdit.this.N0.j() == 129 ? -1 : dq.Q2(ActionEdit.this, editText, 524289);
            String m1 = dq.m1(editText);
            boolean z2 = m1.startsWith("%") && m1.endsWith("(");
            int O3 = ActionEdit.this.O3(editText);
            if (!z2 && O3 != -1 && ((ActionEdit.this.N0.j() == 345 && O3 == 1) || a1.D0(ActionEdit.this.N0.j(), O3).equals("uvar"))) {
                z = true;
            }
            if (!str.startsWith("%")) {
                str = kq.I0(i);
            }
            if (ActionEdit.this.N0.j() == 129 && O3 == 0) {
                str = kq.Z1(str);
            }
            Boolean A2 = ActionEdit.this.m0.A2(O3);
            boolean z3 = (A2 == null || !A2.booleanValue()) ? z : true;
            String o2 = ActionEdit.this.m0.o2(editText, O3, m1, str);
            if (z3) {
                dq.W2(editText, o2);
            } else {
                kq.P0(ActionEdit.this, o2, editText);
                if (z2) {
                    dq.G1(ActionEdit.this, editText, ")");
                }
            }
            if (Q2 != -1) {
                dq.Q2(ActionEdit.this, editText, Q2);
            }
            kq.w(ActionEdit.this, i);
        }

        public void d(int i, String str) {
            if (ActionEdit.this.Y0 != null) {
                ActionEdit.this.Y0.dismiss();
            }
            ActionEdit.this.Y0 = null;
            c(str, i);
        }

        public void e(final int i, String str, ArrayList arrayList) {
            ActionEdit.this.t2(i, str, arrayList, new com.joaomgcd.taskerm.util.c() {
                @Override
                public final void a(Object obj) {
                    ActionEdit.i.this.d(i, (String) obj);
                }
            });
        }

        @Override
        public void handleMessage(Message message) {
            try {
                int i = message.what;
                if (i == 1 || i == 2) {
                    final String string = message.getData().getString("text");
                    int i2 = message.getData().getInt("index");
                    int i3 = message.getData().getInt("boo");
                    if (i2 < i3 && !string.startsWith("%")) {
                        string = ri.r(string);
                    }
                    final int i4 = this.a == 2131887420 ? i2 - i3 : i2;
                    if (i2 >= i3) {
                        ArrayList arrayList = new ArrayList();
                        kq.s0(ActionEdit.this, null, arrayList, false);
                        i4 = ((Integer) arrayList.get(i4)).intValue();
                    }
                    if (message.what == 2) {
                        ActionEdit.this.A.O1(new com.joaomgcd.taskerm.util.c() {
                            @Override
                            public final void a(Object obj) {
                                ActionEdit.i.this.e(i4, string, (ArrayList) obj);
                            }
                        });
                        if (message.what != 2) {
                            ActionEdit.this.Y0 = null;
                            return;
                        }
                        return;
                    }
                    c(string, i4);
                }
                if (message.what != 2) {
                    ActionEdit.this.Y0 = null;
                }
            } catch (Throwable th2) {
                if (message.what != 2) {
                    ActionEdit.this.Y0 = null;
                }
                throw th2;
            }
        }
    }

    class j extends Handler {
        j() {
        }

        @Override
        public void handleMessage(Message message) {
            ActionEdit.this.m0.B3();
        }
    }

    class k implements CompoundButton.OnCheckedChangeListener {
        k() {
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            if (z) {
                ActionEdit.this.t0.setVisibility(0);
                ActionEdit.this.t0.requestFocus();
            } else {
                ActionEdit.this.t0.setVisibility(8);
                ActionEdit.this.t0.setText("");
            }
        }
    }

    class l implements mh.f {
        final EditText a;

        l(EditText editText) {
            this.a = editText;
        }

        @Override
        public void a(mh mhVar) {
            if (mhVar.v()) {
                return;
            }
            dq.W2(this.a, wd.a(mhVar.A()));
        }
    }

    class m extends Handler {
        final List a;
        final String[] b;
        final EditText c;

        m(List list, String[] strArr, EditText editText) {
            this.a = list;
            this.b = strArr;
            this.c = editText;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                int i = message.getData().getInt("index");
                String str = ((String) this.a.get(i)) + "\n" + this.b[i];
                dq.W2(this.c, str);
                ActionEdit.this.N0.k0(2, str);
                for (int i2 = 3; i2 <= 9; i2++) {
                    ActionEdit.this.n5(i2);
                    if (ActionEdit.this.v[i2].getVisibility() != 0) {
                        dq.W2(ActionEdit.this.v[i2], "");
                    } else if (i2 == 3) {
                        ActionEdit.this.v[3].requestFocus();
                    }
                }
                ActionEdit.this.n5(0);
                if (ActionEdit.this.v[0].getVisibility() == 0) {
                    ActionEdit.this.v[0].requestFocus();
                } else {
                    dq.W2(ActionEdit.this.v[0], "");
                }
            }
        }
    }

    class n extends Handler {
        final List a;
        final List b;
        final boolean c;
        final EditText d;

        n(List list, List list2, boolean z, EditText editText) {
            this.a = list;
            this.b = list2;
            this.c = z;
            this.d = editText;
        }

        @Override
        public void handleMessage(Message message) {
            int i = message.what;
            if (i != 1) {
                if (i == 2) {
                    int i2 = message.getData().getInt("index");
                    ActionEdit.this.M5(d6.A(d6.P(((String) this.a.get(i2)) + "." + ((String) this.b.get(i2)))), 57);
                    return;
                }
                return;
            }
            int i3 = message.getData().getInt("index");
            String str = ((String) this.a.get(i3)) + "." + ((String) this.b.get(i3));
            String F = d6.F(str);
            if (F != null) {
                str = F;
            }
            if (this.c) {
                String[] a0 = d6.a0(dq.m1(this.d));
                dq.W2(this.d, d6.j(str) + " " + a0[1]);
                return;
            }
            dq.W2(this.d, str);
            dq.W2(ActionEdit.this.v[2], "");
            for (int i4 = 3; i4 <= 9; i4++) {
                dq.W2(ActionEdit.this.v[i4], "");
            }
            dq.W2(ActionEdit.this.v[2], "");
        }
    }

    class o extends Handler {
        final String[] a;
        final int b;

        o(String[] strArr, int i) {
            this.a = strArr;
            this.b = i;
        }

        @Override
        public void handleMessage(Message message) {
            EditText editText;
            if (message.what == 1) {
                String str = this.a[message.getData().getInt("index")];
                int i = this.b;
                if (i == -1) {
                    ActionEdit actionEdit = ActionEdit.this;
                    editText = actionEdit.N0(actionEdit.N0);
                } else {
                    editText = ActionEdit.this.v[i];
                }
                if (editText != null) {
                    dq.W2(editText, str);
                }
            }
        }
    }

    class p extends Handler {
        final EditText a;

        p(EditText editText) {
            this.a = editText;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                String string = message.getData().getString("text");
                if (!this.a.getText().toString().endsWith(".")) {
                    string = "." + string;
                }
                this.a.append(string);
            }
        }
    }

    class q extends qh {
        q(Context context, yg ygVar, ImageView imageView, ImageView imageView2, ImageView imageView3) {
            super(context, ygVar, imageView, imageView2, imageView3);
        }

        @Override
        public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
            int itemId = menuItem.getItemId();
            if (itemId == 2) {
                ActionEdit.this.M3(d().f());
                ActionEdit.this.v();
                return true;
            }
            if (itemId != 3) {
                return true;
            }
            g(ActionEdit.this.H0);
            return true;
        }

        @Override
        public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
            super.onCreateActionMode(actionMode, menu);
            return ActionEdit.this.U(actionMode);
        }

        @Override
        public void onDestroyActionMode(ActionMode actionMode) {
            super.onDestroyActionMode(actionMode);
            ActionEdit.this.U(null);
        }

        @Override
        public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
            super.e(actionMode, menu, false);
            if (this.g == -1) {
                return false;
            }
            net.dinglisch.android.taskerm.a.k(ActionEdit.this, 2, menu);
            if (d().b()) {
                return true;
            }
            net.dinglisch.android.taskerm.a.P(ActionEdit.this, 3, menu);
            return true;
        }
    }

    static class r {
        static final int[] a;
        static final int[] b;

        static {
            int[] iArr = new int[yo.h.a.values().length];
            b = iArr;
            try {
                iArr[yo.h.a.TimerRemaining.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                b[yo.h.a.ActionAvailable.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                b[yo.h.a.StateAvailable.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                b[yo.h.a.EventAvailable.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            int[] iArr2 = new int[yo.a.EnumC0255a.values().length];
            a = iArr2;
            try {
                iArr2[yo.a.EnumC0255a.PackageVersion.ordinal()] = 1;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[yo.a.EnumC0255a.PackageVersionLabel.ordinal()] = 2;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                a[yo.a.EnumC0255a.PackageName.ordinal()] = 3;
            } catch (NoSuchFieldError unused7) {
            }
        }
    }

    class s implements View.OnTouchListener {
        s() {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            am amVar = ActionEdit.this.E0;
            ActionEdit actionEdit = ActionEdit.this;
            return amVar.h0(actionEdit, actionEdit.H0, ActionEdit.this.y(), motionEvent);
        }
    }

    class t implements AdapterView.OnItemClickListener {
        t() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
            ActionEdit.this.O5(i);
        }
    }

    class u implements TextWatcher {
        u() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            ActionEdit.this.l4(charSequence);
        }
    }

    class v extends Handler {
        final net.dinglisch.android.taskerm.c a;
        final int b;

        v(net.dinglisch.android.taskerm.c cVar, int i) {
            this.a = cVar;
            this.b = i;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                String string = message.getData().getString("text");
                this.a.k0(ActionEdit.this.D, string);
                ActionEdit.this.v[this.b].setText(string);
                ActionEdit.this.I3(this.b);
                ActionEdit.this.J3();
            }
        }
    }

    class w extends Handler {
        final net.dinglisch.android.taskerm.c a;
        final int b;

        w(net.dinglisch.android.taskerm.c cVar, int i) {
            this.a = cVar;
            this.b = i;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                String str = ActionEdit.this.L0().v().get(message.getData().getInt("index"));
                this.a.k0(ActionEdit.this.D, str);
                ActionEdit.this.v[this.b].setText(str);
                ActionEdit.this.I3(this.b);
            }
        }
    }

    class x implements oi.d<we.l0> {
        x() {
        }

        @Override
        public void accept(we.l0 l0Var) throws Exception {
            if (l0Var.k()) {
                ExtensionsContextKt.m(ActionEdit.this, "https://tasker.joaoapps.com/userguide/en/matching.html");
            }
        }
    }

    class y extends Handler {
        y() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                ActionEdit.this.P3();
                return;
            }
            ActionEdit actionEdit = ActionEdit.this;
            actionEdit.C = false;
            actionEdit.M5(MyDeviceAdminReceiver.d(actionEdit), 56);
            ActionEdit.this.C = true;
        }
    }

    class z extends Handler {
        z() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                ActionEdit.this.P3();
                return;
            }
            ActionEdit actionEdit = ActionEdit.this;
            actionEdit.C = true;
            MyAccessibilityService.v(actionEdit);
        }
    }

    public void A4(int i2, ArrayList arrayList) {
        Intent G = ri.G(this, ri.c.Action, this.N0.a(0), i2, kq.a0(this, arrayList));
        if (G != null) {
            M5(G, 51);
        }
    }

    private void A5(int i2, int i3) {
        wj D = wj.D(this, new h(i2, i3), i3);
        if (i3 == 2131887536) {
            D.G(Y3(b4()));
        } else {
            List<String> c4 = c4();
            for (String str : a1.J(this.N0.j(), i2)) {
                if (str != null && !c4.contains(str)) {
                    c4.add(0, xl.k(this, str));
                }
            }
            D.G(c4);
        }
        D.C(this);
    }

    public void B4(int i2, int i3) {
        this.U[i2].setCheckedNoSignal(false);
        dq.a0(this, 2131887853, new Object[0]);
        this.m0.C3(i3, i2);
    }

    private void B5(int i2, int i3, Collection<String> collection, int i4) {
        C5(i2, i3, collection, i4, false);
    }

    public void C4(View view) {
        if (!a1.e1(this.N0.j()) || this.H0.getAdapter().getCount() < 3) {
            O5(-1);
        } else {
            dq.a0(this, 2131887825, 3);
        }
    }

    private void C5(int i2, int i3, Collection<String> collection, int i4, boolean z2) {
        D5(i2, i3, collection, i4, z2, null);
    }

    public void D4(CompoundButton compoundButton, boolean z2) {
        if (this.N0.j() == 549) {
            n5(2);
        }
    }

    private void D5(int i2, int i3, Collection<String> collection, int i4, boolean z2, oi.d<Integer> dVar) {
        if (collection == null) {
            return;
        }
        this.D = i2;
        if (collection.size() == 0 && i4 != -1) {
            dq.n0(this, i4, new Object[0]);
            return;
        }
        wj D = wj.D(this, new d(i2, dVar), i3);
        if (collection.getClass() == List.class || collection.getClass() == ArrayList.class || collection.getClass() == LinkedList.class) {
            D.G((List) collection);
        } else {
            D.H((Set) collection);
        }
        if (z2) {
            D.b0();
        }
        D.C(this);
    }

    public void E4(Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131891164, 2131886930));
            return;
        }
        this.C = true;
        if (this.N0.j() == 915) {
            HTMLView.H0(this, "cpu.html", -1, HTMLView.g.Inform);
        } else {
            p5();
        }
    }

    private void E5(int i2, int i3, String[] strArr, int i4) {
        F5(i2, i3, strArr, i4, false);
    }

    private void F3() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null || cVar.j() != 664) {
            return;
        }
        d6.J(W3());
    }

    public void F4(com.joaomgcd.taskerm.util.s6 s6Var) throws Exception {
        P3();
    }

    private void F5(int i2, int i3, String[] strArr, int i4, boolean z2) {
        this.D = i2;
        if (strArr.length == 0 && i4 != -1) {
            dq.n0(this, i4, new Object[0]);
            return;
        }
        wj D = wj.D(this, new c(i2), i3);
        D.I(strArr);
        if (z2) {
            D.b0();
        }
        D.C(this);
    }

    private void G3() {
        if (this.N0.j() == 47) {
            String m1 = dq.m1(this.v[0]);
            dk.e eVar = dk.e.values()[U0(1)];
            if (eVar == dk.e.Overlay) {
                uo L0 = L0();
                if (L0.p(m1) && L0.h(m1)) {
                    oi.h(this, 2131891282, 2131887281);
                }
            }
            if (dk.x2(eVar)) {
                this.m0.Q(com.joaomgcd.taskerm.dialog.a.s1(this, 2131889441, 2131888172));
            }
        }
    }

    public void G4(we.l0 l0Var) throws Exception {
        P3();
    }

    private void G5() {
        int size = Z0.size();
        String[] strArr = new String[size];
        for (int i2 = 0; i2 < size; i2++) {
            String charSequence = getPackageManager().getApplicationLabel(Z0.get(i2).activityInfo.applicationInfo).toString();
            strArr[i2] = charSequence;
            if (TextUtils.isEmpty(charSequence)) {
                strArr[i2] = "<" + vh.g(this, 2131891270, new Object[0]).toLowerCase() + ">";
            }
        }
        wj.D(this, new e(), 2131890983).I(strArr).C(this);
    }

    private void H3() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar != null) {
            cVar.m(getPackageManager(), L0(), this.I0, null);
        }
    }

    public void H4(int i2, String str) throws Exception {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        N1(i2, str);
    }

    private void H5() {
        wj.D(this, new f(), 2131890984).G(a1).C(this);
    }

    public boolean I3(int i2) {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar != null) {
            boolean U0 = cVar.U0(i2);
            H3();
            if (U0 != this.N0.U0(i2)) {
                n5(i2);
                return true;
            }
        }
        return false;
    }

    public void I4(String str) {
        this.v0.setText(str);
    }

    public void J3() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar != null) {
            int j2 = cVar.j();
            if (a1.W0(j2)) {
                n5(a1.H(j2));
            }
        }
    }

    public void J4(View view) {
        this.m0.f3(new com.joaomgcd.taskerm.util.c() {
            @Override
            public final void a(Object obj) {
                ActionEdit.this.I4((String) obj);
            }
        });
    }

    private void K3() {
        super.A0(this.W0);
    }

    public void K4(View view) {
        J5(2131887420, this.v0);
    }

    private void K5() {
        ExecuteService.Q7(this);
        finish();
    }

    private void L3() {
        if (Y4()) {
            l5();
            this.N0.C(this, sk.c.Standard);
            sk y0 = this.N0.y0();
            qk.a aVar = qk.a.Single;
            y0.k5(aVar);
            sk y02 = this.N0.y0();
            if (this.N0.j() != 551) {
                aVar = qk.a.None;
            }
            y02.k5(aVar);
            j7 l4 = y02.l4(this, this.E0, j7.g.Build, null);
            this.H0.setAdapter((ListAdapter) l4);
            h5(l4);
            this.F0.setNestingWorkaround(true);
        } else {
            this.F0.setNestingWorkaround(false);
        }
        U5();
    }

    public void L4(View view) {
        this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131890214, 2131890215));
    }

    public static void L5(Activity activity, Context context, tn tnVar, int i2, Integer num, String str, String str2, ArrayList<String> arrayList, List<String> list, int i3) {
        net.dinglisch.android.taskerm.c A0;
        if (i2 >= 0 && (A0 = tnVar.A0(i2)) != null && A0.j() >= 1000) {
            ri.c cVar = ri.c.Action;
            if (!ri.T(cVar, A0.j())) {
                oi.t(activity, A0, cVar, 1, 2);
                return;
            }
        }
        activity.startActivityForResult(new d.b().a(context, new d.b.a(tnVar, i2, num, str, str2, arrayList, list, i3)), 65031);
    }

    public void M3(List<Integer> list) {
        this.N0.y0().n4(list);
        k4();
    }

    public void M4(View view) {
        J5(2131887420, this.v0);
    }

    public void M5(Intent intent, int i2) {
        this.C = true;
        try {
            startActivityForResult(intent, i2);
        } catch (SecurityException unused) {
            this.C = false;
            dq.a0(this, 2131887725, new Object[0]);
        } catch (Exception e2) {
            this.C = false;
            dq.b0(this, e2.toString(), new Object[0]);
        }
    }

    private void N3() {
        am amVar = this.E0;
        if (amVar != null) {
            amVar.i0();
            this.E0 = null;
        }
        this.n0 = null;
        Z0 = null;
        a1 = null;
        this.o0 = null;
        this.p0 = null;
        this.s0 = null;
        this.r0 = null;
        this.t0 = null;
        this.B0 = null;
        this.F0 = null;
        this.G0 = null;
        this.H0 = null;
        this.J0 = null;
        this.N0 = null;
        this.Q0 = null;
        this.R0 = null;
        this.m0.J();
    }

    public lj.e0 N4() {
        q5(this, this.N0.r0(), null);
        return lj.e0.a;
    }

    private void N5() {
        Intent intent = new Intent("android.intent.action.PICK");
        intent.setType("image/*");
        M5(intent, 53);
    }

    public int O3(EditText editText) {
        if (this.N0 != null && editText != null) {
            for (int i2 = 0; i2 < this.N0.Y(); i2++) {
                if (editText.equals(this.v[i2])) {
                    return i2;
                }
            }
        }
        return -1;
    }

    public void O4(net.dinglisch.android.taskerm.k kVar, DialogInterface dialogInterface) {
        if (!this.E) {
            i4(kVar.z(), kVar.g());
        }
        this.z = null;
    }

    public void O5(int i2) {
        this.D = i2;
        Intent intent = new Intent(this, (Class<?>) ListItemEdit.class);
        boolean z2 = false;
        if (i2 != -1) {
            intent.putExtra("item", this.N0.y0().r4(i2).U(0).c0());
        }
        sk y0 = this.N0.y0();
        if (y0 != null && y0.F4()) {
            z2 = true;
        }
        intent.putExtra("showSelect", z2);
        intent.putExtra("imageSelectFlags", a1.e1(this.N0.j()) ? 36 : 383);
        startActivityForResult(intent, 63);
    }

    public void P3() {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.P3():void");
    }

    public void P4(MyScrollView myScrollView, DialogInterface dialogInterface) {
        this.E = true;
        if (this.N0 == null) {
            E3();
        } else if (myScrollView != null) {
            myScrollView.setVisibility(0);
        }
        this.z = null;
    }

    private void P5(int i2) {
        this.C = false;
        try {
            M5(ji.j(), i2);
            this.C = true;
        } catch (ActivityNotFoundException unused) {
            dq.a0(this, 2131887775, new Object[0]);
            P3();
        }
    }

    public void Q4(String str, EditText editText, HashMap hashMap) {
        LinkedList linkedList = new LinkedList();
        LinkedList linkedList2 = new LinkedList();
        d6.c b2 = d6.b(W3(), str, d6.a.Both, null, null, null, hashMap, "lookupFields");
        if (b2.a != null) {
            d6.N(W3(), b2, linkedList, linkedList2);
        }
        if (linkedList.isEmpty()) {
            dq.j0(this, 2131887867, new Object[0]);
            return;
        }
        int size = linkedList.size();
        String[] strArr = new String[size];
        for (int i2 = 0; i2 < size; i2++) {
            strArr[i2] = d6.F(((Class) linkedList2.get(i2)).getName());
        }
        wj.D(this, new p(editText), 2131889607).G(linkedList).S(strArr).C(this);
    }

    public void Q5() {
        r7.f("ActionEdit", "stop JSI");
        c6 c6Var = this.p0;
        if (c6Var == null) {
            r7.G("ActionEdit", "stopJSI: null");
        } else {
            c6Var._stop();
            this.p0 = null;
        }
        this.Y[0].setVisibility(0);
    }

    private String R3() {
        return dq.m1(this.v[1]);
    }

    public void R4(java.lang.String r21, android.widget.EditText r22, java.util.HashMap r23) {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.R4(java.lang.String, android.widget.EditText, java.util.HashMap):void");
    }

    private void R5() {
        if (X5()) {
            g5();
            ExecuteService.f6(this, new net.dinglisch.android.taskerm.c[]{this.N0}, TaskerAppWidgetConfigure.i(this), true);
        }
    }

    private a1.c S3() {
        return a1.c.values()[U0(0)];
    }

    public void S4(boolean z2, int i2, int i3, HashMap hashMap) {
        int i4;
        String F;
        eq eqVar = d6.h;
        int size = hashMap == null ? 0 : hashMap.size();
        List<String> d2 = eqVar.d();
        String[] D = z2 ? d6.D() : new String[0];
        int size2 = size + d2.size() + D.length;
        String[] strArr = new String[size2];
        String[] strArr2 = new String[size2];
        if (hashMap != null) {
            i4 = 0;
            for (Map.Entry entry : hashMap.entrySet()) {
                if (kq.W0((String) entry.getKey())) {
                    strArr[i4] = (String) entry.getKey();
                    strArr2[i4] = d6.F((String) entry.getValue());
                    i4++;
                } else {
                    d2.add(((String) entry.getKey()) + '\n' + ((String) entry.getValue()));
                }
            }
        } else {
            i4 = 0;
        }
        Collections.sort(d2);
        int i5 = 0;
        while (i5 < d2.size()) {
            String str = d2.get(i5);
            if (str.contains("\n")) {
                String[] split = str.split("\\n");
                String str2 = split[0];
                F = split[1];
                str = str2;
            } else {
                Class<?> e2 = eqVar.e(d2.get(i5));
                F = e2 != null ? d6.F(e2.getName()) : "";
            }
            strArr[i4] = str;
            strArr2[i4] = F;
            i5++;
            i4++;
        }
        Class<?>[] C = d6.C();
        int i6 = 0;
        while (i6 < D.length) {
            strArr[i4] = D[i6];
            strArr2[i4] = d6.F(C[i6].getName());
            i6++;
            i4++;
        }
        if (size2 == 0) {
            dq.j0(this, 2131887867, new Object[0]);
        } else {
            wj.D(this, new o(strArr, i2), i3).I(strArr).S(strArr2).C(this);
        }
    }

    private void S5(String str, String str2, boolean z2) {
        if (this.p0 != null) {
            r7.G("ActionEdit", "jsi not null");
            return;
        }
        if (str.length() > 0) {
            c6 runPureScript = c6.runPureScript(this, c6.ACTION_EDIT_ID, null, 100, z2, str, str2, new Bundle(), new a0(this, this.D));
            this.p0 = runPureScript;
            if (runPureScript != null) {
                this.Y[0].setVisibility(4);
            }
        }
    }

    private String T3(int i2, int i3) {
        String N0 = a1.N0(i3, i2);
        return N0 == null ? this.m0.a2(i2) : N0;
    }

    public void T4(boolean z2, we.l0 l0Var) throws Exception {
        if (l0Var.o()) {
            P5(64);
        } else if (z2) {
            E3();
        } else {
            P3();
        }
    }

    private void T5(int i2, int i3) {
        if (i2 == 65 && i3 == 3) {
            n5(4);
        }
    }

    private String[] U3(String str) {
        return d6.u(str);
    }

    public void U4(wj wjVar) {
        this.Y0 = wjVar;
    }

    private void U5() {
        if (Y4()) {
            ListAdapter adapter = this.H0.getAdapter();
            int count = adapter == null ? 0 : adapter.getCount();
            dq.S2(this.H0, j7.u(this));
            this.H0.setVisibility(count > 0 ? 0 : 8);
            r1 = 0;
        }
        this.G0.setVisibility(r1);
    }

    private String V3(String str) {
        String[] t2 = d6.t(str);
        if (t2 != null) {
            return d6.s(t2[1], false);
        }
        return null;
    }

    private void V4(int i2) {
        hk hkVar;
        xj.a<lj.e0> b2 = this.m0.b2(i2, M0(i2));
        if (b2 != null) {
            b2.invoke();
            return;
        }
        if (this.N0.j() == 69) {
            String m1 = dq.m1(this.v[3]);
            hk.k kVar = hk.k1()[U0(1)];
            if (m1.length() > 0) {
                try {
                    hkVar = hk.h0(new qi(m1));
                } catch (Exception e2) {
                    dq.b0(this, "oops: " + e2.toString(), new Object[0]);
                    hkVar = null;
                }
                if (hkVar == null) {
                    dq.b0(this, "oops", new Object[0]);
                } else if (hkVar.C1() != kVar) {
                    hk.k[] k1 = hk.k1();
                    int i3 = 0;
                    while (i3 < k1.length && k1[i3] != hkVar.C1()) {
                        i3++;
                    }
                    this.V[1].setSelection(i3, false);
                }
            } else {
                hkVar = hk.W0(this, kVar);
            }
            if (hkVar != null) {
                startActivityForResult(new Intent(this, (Class<?>) SceneEditElement.class).putExtra("el", hkVar.U(0).c0()).putExtra("sc", new dk().U(0).c0()).putExtra("flags", 264), 60);
            }
        }
    }

    private boolean V5(int i2, String str, Integer num) {
        if (str.startsWith("%")) {
            if (!kq.c1(str)) {
                return dq.a0(this, 2131887692, str);
            }
        } else {
            if (num == null) {
                return dq.b0(this, str + ": " + vh.g(this, 2131887865, new Object[0]), new Object[0]);
            }
            if (!l1.t(i2, num.intValue())) {
                return dq.a0(this, 2131887914, vh.g(this, 2131889773, new Object[0]), str);
            }
        }
        return true;
    }

    private Context W3() {
        return this.I0 != null ? this : getApplicationContext();
    }

    private boolean W4() {
        zk.e eVar = zk.e.values()[U0(2)];
        return eVar == zk.e.MoveToMarker || eVar == zk.e.MoveToMarkerAnimated || eVar == zk.e.MoveToPoint || eVar == zk.e.MoveToPointAnimated || eVar == zk.e.SetZoom;
    }

    private List<String> X3(String str) {
        return Z3(str, -1);
    }

    private void X4(List<Integer> list, int i2) {
        this.N0.y0().E4(list, i2);
        k4();
    }

    private boolean X5() {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.X5():boolean");
    }

    private List<String> Y3(String str) {
        return Z3(str, this.N0.j());
    }

    private boolean Y4() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null) {
            return false;
        }
        int j2 = cVar.j();
        return j2 == 551 || j2 == 157 || (a1.e1(j2) && yd.f0.h());
    }

    private boolean Y5() {
        return ll.K4(U0(2));
    }

    private List<String> Z3(String str, int i2) {
        String str2 = this.I0;
        if (str2 == null || !str2.equals(str)) {
            uo L0 = L0();
            return L0.p(str) ? L0.o(str, i2) : new ArrayList();
        }
        ArrayList arrayList = new ArrayList();
        Iterator<String> it = this.J0.iterator();
        while (it.hasNext()) {
            String[] split = it.next().split("::dvd::");
            if (i2 == -1 || i2 == 143) {
                arrayList.add(split[0]);
            } else {
                int[] l1 = hk.l1(hk.k.valueOf(split[1]));
                int length = l1.length;
                int i3 = 0;
                while (true) {
                    if (i3 >= length) {
                        break;
                    }
                    if (l1[i3] == i2) {
                        arrayList.add(split[0]);
                        break;
                    }
                    i3++;
                }
            }
        }
        return arrayList;
    }

    private int Z4(EditText editText, String str) {
        if (TextUtils.isEmpty(str)) {
            str = "%";
        }
        editText.setLines(1);
        oi.o(editText, 524289);
        dq.W2(editText, str);
        return 0;
    }

    private boolean Z5() {
        return ol.s4(U0(2));
    }

    private hk.k a4(String str, String str2) {
        String str3 = this.I0;
        if (str3 == null || !str3.equals(str)) {
            uo L0 = L0();
            if (L0.p(str) && L0.b(str, str2, false)) {
                return L0.I(str, str2);
            }
            return null;
        }
        Iterator<String> it = this.J0.iterator();
        while (it.hasNext()) {
            String[] split = it.next().split("::dvd::");
            if (split[0].equals(str2)) {
                return hk.k.valueOf(split[1]);
            }
        }
        return null;
    }

    public boolean a5() {
        if (Z0 == null) {
            Z0 = getPackageManager().queryIntentActivities(new Intent("android.speech.tts.engine.CHECK_TTS_DATA"), 0);
        }
        boolean F = dq.F(Z0);
        boolean z2 = !F;
        if (F) {
            dq.n0(this, 2131887857, new Object[0]);
        }
        return z2;
    }

    private String b4() {
        String str;
        String m1 = dq.m1(this.v[0]);
        return (!m1.startsWith("%") || (str = this.I0) == null) ? m1 : str;
    }

    private void b5() {
        Camera camera = this.o0;
        if (camera != null) {
            camera.release();
            this.o0 = null;
        }
    }

    private List<String> c4() {
        ArrayList<String> W = L0().W(-2, dk.i.Alpha, true);
        String str = this.I0;
        if (str != null && !W.contains(str)) {
            W.add(0, this.I0);
            dq.f3(W);
        }
        return W;
    }

    private com.joaomgcd.taskerm.action.input.t d4() {
        return a1.l(this.V[0].getSelectedItemPosition());
    }

    private boolean d5() {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.d5():boolean");
    }

    public int e4() {
        return U0(0);
    }

    private void e5(boolean z2, int i2) {
        AudioManager audioManager;
        int y0 = a1.y0(i2);
        if (y0 == -1 || (audioManager = (AudioManager) oi.d(this, "audio", "ActionEdit", "saveRestoreStream")) == null) {
            return;
        }
        if (z2) {
            if (this.M0 == -1) {
                this.M0 = audioManager.getStreamVolume(y0);
            }
        } else if (this.M0 != -1) {
            dq.K2(this, y0);
            try {
                audioManager.setStreamVolume(y0, this.M0, 0);
            } catch (Exception e2) {
                r7.k("ActionEdit", e2.toString());
            }
            this.M0 = -1;
        }
    }

    private Camera f4() {
        if (this.o0 == null) {
            int U0 = U0(0);
            int j2 = CameraProxy.j(U0 != 0 ? 1 : 0);
            if (j2 == -1) {
                r7.G("ActionEdit", "couldn't get cam index for tasker index " + U0);
            } else {
                this.o0 = CameraProxy.e(j2, "ActionEdit", "getSelectedCamera");
            }
        }
        return this.o0;
    }

    private boolean f5(String str) {
        String str2 = this.I0;
        return (str2 != null && str2.equals(str)) || L0().p(str) || xl.P(str);
    }

    private a1.f g4() {
        return a1.f.values()[U0(0)];
    }

    private void g5() {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.g5():void");
    }

    private List<String> h4(boolean z2) {
        Bundle extras;
        ArrayList arrayList = new ArrayList();
        Intent V2 = ExtensionsContextKt.V2(this, null, new IntentFilter("net.dinglisch.android.zoom.ACTION_QUERY_NAMES"));
        if (V2 != null && (extras = V2.getExtras()) != null) {
            for (String str : extras.keySet()) {
                if (z2 && str.contains("/")) {
                    arrayList.add(str.replaceFirst("/", " / "));
                } else if (!z2 && !str.contains("/")) {
                    arrayList.add(str);
                }
            }
        }
        Collections.sort(arrayList);
        return arrayList;
    }

    private void h5(yg ygVar) {
        this.H0.setMultiChoiceModeListener(new q(this, ygVar, this.n0, null, null));
    }

    private void i4(int i2, String str) {
        s1 s1Var;
        if (i2 != -1) {
            this.m0.y2(i2);
            this.m0.c3(i2);
            com.joaomgcd.taskerm.util.k4.W(this, i2);
            int i3 = this.D;
            if (i3 == -1) {
                net.dinglisch.android.taskerm.c cVar = this.N0;
                if (cVar != null) {
                    e5(false, cVar.j());
                    if (a1.b(i2)) {
                        s1Var = this.N0.Q();
                        net.dinglisch.android.taskerm.c cVar2 = new net.dinglisch.android.taskerm.c(i2);
                        this.N0 = cVar2;
                        if (i2 != 38 || i2 == 40) {
                            d5();
                            return;
                        }
                        cVar2.o(s1Var);
                        invalidateOptionsMenu();
                        k5();
                        if (i2 == 35 || i2 == 37) {
                            this.N0.o(new s1(new r1()));
                        } else if (i2 == 130) {
                            this.y[1] = true;
                            this.N0.x(1).L("%priority");
                        } else if (i2 == 256) {
                            lp.e(this, 1, 2131890928, 1);
                        } else if (i2 == 235) {
                            lp.d(this, 2131890861);
                        } else if (i2 == 307) {
                            this.m0.k1(2131890896);
                        } else if (i2 == 915) {
                            lp.e(this, 1, 2131890946, 1);
                        } else if (i2 == 551) {
                            this.m0.k1(2131890900);
                        } else if (i2 == 254) {
                            this.m0.l1(2131890951, "https://issuetracker.google.com/issues/141889136");
                        } else if (i2 == 244 && com.joaomgcd.taskerm.util.k.w()) {
                            this.m0.l1(2131890961, "https://issuetracker.google.com/issues/225186417");
                        } else if (i2 == 95 || i2 == 97) {
                            lp.d(this, 2131890855);
                        } else if (i2 == 150) {
                            lp.e(this, 1, 2131890886, 1);
                        } else if (i2 == 3877) {
                            lp.e(this, 1, 2131890923, 1);
                        } else if (i2 == 3155) {
                            lp.d(this, 2131890925);
                        } else if (i2 == 1221) {
                            lp.e(this, 1, 2131890924, 1);
                        } else if (i2 == 42) {
                            lp.e(this, 1, 2131890944, 1);
                        } else if (i2 == 444) {
                            lp.e(this, 1, 2131890954, 1);
                        } else if (i2 == 525 || i2 == 536 || i2 == 538) {
                            oi.h(this, 2131891085, 2131890920);
                        } else if (i2 == 118 || i2 == 116 || i2 == 117) {
                            oi.i(this, 2131891085, 2131890919, new j());
                        } else if (com.joaomgcd.taskerm.util.k.r() && i2 == 523) {
                            lp.e(this, 1, 2131890917, 1);
                        } else if (i2 == 176) {
                            this.m0.Q(com.joaomgcd.taskerm.dialog.a.n2(this));
                        } else if (this.m0.d3(i2)) {
                            this.m0.p2(this.N0);
                        } else if (i2 == 113 && dq.T1()) {
                            oi.h(this, 2131886612, 2131887345);
                        } else {
                            a1.g(i2);
                        }
                        n5(-1);
                        this.m0.e3(this.N0, str);
                        L3();
                        F3();
                        if (this.N0.Y() > 0 && this.N0.p0(0) == 2) {
                            this.D = 0;
                            M5(AppSelect.G0(this, true, this.N0.j() == 20, false, false, this.N0.j() == 20, true, null, null), 6);
                        }
                    }
                }
                s1Var = null;
                net.dinglisch.android.taskerm.c cVar22 = new net.dinglisch.android.taskerm.c(i2);
                this.N0 = cVar22;
                if (i2 != 38) {
                }
                d5();
                return;
            }
            this.v[i3].setText(a1.v(i2));
        }
        this.F0.setVisibility(0);
    }

    private void j4(final int i2) {
        int i3 = 0;
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null) {
            MyActivity.L(this, "handleChoosePress tAction null");
            return;
        }
        int j2 = cVar.j();
        this.v[i2].requestFocus();
        if (j2 == 156) {
            this.D = i2;
            y5(this.e0[i2], this.v[i2]);
        } else if (j2 == 915) {
            if (i2 > 1) {
                this.D = i2;
                r5();
                return;
            }
        } else if (j2 == 135 && i2 == 2) {
            B5(i2, 2131887552, this.R0, -1);
        }
        String D0 = a1.D0(j2, i2);
        if (D0.equals("iuri")) {
            this.D = i2;
            M5(new Intent("net.dinglisch.android.zoom.ACTION_IMAGE_SELECT"), 55);
        } else if (D0.equals("zelem")) {
            B5(i2, 2131887568, h4(true), 2131887860);
        } else if (D0.equals("js")) {
            h2(i2);
        } else if (D0.equals("jsl")) {
            i2(i2);
        } else if (D0.equals("jfu")) {
            w5(dq.m1(this.v[1]), this.v[i2]);
        } else if (D0.equals("jc")) {
            u5(this.v[i2], false);
        } else if (D0.equals("jp")) {
            v5(dq.m1(this.v[i2]), this.v[i2]);
        } else if (D0.equals("sname")) {
            if (c4().isEmpty()) {
                dq.n0(this, 2131887855, new Object[0]);
            } else {
                A5(i2, 2131887542);
            }
        } else if (D0.equals("sename")) {
            String b4 = b4();
            List<String> Y3 = Y3(b4);
            if (Y3 == null) {
                dq.n0(this, 2131887911, b4);
            } else if (Y3.isEmpty()) {
                dq.n0(this, 2131887854, b4);
            } else {
                A5(i2, 2131887536);
            }
        } else if (D0.equals("psize")) {
            Camera f4 = f4();
            if (f4 != null) {
                E5(i2, 2131887518, CameraProxy.n(f4, false), 2131887784);
            }
        } else if (D0.equals("zwidg")) {
            B5(i2, 2131887570, h4(false), 2131887861);
        } else if (D0.equals("cpug")) {
            int e4 = e4();
            E5(i2, 2131887470, l1.e(e4, false, "ActionEdit/" + e4), -1);
        } else if (D0.equals("f")) {
            this.C = true;
            g2(i2, FileSelect.e.File, j2 == 422 ? ".zip" : null);
        } else if (D0.equals("col")) {
            this.D = i2;
            String m1 = dq.m1(this.v[i2]);
            if (m1.length() == 0) {
                m1 = "#FF000000";
            }
            t5(dh.b(m1));
        } else if (D0.equals("b")) {
            this.D = i2;
            N5();
        } else if (D0.equals("ctit")) {
            B5(i2, 2131887401, bh.K(getContentResolver(), R3()), 2131891075);
        } else if (D0.equals("cloc")) {
            B5(i2, 2131887400, bh.B(getContentResolver(), R3()), 2131891074);
        } else if (D0.equals("sset")) {
            this.m0.h3(this.V, this.v);
        } else if (D0.equals("adbsc")) {
            this.m0.g3(i2, j2);
        } else if (D0.equals("locradi")) {
            this.m0.i3(i2);
        } else if (D0.equals("notcatoreo")) {
            this.m0.X0(this.v, i2);
        } else if (D0.equals("apppakc")) {
            this.m0.E0(this.v, i2);
        } else if (D0.equals("applpakc")) {
            this.m0.T0(this.v, i2);
        } else if (D0.equals("simc")) {
            this.m0.B2(this.v, i2);
        } else if (D0.equals("img")) {
            this.m0.N0(this.v, i2);
        } else if (D0.equals("toggle")) {
            this.m0.Z0(this.v, i2);
        } else if (D0.equals("mattdevi")) {
            this.m0.V0(this.v, i2);
        } else if (D0.equals("inpval")) {
            this.m0.S0(this.v, i2);
        } else if (D0.equals("imgs")) {
            this.m0.P0(this.v, i2);
        } else if (D0.equals("strbool")) {
            this.m0.G0(this.v, i2);
        } else if (D0.equals("dttmms")) {
            this.m0.M0(this.v, i2);
        }
        if (this.m0.D2(i2)) {
            this.m0.t2(new qf.b(i2, cVar));
            return;
        }
        if (D0.equals("pkgName")) {
            this.D = i2;
            startActivityForResult(AppSelect.G0(this, true, false, false, false, true, false, null, null), 8);
            return;
        }
        if (D0.equals("tz")) {
            ArrayList arrayList = new ArrayList();
            String[] availableIDs = TimeZone.getAvailableIDs();
            int length = availableIDs.length;
            while (i3 < length) {
                String str = availableIDs[i3];
                if (str.startsWith("Etc/")) {
                    str = str.substring(4);
                }
                if (str.length() > 0) {
                    arrayList.add(str);
                }
                i3++;
            }
            B5(i2, 2131887419, arrayList, -1);
            return;
        }
        if (D0.equals("ccal")) {
            B5(i2, 2131887399, bh.u(getContentResolver(), -1, true, true).keySet(), 2131891076);
            return;
        }
        if (D0.equals("r")) {
            File file = new File(Environment.getExternalStorageDirectory(), "sl4a/scripts");
            if (!file.exists() || !file.isDirectory()) {
                dq.a0(this, 2131887717, new Object[0]);
                return;
            }
            File[] listFiles = file.listFiles();
            if (listFiles == null || listFiles.length == 0) {
                dq.a0(this, 2131887718, new Object[0]);
                return;
            }
            String[] strArr = new String[listFiles.length];
            while (i3 < listFiles.length) {
                strArr[i3] = listFiles[i3].getName();
                i3++;
            }
            F5(i2, 2131886717, strArr, -1, true);
            return;
        }
        if (D0.equals("mime")) {
            E5(i2, 2131888727, vh.i(this, RFactory.layout.scroll_up_indicator), -1);
            return;
        }
        if (D0.equals("act")) {
            this.D = i2;
            s5();
            return;
        }
        if (D0.equals("ssid")) {
            this.D = i2;
            this.m0.B0(this.v[i2]);
            return;
        }
        if (D0.equals("d")) {
            this.C = true;
            g2(i2, FileSelect.e.Dir, null);
            return;
        }
        if (D0.equals("i")) {
            List<String> q0 = ImageSelect.q0(this.w, false, false);
            if (!dq.F(q0)) {
                String[] f2 = w5.f();
                int length2 = f2.length;
                while (i3 < length2) {
                    String str2 = f2[i3];
                    if (str2 != null) {
                        q0.add(str2);
                    }
                    i3++;
                }
                Collections.sort(q0);
            }
            B5(i2, 2131888271, q0, -1);
            return;
        }
        if (D0.equals("rtn")) {
            this.D = i2;
            M5(zj.c(c5(j2)), 52);
            return;
        }
        if (D0.equals("a")) {
            B5(i2, 2131891104, TaskerAppWidgetConfigure.n(this, false), 2131887850);
            return;
        }
        if (D0.equals("at")) {
            B5(i2, 2131891104, TaskerAppWidgetConfigure.n(this, true), 2131887850);
            return;
        }
        if (D0.equals("l")) {
            if (a5()) {
                b1 = -1;
                a1 = null;
                G5();
                return;
            }
            return;
        }
        if (D0.equals("la")) {
            j2(i2);
            return;
        }
        if (D0.equals("p") || D0.equals("pv")) {
            this.m0.o1(com.joaomgcd.taskerm.util.e5.w(this), new Runnable() {
                @Override
                public final void run() {
                    ActionEdit.this.u4(i2);
                }
            });
            return;
        }
        if (D0.equals("prof")) {
            m2(i2, false);
            return;
        }
        if (D0.equals("m")) {
            this.D = i2;
            o2(cVar.j() == 552 ? new v(cVar, i2) : new w(cVar, i2), L0());
            return;
        }
        if (i2 == 1) {
            int U0 = U0(0);
            if (j2 == 346) {
                if (eh.w(this, this.v[i2], false)) {
                    this.D = i2;
                    this.C = true;
                    return;
                }
                return;
            }
            if (j2 == 343) {
                this.C = true;
                g2(i2, FileSelect.e.File, null);
                return;
            }
            if (j2 == 344) {
                int i4 = r.a[yo.a.e(U0).ordinal()];
                if (i4 == 1 || i4 == 2 || i4 == 3) {
                    this.D = i2;
                    M5(AppSelect.G0(this, true, false, false, false, true, true, null, null), 6);
                    return;
                }
                return;
            }
            if (j2 != 347) {
                if (j2 == 342) {
                    this.C = true;
                    g2(i2, FileSelect.e.File, null);
                    return;
                } else {
                    if (j2 == 345) {
                        I5(2131887420);
                        return;
                    }
                    return;
                }
            }
            int i5 = r.b[yo.h.d(U0).ordinal()];
            if (i5 == 1) {
                B5(i2, 2131891104, TaskerAppWidgetConfigure.n(this, true), 2131887850);
                return;
            }
            if (i5 == 2) {
                this.D = i2;
                a2(i2);
            } else if (i5 == 3) {
                this.D = i2;
                n2(i2);
            } else {
                if (i5 != 4) {
                    return;
                }
                this.D = i2;
                f2(i2);
            }
        }
    }

    private void k4() {
        this.N0.y0().G4();
        U5();
        J3();
    }

    private void k5() {
        for (int i2 = 0; i2 < this.N0.Y(); i2++) {
            int p0 = this.N0.p0(i2);
            boolean z2 = p0 == 0 && this.N0.x(i2).I();
            if (!z2 && p0 == 2) {
                net.dinglisch.android.taskerm.d R = this.N0.R(i2);
                z2 = R.y() > 0 && kq.K(R.H());
            }
            this.y[i2] = z2;
        }
    }

    public void l4(CharSequence charSequence) {
        net.dinglisch.android.taskerm.c Q3;
        ViewGroup viewGroup = this.N[1];
        if (TextUtils.isEmpty(charSequence)) {
            this.D0.setVisibility(8);
            viewGroup.setVisibility(this.N0.j() != 130 ? 8 : 0);
            return;
        }
        viewGroup.setVisibility(8);
        this.D0.setVisibility(0);
        Editable text = this.w0.getText();
        if ((text == null || TextUtils.isEmpty(text.toString())) && (Q3 = Q3()) != null) {
            this.w0.setText(String.valueOf(Q3.J0()));
        }
    }

    private void l5() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        dq.M2(this, 2131297060, (cVar == null || !(cVar.j() == 551 || this.N0.j() == 157)) ? 2131891115 : 2131889699);
    }

    private void m4(int i2) {
        kq.O0(this.v[i2]);
        String D0 = a1.D0(this.N0.j(), i2);
        if (this.N0.j() == 664 || D0.equals("uvar")) {
            this.A.O1(new com.joaomgcd.taskerm.util.c() {
                @Override
                public final void a(Object obj) {
                    ActionEdit.this.w4((ArrayList) obj);
                }
            });
        } else {
            I5(2131887420);
        }
    }

    private void m5(int i2, int i3, int i4) {
        int c0 = a1.c0(i2, i3);
        int d0 = a1.d0(i2, i3);
        this.P[i3].setMax(c0 - d0);
        SeekBar seekBar = this.P[i3];
        if (d0 != Integer.MIN_VALUE) {
            i4 -= d0;
        }
        seekBar.setProgress(i4);
    }

    public void n5(int r42) {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.ActionEdit.n5(int):void");
    }

    private boolean o4(int i2, int i3) {
        if (i2 == 188) {
            return true;
        }
        return i2 == 133 && i3 == 1 && U0(0) == 26;
    }

    private void o5() {
        super.Z1(this, this.W0);
    }

    private boolean p4() {
        return a1.V0(U0(0));
    }

    private boolean q4(int i2) {
        return this.N0.j() == 64 && i2 == 3;
    }

    public static void q5(Activity activity, String str, String str2) {
        HTMLView.H0(activity, HasArgsEdit.Q0("ah", str, str2), -1, HTMLView.g.Inform);
    }

    private boolean r4(int i2) {
        if (!q4(i2)) {
            return false;
        }
        int U0 = U0(2);
        return U0 == zk.e.MoveToPoint.ordinal() || U0 == zk.e.MoveToPointAnimated.ordinal();
    }

    private void r5() {
        wj.D(this, new g(), 2131887469).I(l1.d(e4())).C(this);
    }

    private boolean s4(int i2) {
        return (!q4(i2) || r4(i2) || t4(i2)) ? false : true;
    }

    public void s5() {
        final net.dinglisch.android.taskerm.k kVar = new net.dinglisch.android.taskerm.k(this);
        this.E = false;
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null) {
            kVar.B(true, this.P0 != b0.None);
        } else {
            cVar.o(K0());
            kVar.E(this.N0.j());
            kVar.C(false, this.P0 != b0.None, a1.M(this.N0.j()).intValue());
        }
        kVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ActionEdit.this.O4(kVar, dialogInterface);
            }
        });
        final MyScrollView myScrollView = this.F0;
        kVar.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public final void onCancel(DialogInterface dialogInterface) {
                ActionEdit.this.P4(myScrollView, dialogInterface);
            }
        });
        if (myScrollView != null) {
            myScrollView.setVisibility(4);
        }
        this.m0.z2();
        kVar.show();
        this.z = kVar;
    }

    private boolean t4(int i2) {
        return q4(i2) && U0(2) == zk.e.SetZoom.ordinal();
    }

    private void t5(int i2) {
        b1.y(this, new b(), i2).x(this);
    }

    public void u4(int i2) {
        if (eh.w(this, this.v[i2], false)) {
            this.D = i2;
            this.C = true;
        }
    }

    private void u5(EditText editText, boolean z2) {
        String[] y2 = d6.y(W3());
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        int[] iArr = new int[y2.length];
        int L = tp.L(this);
        int C = tp.C(this, 2130968883, "ActionEdit/sjfc2");
        int length = y2.length;
        int i2 = 0;
        int i3 = 0;
        while (i2 < length) {
            String str = y2[i2];
            int lastIndexOf = str.lastIndexOf(46);
            arrayList.add(str.substring(lastIndexOf + 1, str.length()));
            arrayList2.add(str.substring(0, lastIndexOf));
            int i4 = i3 + 1;
            iArr[i3] = yd.k(d6.b0(str)[0]) == null ? C : L;
            i2++;
            i3 = i4;
        }
        if (arrayList.size() == 0) {
            dq.j0(this, 2131887867, new Object[0]);
        } else {
            wj.D(this, new n(arrayList2, arrayList, z2, editText), 2131889500).Z(2131890863).G(arrayList).R(arrayList2).P(iArr).C(this);
        }
    }

    public ji.v v4(String str, String str2, List list, String str3) throws Exception {
        return TextUtils.isEmpty(str3) ? super.X0(str, str2, list) : ji.r.w(str3);
    }

    private void v5(final String str, final EditText editText) {
        this.m0.V2(new com.joaomgcd.taskerm.util.c() {
            @Override
            public final void a(Object obj) {
                ActionEdit.this.Q4(str, editText, (HashMap) obj);
            }
        });
    }

    public void w4(ArrayList arrayList) {
        if (kq.a0(this, arrayList).isEmpty()) {
            dq.j0(this, 2131887858, new Object[0]);
        } else {
            I5(2131887564);
        }
    }

    private void w5(final String str, final EditText editText) {
        this.m0.V2(new com.joaomgcd.taskerm.util.c() {
            @Override
            public final void a(Object obj) {
                ActionEdit.this.R4(str, editText, (HashMap) obj);
            }
        });
    }

    public void x4(final int i2, final int i3, Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            return;
        }
        pg.w0.p0(new Runnable() {
            @Override
            public final void run() {
                ActionEdit.this.B4(i2, i3);
            }
        });
    }

    private void x5(final int i2, final int i3, final boolean z2) {
        this.m0.V2(new com.joaomgcd.taskerm.util.c() {
            @Override
            public final void a(Object obj) {
                ActionEdit.this.S4(z2, i3, i2, (HashMap) obj);
            }
        });
    }

    public void y4(boolean z2, int i2, HashMap hashMap) {
        String m1 = dq.m1(this.v[1]);
        String str = null;
        if (m1.isEmpty()) {
            str = d6.P(null);
        } else {
            String str2 = d6.b(W3(), m1, d6.a.Both, null, null, null, hashMap, "lookupHelp").a;
            if (str2 == null) {
                dq.j0(this, 2131887867, new Object[0]);
            } else if (z2) {
                String m12 = dq.m1(this.v[i2]);
                if (m12.startsWith("assign") || m12.startsWith("new")) {
                    dq.j0(this, 2131887867, new Object[0]);
                } else {
                    str = d6.Q(str2, m12);
                }
            } else {
                str = d6.P(str2);
            }
        }
        if (str != null) {
            M5(d6.A(str), 57);
        }
    }

    private void y5(View view, EditText editText) {
        mh mhVar = new mh(this, view);
        int[] c2 = wd.c();
        for (int i2 = 0; i2 < c2.length; i2++) {
            mhVar.j(i2, c2[i2]);
        }
        mhVar.F(new l(editText)).show();
    }

    public static lj.e0 z4(String str) {
        r7.f("ActionEdit", str);
        return lj.e0.a;
    }

    private void z5(final boolean z2) {
        this.m0.R(com.joaomgcd.taskerm.dialog.a.c1(this), new oi.d() {
            @Override
            public final void accept(Object obj) {
                ActionEdit.this.T4(z2, (we.l0) obj);
            }
        });
    }

    public void E3() {
        if (this.P0 != b0.None) {
            K5();
        } else {
            finish();
        }
    }

    public void I5(int i2) {
        J5(i2, null);
    }

    public void J5(int i2, EditText editText) {
        super.q2(i2, false, this.N0, new i(i2, editText), new com.joaomgcd.taskerm.util.c() {
            @Override
            public final void a(Object obj) {
                ActionEdit.this.U4((wj) obj);
            }
        });
    }

    @Override
    public uo L0() {
        return this.P0 == b0.Exe ? to.v1(this) : to.j2(this);
    }

    @Override
    public b5 O0() {
        return Q3();
    }

    public net.dinglisch.android.taskerm.c Q3() {
        return this.N0;
    }

    @Override
    public void U1(int i2) {
        n5(i2);
    }

    protected boolean W5(int i2) {
        if (Z0()) {
            return super.C2(false, true, true);
        }
        if (i2 == 35 || i2 == 37) {
            return dq.a0(this, 2131887788, new Object[0]);
        }
        return true;
    }

    @Override
    public ji.r<String> X0(final String str, final String str2, final List<String> list) {
        return this.m0.Y2(str, str2, list).t(new oi.e() {
            @Override
            public final Object a(Object obj) {
                ji.v v4;
                v4 = ActionEdit.this.v4(str, str2, list, (String) obj);
                return v4;
            }
        });
    }

    @Override
    public void afterTextChanged(Editable editable) {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null || cVar.j() != 60) {
            return;
        }
        n5(4);
        n5(5);
        n5(7);
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
    }

    public int c5(int i2) {
        if (i2 == 566) {
            return 4;
        }
        return i2 == 457 ? zj.g(U0(0)) : zj.g(U0(0));
    }

    @Override
    public void e(am.k kVar, int i2) {
        List<Integer> linkedList;
        if (y()) {
            linkedList = ((yg) this.H0.getAdapter()).f();
            v();
        } else {
            linkedList = new LinkedList<>();
            linkedList.add(Integer.valueOf(this.E0.H()));
        }
        if (kVar == am.k.DropBin) {
            M3(linkedList);
        } else if (i2 != -1) {
            X4(linkedList, i2);
        }
    }

    @Override
    public void g(com.joaomgcd.taskerm.util.e5 e5Var, com.joaomgcd.taskerm.util.t6 t6Var) {
        if (Arrays.asList(e5Var.M()).contains("android.permission.NOTIFICATION_ACCESS")) {
            z5(true);
        } else {
            if (this.m0.w2(e5Var, t6Var)) {
                return;
            }
            this.m0.r(new Runnable() {
                @Override
                public final void run() {
                    ActionEdit.this.s5();
                }
            });
        }
    }

    public void i5() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        int j2 = cVar == null ? -1 : cVar.j();
        super.F1((j2 == 300 || j2 == 40 || j2 == 38 || this.P0 != b0.None) ? 8 : 0);
        M1();
    }

    public void j5(final int i2, ji.r<String> rVar) {
        this.m0.R(rVar, new oi.d() {
            @Override
            public final void accept(Object obj) {
                ActionEdit.this.H4(i2, (String) obj);
            }
        });
    }

    public void n4() {
        this.E0.b0(this, "ActionEdit", this.H0, this.n0, null, null, null, false, false, (ImageView) findViewById(2131297342), (ImageView) findViewById(2131297340), this.F0, this);
    }

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        String str;
        String L0;
        int i4;
        if (this.m0.z0(i2, i3, intent) || this.m0.r2(i2, i3, intent)) {
            return;
        }
        boolean z2 = false;
        if (!super.n1(i2, i3, intent)) {
            if (i2 == 61) {
                P3();
            } else if (i2 == 64) {
                if (!ji.v()) {
                    E3();
                }
            } else if (i2 == 62) {
                h4.D(this, i3, intent);
                P3();
            } else if (i2 == 63) {
                if (i3 == -1) {
                    k7 k7Var = new k7(new qi(intent.getBundleExtra("item")));
                    sk y0 = this.N0.y0();
                    if (this.D == -1) {
                        y0.k4(k7Var);
                        U5();
                        this.F0.fullScroll(130);
                        this.D = y0.u4() - 1;
                    } else {
                        y0.s4().set(this.D, k7Var);
                    }
                    if (k7Var.q()) {
                        y0.L4(this.D);
                    } else {
                        y0.o4(this.D);
                    }
                    y0.G4();
                }
            } else if (i2 == 60) {
                if (i3 == -1 && intent.hasExtra("el")) {
                    Bundle bundleExtra = intent.getBundleExtra("el");
                    if (bundleExtra == null) {
                        r7.G("ActionEdit", "no result bundle");
                    } else {
                        dq.W2(this.v[3], hk.h0(new qi(bundleExtra)).U(0).e0(0));
                    }
                }
            } else if (i2 == 6) {
                if (i3 == -1) {
                    g1 g1Var = new g1(new qi(intent.getBundleExtra("ssc")));
                    if (this.N0.p0(this.D) == 2) {
                        if (this.N0.j() == 173) {
                            net.dinglisch.android.taskerm.d R = this.N0.R(this.D);
                            R.q();
                            for (int i5 = 0; i5 < g1Var.d1(); i5++) {
                                R.p(g1Var.j1(i5), g1Var.a1(i5), g1Var.c1(i5));
                            }
                        } else {
                            this.N0.i1(this.D, g1Var.i1(), g1Var.Z0(), g1Var.b1());
                        }
                        if (!I3(this.D)) {
                            n5(this.D);
                        }
                        if (this.N0.j() == 18) {
                            lp.e(this, 1, 2131890887, 1);
                        }
                        this.m0.s2(this.D);
                    } else if (this.N0.j() == 344 && (i4 = this.D) == 1) {
                        dq.W2(this.v[i4], g1Var.i1());
                    } else {
                        this.N0.g0(this.D).p0(g1Var.i1(), g1Var.Z0());
                        C0(this.N0, this.D);
                    }
                }
            } else if (i2 == 7) {
                if (i3 == -1) {
                    String string = intent.getExtras().getString("path");
                    int j2 = this.N0.j();
                    W0(string, a1.D0(j2, this.D), j2 == 118 || j2 == 116, this.N0.j() == 420 && this.D == 0);
                }
            } else if (i2 == 59) {
                lp.d(this, 2131890884);
            } else if (i2 == 56) {
                if (i3 == -1) {
                    oi.h(this, 2131891282, 2131887180);
                }
            } else if (i2 == 5) {
                if (i3 == -1) {
                    Bundle bundleExtra2 = intent.getBundleExtra("actisss");
                    if (bundleExtra2 == null) {
                        r7.k("ActionEdit", "oar: null action bundle");
                    } else {
                        this.N0.y0().z4(L0(), getPackageManager(), this.D, new net.dinglisch.android.taskerm.c(new qi(bundleExtra2)), (Y4() && a1.e1(this.N0.j())) ? false : true);
                        H3();
                    }
                }
            } else if (i2 != 3) {
                if (i2 == 55) {
                    if (i3 == -1) {
                        String dataString = intent.getDataString();
                        this.v[this.D].setText(dataString != null ? dataString : "");
                    }
                } else if (i2 == 58 || i2 == 4) {
                    if (i3 == -1) {
                        if (this.N0 == null) {
                            r7.k("ActionEdit", "oar: icon select: no action");
                        } else if (this.D == -1) {
                            r7.k("ActionEdit", "oar: icon select: no editingArgNo");
                        } else {
                            net.dinglisch.android.taskerm.g r0 = ImageSelect.r0(intent);
                            if (i2 == 58) {
                                if (r0 == null) {
                                    this.N0.g0(this.D).m0();
                                } else {
                                    this.N0.k1(this.D, r0);
                                }
                                n5(this.D);
                                if (r0 != null && dq.T1() && a1.e1(this.N0.j()) && (!r0.Y() || (r0.T() != 0 && r0.T() != -1))) {
                                    lp.e(this, 1, 2131890916, 1);
                                }
                            } else {
                                this.N0.y0().A4(getPackageManager(), this.D, r0);
                                if (a1.e1(this.N0.j()) && dq.T1()) {
                                    lp.e(this, 1, 2131890915, 1);
                                }
                            }
                        }
                    }
                } else if (i2 == 53) {
                    if (i3 == -1) {
                        if (intent == null) {
                            r7.G("ActionEdit", "imageSelectResult: no data intent");
                            L0 = null;
                        } else {
                            L0 = dq.L0(getContentResolver(), intent.getData(), "_data");
                        }
                        if (L0 == null) {
                            dq.a0(this, 2131887772, new Object[0]);
                        } else {
                            String B2 = dq.B2(L0);
                            this.v[this.D].setText(B2);
                            this.N0.k0(this.D, B2);
                            J3();
                        }
                    }
                } else if (eh.l(i2)) {
                    int j3 = this.N0.j();
                    if (!eh.n(i2, i3, intent, getContentResolver(), this.v[this.D], (j3 == 95 || j3 == 99) ? 2 : (j3 == 41 || j3 == 41 || j3 == 250 || j3 == 111) ? 1 : 0, true)) {
                        dq.n0(this, 2131887773, new Object[0]);
                    }
                } else if (i2 == 52) {
                    if (i3 == -1) {
                        int c5 = c5(this.N0.j());
                        Bundle extras = intent.getExtras();
                        if (extras != null) {
                            String k2 = zj.k(this, c5, zj.e(extras), true);
                            r7.f("ActionEdit", "--------title: " + k2);
                            this.v[this.D].setText(k2 != null ? k2 : "");
                        }
                    }
                } else if (i2 == 51) {
                    this.D = 0;
                    if (i3 == -1) {
                        Bundle s2 = ri.s(intent);
                        if (s2 != null) {
                            if (ri.i0(s2)) {
                                if (vo.c.m(s2)) {
                                    net.dinglisch.android.taskerm.h x2 = this.N0.x(3);
                                    if (!this.y[3] && (!x2.k() || x2.v() == 0)) {
                                        int d0 = a1.d0(this.N0.j(), 3);
                                        int c0 = a1.c0(this.N0.j(), 3);
                                        int i6 = vo.c.i(s2);
                                        int i7 = i6 / 1000;
                                        if (i7 < d0) {
                                            i7 = d0;
                                        } else if (i7 > c0) {
                                            i7 = c0;
                                        }
                                        r7.f("ActionEdit", "timeout req " + i6 + "ms min: " + d0 + "s max " + c0 + "s used: " + i7 + "s");
                                        this.N0.s1(3, i7);
                                    }
                                    vo.c.e(s2);
                                } else {
                                    this.N0.s1(3, 0);
                                }
                                this.N0.n1(0, s2);
                                net.dinglisch.android.taskerm.c cVar = this.N0;
                                ri.f0(cVar, cVar.j(), ri.c.Action);
                                n5(-1);
                            } else {
                                dq.a0(this, 2131887879, new Object[0]);
                            }
                        }
                    } else if (i3 == 0) {
                        r7.f("ActionEdit", "Cancelled");
                    } else {
                        r7.f("ActionEdit", "R: " + i3);
                    }
                } else if (i2 == 50) {
                    if (i3 == 1 || ((str = this.q0) != null && str.equals("com.svox.classic") && i3 == 0)) {
                        if (intent == null) {
                            dq.a0(this, 2131887904, new Object[0]);
                        } else if (intent.getExtras() == null) {
                            dq.a0(this, 2131887903, new Object[0]);
                        } else {
                            if (intent.hasExtra("availableVoices")) {
                                r7.f("ActionEdit", "try get voices from EXTRA_AVAILABLE_VOICES");
                                a1 = intent.getStringArrayListExtra("availableVoices");
                            }
                            if (dq.F(a1)) {
                                r7.f("ActionEdit", "no voices so far...");
                                if (intent.hasExtra("dataFilesInfo")) {
                                    r7.f("ActionEdit", "try get voices from EXTRA_VOICE_DATA_FILES_INFO");
                                    String[] stringArrayExtra = intent.getStringArrayExtra("dataFilesInfo");
                                    if (!dq.r(stringArrayExtra)) {
                                        r7.f("ActionEdit", "array empty");
                                        a1 = new ArrayList<>();
                                        for (String str2 : stringArrayExtra) {
                                            r7.f("ActionEdit", "found file: " + stringArrayExtra);
                                            if (!a1.contains(str2)) {
                                                a1.add(str2);
                                            }
                                        }
                                    }
                                }
                            }
                            if (dq.F(a1)) {
                                dq.a0(this, 2131887905, new Object[0]);
                            } else {
                                n5(1);
                                this.D = 1;
                                H5();
                            }
                        }
                    } else if (i3 == -2) {
                        dq.h0(this, 2131886148, new Object[0]);
                        M5(new Intent("android.speech.tts.engine.INSTALL_TTS_DATA"), 57);
                        z2 = this.C;
                    } else {
                        dq.b0(this, vh.g(this, 2131887902, new Object[0]) + ": " + i3, new Object[0]);
                    }
                }
            } else if (i3 == -1) {
                this.N0.g0(this.D).q0(this.F.getPath());
                n5(this.D);
            }
        }
        this.C = z2;
    }

    @Override
    public void onClick(View view) {
        int i2;
        ArrayList<String> arrayList;
        g1 g1Var;
        boolean z2;
        boolean z3;
        if (super.o1(view, this.N0)) {
            if (this.J.equals(view)) {
                I5(2131887420);
                return;
            } else if (this.L.equals(view)) {
                x5(2131886413, -1, false);
                return;
            } else {
                if (this.K.equals(view)) {
                    this.m0.R0(N0(this.N0));
                    return;
                }
                return;
            }
        }
        final int i3 = 0;
        while (i3 < 17) {
            final int j2 = this.N0.j();
            if (view == this.Z[i3]) {
                this.D = i3;
                if (j2 == 664) {
                    final boolean z4 = i3 == 2;
                    if (z4 || i3 == 1) {
                        this.m0.V2(new com.joaomgcd.taskerm.util.c() {
                            @Override
                            public final void a(Object obj) {
                                ActionEdit.this.y4(z4, i3, (HashMap) obj);
                            }
                        });
                    }
                } else if (j2 == 130) {
                    if (i3 == 8) {
                        this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131889905, 2131888281));
                    } else if (i3 == 6) {
                        this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131889730, 2131888176));
                    } else if (i3 == 9) {
                        this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131889440, 2131888168));
                    } else if (i3 == 7) {
                        this.m0.R(com.joaomgcd.taskerm.dialog.a.g1(this, getString(2131889731), getString(2131888173), new com.joaomgcd.taskerm.util.t(this, 2131889579, new Object[0])), new x());
                    } else {
                        this.m0.F2(this.N0, i3);
                    }
                } else if (j2 == 25 && i3 == 1) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131889840, 2131888171));
                } else if (j2 == 123 && i3 == 7) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131890049, 2131888189));
                } else if (j2 == 159 && i3 == 0) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131889790, 2131888212));
                } else if (j2 == 47 && i3 == 8) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889441, com.joaomgcd.taskerm.util.x2.Q4(2131888169, this, new Object[0]) + "\n\n" + com.joaomgcd.taskerm.util.x2.Q4(2131888172, this, new Object[0])));
                } else if (j2 == 47 && i3 == 9) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889942, com.joaomgcd.taskerm.util.x2.Q4(2131888196, this, new Object[0])));
                } else if (j2 == 47 && i3 == 10) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889362, com.joaomgcd.taskerm.util.x2.Q4(2131888195, this, new Object[0])));
                } else if (j2 == 523 && i3 == 2) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131886464, com.joaomgcd.taskerm.util.x2.Q4(2131888175, this, new Object[0])));
                } else if (j2 == 162 && i3 == 7) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889661, com.joaomgcd.taskerm.util.x2.Q4(2131888193, this, new Object[0])));
                } else if (j2 == 162 && i3 == 8) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889709, com.joaomgcd.taskerm.util.x2.Q4(2131888194, this, new Object[0])));
                } else if (j2 == 162 && (i3 == 9 || i3 == 10 || i3 == 11)) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889516, com.joaomgcd.taskerm.util.x2.Q4(2131888191, this, new Object[0])));
                } else if (j2 == 162 && i3 == 12) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889517, com.joaomgcd.taskerm.util.x2.Q4(2131888192, this, new Object[0])));
                } else if (j2 == 171 && i3 == 4) {
                    this.m0.Q(com.joaomgcd.taskerm.dialog.a.e1(this, 2131889577, com.joaomgcd.taskerm.util.x2.Q4(2131886783, this, new Object[0])));
                } else {
                    this.m0.F2(this.N0, i3);
                }
            } else if (view == this.Y[i3]) {
                this.D = i3;
                if (j2 == 156) {
                    R5();
                } else if (j2 == 664) {
                    x5(2131886413, i3, i3 != 0);
                } else if (j2 == 665) {
                    x5(2131886413, i3, false);
                } else if (j2 == 877 && (i3 == 4 || i3 == 5 || i3 == 6)) {
                    x5(2131886413, i3, false);
                } else if (j2 == 39 && i3 == 1) {
                    x5(2131886413, i3, false);
                } else if (j2 == 129) {
                    S5(dq.m1(this.v[i3]), dq.m1(this.v[1]), this.U[2].isChecked());
                } else if (j2 == 131) {
                    String m1 = dq.m1(this.v[0]);
                    if (m1.length() == 0) {
                        dq.a0(this, 2131887893, new Object[0]);
                    } else {
                        String E2 = dq.E2(m1);
                        if (E2 == null) {
                            dq.a0(this, 2131887719, new Object[0]);
                        } else {
                            try {
                                startActivityForResult(com.joaomgcd.taskerm.util.g8.b0(new File(E2), this, "text/javascript", "android.intent.action.VIEW", new xj.l() {
                                    @Override
                                    public final Object invoke(Object obj) {
                                        lj.e0 z42;
                                        z42 = ActionEdit.z4((String) obj);
                                        return z42;
                                    }
                                }, true, "JavaScript Editor"), 59);
                            } catch (Exception unused) {
                                dq.b0(this, "no editor", new Object[0]);
                            }
                        }
                    }
                } else {
                    u2(this.N0.g0(i3).y0(this));
                }
            } else {
                if (view == this.X[i3]) {
                    if (this.N0.p0(i3) == 2) {
                        this.D = i3;
                        boolean z5 = j2 == 20 || j2 == 173;
                        boolean z6 = j2 == 20;
                        if (j2 == 252) {
                            arrayList = th.n(getPackageManager());
                            g1Var = null;
                        } else if (j2 == 173) {
                            net.dinglisch.android.taskerm.d R = this.N0.R(1);
                            g1 g1Var2 = new g1();
                            for (int i4 = 0; i4 < R.y(); i4++) {
                                g1Var2.U0(R.I(i4), R.s(i4), R.x(i4));
                            }
                            g1Var = g1Var2;
                            arrayList = null;
                            z2 = false;
                            z3 = false;
                            M5(AppSelect.G0(this, z2, z6, false, false, z5, z3, arrayList, g1Var), 6);
                        } else {
                            arrayList = null;
                            g1Var = null;
                        }
                        z2 = true;
                        z3 = true;
                        M5(AppSelect.G0(this, z2, z6, false, false, z5, z3, arrayList, g1Var), 6);
                    } else if (this.N0.p0(i3) == 1) {
                        A5(i3, 2131887542);
                    } else if (this.N0.p0(i3) == 4) {
                        this.D = i3;
                        int i5 = j2 != 138 ? 292 : 260;
                        if (this.P0 == b0.None && j2 != 138) {
                            i5 |= 8;
                        }
                        if (j2 == 138) {
                            i2 = i5 | 512;
                        } else {
                            if (j2 != 188) {
                                i5 |= 128;
                            }
                            if (a1.e1(j2)) {
                                if (!yd.c0.c()) {
                                    i5 |= 512;
                                }
                                i5 |= 6144;
                            }
                            i2 = i5 | 83;
                        }
                        M5(ImageSelect.s0(this, i2), 58);
                    }
                } else if (view == this.e0[i3]) {
                    j4(i3);
                } else if (view == this.f0[i3]) {
                    m4(i3);
                } else if (view == this.a0[i3]) {
                    this.P[i3].incrementProgressBy(a1.M0(j2, i3));
                    SeekBar seekBar = this.P[i3];
                    onProgressChanged(seekBar, seekBar.getProgress(), true);
                } else if (view == this.b0[i3]) {
                    this.P[i3].incrementProgressBy(0 - a1.M0(j2, i3));
                    SeekBar seekBar2 = this.P[i3];
                    onProgressChanged(seekBar2, seekBar2.getProgress(), true);
                } else if (view.equals(this.c0[i3])) {
                    this.D = 0;
                    if (a1.f1(j2)) {
                        this.A.O1(new com.joaomgcd.taskerm.util.c() {
                            @Override
                            public final void a(Object obj) {
                                ActionEdit.this.A4(j2, (ArrayList) obj);
                            }
                        });
                    } else {
                        V4(i3);
                    }
                } else if (view == this.d0[i3]) {
                    String w1 = w1(this.N0, i3);
                    n5(i3);
                    v1(this.N0, i3, w1, t4(i3));
                    T5(j2, i3);
                } else {
                    MyCheckBox myCheckBox = this.U[i3];
                    if (view == myCheckBox) {
                        if (a1.H(j2) != -1) {
                            this.N0.m1(i3, myCheckBox.isChecked());
                            J3();
                        }
                        this.m0.C3(j2, i3);
                        if (j2 == 47 && i3 == 5 && !myCheckBox.isChecked()) {
                            lp.e(this, 1, 2131890964, 1);
                        } else if (j2 == 15 && i3 == 4) {
                            this.N0.m1(4, this.U[4].isChecked());
                            n5(0);
                        } else if (j2 == 376 && i3 == 2) {
                            this.N0.m1(2, this.U[2].isChecked());
                            n5(3);
                        } else if (j2 == 113 && i3 == 1) {
                            lp.e(this, 1, 2131890885, 1);
                        } else if (j2 == 810 && i3 == 1) {
                            lp.e(this, 1, 2131890853, 1);
                        } else if (j2 == 443 && i3 == 1) {
                            n5(2);
                        } else if (j2 == 104 && i3 == 2) {
                            n5(1);
                            n5(3);
                        } else if (j2 == 598 && i3 == 6) {
                            n5(7);
                        } else if (j2 == 547 && i3 == 3) {
                            n5(5);
                        }
                        if (j2 == 130 && i3 == 6) {
                            n5(7);
                        } else if (j2 == 443 && i3 == 3 && myCheckBox.isChecked()) {
                            this.m0.Q(com.joaomgcd.taskerm.dialog.a.S0(this));
                        } else if (j2 == 41 && !dq.w1(getPackageManager(), "sms")) {
                            lp.e(this, 1, 2131890912, 1);
                        } else if ((j2 == 18 && i3 == 1) || ((j2 == 667 && i3 == 9) || ((j2 == 412 && i3 == 3) || ((j2 == 123 && i3 == 2) || ((j2 == 406 && i3 == 2) || ((j2 == 404 && i3 == 2) || ((j2 == 405 && i3 == 2) || ((j2 == 400 && i3 == 2) || ((j2 == 409 && i3 == 2) || ((j2 == 408 && i3 == 2) || this.m0.R2(i3))))))))))) {
                            if (myCheckBox.isChecked()) {
                                this.m0.R(s5.r(this), new oi.d() {
                                    @Override
                                    public final void accept(Object obj) {
                                        ActionEdit.this.x4(i3, j2, (Boolean) obj);
                                    }
                                });
                            }
                        } else if (!this.m0.u2(i3, myCheckBox.isChecked())) {
                            D1(i3, false);
                        }
                    }
                }
                i3++;
            }
            i3++;
        }
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        J3();
        getActionBar().hide();
        net.dinglisch.android.taskerm.a.T(this, true);
        getActionBar().show();
        invalidateOptionsMenu();
        super.onConfigurationChanged(configuration);
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.p1(bundle, 2131492894);
        G1(false, 2131891277, 2131890053);
        this.E0 = new am();
        this.t0 = (EditText) findViewById(2131297023);
        this.u0 = (CheckBox) findViewById(2131297021);
        this.v0 = (EditText) findViewById(2131297302);
        this.w0 = (EditText) findViewById(2131297305);
        this.x0 = (ImageButton) findViewById(2131296553);
        this.y0 = (ImageButton) findViewById(2131296554);
        this.z0 = (ImageButton) findViewById(2131296556);
        this.A0 = (ImageButton) findViewById(2131296555);
        this.u0.setOnCheckedChangeListener(this.V0);
        this.B0 = (LinearLayout) findViewById(2131297024);
        this.C0 = (LinearLayout) findViewById(2131297304);
        this.D0 = (LinearLayout) findViewById(2131297307);
        q1(true);
        ((TextView) findViewById(2131297709)).setText(vh.g(this, 2131889709, new Object[0]) + " ");
        this.r0 = (CheckBox) findViewById(2131296781);
        this.s0 = (LinearLayout) findViewById(2131296783);
        dq.M2(this, 2131296782, 2131889531);
        dq.M2(this, 2131297303, 2131890209);
        dq.M2(this, 2131297306, 2131890214);
        this.G0 = (LinearLayout) findViewById(2131297061);
        ListView listView = (ListView) findViewById(2131297059);
        this.H0 = listView;
        listView.setOnTouchListener(new s());
        this.H0.setChoiceMode(3);
        this.H0.setItemsCanFocus(false);
        this.H0.setOnItemClickListener(new t());
        ImageView imageView = (ImageView) findViewById(2131296538);
        this.n0 = imageView;
        if (imageView != null) {
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    ActionEdit.this.C4(view);
                }
            });
            if (tp.e0()) {
                this.n0.setColorFilter(tp.L(this), PorterDuff.Mode.SRC_IN);
            }
        }
        MyScrollView myScrollView = (MyScrollView) findViewById(2131296767);
        this.F0 = myScrollView;
        x1(myScrollView);
        t1(17, 90111);
        for (int i2 = 0; i2 < 17; i2++) {
            this.Z[i2].setOnClickListener(this);
            this.a0[i2].setOnClickListener(this);
            this.b0[i2].setOnClickListener(this);
            this.d0[i2].setOnClickListener(this);
            this.U[i2].setOnClickListener(this);
            this.Y[i2].setOnClickListener(this);
            this.c0[i2].setOnClickListener(this);
        }
        this.v[3].addTextChangedListener(this);
        this.v[6].addTextChangedListener(this);
        this.v0.addTextChangedListener(new u());
        this.U[1].setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
                ActionEdit.this.D4(compoundButton, z2);
            }
        });
        if (bundle == null) {
            this.Q0 = getIntent().getExtras();
        } else {
            this.Q0 = bundle.getBundle("savedState");
            this.S0 = bundle.getString("ilabel");
            if (bundle.containsKey("ttsv")) {
                a1 = bundle.getStringArrayList("ttsv");
            }
            if (bundle.containsKey("ttse")) {
                b1 = bundle.getInt("ttse");
            }
        }
        Bundle bundle2 = this.Q0;
        if (bundle2 == null) {
            return;
        }
        this.O0 = bundle2.getInt("actioncode", -1);
        setTitle(vh.g(this, 2131886721, new Object[0]));
        if (bundle2.containsKey("raf")) {
            this.P0 = b0.valueOf(bundle2.getString("raf"));
        }
        this.R0 = bundle2.getStringArrayList("lbl");
        this.T0 = bundle2.getInt("noa");
        if (bundle2.containsKey("sc")) {
            this.I0 = bundle2.getString("sc");
            this.J0 = bundle2.getStringArrayList("el");
        }
        if (bundle2.containsKey("dsn")) {
            this.K0 = bundle2.getStringArrayList("dsn");
        }
        int i3 = bundle2.getInt("actionindex", -1);
        String string = bundle2.getString("actionsearch");
        Bundle bundle3 = bundle2.getBundle("aci");
        if (i3 != -1) {
            this.N0 = new net.dinglisch.android.taskerm.c(i3);
            k5();
            n5(-1);
            i4(this.N0.j(), string);
            L3();
        } else if (bundle3 != null) {
            net.dinglisch.android.taskerm.c cVar = new net.dinglisch.android.taskerm.c(new qi(bundle3));
            this.N0 = cVar;
            if (bundle == null) {
                this.S0 = cVar.Q0() ? this.N0.t0() : null;
            }
            H3();
            k5();
            n5(-1);
            L3();
            int j2 = this.N0.j();
            if (!(a1.q(j2) ? lp.e(this, 1, 2131890831, 1) : false) && j2 == 551) {
                lp.e(this, 0, 2131890899, 2);
            }
            F3();
        } else if (bundle == null) {
            this.D = -1;
            s5();
        }
        n4();
        o5();
        this.m0.I();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        net.dinglisch.android.taskerm.a.M(this, 8, 2131891114, menu);
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar != null && cVar.r0() != null) {
            net.dinglisch.android.taskerm.a.v(this, 7777, menu);
        }
        return super.r1(menu, 2131888880, 2131888736);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        N3();
    }

    @Override
    public void onItemSelected(AdapterView<?> adapterView, View view, int i2, long j2) {
        KeyguardManager keyguardManager;
        int i3;
        int j3 = this.N0.j();
        int i4 = 0;
        while (true) {
            if (i4 >= this.N0.Y()) {
                i4 = -1;
                break;
            } else if (adapterView.equals(this.V[i4])) {
                break;
            } else {
                i4++;
            }
        }
        int i5 = 5;
        if (j3 == 165 && i4 == 0) {
            n5(2);
            n5(1);
            n5(3);
        } else if (j3 == 69 && i4 == 1) {
            if (this.X0) {
                dq.W2(this.v[3], "");
            } else {
                this.X0 = true;
            }
        } else if (j3 == 314 && i4 == 0) {
            n5(2);
            n5(4);
            n5(5);
            n5(8);
            n5(9);
            if (d4() == com.joaomgcd.taskerm.action.input.t.q && com.joaomgcd.taskerm.util.k.i()) {
                pg.w0.D1(com.joaomgcd.taskerm.dialog.a.A0(this, 28), this);
            }
            if (d4() == com.joaomgcd.taskerm.action.input.t.i && (keyguardManager = (KeyguardManager) getSystemService("keyguard")) != null && keyguardManager.createConfirmDeviceCredentialIntent("bla", "blu") == null) {
                lp.e(this, 1, 2131890911, 1);
            }
        } else if (yo.b(j3) && i2 == 0) {
            n5(1);
        } else if (j3 == 490 && i4 == 0) {
            n5(1);
        } else if (j3 == 596 && i4 == 1) {
            n5(3);
        } else if (j3 == 162 && i4 == 0) {
            n5(1);
        }
        if (j3 == 457 || j3 == 192) {
            if (i4 == 0) {
                String m1 = dq.m1(this.v[1]);
                if (m1.length() > 0 && zj.j(this, zj.g(i2), m1) == null) {
                    this.N0.k0(1, "");
                    n5(1);
                }
                if (j3 == 192) {
                    int g2 = zj.g(i2);
                    if (g2 == 4) {
                        i3 = -1;
                        i5 = 4;
                    } else if (g2 == 2) {
                        i3 = -1;
                    } else if (g2 == 1) {
                        i3 = -1;
                        i5 = 2;
                    } else {
                        r7.k("ActionEdit", "unexpected ringtone type " + g2);
                        i3 = -1;
                        i5 = -1;
                    }
                    if (i5 != i3) {
                        this.V[2].setSelection(i5, true);
                    }
                }
            }
        } else if (j3 == 101) {
            if (i4 == 0) {
                b5();
                n5(6);
                n5(8);
                n5(9);
                n5(7);
                n5(5);
            }
        } else if (j3 == 53) {
            n5(3);
        } else if (j3 == 612) {
            n5(3);
        } else if (j3 == 185) {
            n5(1);
        } else if (j3 == 64) {
            n5(3);
        } else if (j3 == 135) {
            n5(1);
            n5(2);
        } else if (j3 == 173) {
            if (MyVpnService.n(i2)) {
                this.N0.R(1).q();
            } else if (!yd.y0.c()) {
                dq.n0(this, 2131887838, new Object[0]);
            }
            n5(1);
        } else if (j3 == 667 && i4 == 0) {
            this.N0.s1(0, U0(0));
            this.N0.k0(4, "");
            n5(2);
            n5(4);
            n5(3);
            n5(6);
            n5(1);
            n5(9);
        } else if (j3 == 47) {
            this.N0.s1(1, U0(1));
            this.N0.s1(4, U0(4));
            n5(2);
            n5(3);
            n5(4);
            n5(6);
            n5(8);
            n5(9);
            n5(10);
            G3();
        } else if (j3 == 119) {
            n5(1);
            n5(4);
            n5(3);
        } else if (j3 == 999) {
            this.N0.s1(1, 0);
            n5(1);
        } else if (j3 == 552) {
            this.N0.s1(1, i2);
            J3();
        } else if (j3 == 133 && i4 == 0) {
            this.N0.s1(0, i2);
            n5(2);
            n5(1);
        } else if (j3 == 559) {
            if (i2 != 3) {
                lp.e(this, 1, 2131890931, 1);
            }
        } else if (j3 == 444 || j3 == 442) {
            n5(1);
        } else if (yo.b(j3)) {
            n5(1);
        } else if (j3 == 643 && i2 == 0) {
            n5(1);
        }
        this.m0.F1(i4, i2);
    }

    @Override
    public boolean onKeyDown(int i2, KeyEvent keyEvent) {
        if (i2 != 4 || d5()) {
            return super.onKeyDown(i2, keyEvent);
        }
        return true;
    }

    @Override
    public void onNothingSelected(AdapterView<?> adapterView) {
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        int itemId = menuItem.getItemId();
        if (itemId == 6) {
            E3();
            return true;
        }
        if (itemId == 8) {
            this.D = -1;
            s5();
            return true;
        }
        if (itemId == 7777) {
            if (this.N0.r0() != null) {
                this.m0.R(com.joaomgcd.taskerm.util.e5.r0(this), new oi.d() {
                    @Override
                    public final void accept(Object obj) {
                        ActionEdit.this.E4((Boolean) obj);
                    }
                });
            }
            return true;
        }
        if (itemId != 16908332) {
            return s1(menuItem, "help/ah_index.html", "activity_actionedit.html");
        }
        d5();
        return true;
    }

    @Override
    protected void onPause() {
        r7.f("ActionEdit", "onpause");
        super.onPause();
        this.m0.v2();
        b5();
        if (this.p0 != null) {
            Q5();
        }
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar != null) {
            e5(false, cVar.j());
        }
        if (this.P0 == b0.None || this.C) {
            return;
        }
        if (this.L0 || isFinishing()) {
            K5();
        }
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i2, boolean z2) {
        String num;
        int i3;
        if (z2) {
            seekBar.requestFocus();
            if (this.P == null) {
                r7.k("ActionEdit", "onProgressChanged: null seekers");
                return;
            }
            if (this.R == null) {
                r7.k("ActionEdit", "onProgressChanged: null seekers");
                return;
            }
            if (this.N0 == null) {
                r7.k("ActionEdit", "onProgressChanged: null action");
                return;
            }
            int i4 = 0;
            while (i4 < this.N0.Y()) {
                SeekBar seekBar2 = this.P[i4];
                if (seekBar2 == null) {
                    r7.k("ActionEdit", "onProgressChanged: null seeker index " + i4);
                } else if (this.R[i4] == null) {
                    r7.k("ActionEdit", "onProgressChanged: null text view index " + i4);
                } else if (seekBar.equals(seekBar2)) {
                    int j2 = this.N0.j();
                    String T3 = T3(i4, j2);
                    int progress = seekBar.getProgress();
                    int d0 = t4(i4) ? 1 : a1.d0(j2, i4);
                    if (d0 > Integer.MIN_VALUE) {
                        progress += d0;
                    }
                    T5(j2, i4);
                    boolean z3 = i4 == 2;
                    if (a1.H(j2) != -1 && i2 + d0 == 600) {
                        num = vh.g(this, 2131891206, new Object[0]);
                    } else if (a1.f1(j2)) {
                        num = i2 == 0 ? vh.g(this, 2131891208, new Object[0]) : d0 + i2 == a1.c0(j2, i4) ? vh.g(this, 2131891206, new Object[0]) : Integer.toString(progress);
                    } else if (j2 == 47 && (i4 == 3 || z3)) {
                        if (progress == 100) {
                            i3 = 2131891137;
                        } else if (progress == 0) {
                            if (!z3) {
                                i3 = 2131891264;
                            }
                            i3 = 2131891190;
                        } else if (progress == 200) {
                            if (!z3) {
                                i3 = 2131891132;
                            }
                            i3 = 2131891234;
                        } else if (progress < 100) {
                            if (!z3) {
                                i3 = 2131891275;
                            }
                            i3 = 2131891190;
                        } else {
                            if (!z3) {
                                i3 = 2131891154;
                            }
                            i3 = 2131891234;
                        }
                        num = vh.g(this, i3, new Object[0]);
                    } else {
                        num = Integer.toString(progress);
                    }
                    if (T3 != null) {
                        num = num + T3;
                    }
                    this.R[i4].setText(num);
                    int y0 = a1.y0(j2);
                    if (y0 != -1) {
                        try {
                            AudioManager audioManager = (AudioManager) oi.d(this, "audio", "ActionEdit", "opc");
                            if (audioManager != null) {
                                e5(true, j2);
                                dq.K2(this, y0);
                                audioManager.setStreamVolume(y0, progress, 4);
                            }
                        } catch (SecurityException unused) {
                            z5(true);
                        }
                    }
                    this.m0.G1(i4, i2);
                    return;
                }
                i4++;
            }
        }
    }

    @Override
    public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i2, strArr, iArr);
        this.m0.A0(i2, strArr, iArr);
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.m0.x2();
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        r7.f("ActionEdit", "OSIS");
        Bundle bundle2 = this.Q0;
        if (bundle2 == null) {
            return;
        }
        if (this.N0 != null) {
            g5();
            bundle2.putBundle("aci", this.N0.U(0).c0());
        }
        bundle2.putInt("actioncode", this.O0);
        bundle2.putInt("actionindex", -1);
        String str = this.I0;
        if (str != null) {
            bundle.putString("sc", str);
            bundle.putStringArrayList("el", this.J0);
        }
        ArrayList<String> arrayList = this.K0;
        if (arrayList != null) {
            bundle.putStringArrayList("dsn", arrayList);
        }
        bundle.putString("raf", this.P0.toString());
        bundle.putBundle("savedState", bundle2);
        bundle.putString("ilabel", this.S0);
        bundle.putStringArrayList("ttsv", a1);
        bundle.putInt("ttse", b1);
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        EditText N0 = N0(this.N0);
        if (D2(N0)) {
            N0.clearFocus();
        }
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
    }

    @Override
    public void onUserLeaveHint() {
        super.onUserLeaveHint();
        if (this.P0 == b0.None || this.C) {
            return;
        }
        this.L0 = true;
    }

    public void p5() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null) {
            return;
        }
        this.m0.H2(cVar.j0(), new xj.a() {
            @Override
            public final Object invoke() {
                lj.e0 N4;
                N4 = ActionEdit.this.N4();
                return N4;
            }
        });
    }

    @Override
    public boolean y0() {
        net.dinglisch.android.taskerm.c cVar = this.N0;
        if (cVar == null) {
            return false;
        }
        return a1.b(cVar.j());
    }
}