ComeetChat v1.866866806590版本的 MD5 值为:4a7461802cd62adce19de75377dd7ca7

以下内容为反编译后的 ActionEdit.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.ContentResolver;
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.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.hardware.Camera;
import android.media.AudioManager;
import android.net.VpnService;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.text.Editable;
import android.text.InputFilter;
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.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
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 androidx.core.app.NotificationCompat;
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.HashSet;
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 java.util.regex.Pattern;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.ActionEdit;
import net.dinglisch.android.taskerm.CameraProxy;
import net.dinglisch.android.taskerm.FileSelect;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.bg;
import net.dinglisch.android.taskerm.bl;
import net.dinglisch.android.taskerm.bw;
import net.dinglisch.android.taskerm.cl;
import net.dinglisch.android.taskerm.di;
import net.dinglisch.android.taskerm.dt;
import net.dinglisch.android.taskerm.du;
import net.dinglisch.android.taskerm.ed;
import net.dinglisch.android.taskerm.ef;
import net.dinglisch.android.taskerm.eh;
import net.dinglisch.android.taskerm.fa;
import net.dinglisch.android.taskerm.ga;
import net.dinglisch.android.taskerm.gd;
import net.dinglisch.android.taskerm.n;

public class ActionEdit extends HasArgsEdit implements TextWatcher, AdapterView.OnItemSelectedListener, com.joaomgcd.taskerm.helper.b, fa.c {
    private static List<ResolveInfo> O = null;
    private static ArrayList<String> P = null;
    private static int Q = -1;
    private ImageView R;
    private String U;
    private CheckBox V;
    private LinearLayout W;
    private EditText X;
    private CheckBox Y;
    private LinearLayout Z;
    private fa aa;
    private MyScrollView ab;
    private LinearLayout ac;
    private ListView ad;
    private c aj;
    private int ak;
    private boolean ap;

    public Bundle f10857b;

    public com.joaomgcd.taskerm.helper.actions.d f10856a = new com.joaomgcd.taskerm.helper.actions.d(this);
    private Camera S = null;
    private bf T = null;
    private String ae = null;
    private ArrayList<String> af = null;
    private ArrayList<String> ag = null;
    private boolean ah = false;
    private int ai = -1;
    private b al = b.None;
    private List<String> am = null;
    private String an = null;
    private int ao = 99;
    private CompoundButton.OnCheckedChangeListener aq = new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            if (z) {
                ActionEdit.this.X.setVisibility(0);
                ActionEdit.this.X.requestFocus();
            } else {
                ActionEdit.this.X.setVisibility(8);
                ActionEdit.this.X.setText("");
            }
        }
    };
    private int ar = 11;

    boolean f10858c = false;
    private dp as = null;

    public enum b {
        None,
        UI,
        Exe
    }

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

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

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

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

    public c a() {
        return this.aj;
    }

    public static void a(Activity activity, String str, String str2) {
        HTMLView.a(activity, a("ah", str, str2), -1, HTMLView.c.Inform);
    }

    @Override
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bo.b("ActionEdit", "OSIS");
        Bundle bundle2 = this.f10857b;
        if (bundle2 == null) {
            return;
        }
        if (this.aj != null) {
            I();
            bundle2.putBundle("aci", this.aj.a(0).c());
        }
        bundle2.putInt("actioncode", this.ak);
        bundle2.putInt("actionindex", -1);
        if (this.ae != null) {
            bundle.putString("sc", this.ae);
            bundle.putStringArrayList("el", this.af);
        }
        if (this.ag != null) {
            bundle.putStringArrayList("dsn", this.ag);
        }
        bundle.putString("raf", this.al.toString());
        bundle.putBundle("savedState", bundle2);
        bundle.putString("ilabel", this.an);
        bundle.putStringArrayList("ttsv", P);
        bundle.putInt("ttse", Q);
    }

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

    public void W_() {
        this.aa.a(this, "ActionEdit", this.ad, this.R, null, null, null, false, false, (ImageView) findViewById(R.id.scroll_up_indicator_lb), (ImageView) findViewById(R.id.scroll_down_indicator_lb), this.ab, this);
    }

    @Override
    public void onUserLeaveHint() {
        super.onUserLeaveHint();
        if (this.al == b.None || this.k) {
            return;
        }
        this.ah = true;
    }

    @Override
    public void onPause() {
        bo.b("ActionEdit", "onpause");
        super.onPause();
        this.f10856a.o();
        ac();
        if (this.T != null) {
            ae();
        }
        if (this.aj != null) {
            a(false, this.aj.i());
        }
        if (this.al == b.None || this.k) {
            return;
        }
        if (this.ah || isFinishing()) {
            P();
        }
    }

    @Override
    public b.a.l<String> a(final String str, final String str2, final List<String> list) {
        return this.f10856a.a(str, str2, list).a(new b.a.d.g() {
            @Override
            public final Object apply(Object obj) {
                b.a.p a2;
                a2 = ActionEdit.this.a(str, str2, list, (String) obj);
                return a2;
            }
        });
    }

    public b.a.p a(String str, String str2, List list, String str3) throws Exception {
        if (TextUtils.isEmpty(str3)) {
            return super.a(str, str2, (List<String>) list);
        }
        return b.a.l.a(str3);
    }

    private void a(boolean z, int i) {
        AudioManager audioManager;
        int g = n.g(i);
        if (g == -1 || (audioManager = (AudioManager) df.a(this, "audio", "ActionEdit", "saveRestoreStream")) == null) {
            return;
        }
        if (z) {
            if (this.ai == -1) {
                this.ai = audioManager.getStreamVolume(g);
            }
        } else if (this.ai != -1) {
            gs.b(this, g);
            try {
                audioManager.setStreamVolume(g, this.ai, 0);
            } catch (Exception e2) {
                bo.c("ActionEdit", e2.toString());
            }
            this.ai = -1;
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.a(bundle, R.layout.actionedit);
        a(false, R.string.word_variable, R.string.pl_value);
        this.aa = new fa();
        this.X = (EditText) findViewById(R.id.label_edittext);
        this.Y = (CheckBox) findViewById(R.id.label_checkbox);
        this.Y.setOnCheckedChangeListener(this.aq);
        this.Z = (LinearLayout) findViewById(R.id.label_layout);
        a(true);
        ((TextView) findViewById(R.id.word_label)).setText(ct.a(this, R.string.pl_label, new Object[0]) + " ");
        this.V = (CheckBox) findViewById(R.id.continue_on_error_checkbox);
        this.W = (LinearLayout) findViewById(R.id.continue_on_error_layout);
        gs.a(this, R.id.continue_on_error_label, R.string.pl_continue_task_after_action_error);
        this.ac = (LinearLayout) findViewById(R.id.list_builder_layout);
        this.ad = (ListView) findViewById(R.id.list_builder);
        this.ad.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                return ActionEdit.this.aa.a(ActionEdit.this, ActionEdit.this.ad, ActionEdit.this.u(), motionEvent);
            }
        });
        this.ad.setChoiceMode(3);
        this.ad.setItemsCanFocus(false);
        this.ad.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                ActionEdit.this.I(i);
            }
        });
        this.R = (ImageView) findViewById(R.id.button_new);
        if (this.R != null) {
            this.R.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    ActionEdit.this.e(view);
                }
            });
            if (go.a()) {
                this.R.setColorFilter(go.g(this), PorterDuff.Mode.SRC_IN);
            }
        }
        this.ab = (MyScrollView) findViewById(R.id.content_scroller);
        a((View) this.ab);
        b(16, 90111);
        for (int i = 0; i < 16; i++) {
            this.E[i].setOnClickListener(this);
            this.F[i].setOnClickListener(this);
            this.G[i].setOnClickListener(this);
            this.I[i].setOnClickListener(this);
            this.z[i].setOnClickListener(this);
            this.D[i].setOnClickListener(this);
            this.H[i].setOnClickListener(this);
        }
        this.f11152d[3].addTextChangedListener(this);
        this.f11152d[6].addTextChangedListener(this);
        this.z[1].setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                ActionEdit.this.a(compoundButton, z);
            }
        });
        if (bundle == null) {
            this.f10857b = getIntent().getExtras();
        } else {
            this.f10857b = bundle.getBundle("savedState");
            this.an = bundle.getString("ilabel");
            if (bundle.containsKey("ttsv")) {
                P = bundle.getStringArrayList("ttsv");
            }
            if (bundle.containsKey("ttse")) {
                Q = bundle.getInt("ttse");
            }
        }
        Bundle bundle2 = this.f10857b;
        if (bundle2 == null) {
            return;
        }
        this.ak = bundle2.getInt("actioncode", -1);
        setTitle(ct.a(this, R.string.at_action_edit, new Object[0]));
        if (bundle2.containsKey("raf")) {
            this.al = b.valueOf(bundle2.getString("raf"));
        }
        this.am = bundle2.getStringArrayList("lbl");
        this.ao = bundle2.getInt("noa");
        if (bundle2.containsKey("sc")) {
            this.ae = bundle2.getString("sc");
            this.af = bundle2.getStringArrayList("el");
        }
        if (bundle2.containsKey("dsn")) {
            this.ag = bundle2.getStringArrayList("dsn");
        }
        int i2 = bundle2.getInt("actionindex", -1);
        String string = bundle2.getString("actionsearch");
        Bundle bundle3 = bundle2.getBundle("aci");
        if (i2 != -1) {
            this.aj = new c(i2);
            N();
            A(-1);
            c(this.aj.i(), string);
            aa();
        } else if (bundle3 != null) {
            this.aj = new c(new dh(bundle3));
            if (bundle == null) {
                this.an = this.aj.p() ? this.aj.q() : null;
            }
            E();
            N();
            A(-1);
            aa();
            int i3 = this.aj.i();
            if (!(n.m(i3) ? gi.b(this, 1, R.string.tip_action_deprecated, 1) : false) && i3 == 551) {
                gi.b(this, 0, R.string.tip_menu_list, 2);
            }
            C();
        } else if (bundle == null) {
            this.l = -1;
            ak();
        }
        W_();
        A();
        this.f10856a.n();
    }

    public void e(View view) {
        if (n.R(this.aj.i()) && this.ad.getAdapter().getCount() >= 3) {
            gs.d(this, R.string.f_max_items, 3);
        } else {
            I(-1);
        }
    }

    public void a(CompoundButton compoundButton, boolean z) {
        if (this.aj.i() == 549) {
            A(2);
        }
    }

    private void A() {
        super.a((AdapterView.OnItemSelectedListener) this, this.ar);
    }

    private void B() {
        super.m(this.ar);
    }

    private void C() {
        if (this.aj == null || this.aj.i() != 664) {
            return;
        }
        bg.a(ao());
    }

    private void D() {
        gs.a(this, R.id.list_builder_label, (this.aj == null || !(this.aj.i() == 551 || this.aj.i() == 157)) ? R.string.word_actions : R.string.pl_items);
    }

    private void E() {
        if (this.aj != null) {
            this.aj.a(getPackageManager(), e(), this.ae, (ft) null);
        }
    }

    public boolean x(int i) {
        if (this.aj != null) {
            boolean o = this.aj.o(i);
            E();
            if (o != this.aj.o(i)) {
                A(i);
                return true;
            }
        }
        return false;
    }

    public void a(final int i, b.a.l<String> lVar) {
        this.f10856a.a(lVar, new b.a.d.f() {
            @Override
            public final void accept(Object obj) {
                ActionEdit.this.d(i, (String) obj);
            }
        });
    }

    public void d(int i, String str) throws Exception {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        a(i, str);
    }

    private void y(int i) {
        gx.a(this.f11152d[i]);
        String f2 = n.f(this.aj.i(), i);
        if (this.aj.i() == 664 || f2.equals("uvar")) {
            this.i.b(new com.joaomgcd.taskerm.util.b() {
                @Override
                public final void call(Object obj) {
                    ActionEdit.this.a((ArrayList) obj);
                }
            });
        } else {
            H(R.string.dialog_title_variable_select);
        }
    }

    public void a(ArrayList arrayList) {
        if (gx.a(this, arrayList).isEmpty()) {
            gs.a(this, R.string.f_no_user_variables_defined, new Object[0]);
        } else {
            H(R.string.dt_variable_select_user);
        }
    }

    private void z(final int i) {
        final c cVar = this.aj;
        if (cVar == null) {
            d(this, "handleChoosePress tAction null");
            return;
        }
        int i2 = cVar.i();
        this.f11152d[i].requestFocus();
        if (i2 == 156) {
            this.l = i;
            a(this.J[i], this.f11152d[i]);
        } else if (i2 == 915) {
            if (i > 1) {
                this.l = i;
                ai();
                return;
            }
        } else if (i2 == 135 && i == 2) {
            a(i, R.string.dt_target_action_select, this.am, -1);
        }
        String f2 = n.f(i2, i);
        int i3 = 0;
        if (f2.equals("iuri")) {
            this.l = i;
            b(new Intent("net.dinglisch.android.zoom.ACTION_IMAGE_SELECT"), 55);
        } else if (f2.equals("zelem")) {
            a(i, R.string.dt_zoom_element_select, d(true), R.string.f_no_zoom_elements);
        } else if (f2.equals("js")) {
            p(i);
        } else if (f2.equals("jsl")) {
            o(i);
        } else if (f2.equals("jfu")) {
            a(gs.a((TextView) this.f11152d[1]), this.f11152d[i]);
        } else if (f2.equals("jc")) {
            a(this.f11152d[i], false);
        } else if (f2.equals("jp")) {
            b(gs.a((TextView) this.f11152d[i]), this.f11152d[i]);
        } else if (f2.equals("sname")) {
            if (S().isEmpty()) {
                gs.c(this, R.string.f_no_scenes, new Object[0]);
            } else {
                f(i, R.string.dt_scene_select);
            }
        } else if (f2.equals("sename")) {
            String aj = aj();
            List<String> c2 = c(aj);
            if (c2 == null) {
                gs.c(this, R.string.f_unknown_scene, aj);
            } else if (c2.isEmpty()) {
                gs.c(this, R.string.f_no_scene_elements, aj);
            } else {
                f(i, R.string.dt_scene_element_select);
            }
        } else if (f2.equals("psize")) {
            Camera ad = ad();
            if (ad != null) {
                a(i, R.string.dt_picture_size_select, CameraProxy.a(ad, false), R.string.f_couldnt_retrieve_data);
            }
        } else if (f2.equals("zwidg")) {
            a(i, R.string.dt_zoom_widget_select, d(false), R.string.f_no_zoom_widgets);
        } else if (f2.equals("cpug")) {
            int R = R();
            a(i, R.string.dt_cpu_gov_select, v.a(R, false, "ActionEdit/" + R), -1);
        } else if (f2.equals("f")) {
            this.k = true;
            a(i, FileSelect.b.File, i2 == 422 ? ".zip" : null);
        } else if (f2.equals("col")) {
            this.l = i;
            String a2 = gs.a((TextView) this.f11152d[this.l]);
            if (a2.length() == 0) {
                a2 = "#FF000000";
            }
            G(cd.c(a2));
        } else if (f2.equals("b")) {
            this.l = i;
            Q();
        } else if (f2.equals("ctit")) {
            a(i, R.string.dialog_title_calendar_tit, cb.b(getContentResolver(), O()), R.string.warn_no_calendar_tits);
        } else if (f2.equals("cloc")) {
            a(i, R.string.dialog_title_calendar_loc, cb.a(getContentResolver(), O()), R.string.warn_no_calendar_locs);
        } else if (f2.equals("sset")) {
            this.f10856a.a(this.A, this.f11152d);
        } else if (f2.equals("adbsc")) {
            this.f10856a.i(i, i2);
        } else if (f2.equals("locradi")) {
            this.f10856a.u(i);
        } else if (f2.equals("notcatoreo")) {
            this.f10856a.a(this.f11152d, i);
        } else if (f2.equals("apppakc")) {
            this.f10856a.h(this.f11152d, i);
        } else if (f2.equals("applpakc")) {
            this.f10856a.g(this.f11152d, i);
        } else if (f2.equals("simc")) {
            this.f10856a.i(this.f11152d, i);
        } else if (f2.equals("img")) {
            this.f10856a.c(this.f11152d, i);
        } else if (f2.equals("imgs")) {
            this.f10856a.d(this.f11152d, i);
        } else if (f2.equals("strbool")) {
            this.f10856a.e(this.f11152d, i);
        } else if (f2.equals("dttmms")) {
            this.f10856a.f(this.f11152d, i);
        }
        if (this.f10856a.g(i)) {
            this.f10856a.a(new com.joaomgcd.taskerm.helper.actions.b(i, cVar));
            return;
        }
        if (f2.equals("pkgName")) {
            this.l = i;
            startActivityForResult(AppSelect.a(this, true, false, false, false, true, false, null, null), 8);
            return;
        }
        if (f2.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++;
            }
            a(i, R.string.dialog_title_timezones, arrayList, -1);
            return;
        }
        if (f2.equals("ccal")) {
            a(i, R.string.dialog_title_calendar_cal, cb.a(getContentResolver(), -1, true, true).keySet(), R.string.warn_no_calendars);
            return;
        }
        if (f2.equals("r")) {
            File file = new File(Environment.getExternalStorageDirectory(), "sl4a/scripts");
            if (file.exists() && file.isDirectory()) {
                File[] listFiles = file.listFiles();
                if (listFiles == null || listFiles.length == 0) {
                    gs.d(this, R.string.err_no_scripts, new Object[0]);
                    return;
                }
                String[] strArr = new String[listFiles.length];
                while (i3 < listFiles.length) {
                    strArr[i3] = listFiles[i3].getName();
                    i3++;
                }
                a(i, R.string.ase_select_dialog_title, strArr, -1, true);
                return;
            }
            gs.d(this, R.string.err_no_script_dir, new Object[0]);
            return;
        }
        if (f2.equals("mime")) {
            a(i, R.string.mime_type_select_dialog_title, ct.a(this, R.array.mime_types), -1);
            return;
        }
        if (f2.equals("act")) {
            this.l = i;
            ak();
            return;
        }
        if (f2.equals("ssid")) {
            this.l = i;
            this.f10856a.a(this.f11152d[i]);
            return;
        }
        if (f2.equals("d")) {
            this.k = true;
            a(i, FileSelect.b.Dir, (String) null);
            return;
        }
        if (f2.equals("i")) {
            List<String> a3 = ImageSelect.a(this.f11153e, false, false);
            if (!gs.a((Collection<?>) a3)) {
                String[] a4 = bb.a();
                int length2 = a4.length;
                while (i3 < length2) {
                    String str2 = a4[i3];
                    if (str2 != null) {
                        a3.add(str2);
                    }
                    i3++;
                }
                Collections.sort(a3);
            }
            a(i, R.string.iconsetselect_title, a3, -1);
            return;
        }
        if (f2.equals("rtn")) {
            this.l = i;
            b(ds.c(c(i2)), 52);
            return;
        }
        if (f2.equals("a")) {
            a(i, R.string.widgetselect_title, TaskerAppWidgetConfigure.b((Context) this, false), R.string.f_no_named_widgets);
            return;
        }
        if (f2.equals("at")) {
            a(i, R.string.widgetselect_title, TaskerAppWidgetConfigure.b((Context) this, true), R.string.f_no_named_widgets);
            return;
        }
        if (f2.equals("l")) {
            if (W()) {
                Q = -1;
                P = null;
                ag();
                return;
            }
            return;
        }
        if (f2.equals("la")) {
            j(i);
            return;
        }
        if (f2.equals("p") || f2.equals("pv")) {
            this.f10856a.a(com.joaomgcd.taskerm.util.bw.l(this), new Runnable() {
                @Override
                public final void run() {
                    ActionEdit.this.J(i);
                }
            });
            return;
        }
        if (f2.equals("prof")) {
            b(i, false);
            return;
        }
        if (f2.equals("m")) {
            this.l = i;
            a(cVar.i() == 552 ? new Handler() {
                @Override
                public void handleMessage(Message message) {
                    if (message.what == 1) {
                        String string = message.getData().getString("text");
                        cVar.b(ActionEdit.this.l, string);
                        ActionEdit.this.f11152d[i].setText(string);
                        ActionEdit.this.x(i);
                        ActionEdit.this.X();
                    }
                }
            } : new Handler() {
                @Override
                public void handleMessage(Message message) {
                    if (message.what == 1) {
                        String str3 = ActionEdit.this.e().w().get(message.getData().getInt("index"));
                        cVar.b(ActionEdit.this.l, str3);
                        ActionEdit.this.f11152d[i].setText(str3);
                        ActionEdit.this.x(i);
                    }
                }
            }, e());
            return;
        }
        if (i == 1) {
            l(0);
            if (i2 == 346) {
                if (ce.a((Activity) this, this.f11152d[i], false)) {
                    this.l = i;
                    this.k = true;
                    return;
                }
                return;
            }
            if (i2 == 343) {
                this.k = true;
                a(i, FileSelect.b.File, (String) null);
                return;
            }
            if (i2 == 344) {
                switch (gd.a.c(r0)) {
                    case PackageVersion:
                    case PackageVersionLabel:
                    case PackageName:
                        this.l = i;
                        b(AppSelect.a(this, true, false, false, false, true, true, null, null), 6);
                        return;
                    default:
                        return;
                }
            }
            if (i2 != 347) {
                if (i2 == 342) {
                    this.k = true;
                    a(i, FileSelect.b.File, (String) null);
                    return;
                } else {
                    if (i2 == 345) {
                        H(R.string.dialog_title_variable_select);
                        return;
                    }
                    return;
                }
            }
            switch (gd.h.c(r0)) {
                case TimerRemaining:
                    a(i, R.string.widgetselect_title, TaskerAppWidgetConfigure.b((Context) this, true), R.string.f_no_named_widgets);
                    return;
                case ActionAvailable:
                    this.l = i;
                    r(i);
                    return;
                case StateAvailable:
                    this.l = i;
                    q(i);
                    return;
                case EventAvailable:
                    this.l = i;
                    s(i);
                    return;
                default:
                    return;
            }
        }
    }

    public void J(int i) {
        if (ce.a((Activity) this, this.f11152d[i], false)) {
            this.l = i;
            this.k = true;
        }
    }

    @Override
    public void onClick(View view) {
        int i;
        q qVar;
        ArrayList<String> arrayList;
        boolean z;
        boolean z2;
        boolean a2 = super.a(view, this.aj);
        int i2 = -1;
        int i3 = R.string.an_java_object;
        if (a2) {
            if (this.r.equals(view)) {
                H(R.string.dialog_title_variable_select);
                return;
            } else {
                if (this.s.equals(view)) {
                    a(R.string.an_java_object, -1, false);
                    return;
                }
                return;
            }
        }
        final int i4 = 0;
        while (i4 < 16) {
            final int i5 = this.aj.i();
            if (view == this.E[i4]) {
                this.l = i4;
                if (i5 == 664) {
                    final boolean z3 = i4 == 2;
                    if (z3 || i4 == 1) {
                        this.f10856a.a(new com.joaomgcd.taskerm.util.b() {
                            @Override
                            public final void call(Object obj) {
                                ActionEdit.this.a(z3, i4, (HashMap) obj);
                            }
                        });
                    }
                } else if (i5 == 130) {
                    if (i4 == 8) {
                        this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_reset_return_variable, R.string.if_return_variable_used_will_cleared_before_calling_task));
                    } else if (i4 == 6) {
                        this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_local_variable_passthrough, R.string.help_perform_task_passthrough));
                    } else if (i4 == 9) {
                        this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_allow_child_overwrite_variable, R.string.help_allow_child_overwrite_vars));
                    } else if (i4 == 7) {
                        this.f10856a.a(com.joaomgcd.taskerm.dialog.y.a(this, getString(R.string.pl_local_variable_passthrough_limit), getString(R.string.help_limit_passthrough), new com.joaomgcd.taskerm.util.l(this, R.string.pl_do_pattern_matching, new Object[0])), new b.a.d.f<com.joaomgcd.taskerm.dialog.x>() {
                            @Override
                            public void accept(com.joaomgcd.taskerm.dialog.x xVar) throws Exception {
                                if (xVar.e()) {
                                    com.joaomgcd.taskerm.util.al.i(ActionEdit.this, "https://tasker.joaoapps.com/userguide/en/matching.html");
                                }
                            }
                        });
                    } else {
                        this.f10856a.b((com.joaomgcd.taskerm.helper.actions.d) this.aj, i4);
                    }
                } else if (i5 == 25 && i4 == 1) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_package, R.string.help_go_home_package));
                } else if (i5 == 123 && i4 == 7) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_use_tasker_settings, R.string.help_run_shell_use_tasker_settings));
                } else if (i5 == 159 && i4 == 0) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.pl_name, R.string.help_toggle_profile));
                } else if (i5 == 47 && i4 == 8) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_allow_outside_boundaries, com.joaomgcd.taskerm.util.an.a(R.string.help_allow_scene_outside_boundaries, this, new Object[0]) + "\n\n" + com.joaomgcd.taskerm.util.an.a(R.string.help_interactive_out_of_bounds_scenes, this, new Object[0])));
                } else if (i5 == 47 && i4 == 9) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_show_on_lock_screen_interactive_everywhere, com.joaomgcd.taskerm.util.an.a(R.string.help_show_on_lock_screen_interactive_everywhere, this, new Object[0])));
                } else if (i5 == 47 && i4 == 10) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.overlay_plus, com.joaomgcd.taskerm.util.an.a(R.string.help_show_on_lock_screen_everywhere, this, new Object[0])));
                } else if (i5 == 523 && i4 == 2) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.an_notify_plain, com.joaomgcd.taskerm.util.an.a(R.string.help_notify_plain_icon_can_be_anything, this, new Object[0])));
                } else if (i5 == 162 && i4 == 7) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_icon, com.joaomgcd.taskerm.util.an.a(R.string.help_set_quick_tile_icon, this, new Object[0])));
                } else if (i5 == 162 && i4 == 8) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_label, com.joaomgcd.taskerm.util.an.a(R.string.help_set_quick_tile_label, this, new Object[0])));
                } else if (i5 == 162 && (i4 == 9 || i4 == 10 || i4 == 11)) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_command, com.joaomgcd.taskerm.util.an.a(R.string.help_set_quick_tile_command, this, new Object[0])));
                } else if (i5 == 162 && i4 == 12) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_command_prefix, com.joaomgcd.taskerm.util.an.a(R.string.help_set_quick_tile_command_prefix, this, new Object[0])));
                } else if (i5 == 171 && i4 == 4) {
                    this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_do_at_time, com.joaomgcd.taskerm.util.an.a(R.string.beep_do_at_time, this, new Object[0])));
                } else {
                    this.f10856a.b((com.joaomgcd.taskerm.helper.actions.d) this.aj, i4);
                }
            } else if (view == this.D[i4]) {
                this.l = i4;
                if (i5 == 156) {
                    am();
                } else if (i5 == 664) {
                    a(i3, i4, i4 != 0);
                } else if (i5 == 665) {
                    a(i3, i4, false);
                } else if (i5 == 877 && (i4 == 4 || i4 == 5 || i4 == 6)) {
                    a(i3, i4, false);
                } else if (i5 == 39 && i4 == 1) {
                    a(i3, i4, false);
                } else if (i5 == 129) {
                    a(gs.a((TextView) this.f11152d[this.l]), gs.a((TextView) this.f11152d[1]), this.z[2].isChecked());
                } else if (i5 == 131) {
                    String a3 = gs.a((TextView) this.f11152d[0]);
                    if (a3.length() == 0) {
                        gs.d(this, R.string.f_select_file, new Object[0]);
                    } else {
                        String n = gs.n(a3);
                        if (n == null) {
                            gs.d(this, R.string.err_no_sd, new Object[0]);
                        } else {
                            try {
                                startActivityForResult(com.joaomgcd.taskerm.util.dq.a(new File(n), (Context) this, "text/javascript", "android.intent.action.VIEW", (c.f.a.b<? super String, c.s>) new c.f.a.b() {
                                    @Override
                                    public final Object invoke(Object obj) {
                                        c.s f2;
                                        f2 = ActionEdit.f((String) obj);
                                        return f2;
                                    }
                                }, true, "JavaScript Editor"), 59);
                            } catch (Exception unused) {
                                gs.a(this, "no editor", new Object[0]);
                            }
                        }
                    }
                } else {
                    a(this.aj.e(i4).c(this));
                }
            } else if (view == this.C[i4]) {
                if (this.aj.m(i4) == 2) {
                    this.l = i4;
                    boolean z4 = i5 == 20 || i5 == 173;
                    boolean z5 = i5 == 20;
                    if (i5 == 252) {
                        arrayList = cr.c(getPackageManager());
                        qVar = null;
                    } else if (i5 == 173) {
                        d k = this.aj.k(1);
                        q qVar2 = new q();
                        for (int i6 = 0; i6 < k.l(); i6++) {
                            qVar2.a(k.b(i6), k.c(i6), k.d(i6));
                        }
                        qVar = qVar2;
                        arrayList = null;
                        z = false;
                        z2 = false;
                        b(AppSelect.a(this, z, z5, false, false, z4, z2, arrayList, qVar), 6);
                    } else {
                        qVar = null;
                        arrayList = null;
                    }
                    z = true;
                    z2 = true;
                    b(AppSelect.a(this, z, z5, false, false, z4, z2, arrayList, qVar), 6);
                } else if (this.aj.m(i4) == 1) {
                    f(i4, R.string.dt_scene_select);
                } else if (this.aj.m(i4) == 4) {
                    this.l = i4;
                    int i7 = i5 != 138 ? 292 : 260;
                    if (this.al == b.None && i5 != 138) {
                        i7 |= 8;
                    }
                    if (i5 == 138) {
                        i = i7 | NotificationCompat.FLAG_GROUP_SUMMARY;
                    } else {
                        if (i5 != 188) {
                            i7 |= 128;
                        }
                        if (n.R(i5)) {
                            if (!bw.ac.b()) {
                                i7 |= NotificationCompat.FLAG_GROUP_SUMMARY;
                            }
                            i7 = i7 | 2048 | NotificationCompat.FLAG_BUBBLE;
                        }
                        i = i7 | 83;
                    }
                    b(ImageSelect.a((Context) this, i), 58);
                }
            } else if (view == this.J[i4]) {
                z(i4);
            } else if (view == this.K[i4]) {
                y(i4);
            } else if (view == this.F[i4]) {
                this.w[i4].incrementProgressBy(n.n(i5, i4));
                onProgressChanged(this.w[i4], this.w[i4].getProgress(), true);
            } else if (view == this.G[i4]) {
                this.w[i4].incrementProgressBy(0 - n.n(i5, i4));
                onProgressChanged(this.w[i4], this.w[i4].getProgress(), true);
            } else if (view.equals(this.H[i4])) {
                this.l = 0;
                if (n.s(i5)) {
                    this.i.b(new com.joaomgcd.taskerm.util.b() {
                        @Override
                        public final void call(Object obj) {
                            ActionEdit.this.a(i5, (ArrayList) obj);
                        }
                    });
                } else {
                    M();
                }
            } else if (view == this.I[i4]) {
                String b2 = b(this.aj, i4);
                A(i4);
                a(this.aj, i4, b2, F(i4));
                d(i5, i4);
            } else {
                MyCheckBox myCheckBox = this.z[i4];
                if (view == myCheckBox) {
                    if (n.P(i5) != i2) {
                        this.aj.a(i4, myCheckBox.isChecked());
                        X();
                    }
                    this.f10856a.k(i5, i4);
                    if (i5 == 47 && i4 == 5 && !myCheckBox.isChecked()) {
                        gi.b(this, 1, R.string.tip_uncheck_scene_exit_button, 1);
                    } else if (i5 == 15 && i4 == 4) {
                        this.aj.a(4, this.z[4].isChecked());
                        A(0);
                    } else if (i5 == 376 && i4 == 2) {
                        this.aj.a(2, this.z[2].isChecked());
                        A(3);
                    } else if (i5 == 113 && i4 == 1) {
                        gi.b(this, 1, R.string.tip_keep_wifi_on_may_not_work_all_devices, 1);
                    } else if (i5 == 810 && i4 == 1) {
                        gi.b(this, 1, R.string.tip_brightness_safeguard, 1);
                    } else if (i5 == 443 && i4 == 1) {
                        A(2);
                    } else if (i5 == 104 && i4 == 2) {
                        A(1);
                        A(3);
                    } else if (i5 == 598 && i4 == 6) {
                        A(7);
                    } else if (i5 == 547 && i4 == 3) {
                        A(5);
                    }
                    if (i5 == 130 && i4 == 6) {
                        A(7);
                    } else if (i5 == 443 && i4 == 3 && myCheckBox.isChecked()) {
                        this.f10856a.b(com.joaomgcd.taskerm.dialog.y.j(this));
                    } else if (i5 == 41 && !gs.a(getPackageManager(), "sms")) {
                        gi.b(this, 1, R.string.tip_no_sms_app, 1);
                    } else if ((i5 == 18 && i4 == 1) || ((i5 == 667 && i4 == 9) || ((i5 == 412 && i4 == 3) || ((i5 == 123 && i4 == 2) || ((i5 == 406 && i4 == 2) || ((i5 == 404 && i4 == 2) || ((i5 == 405 && i4 == 2) || ((i5 == 400 && i4 == 2) || ((i5 == 409 && i4 == 2) || ((i5 == 408 && i4 == 2) || this.f10856a.t(i4))))))))))) {
                        if (myCheckBox.isChecked()) {
                            this.f10856a.a(ba.b(this), new b.a.d.f() {
                                @Override
                                public final void accept(Object obj) {
                                    ActionEdit.this.a(i4, i5, (Boolean) obj);
                                }
                            });
                        }
                    } else if (!this.f10856a.a(i4, myCheckBox.isChecked())) {
                        a(i4, false);
                    }
                }
            }
            i4++;
            i2 = -1;
            i3 = R.string.an_java_object;
        }
    }

    public void a(boolean z, int i, HashMap hashMap) {
        String a2 = gs.a((TextView) this.f11152d[1]);
        String str = null;
        if (a2.isEmpty()) {
            str = bg.c((String) null);
        } else {
            String str2 = bg.a(ao(), a2, bg.a.Both, (gt) null, (Bundle) null, (Class<?>) null, (HashMap<String, String>) hashMap, "lookupHelp").f12196a;
            if (str2 == null) {
                gs.a(this, R.string.f_nothing_found, new Object[0]);
            } else if (z) {
                String a3 = gs.a((TextView) this.f11152d[i]);
                if (a3.startsWith("assign") || a3.startsWith("new")) {
                    gs.a(this, R.string.f_nothing_found, new Object[0]);
                } else {
                    str = bg.a(str2, a3);
                }
            } else {
                str = bg.c(str2);
            }
        }
        if (str != null) {
            b(bg.d(str), 57);
        }
    }

    public static c.s f(String str) {
        bo.b("ActionEdit", str);
        return c.s.f2131a;
    }

    public void a(int i, ArrayList arrayList) {
        Intent a2 = di.a(this, di.a.Action, this.aj.i(0), i, gx.a(this, arrayList));
        if (a2 != null) {
            b(a2, 51);
        }
    }

    public void a(final int i, final int i2, Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            return;
        }
        com.joaomgcd.taskerm.rx.h.c(new Runnable() {
            @Override
            public final void run() {
                ActionEdit.this.h(i, i2);
            }
        });
    }

    public void h(int i, int i2) {
        this.z[i].setCheckedNoSignal(false);
        gs.d(this, R.string.f_no_root, new Object[0]);
        this.f10856a.k(i2, i);
    }

    private n.e F() {
        return n.e.values()[l(0)];
    }

    public void G() {
        boolean z;
        if (this.al != b.None) {
            if (gn.d(this)) {
                int i = this.aj.i();
                if (i != 139 && i != 133 && i != 138) {
                    if (i == 159) {
                        String c2 = this.aj.j(0).c();
                        fz c3 = fy.c(this);
                        Iterator<Integer> it = c3.h(c2).iterator();
                        while (it.hasNext()) {
                            if (c3.c(it.next().intValue())) {
                            }
                        }
                    }
                    z = true;
                    if (!z) {
                        gs.d(this, R.string.f_cant_locked, n.u(i));
                    }
                }
                z = false;
                if (!z) {
                }
            } else {
                z = true;
            }
            if (z) {
                ExecuteService.a(this, new c[]{this.aj}, TaskerAppWidgetConfigure.a(this), this.al == b.UI);
                P();
                return;
            }
            return;
        }
        Intent intent = new Intent();
        intent.putExtra("actisss", this.aj.a(0).c());
        intent.putExtra("actionindex", this.ak);
        setResult(-1, intent);
        finish();
    }

    public void A(int i) {
        int i2;
        int i3;
        boolean z;
        int i4;
        boolean z2;
        int i5;
        int i6;
        int i7;
        int i8;
        int i9;
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15;
        int i16;
        ?? r11;
        int i17;
        int i18;
        boolean z3;
        int i19;
        int i20;
        int i21;
        int i22;
        int i23;
        int i24;
        int i25;
        int i26;
        String[] strArr;
        int i27;
        int i28;
        String a2;
        int i29;
        int i30;
        int i31;
        int i32;
        int i33;
        String b2;
        int h;
        int i34;
        ContentResolver contentResolver;
        int i35;
        int i36;
        int i37;
        int i38;
        int i39;
        int i40;
        int i41;
        int i42;
        boolean z4;
        int i43;
        int i44;
        char c2;
        int i45;
        int c3;
        int i46;
        String str;
        char c4;
        int i47;
        int i48;
        int i49;
        int i50;
        int i51;
        boolean z5;
        int i52;
        int i53;
        ?? r13;
        Integer c5;
        int i54;
        int i55;
        int i56;
        dt dtVar;
        Drawable b3;
        int i57;
        int i58;
        int i59;
        int i60;
        int i61;
        int i62;
        String m;
        int i63 = i;
        int i64 = this.aj.i();
        this.f10856a.r(i64);
        int i65 = 1;
        int i66 = 0;
        if (i63 == -1) {
            if (this.al == b.None && n.q(i64) && (!i() || !this.aj.t())) {
                this.W.setVisibility(0);
                this.V.setChecked(!this.aj.t());
            } else {
                this.W.setVisibility(8);
            }
            boolean z6 = i64 == 300;
            this.X.setHint(z6 ? "" : ct.a(this, R.string.word_optional, new Object[0]));
            if (this.al != b.None || (i() && !this.aj.p() && !z6)) {
                this.Z.setVisibility(8);
            } else {
                boolean z7 = z6 || this.aj.p();
                this.Y.setVisibility(z6 ? 8 : 0);
                if (this.aj.p()) {
                    this.X.setText(this.aj.q());
                }
                this.X.setVisibility(z7 ? 0 : 8);
                this.Y.setOnCheckedChangeListener(null);
                this.Y.setChecked(z7);
                this.Y.setOnCheckedChangeListener(this.aq);
                this.Z.setVisibility(0);
            }
            if (i64 == 35) {
                m = ct.a(this, R.string.an_wait, new Object[0]);
                a(true, R.string.word_variable, R.string.pl_value);
                u(R.string.word_until);
            } else if (i64 == 37) {
                m = this.aj.n();
                a(true, R.string.word_variable, R.string.pl_value);
                u(R.string.pl_condition);
            } else {
                m = this.aj.m();
                a(false, R.string.word_variable, R.string.pl_value);
                u(R.string.an_if);
            }
            if (this.ak >= 0) {
                m = String.valueOf(this.ak + 1) + ". " + m;
            }
            getActionBar().setSubtitle(m);
            b(this.aj);
            if (a(this.aj) == null) {
                this.f10856a.i();
            }
        }
        boolean z8 = i63 != -1;
        if (i63 == -1) {
            i2 = this.aj.h();
            i3 = 0;
        } else {
            i2 = i63 + 1;
            i3 = i63;
        }
        int i67 = i3;
        String[] strArr2 = null;
        while (i67 < i2) {
            boolean g = this.f10856a.g(i64, i67);
            int i68 = this.f10856a.h(i67) ? 0 : 8;
            boolean s = n.s(i64);
            if (i67 < this.aj.h()) {
                if (E(i)) {
                    b2 = ct.a(this, R.string.pl_coord, new Object[i66]);
                } else if (D(i)) {
                    b2 = ct.a(this, R.string.pl_name, new Object[i66]);
                } else if (i64 == 185 && i67 == i65 && l(i66) == 0) {
                    b2 = ct.a(this, R.string.pl_threshold, new Object[i66]);
                } else if (i64 == 53 && i67 == 3) {
                    b2 = eu.d(getResources(), l(2));
                } else if (i64 == 612 && i67 == 3) {
                    b2 = ct.a(this, et.T(l(2)), new Object[i66]);
                } else if (i64 == 667 && i67 == 4 && F() != n.e.Raw) {
                    b2 = ct.a(this, R.string.pl_selection, new Object[i66]);
                } else if (i64 == 667 && i67 == i65 && F() == n.e.TableURIFormatted) {
                    b2 = ct.a(this, R.string.pl_uri, new Object[i66]);
                } else {
                    b2 = this.aj.b(getResources(), i67);
                }
                this.x[i67].setText(b2);
                switch (this.aj.m(i67)) {
                    case 0:
                        z = s;
                        i4 = i67;
                        h g2 = this.aj.g(i4);
                        boolean g3 = g2.g();
                        if (g3) {
                            h = g2.h();
                        } else {
                            h = n.h(i64, i4);
                        }
                        int i69 = h;
                        String[] a3 = n.a(getResources(), i64, i4, this.aj);
                        if (a3 != null) {
                            if (i64 == 47 && i4 == 1 && !g3) {
                                String a4 = gs.a((TextView) this.f11152d[0]);
                                fz e2 = e();
                                if (e2.t(a4)) {
                                    i69 = ek.a(e2.B(a4)).ordinal();
                                }
                                i37 = 0;
                            } else if (i64 != 101 || i4 == 0) {
                                i37 = 0;
                            } else {
                                if (!g3) {
                                    i69 = 0;
                                }
                                String str2 = a3[i69];
                                if (i4 == 8) {
                                    List<String> a5 = CameraProxy.a(CameraProxy.c.Flash, ad(), false);
                                    if (!gs.a((Collection<?>) a5)) {
                                        Collections.sort(a5);
                                        a3 = gs.b(CameraProxy.a(this.f11154f, a5, n.t, n.w));
                                        i40 = 0;
                                    }
                                    i40 = 8;
                                } else if (i4 == 9) {
                                    List<String> a6 = CameraProxy.a(CameraProxy.c.Focus, ad(), false);
                                    if (!gs.a((Collection<?>) a6)) {
                                        Collections.sort(a6);
                                        a3 = gs.b(CameraProxy.a(this.f11154f, a6, n.u, n.v));
                                        i40 = 0;
                                    }
                                    i40 = 8;
                                } else {
                                    if (i4 == 7) {
                                        List<String> a7 = CameraProxy.a(CameraProxy.c.White, ad(), false);
                                        if (gs.a((Collection<?>) a7)) {
                                            i39 = 8;
                                        } else {
                                            Collections.sort(a7);
                                            a3 = gs.b(CameraProxy.a(this.f11154f, a7, n.r, n.s));
                                            i39 = 0;
                                        }
                                        i38 = i39;
                                    } else {
                                        if (i4 == 6) {
                                            List<String> a8 = CameraProxy.a(CameraProxy.c.Scene, ad(), false);
                                            if (gs.a((Collection<?>) a8)) {
                                                i38 = 8;
                                            } else {
                                                Collections.sort(a8);
                                                a3 = gs.b(CameraProxy.a(this.f11154f, a8, n.x, n.y));
                                            }
                                        }
                                        i38 = 0;
                                    }
                                    int i70 = i38;
                                    i69 = gs.b(str2, a3);
                                    i37 = i70;
                                }
                                i38 = i40;
                                int i702 = i38;
                                i69 = gs.b(str2, a3);
                                i37 = i702;
                            }
                            if (i64 == 820) {
                                a(0, R.array.actionedit_array_action_choices_stay_on, i69);
                            } else {
                                if (z8) {
                                    B();
                                }
                                a(i4, a3, i69);
                                if (z8) {
                                    A();
                                }
                            }
                            if (i64 == 101 && i4 == 0) {
                                int a9 = CameraProxy.a(1);
                                int a10 = CameraProxy.a(0);
                                boolean z9 = a9 != -1;
                                boolean z10 = a10 != -1;
                                bo.b("ActionEdit", "camera: front index : " + a9 + " rear: " + a10);
                                if (z9 && z10) {
                                    i42 = 1;
                                } else {
                                    if (z10) {
                                        this.A[i4].setSelection(0, false);
                                    } else if (z9) {
                                        this.A[i4].setSelection(1, false);
                                    }
                                    i42 = 0;
                                }
                                i14 = i37;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 8;
                                i8 = 0;
                                i41 = i42;
                            } else {
                                i14 = i37;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 8;
                                i8 = 0;
                                i41 = 1;
                            }
                            i16 = 8;
                            i30 = 8;
                            i13 = 8;
                            i12 = 8;
                            i11 = 0;
                            i31 = i41;
                            i10 = 8;
                            i9 = 8;
                            r11 = i31;
                            i15 = i30;
                            break;
                        } else if (n.o(i64, i4)) {
                            int i71 = (this.al != b.None || (i() && !g2.e())) ? 8 : 0;
                            if (this.g[i4]) {
                                a(g2, i4);
                                i9 = i71;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 8;
                                i8 = 0;
                                i35 = 1;
                                i16 = 0;
                                i36 = 8;
                                i14 = 0;
                                i13 = 8;
                                i12 = 8;
                                i11 = 8;
                                i10 = 8;
                                r11 = i35;
                                i15 = i36;
                                break;
                            } else {
                                int g4 = n.g(i64, i4);
                                int j = n.j(i64, i4);
                                if (i64 == 67 && i4 == 2) {
                                    g4 = b(gs.a((TextView) this.f11152d[0])).size();
                                    if (i69 > g4) {
                                        i34 = g4;
                                        this.w[i4].setMax(g4 - j);
                                        this.w[i4].setProgress(j == Integer.MIN_VALUE ? i34 : i34 - j);
                                        String num = Integer.toString(i34);
                                        if (n.s(this.aj.i())) {
                                        }
                                        if (i64 != 47) {
                                        }
                                        onProgressChanged(this.w[i4], i34 - j, true);
                                        i9 = i71;
                                        z2 = false;
                                        i5 = 8;
                                        i6 = 8;
                                        i7 = 0;
                                        i8 = 0;
                                        r11 = 1;
                                        i16 = 8;
                                        i15 = 8;
                                        i14 = 0;
                                        i13 = 8;
                                        i12 = 8;
                                        i11 = 8;
                                        i10 = 0;
                                    }
                                    i34 = i69;
                                    this.w[i4].setMax(g4 - j);
                                    this.w[i4].setProgress(j == Integer.MIN_VALUE ? i34 : i34 - j);
                                    String num2 = Integer.toString(i34);
                                    if (n.s(this.aj.i())) {
                                    }
                                    if (i64 != 47) {
                                    }
                                    onProgressChanged(this.w[i4], i34 - j, true);
                                    i9 = i71;
                                    z2 = false;
                                    i5 = 8;
                                    i6 = 8;
                                    i7 = 0;
                                    i8 = 0;
                                    r11 = 1;
                                    i16 = 8;
                                    i15 = 8;
                                    i14 = 0;
                                    i13 = 8;
                                    i12 = 8;
                                    i11 = 8;
                                    i10 = 0;
                                } else if (n.g(i64) != -1 && i4 == 0) {
                                    AudioManager audioManager = (AudioManager) df.a(this, "audio", "ActionEdit", "suia");
                                    if (audioManager == null) {
                                        gs.d(this, R.string.err_no_audio_manager, new Object[0]);
                                        i34 = i69;
                                        g4 = 0;
                                    } else {
                                        int g5 = n.g(i64);
                                        int streamMaxVolume = audioManager.getStreamMaxVolume(g5);
                                        if (g3) {
                                            g4 = streamMaxVolume;
                                            i34 = i69;
                                        } else {
                                            i34 = audioManager.getStreamVolume(g5);
                                            g4 = streamMaxVolume;
                                        }
                                    }
                                    this.w[i4].setMax(g4 - j);
                                    this.w[i4].setProgress(j == Integer.MIN_VALUE ? i34 : i34 - j);
                                    String num22 = Integer.toString(i34);
                                    if (n.s(this.aj.i())) {
                                    }
                                    if (i64 != 47) {
                                    }
                                    onProgressChanged(this.w[i4], i34 - j, true);
                                    i9 = i71;
                                    z2 = false;
                                    i5 = 8;
                                    i6 = 8;
                                    i7 = 0;
                                    i8 = 0;
                                    r11 = 1;
                                    i16 = 8;
                                    i15 = 8;
                                    i14 = 0;
                                    i13 = 8;
                                    i12 = 8;
                                    i11 = 8;
                                    i10 = 0;
                                } else {
                                    if (i64 == 999) {
                                        g4 = bk.b(gs.a((TextView) this.f11152d[0]));
                                        if (g4 == -1 || g4 > 255) {
                                            g4 = 255;
                                        }
                                    } else {
                                        if (i64 == 130 && !g3) {
                                            i34 = 5;
                                        } else if (i64 == 810) {
                                            if (!g3 && (contentResolver = getContentResolver()) != null) {
                                                try {
                                                    i34 = Settings.System.getInt(contentResolver, "screen_brightness");
                                                } catch (Settings.SettingNotFoundException unused) {
                                                }
                                                g4 = com.joaomgcd.taskerm.util.ds.e();
                                            }
                                            i34 = i69;
                                            g4 = com.joaomgcd.taskerm.util.ds.e();
                                        }
                                        this.w[i4].setMax(g4 - j);
                                        this.w[i4].setProgress(j == Integer.MIN_VALUE ? i34 : i34 - j);
                                        String num222 = Integer.toString(i34);
                                        if (n.s(this.aj.i())) {
                                            if (i34 == 0) {
                                                num222 = ct.a(this, R.string.word_none, new Object[0]);
                                            } else if (i34 == di.b()) {
                                                num222 = ct.a(this, R.string.word_never, new Object[0]);
                                            }
                                        }
                                        if (i64 != 47 || n.M(i64)) {
                                            onProgressChanged(this.w[i4], i34 - j, true);
                                        } else {
                                            String e3 = e(i4, i64);
                                            if (e3 != null) {
                                                num222 = num222 + e3;
                                            }
                                            this.y[i4].setText(num222);
                                        }
                                        i9 = i71;
                                        z2 = false;
                                        i5 = 8;
                                        i6 = 8;
                                        i7 = 0;
                                        i8 = 0;
                                        r11 = 1;
                                        i16 = 8;
                                        i15 = 8;
                                        i14 = 0;
                                        i13 = 8;
                                        i12 = 8;
                                        i11 = 8;
                                        i10 = 0;
                                        break;
                                    }
                                    i34 = i69;
                                    this.w[i4].setMax(g4 - j);
                                    this.w[i4].setProgress(j == Integer.MIN_VALUE ? i34 : i34 - j);
                                    String num2222 = Integer.toString(i34);
                                    if (n.s(this.aj.i())) {
                                    }
                                    if (i64 != 47) {
                                    }
                                    onProgressChanged(this.w[i4], i34 - j, true);
                                    i9 = i71;
                                    z2 = false;
                                    i5 = 8;
                                    i6 = 8;
                                    i7 = 0;
                                    i8 = 0;
                                    r11 = 1;
                                    i16 = 8;
                                    i15 = 8;
                                    i14 = 0;
                                    i13 = 8;
                                    i12 = 8;
                                    i11 = 8;
                                    i10 = 0;
                                }
                            }
                        } else {
                            this.f11152d[i4].setLines(1);
                            this.f11152d[i4].setFilters(new InputFilter[]{new InputFilter.LengthFilter(40)});
                            if (i64 == 794 || i64 == 795) {
                                df.a((TextView) this.f11152d[i4], 2);
                            } else {
                                df.a((TextView) this.f11152d[i4], 12290);
                            }
                            int i72 = i64 == 915 ? 0 : 8;
                            h g6 = this.aj.g(i4);
                            boolean g7 = g(i64, i4);
                            if (g6.e()) {
                                this.f11152d[i4].setText(g6.f());
                            } else if (!g6.g()) {
                                if (i64 == 60 && i4 == 6) {
                                    this.f11152d[i4].setText("0");
                                } else if (i64 == 915) {
                                    if (i4 == 2) {
                                        this.f11152d[i4].setText(String.valueOf(v.b(R())));
                                    } else {
                                        this.f11152d[i4].setText(String.valueOf(v.c(R())));
                                    }
                                } else if (i64 == 118 || i64 == 116) {
                                    this.f11152d[i4].setText("80");
                                } else {
                                    this.f11152d[i4].setText("");
                                }
                                i6 = i72;
                                z2 = g7;
                                i5 = 8;
                                i7 = 8;
                                i8 = 0;
                                i32 = 1;
                                i16 = 0;
                                i30 = 8;
                                i14 = 0;
                                i13 = 8;
                                i12 = 8;
                                i11 = 8;
                                i31 = i32;
                                i10 = 8;
                                i9 = 8;
                                r11 = i31;
                                i15 = i30;
                            } else if (i64 == 188 && g6.h() == 0) {
                                this.f11152d[i4].setText("");
                            } else {
                                this.f11152d[i4].setText(Integer.toString(g6.h()));
                            }
                            i6 = i72;
                            z2 = g7;
                            i5 = 8;
                            i7 = 8;
                            i8 = 0;
                            i32 = 1;
                            i16 = 0;
                            i30 = 8;
                            i14 = 0;
                            i13 = 8;
                            i12 = 8;
                            i11 = 8;
                            i31 = i32;
                            i10 = 8;
                            i9 = 8;
                            r11 = i31;
                            i15 = i30;
                        }
                        break;
                    case 1:
                        String f2 = n.f(i64, i67);
                        j j2 = this.aj.j(i67);
                        if (n.u(i64, i67)) {
                            fz e4 = e();
                            if (j2.g()) {
                                String c6 = j2.c();
                                if (e4.t(c6)) {
                                    dtVar = e4.y(c6);
                                } else {
                                    dtVar = n.a(this, c6);
                                }
                            } else {
                                dtVar = null;
                            }
                            if (dtVar == null) {
                                dtVar = n.a(this, i64, i67);
                            }
                            dt dtVar2 = dtVar;
                            z = s;
                            i4 = i67;
                            n.a(this, e(), dtVar2, this.aj, i67, (Bundle) null);
                            this.y[i4].setText(ex.b(this, dtVar2.m()));
                            this.f11152d[i4].setText(dtVar2.m());
                            a(e4, i4, dtVar2);
                            c4 = '\b';
                            i47 = 8;
                            i52 = 0;
                            i48 = 0;
                            i49 = 8;
                            r13 = i66;
                        } else {
                            z = s;
                            i4 = i67;
                            String c7 = j2.c();
                            Boolean i73 = this.f10856a.i(i4);
                            if (i73 == null) {
                                z4 = (n.d(i64, i4) ? 1 : 0) ^ i65;
                            } else {
                                z4 = i73.booleanValue();
                            }
                            if (i64 == 101 && i4 == 5) {
                                String[] a11 = CameraProxy.a(ad(), (boolean) i66);
                                if (!gs.a((Object[]) a11)) {
                                    if (TextUtils.isEmpty(c7)) {
                                        c7 = a11[a11.length - i65];
                                    } else if (CameraProxy.a(c7, a11) == null && !gx.h(c7)) {
                                        gs.c(this, R.string.f_unsupported_resolution, new Object[i66]);
                                    }
                                }
                            }
                            if (F(i4)) {
                                if (TextUtils.isEmpty(c7)) {
                                    c5 = 15;
                                } else {
                                    c5 = gs.c(c7);
                                    if (c5 == null) {
                                        this.g[i4] = i65;
                                    }
                                }
                                if (this.g[i4]) {
                                    i54 = a(this.f11152d[i4], c7);
                                    i55 = 8;
                                    i56 = 8;
                                } else {
                                    if (c5 == null) {
                                        c5 = 15;
                                    }
                                    this.w[i4].setMax(20);
                                    this.w[i4].setProgress(c5.intValue() - i65);
                                    this.y[i4].setText(String.valueOf(c5));
                                    i54 = 8;
                                    i55 = 0;
                                    i56 = 0;
                                }
                                i16 = i54;
                                z5 = z4;
                                i50 = i56;
                                c4 = '\b';
                                i48 = 8;
                                i49 = 8;
                                i51 = 0;
                                i46 = 8;
                                i52 = i55;
                                i47 = 8;
                            } else if (i64 == 999) {
                                int b4 = gs.b(c7, bk.a());
                                String[] a12 = bk.a();
                                if (b4 == -1) {
                                    b4 = 0;
                                }
                                a(i4, a12, b4);
                                r13 = z4;
                                c4 = '\b';
                                i47 = 8;
                                i52 = 8;
                                i48 = 8;
                                i49 = 0;
                            } else {
                                Typeface typeface = Typeface.DEFAULT;
                                if (f2.equals("c") || f2.equals("cv") || f2.equals("p")) {
                                    i43 = 3;
                                } else {
                                    if (!f2.equals("w") && !f2.equals("a") && !f2.equals("at")) {
                                        if (f2.equals("let")) {
                                            i43 = 528385;
                                        } else {
                                            if (f2.equals("var") || f2.equals("uvar")) {
                                                if (c7.length() == 0 && !z4 && ((i64 != 415 && i64 != 416) || i4 != i65)) {
                                                    c7 = "%";
                                                }
                                            } else if (f2.equals("sename") && TextUtils.isEmpty(c7)) {
                                                Set<du.e> b5 = du.b(i64);
                                                HashSet hashSet = new HashSet();
                                                String a13 = gs.a((TextView) this.f11152d[i66]);
                                                List<String> c8 = c(a13);
                                                if (c8 != null) {
                                                    for (String str3 : c8) {
                                                        du.e b6 = b(a13, str3);
                                                        if (b6 != null && b5.contains(b6)) {
                                                            hashSet.add(str3);
                                                        }
                                                    }
                                                    if (hashSet.size() == i65) {
                                                        c7 = (String) hashSet.iterator().next();
                                                    }
                                                }
                                            } else if (f2.equals("sname")) {
                                                if (TextUtils.isEmpty(c7)) {
                                                    List<String> S = S();
                                                    if (this.ae != null && S.contains(this.ae)) {
                                                        c7 = this.ae;
                                                    } else if (S.size() == i65) {
                                                        c7 = S.get(0);
                                                    }
                                                }
                                            } else if (i64 == 457 && TextUtils.isEmpty(c7)) {
                                                c7 = ds.a(this, c(i64));
                                                if (c7 == null) {
                                                    c7 = ds.a();
                                                }
                                            } else if (f2.equals("cpug")) {
                                                if (TextUtils.isEmpty(c7)) {
                                                    c7 = v.d(R());
                                                }
                                            } else if (f2.equals("s")) {
                                                i43 = 540673;
                                            } else if (!f2.equals("pp")) {
                                                break;
                                            } else {
                                                i43 = 524417;
                                            }
                                            i43 = 524289;
                                        }
                                    }
                                    i43 = 532481;
                                }
                                int i74 = (f2.equals("col") || f2.equals("zelem") || f2.equals("zwidg") || f2.equals("act") || f2.equals("a") || f2.equals("at") || f2.equals("p") || f2.equals("pv") || f2.equals("simc") || f2.equals("f") || f2.equals("d") || f2.equals("m") || f2.equals("i") || f2.equals("b") || f2.equals("l") || f2.equals("la") || f2.equals("r") || f2.equals("mime") || f2.equals("prof") || f2.equals("rtn") || f2.equals("cloc") || f2.equals("ctit") || f2.equals("ccal") || f2.equals("tz") || f2.equals("iuri") || f2.equals("cpug") || f2.equals("cpuf") || f2.equals("sname") || f2.equals("sename") || f2.equals("psize") || f2.equals("js") || f2.equals("jsl") || f2.equals("score") || f2.equals("jfu") || f2.equals("jc") || f2.equals("jp") || f2.equals("pkgName") || f2.equals("sset") || f2.equals("locradi") || f2.equals("apppakc") || f2.equals("applpakc") || f2.equals("notcatoreo") || f2.equals("img") || f2.equals("imgs") || f2.equals("strbool") || f2.equals("dttmms") || f2.equals("adbsc") || f2.equals("ssid") || this.f10856a.g(i4)) ? 0 : 8;
                                if (i64 == 664 && (i4 == i65 || i4 == 2)) {
                                    i68 = 0;
                                }
                                if (i64 != 37 && ((i64 != 39 || i4 != i65) && (i64 != 877 || (i4 != 4 && i4 != 5 && i4 != 6)))) {
                                    if (i64 == 664) {
                                        if (i4 != i65 && i4 != 0) {
                                            if (i4 >= 3) {
                                                break;
                                            }
                                        }
                                    }
                                    if (i64 != 665 || i4 != i65) {
                                        if (i64 == 667 && i4 == i65 && F() == n.e.TableURIFormatted) {
                                            c2 = '\b';
                                            i44 = 8;
                                        } else {
                                            if (f2.equals("score")) {
                                                this.D[i4].setImageResource(go.c(this, R.attr.iconTestTask));
                                                i43 = 528385;
                                                typeface = Typeface.MONOSPACE;
                                            } else if (f2.equals("js")) {
                                                this.D[i4].setImageResource(go.c(this, R.attr.iconTestTask));
                                                this.f11152d[i4].setGravity(51);
                                                i43 = 524433;
                                            } else if (i64 == 131 && i4 == 0) {
                                                this.D[i4].setImageResource(go.c(this, R.attr.iconDir));
                                            } else {
                                                i44 = i74;
                                                c2 = '\b';
                                            }
                                            i44 = i74;
                                            c2 = 0;
                                        }
                                        if (i64 != 347 && i4 == i65) {
                                            i43 = gd.h.d(l(0));
                                        } else if ((i64 == 342 || i4 != i65) && (i64 != 343 || i4 != i65)) {
                                            if (i64 != 344 && i4 == i65) {
                                                if (gd.a.a(gd.a.c(l(0)))) {
                                                    i44 = 8;
                                                    if (i64 == 69) {
                                                    }
                                                    c3 = n.c(i64, i4);
                                                    if (c3 > i65) {
                                                    }
                                                    int i75 = i43;
                                                    super.c(i4, c3);
                                                    if (i64 == 15) {
                                                        if (c7 == null) {
                                                        }
                                                        EditText editText = this.f11152d[i4];
                                                        i46 = i45;
                                                        InputFilter[] inputFilterArr = new InputFilter[i65];
                                                        inputFilterArr[0] = new InputFilter.LengthFilter(i53);
                                                        editText.setFilters(inputFilterArr);
                                                        if (TextUtils.isEmpty(c7)) {
                                                        }
                                                        str = c7;
                                                        this.f11152d[i4].setText(str);
                                                        df.a((TextView) this.f11152d[i4], i75);
                                                        this.f11152d[i4].setTypeface(typeface);
                                                        gs.a(this.f11152d[i4]);
                                                        c4 = c2;
                                                        i47 = i44;
                                                        i48 = 8;
                                                        i49 = 8;
                                                        i50 = 8;
                                                        i51 = 8;
                                                        i16 = 0;
                                                        z5 = z4;
                                                        i52 = 8;
                                                    }
                                                    i46 = i45;
                                                    if (TextUtils.isEmpty(c7)) {
                                                    }
                                                    str = c7;
                                                    this.f11152d[i4].setText(str);
                                                    df.a((TextView) this.f11152d[i4], i75);
                                                    this.f11152d[i4].setTypeface(typeface);
                                                    gs.a(this.f11152d[i4]);
                                                    c4 = c2;
                                                    i47 = i44;
                                                    i48 = 8;
                                                    i49 = 8;
                                                    i50 = 8;
                                                    i51 = 8;
                                                    i16 = 0;
                                                    z5 = z4;
                                                    i52 = 8;
                                                }
                                            } else if ((i64 == 346 || i4 != i65) && (i64 != 135 || i4 != 2 || this.am == null || this.am.size() <= 0)) {
                                                if (TextUtils.isEmpty(c7) && ((i64 == 559 && i4 == i65) || (i64 == 699 && i4 == i65))) {
                                                    c7 = "default:default";
                                                }
                                                i45 = (i64 == 69 || i4 != 3) ? 8 : 0;
                                                c3 = n.c(i64, i4);
                                                if (c3 > i65) {
                                                    i43 |= 131072;
                                                }
                                                int i752 = i43;
                                                super.c(i4, c3);
                                                if (i64 == 15 && i4 == 0) {
                                                    if (c7 == null) {
                                                        i53 = 8;
                                                        break;
                                                    } else {
                                                        i53 = 8;
                                                    }
                                                    EditText editText2 = this.f11152d[i4];
                                                    i46 = i45;
                                                    InputFilter[] inputFilterArr2 = new InputFilter[i65];
                                                    inputFilterArr2[0] = new InputFilter.LengthFilter(i53);
                                                    editText2.setFilters(inputFilterArr2);
                                                    if (TextUtils.isEmpty(c7)) {
                                                        str = this.f10856a.m(i4);
                                                        break;
                                                    }
                                                    str = c7;
                                                    this.f11152d[i4].setText(str);
                                                    df.a((TextView) this.f11152d[i4], i752);
                                                    this.f11152d[i4].setTypeface(typeface);
                                                    gs.a(this.f11152d[i4]);
                                                    c4 = c2;
                                                    i47 = i44;
                                                    i48 = 8;
                                                    i49 = 8;
                                                    i50 = 8;
                                                    i51 = 8;
                                                    i16 = 0;
                                                    z5 = z4;
                                                    i52 = 8;
                                                }
                                                i46 = i45;
                                                if (TextUtils.isEmpty(c7)) {
                                                }
                                                str = c7;
                                                this.f11152d[i4].setText(str);
                                                df.a((TextView) this.f11152d[i4], i752);
                                                this.f11152d[i4].setTypeface(typeface);
                                                gs.a(this.f11152d[i4]);
                                                c4 = c2;
                                                i47 = i44;
                                                i48 = 8;
                                                i49 = 8;
                                                i50 = 8;
                                                i51 = 8;
                                                i16 = 0;
                                                z5 = z4;
                                                i52 = 8;
                                            }
                                        }
                                        i44 = 0;
                                        if (i64 == 69) {
                                        }
                                        c3 = n.c(i64, i4);
                                        if (c3 > i65) {
                                        }
                                        int i7522 = i43;
                                        super.c(i4, c3);
                                        if (i64 == 15) {
                                        }
                                        i46 = i45;
                                        if (TextUtils.isEmpty(c7)) {
                                        }
                                        str = c7;
                                        this.f11152d[i4].setText(str);
                                        df.a((TextView) this.f11152d[i4], i7522);
                                        this.f11152d[i4].setTypeface(typeface);
                                        gs.a(this.f11152d[i4]);
                                        c4 = c2;
                                        i47 = i44;
                                        i48 = 8;
                                        i49 = 8;
                                        i50 = 8;
                                        i51 = 8;
                                        i16 = 0;
                                        z5 = z4;
                                        i52 = 8;
                                    }
                                    this.D[i4].setImageResource(go.c(this, R.attr.iconCoffee));
                                    i44 = i74;
                                    c2 = 0;
                                    if (i64 != 347) {
                                    }
                                    if (i64 == 342) {
                                    }
                                    if (i64 != 344) {
                                    }
                                    if (i64 == 346) {
                                    }
                                    if (TextUtils.isEmpty(c7)) {
                                        c7 = "default:default";
                                    }
                                    if (i64 == 69) {
                                    }
                                    c3 = n.c(i64, i4);
                                    if (c3 > i65) {
                                    }
                                    int i75222 = i43;
                                    super.c(i4, c3);
                                    if (i64 == 15) {
                                    }
                                    i46 = i45;
                                    if (TextUtils.isEmpty(c7)) {
                                    }
                                    str = c7;
                                    this.f11152d[i4].setText(str);
                                    df.a((TextView) this.f11152d[i4], i75222);
                                    this.f11152d[i4].setTypeface(typeface);
                                    gs.a(this.f11152d[i4]);
                                    c4 = c2;
                                    i47 = i44;
                                    i48 = 8;
                                    i49 = 8;
                                    i50 = 8;
                                    i51 = 8;
                                    i16 = 0;
                                    z5 = z4;
                                    i52 = 8;
                                }
                                this.D[i4].setImageResource(go.c(this, R.attr.iconCoffee));
                                i44 = i74;
                                c2 = 0;
                                if (i64 != 347) {
                                }
                                if (i64 == 342) {
                                }
                                if (i64 != 344) {
                                }
                                if (i64 == 346) {
                                }
                                if (TextUtils.isEmpty(c7)) {
                                }
                                if (i64 == 69) {
                                }
                                c3 = n.c(i64, i4);
                                if (c3 > i65) {
                                }
                                int i752222 = i43;
                                super.c(i4, c3);
                                if (i64 == 15) {
                                }
                                i46 = i45;
                                if (TextUtils.isEmpty(c7)) {
                                }
                                str = c7;
                                this.f11152d[i4].setText(str);
                                df.a((TextView) this.f11152d[i4], i752222);
                                this.f11152d[i4].setTypeface(typeface);
                                gs.a(this.f11152d[i4]);
                                c4 = c2;
                                i47 = i44;
                                i48 = 8;
                                i49 = 8;
                                i50 = 8;
                                i51 = 8;
                                i16 = 0;
                                z5 = z4;
                                i52 = 8;
                            }
                            this.f10856a.n(i4);
                            i13 = i48;
                            i11 = i49;
                            i10 = i50;
                            i9 = i51;
                            i8 = 0;
                            r11 = 1;
                            i14 = 0;
                            i12 = 8;
                            i6 = i47;
                            i7 = i52;
                            z2 = z5;
                            i5 = i46;
                            i15 = c4;
                            break;
                        }
                        i50 = 8;
                        i51 = 8;
                        i16 = 8;
                        i46 = 8;
                        z5 = r13;
                        this.f10856a.n(i4);
                        i13 = i48;
                        i11 = i49;
                        i10 = i50;
                        i9 = i51;
                        i8 = 0;
                        r11 = 1;
                        i14 = 0;
                        i12 = 8;
                        i6 = i47;
                        i7 = i52;
                        z2 = z5;
                        i5 = i46;
                        i15 = c4;
                        break;
                    case 2:
                        d k = this.aj.k(i67);
                        if (this.g[i67]) {
                            i58 = a(this.f11152d[i67], k.g() ? k.a(this) : "%");
                            i57 = 8;
                            i59 = 8;
                        } else {
                            if (k.g()) {
                                this.y[i67].setText(k.h());
                                b3 = k.a(getPackageManager());
                                i57 = 0;
                            } else {
                                b3 = ((this.aj.i() == 443 && i67 == 2) || (this.aj.i() == 104 && i67 == i65)) ? go.b(this, R.attr.iconIcon) : null;
                                i57 = 8;
                            }
                            if (b3 == null) {
                                this.C[i67].setImageResource(R.drawable.cust_warning);
                            } else {
                                this.C[i67].setImageDrawable(b3);
                            }
                            i58 = 8;
                            i59 = 0;
                        }
                        i16 = i58;
                        i13 = i59;
                        z = s;
                        i4 = i67;
                        i5 = 8;
                        i6 = 8;
                        i8 = 0;
                        i15 = 8;
                        i14 = 0;
                        i12 = 8;
                        i11 = 8;
                        i10 = 8;
                        i9 = 0;
                        i7 = i57;
                        z2 = false;
                        r11 = i65;
                        break;
                    case 3:
                        e h2 = this.aj.h(i67);
                        if (n.s(i64, i67)) {
                            a(i67, n.t(i64, i67), h2.g() ? h2.h() : 0);
                            i60 = 8;
                            i61 = 0;
                        } else {
                            this.z[i67].setChecked(this.f10856a.a((com.joaomgcd.taskerm.helper.actions.d) this.aj, h2, i64, i67));
                            i60 = 0;
                            i61 = 8;
                        }
                        if ("bosta".equals(n.a(i64, i67))) {
                            i68 = 0;
                        }
                        i12 = i60;
                        i11 = i61;
                        z = s;
                        i4 = i67;
                        z2 = false;
                        i5 = 8;
                        i6 = 8;
                        i7 = 8;
                        i8 = 0;
                        i16 = 8;
                        i30 = 8;
                        i14 = 0;
                        i13 = 8;
                        i31 = i65;
                        i10 = 8;
                        i9 = 8;
                        r11 = i31;
                        i15 = i30;
                        break;
                    case 4:
                        g e5 = this.aj.e(i67);
                        if (a(e5, i67)) {
                            z = s;
                            i4 = i67;
                            z2 = false;
                            i5 = 8;
                            i6 = 8;
                            i7 = 8;
                            i8 = 0;
                            i16 = 0;
                            i15 = 8;
                            i14 = 0;
                            i13 = 8;
                            i12 = 8;
                            i11 = 8;
                            i10 = 8;
                            i9 = 0;
                            r11 = i65;
                            break;
                        } else {
                            int i76 = (i() || this.al != b.None) ? 8 : 0;
                            if (i64 == 60 && i67 == 8 && e5.c()) {
                                e5.a(getResources(), go.c(this, R.attr.iconPlace));
                            }
                            if (!a(this.aj, i67)) {
                                i9 = i76;
                                z = s;
                                i4 = i67;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 0;
                            } else if (e5.w()) {
                                i9 = i76;
                                z = s;
                                i4 = i67;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 8;
                                i8 = 0;
                                i16 = 8;
                                i62 = i66;
                                i14 = 0;
                                i13 = 0;
                                i35 = i65;
                                i36 = i62;
                                i12 = 8;
                                i11 = 8;
                                i10 = 8;
                                r11 = i35;
                                i15 = i36;
                                break;
                            } else {
                                i9 = i76;
                                z = s;
                                i4 = i67;
                                z2 = false;
                                i5 = 8;
                                i6 = 8;
                                i7 = 8;
                            }
                            i8 = 0;
                            i16 = 8;
                            i62 = 8;
                            i14 = 0;
                            i13 = 0;
                            i35 = i65;
                            i36 = i62;
                            i12 = 8;
                            i11 = 8;
                            i10 = 8;
                            r11 = i35;
                            i15 = i36;
                        }
                        break;
                    case 5:
                        f i77 = this.aj.i(i67);
                        this.f10856a.a(this, i67, i77);
                        this.y[i67].setText(i77.a(s));
                        this.y[i67].setTextIsSelectable(i65);
                        di.a(this.y[i67], i77.c());
                        if (s && i67 == 0) {
                            z = s;
                            i4 = i67;
                            z2 = false;
                            i5 = 0;
                        } else {
                            z = s;
                            i4 = i67;
                            z2 = false;
                            i5 = 8;
                        }
                        i6 = 8;
                        i7 = 0;
                        i8 = 0;
                        i33 = i65;
                        i16 = 8;
                        i32 = i33;
                        i30 = 8;
                        i14 = 0;
                        i13 = 8;
                        i12 = 8;
                        i11 = 8;
                        i31 = i32;
                        i10 = 8;
                        i9 = 8;
                        r11 = i31;
                        i15 = i30;
                        break;
                    case 6:
                        z = s;
                        i4 = i67;
                        z2 = false;
                        i5 = 8;
                        i6 = 8;
                        i7 = 8;
                        i8 = 0;
                        break;
                    default:
                        z = s;
                        i4 = i67;
                        bo.c("ActionEdit", "setUIFromAction: bad arg type");
                        z2 = false;
                        i5 = 8;
                        i6 = 8;
                        i7 = 8;
                        i8 = 0;
                        break;
                }
                if (i64 != 131) {
                    i17 = 1;
                    if (i4 != 1) {
                    }
                    i18 = 8;
                    if (z) {
                        if (i64 == 667) {
                            if (this.f10856a.j(i64, i4)) {
                                i14 = 8;
                            }
                            n.e F = F();
                            z3 = z8;
                            if (F == n.e.Raw) {
                                if (i4 != 2) {
                                    if (i4 != 3) {
                                    }
                                }
                                i14 = 8;
                                i24 = i2;
                                i28 = i68;
                                i27 = i14;
                            }
                            if (F == n.e.TableURIFormatted) {
                                if (i4 != 2) {
                                }
                                i14 = 8;
                            }
                            i24 = i2;
                            i28 = i68;
                            i27 = i14;
                        } else {
                            z3 = z8;
                            if (i64 != 490 || i4 != 1 || (l(0) == 0 && gs.t())) {
                                if (i64 == 566 && gs.l() < 19) {
                                    i19 = i4 != 3 ? 4 : 4;
                                }
                                if (i64 != 65 || i4 != i19 || this.g[i4] || this.w[3].getProgress() != 0) {
                                    if (i64 == 549) {
                                        i20 = 2;
                                        if (i4 == 2) {
                                        }
                                    } else {
                                        i20 = 2;
                                    }
                                    if ((i64 != 41 || i4 != i20) && ((i64 != 162 || i4 != 6 || !com.joaomgcd.taskerm.util.g.m()) && (i64 != 165 || ((i4 != 3 || an() == n.b.DisableByLabel) && ((i4 != 2 || an() == n.b.DisableByTime || an() == n.b.SnoozeCurrent) && (i4 != 1 || an() == n.b.DisableByTime)))))) {
                                        if (i64 == 51 && i4 == 4) {
                                            String aj = aj();
                                            String a14 = gs.a((TextView) this.f11152d[1]);
                                            if (aj != null) {
                                                if (a14 != null) {
                                                    du.e b7 = b(aj, a14);
                                                    if (b7 != null) {
                                                    }
                                                }
                                            }
                                            i24 = i2;
                                            i28 = i68;
                                            i27 = i14;
                                        } else {
                                            int i78 = i64 == 536 ? 5 : 5;
                                            if (i64 == 523) {
                                            }
                                            if (i64 == 525) {
                                            }
                                            if (i64 == 538) {
                                            }
                                            int i79 = i64 == 536 ? 3 : 3;
                                            if (i64 == 523) {
                                            }
                                            if (i64 == 525) {
                                            }
                                            if (i64 == 538) {
                                            }
                                            if ((i64 != 60 || ((i4 != 4 && i4 != 5) || !gs.q())) && ((i64 != 376 || i4 != 3 || this.z[2].isChecked()) && ((i64 != 109 || i4 != 0 || hh.a()) && (i64 != 123 || i4 != 5)))) {
                                                if (i64 == 406) {
                                                    i21 = 1;
                                                    if (i4 == 1) {
                                                    }
                                                } else {
                                                    i21 = 1;
                                                }
                                                if (i64 == 173 && i4 == i21) {
                                                    if (!MyVpnService.a(l(0))) {
                                                    }
                                                } else if (i64 == 133) {
                                                    boolean af = af();
                                                    if (af) {
                                                    }
                                                    if (!af) {
                                                    }
                                                    i24 = i2;
                                                    i28 = i68;
                                                    i27 = i14;
                                                } else if (i64 == 111 && i4 == 0 && gs.l() >= 19) {
                                                    gs.b(this.f11152d[i4], "");
                                                } else if (i64 != 41 || i4 != 2 || n.d(this)) {
                                                    if (i64 == 810 && i4 == 3 && gs.l() >= 19) {
                                                        this.z[i4].setChecked(false);
                                                    } else if ((i4 != 1 || !gd.a(i64) || gd.a(i64, l(0))) && ((i64 != 185 || i4 != 1 || l(0) != 4) && (i64 != 442 || i4 != 1 || l(0) != 0))) {
                                                        if (i64 == 53) {
                                                            i22 = 3;
                                                            if (i4 == 3) {
                                                            }
                                                        } else {
                                                            i22 = 3;
                                                        }
                                                        if (i64 != 612 || i4 != i22) {
                                                            if (i64 != 60 || gs.a((TextView) this.f11152d[i22]).length() != 0 || (i4 != 4 && i4 != 5)) {
                                                                if (i64 == 60 && i4 == 7) {
                                                                    Integer c9 = gs.c(gs.a((TextView) this.f11152d[6]));
                                                                    if (c9 != null) {
                                                                    }
                                                                    i14 = 8;
                                                                    i24 = i2;
                                                                    i28 = i68;
                                                                    i27 = i14;
                                                                } else if ((i64 != 598 || i4 != 7 || this.z[6].isChecked()) && ((i64 != 547 || i4 != 5 || this.z[3].isChecked()) && ((i64 != 314 || ((i4 != 2 && i4 != 4 && i4 != 5) || H() != com.joaomgcd.taskerm.action.input.s.Credentials)) && (i64 != 596 || i4 != 3 || this.A[1].getSelectedItemPosition() == 25)))) {
                                                                    int i80 = (i64 == 104 && i4 == 1) ? 2 : 2;
                                                                    if (i64 == 104) {
                                                                        i23 = 3;
                                                                        if (i4 == 3) {
                                                                        }
                                                                    } else {
                                                                        i23 = 3;
                                                                    }
                                                                    if ((i64 != 455 || i4 != i23) && ((i64 != 171 || i4 != 4 || !com.joaomgcd.taskerm.util.g.m()) && !this.f10856a.l(i4) && !this.f10856a.j(i64, i4) && (i64 != 443 || i4 != 2 || this.z[1].isChecked()))) {
                                                                        if (i64 != 15 || i4 != 0) {
                                                                            if (i64 != 64 || i4 != 3) {
                                                                                if (i64 != 135) {
                                                                                    if (i64 == 130) {
                                                                                        if (i4 == 7) {
                                                                                            if (!g(6).booleanValue()) {
                                                                                                i24 = i2;
                                                                                                i28 = 0;
                                                                                                i27 = 8;
                                                                                            }
                                                                                        } else if (i4 != 8) {
                                                                                            if (i4 != 6) {
                                                                                            }
                                                                                        }
                                                                                        i24 = i2;
                                                                                        i27 = i14;
                                                                                        i28 = 0;
                                                                                    } else {
                                                                                        if (i64 != 25 || i4 != 1) {
                                                                                            int i81 = i64 == 123 ? 7 : 7;
                                                                                            if ((i64 != 523 || i4 != 2) && ((i64 != 162 || i4 != i81) && ((i64 != 162 || i4 != 8) && ((i64 != 162 || i4 != 9) && ((i64 != 162 || i4 != 10) && ((i64 != 162 || i4 != 11) && ((i64 != 162 || i4 != 12) && ((i64 != 171 || i4 != 4) && (i64 != 159 || i4 != 0))))))))) {
                                                                                                if (i64 == 47) {
                                                                                                    if (i4 != 2 && i4 != 3) {
                                                                                                        if (i4 != 4 && i4 != 6) {
                                                                                                            if (i4 != 8) {
                                                                                                                if (i4 != 9) {
                                                                                                                    if (i4 == 10) {
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                } else if (i64 == 119) {
                                                                                                    int l = l(0);
                                                                                                    if (i4 != 4) {
                                                                                                    }
                                                                                                } else {
                                                                                                    if (i64 == 444) {
                                                                                                        i25 = 1;
                                                                                                        if (i4 == 1) {
                                                                                                            i24 = i2;
                                                                                                            i26 = 0;
                                                                                                        } else {
                                                                                                            i24 = i2;
                                                                                                        }
                                                                                                    } else {
                                                                                                        i24 = i2;
                                                                                                        i25 = 1;
                                                                                                    }
                                                                                                    i26 = 0;
                                                                                                    if (i64 != 643 || i4 != i25 || l(i26) == 0) {
                                                                                                        if (i64 == 664) {
                                                                                                            String c10 = this.aj.j(2).c();
                                                                                                            if (i4 == 0) {
                                                                                                                String d2 = d(c10);
                                                                                                                if (bg.t(d2)) {
                                                                                                                    this.x[i4].append(" " + bg.q(bg.f(d2)));
                                                                                                                }
                                                                                                                i14 = 8;
                                                                                                            } else if (i4 >= 3 && i4 <= 9) {
                                                                                                                if (strArr2 == null) {
                                                                                                                    strArr2 = e(c10);
                                                                                                                }
                                                                                                                String[] strArr3 = strArr2;
                                                                                                                if (strArr3 != null) {
                                                                                                                    int i82 = i4 - 3;
                                                                                                                    if (i82 >= strArr3.length) {
                                                                                                                        strArr = strArr3;
                                                                                                                        i14 = 8;
                                                                                                                    } else {
                                                                                                                        String str4 = strArr3[i82];
                                                                                                                        TextView textView = this.x[i4];
                                                                                                                        StringBuilder sb = new StringBuilder();
                                                                                                                        strArr = strArr3;
                                                                                                                        sb.append(" ");
                                                                                                                        sb.append(bg.e(str4));
                                                                                                                        textView.append(sb.toString());
                                                                                                                    }
                                                                                                                    strArr2 = strArr;
                                                                                                                } else {
                                                                                                                    strArr2 = strArr3;
                                                                                                                    i14 = 8;
                                                                                                                }
                                                                                                            }
                                                                                                        } else if (i4 == 0) {
                                                                                                            if (i64 == 915) {
                                                                                                            }
                                                                                                        }
                                                                                                        i28 = i68;
                                                                                                        i27 = i14;
                                                                                                    }
                                                                                                    i28 = i68;
                                                                                                    i27 = 8;
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                        i24 = i2;
                                                                                        i27 = i14;
                                                                                        i28 = 0;
                                                                                    }
                                                                                }
                                                                                i24 = i2;
                                                                                i28 = i68;
                                                                                i27 = i14;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            i24 = i2;
                            i28 = i68;
                            i27 = 8;
                        }
                    } else if (i4 == 1 || i4 == 2) {
                        z3 = z8;
                        i24 = i2;
                        i28 = i68;
                        i27 = 8;
                    } else {
                        z3 = z8;
                        i24 = i2;
                        i28 = i68;
                        i27 = i14;
                    }
                    this.L[i4].setVisibility(!this.aj.o(i4) ? 0 : 8);
                    this.x[i4].setVisibility(i8);
                    this.y[i4].setVisibility(i7);
                    this.f11152d[i4].setVisibility(i16);
                    this.K[i4].setVisibility(i18);
                    if (i64 != 162 && i4 == 1) {
                        a2 = dn.a(this.f11154f, l(0));
                    } else {
                        a2 = !z2 ? ct.a(this, R.string.word_optional, new Object[0]) : "";
                    }
                    this.f11152d[i4].setHint(a2);
                    this.B[i4].setVisibility(i13);
                    this.D[i4].setVisibility(i15);
                    this.z[i4].setVisibility(i12);
                    i29 = i11;
                    this.A[i4].setVisibility(i29);
                    if (i29 == 0) {
                        this.A[i4].setEnabled(r11);
                    }
                    int i83 = i10;
                    this.w[i4].setVisibility(i83);
                    this.F[i4].setVisibility(i83);
                    this.G[i4].setVisibility(i83);
                    this.I[i4].setVisibility(i9);
                    this.J[i4].setVisibility(i6);
                    this.H[i4].setVisibility(i5);
                    if (g) {
                        if (com.joaomgcd.taskerm.settings.ai.g(this)) {
                            this.f11152d[i4].setHorizontallyScrolling(true);
                            this.f11152d[i4].setHorizontalScrollBarEnabled(true);
                            this.f11152d[i4].setTypeface(Typeface.MONOSPACE);
                        }
                        this.f11152d[i4].setTextSize(2, com.joaomgcd.taskerm.settings.ai.f(this));
                    }
                    this.E[i4].setVisibility(i28);
                    this.u[i4].setVisibility(i27);
                    h(i4);
                    i67 = i4 + 1;
                    z8 = z3;
                    i2 = i24;
                    i63 = i;
                    i65 = 1;
                    i66 = 0;
                } else {
                    i17 = 1;
                }
                if (i64 == 129 || i4 != i17) {
                    if (i64 != 664) {
                    }
                    i18 = i16;
                    if (z) {
                    }
                    this.L[i4].setVisibility(!this.aj.o(i4) ? 0 : 8);
                    this.x[i4].setVisibility(i8);
                    this.y[i4].setVisibility(i7);
                    this.f11152d[i4].setVisibility(i16);
                    this.K[i4].setVisibility(i18);
                    if (i64 != 162) {
                    }
                    if (!z2) {
                    }
                    this.f11152d[i4].setHint(a2);
                    this.B[i4].setVisibility(i13);
                    this.D[i4].setVisibility(i15);
                    this.z[i4].setVisibility(i12);
                    i29 = i11;
                    this.A[i4].setVisibility(i29);
                    if (i29 == 0) {
                    }
                    int i832 = i10;
                    this.w[i4].setVisibility(i832);
                    this.F[i4].setVisibility(i832);
                    this.G[i4].setVisibility(i832);
                    this.I[i4].setVisibility(i9);
                    this.J[i4].setVisibility(i6);
                    this.H[i4].setVisibility(i5);
                    if (g) {
                    }
                    this.E[i4].setVisibility(i28);
                    this.u[i4].setVisibility(i27);
                    h(i4);
                    i67 = i4 + 1;
                    z8 = z3;
                    i2 = i24;
                    i63 = i;
                    i65 = 1;
                    i66 = 0;
                }
                i18 = 8;
                if (z) {
                }
                this.L[i4].setVisibility(!this.aj.o(i4) ? 0 : 8);
                this.x[i4].setVisibility(i8);
                this.y[i4].setVisibility(i7);
                this.f11152d[i4].setVisibility(i16);
                this.K[i4].setVisibility(i18);
                if (i64 != 162) {
                }
                if (!z2) {
                }
                this.f11152d[i4].setHint(a2);
                this.B[i4].setVisibility(i13);
                this.D[i4].setVisibility(i15);
                this.z[i4].setVisibility(i12);
                i29 = i11;
                this.A[i4].setVisibility(i29);
                if (i29 == 0) {
                }
                int i8322 = i10;
                this.w[i4].setVisibility(i8322);
                this.F[i4].setVisibility(i8322);
                this.G[i4].setVisibility(i8322);
                this.I[i4].setVisibility(i9);
                this.J[i4].setVisibility(i6);
                this.H[i4].setVisibility(i5);
                if (g) {
                }
                this.E[i4].setVisibility(i28);
                this.u[i4].setVisibility(i27);
                h(i4);
                i67 = i4 + 1;
                z8 = z3;
                i2 = i24;
                i63 = i;
                i65 = 1;
                i66 = 0;
            } else {
                z = s;
                i4 = i67;
                z2 = false;
                i5 = 8;
                i6 = 8;
                i7 = 8;
                i8 = 8;
            }
            i33 = 1;
            i16 = 8;
            i32 = i33;
            i30 = 8;
            i14 = 0;
            i13 = 8;
            i12 = 8;
            i11 = 8;
            i31 = i32;
            i10 = 8;
            i9 = 8;
            r11 = i31;
            i15 = i30;
            if (i64 != 131) {
            }
            if (i64 == 129) {
            }
            if (i64 != 664) {
            }
            i18 = i16;
            if (z) {
            }
            this.L[i4].setVisibility(!this.aj.o(i4) ? 0 : 8);
            this.x[i4].setVisibility(i8);
            this.y[i4].setVisibility(i7);
            this.f11152d[i4].setVisibility(i16);
            this.K[i4].setVisibility(i18);
            if (i64 != 162) {
            }
            if (!z2) {
            }
            this.f11152d[i4].setHint(a2);
            this.B[i4].setVisibility(i13);
            this.D[i4].setVisibility(i15);
            this.z[i4].setVisibility(i12);
            i29 = i11;
            this.A[i4].setVisibility(i29);
            if (i29 == 0) {
            }
            int i83222 = i10;
            this.w[i4].setVisibility(i83222);
            this.F[i4].setVisibility(i83222);
            this.G[i4].setVisibility(i83222);
            this.I[i4].setVisibility(i9);
            this.J[i4].setVisibility(i6);
            this.H[i4].setVisibility(i5);
            if (g) {
            }
            this.E[i4].setVisibility(i28);
            this.u[i4].setVisibility(i27);
            h(i4);
            i67 = i4 + 1;
            z8 = z3;
            i2 = i24;
            i63 = i;
            i65 = 1;
            i66 = 0;
        }
        int i84 = i63;
        if (i84 == -1) {
            for (int i85 = i67; i85 < 16; i85++) {
                this.u[i85].setVisibility(8);
            }
            f();
            this.ap = true;
        }
        this.f10856a.a((com.joaomgcd.taskerm.helper.actions.d) this.aj, i84 == -1 ? null : Integer.valueOf(i));
        this.f10856a.a(i64, 65);
    }

    private int a(EditText editText, String str) {
        if (TextUtils.isEmpty(str)) {
            str = "%";
        }
        editText.setLines(1);
        df.a((TextView) editText, 524289);
        gs.b(editText, str);
        return 0;
    }

    private com.joaomgcd.taskerm.action.input.s H() {
        return n.b(this.A[0].getSelectedItemPosition());
    }

    private void I() {
        int intValue;
        String a2;
        int i = this.aj.i();
        if (this.Y.isChecked()) {
            this.aj.a(gs.a((TextView) this.X));
        } else {
            this.aj.a((String) null);
        }
        this.aj.b((this.W.getVisibility() == 0 && this.V.isChecked()) ? false : true);
        this.aj.a(r());
        int i2 = 0;
        while (i2 < this.aj.h()) {
            switch (this.aj.m(i2)) {
                case 0:
                    if (!this.g[i2]) {
                        if (i != 820) {
                            if (i == 101 && (i2 == 6 || i2 == 8 || i2 == 7 || i2 == 9)) {
                                if (this.u[i2].getVisibility() == 8) {
                                    intValue = 0;
                                } else if (i2 == 9) {
                                    intValue = CameraProxy.a(this.f11154f, (String) this.A[i2].getSelectedItem(), n.v);
                                } else if (i2 == 8) {
                                    intValue = CameraProxy.a(this.f11154f, (String) this.A[i2].getSelectedItem(), n.w);
                                } else if (i2 == 6) {
                                    intValue = CameraProxy.a(this.f11154f, (String) this.A[i2].getSelectedItem(), n.y);
                                } else {
                                    intValue = i2 == 7 ? CameraProxy.a(this.f11154f, (String) this.A[i2].getSelectedItem(), n.s) : Integer.MAX_VALUE;
                                }
                                break;
                            } else if (n.a(getResources(), i, i2, this.aj) != null) {
                                intValue = l(i2);
                            } else if (n.o(i, i2)) {
                                intValue = this.w[i2].getProgress();
                                int j = n.j(i, i2);
                                if (j > Integer.MIN_VALUE) {
                                    intValue += j;
                                }
                            } else {
                                String a3 = gs.a((TextView) this.f11152d[i2]);
                                if (a3.length() == 0) {
                                    if (g(i, i2)) {
                                        this.aj.g(i2).i();
                                    }
                                    intValue = 0;
                                } else {
                                    Integer c2 = gs.c(a3);
                                    if (c2 == null) {
                                        this.aj.g(i2).b(a3);
                                    } else {
                                        intValue = c2.intValue();
                                    }
                                }
                                intValue = Integer.MAX_VALUE;
                            }
                        } else {
                            intValue = l(i2);
                        }
                        if (intValue == Integer.MAX_VALUE) {
                            break;
                        } else {
                            this.aj.a(i2, intValue);
                            break;
                        }
                    } else {
                        d(this.aj, i2);
                        break;
                    }
                    break;
                case 1:
                    if (i == 999) {
                        a2 = (String) this.A[i2].getSelectedItem();
                    } else if (F(i2)) {
                        if (this.g[i2]) {
                            a2 = gs.a((TextView) this.f11152d[i2]);
                        } else {
                            a2 = String.valueOf(this.w[i2].getProgress() + 1);
                        }
                    } else if ((i == 51 && i2 == 3) || ((i == 547 && i2 == 1) || ((i == 354 && i2 == 2) || ((i == 598 && (i2 == 1 || i2 == 7)) || ((i == 590 && i2 == 1) || ((i == 592 && i2 == 1) || ((i == 410 && i2 == 1) || ((i == 354 && i2 == 1) || this.f10856a.p(i2))))))))) {
                        a2 = this.f11152d[i2].getText().toString();
                    } else {
                        a2 = gs.a((TextView) this.f11152d[i2]);
                    }
                    String f2 = n.f(i, i2);
                    if (i == 699 && i2 == 2) {
                        if (!gs.a(a2, false).equals("wav")) {
                            a2 = a2 + ".wav";
                        }
                    } else if (f2.equals("k") && a2.length() == 0) {
                        a2 = fq.a();
                    } else if ((f2.equals("d") || f2.equals("f")) && (i != 116 || i2 != 2)) {
                        a2 = gs.b(a2, true);
                    }
                    this.aj.b(i2, a2);
                    break;
                case 2:
                    if (!this.g[i2]) {
                        break;
                    } else {
                        this.aj.a(this, i2, gs.a((TextView) this.f11152d[i2]));
                        break;
                    }
                case 3:
                    if (n.s(i, i2)) {
                        this.aj.b(i2, l(i2));
                        break;
                    } else {
                        this.aj.a(i2, this.z[i2].isChecked());
                        break;
                    }
                case 4:
                    c(this.aj, i2);
                    break;
                case 5:
                    break;
                default:
                    bo.c("ActionEdit", "setActionFromUI: bad arg type");
                    break;
            }
            i2++;
        }
    }

    private boolean J() {
        boolean z;
        char c2;
        boolean z2;
        int i;
        int intValue;
        String a2;
        try {
            int i2 = this.aj.i();
            String a3 = gs.a((TextView) this.X);
            int length = a3.length();
            if (i2 == 551) {
                if (this.ad.getCount() == 0) {
                    return gs.d(this, R.string.hint_new_item, new Object[0]);
                }
            } else if (i2 == 300) {
                if (length == 0) {
                    return gs.d(this, R.string.f_need_value, ct.a(this, R.string.pl_label, new Object[0]));
                }
                if (this.am != null && this.am.contains(a3) && (this.an == null || !this.an.equals(a3))) {
                    return gs.d(this, R.string.f_duplicate_label, a3);
                }
            }
            if (!b(i2)) {
                return false;
            }
            if (i2 == 406 && this.w[1].getProgress() > 0 && this.z[2].isChecked()) {
                return gs.d(this, R.string.f_delete_file_root_shred, new Object[0]);
            }
            if (i2 == 812 && this.w[0].getProgress() < 7 && this.w[1].getProgress() == 0 && this.w[2].getProgress() == 0 && !this.g[0] && !this.g[1] && !this.g[2]) {
                return gs.d(this, R.string.f_screen_timeout_min, new Object[0]);
            }
            int i3 = 5;
            if (i2 == 35 || i2 == 30) {
                for (int i4 = 0; i4 < 5; i4++) {
                    if (this.w[i4].getProgress() == 0 && !this.g[i4]) {
                    }
                    z = true;
                    break;
                }
                z = false;
                if (!z) {
                    return gs.d(this, R.string.f_no_wait_time_set, new Object[0]);
                }
            }
            if (i2 == 119) {
                String a4 = gs.a((TextView) this.f11152d[1]);
                String a5 = gs.a((TextView) this.f11152d[2]);
                boolean z3 = !TextUtils.isEmpty(a4);
                boolean z4 = !TextUtils.isEmpty(a5);
                if ((!z3 && !z4) || (z3 && z4)) {
                    return gs.d(this, R.string.f_openmap_need_entry, new Object[0]);
                }
                int l = l(0);
                if (z3 && l == 1) {
                    return gs.d(this, R.string.f_openmap_no_address_with_streetview, new Object[0]);
                }
                if (!this.g[3] && this.w[3].getProgress() + 1 > 1) {
                    if (l == 2) {
                        return gs.d(this, R.string.f_openmap_navigate_no_zoom, new Object[0]);
                    }
                    if (z3) {
                        return gs.d(this, R.string.f_openmap_address_no_zoom, new Object[0]);
                    }
                }
            }
            int i5 = 0;
            boolean z5 = false;
            while (i5 < this.aj.h()) {
                String str = gs.a(this.x[i5]) + " ";
                EditText editText = this.f11152d[i5];
                String a6 = gs.a((TextView) editText);
                switch (this.aj.m(i5)) {
                    case 0:
                        if (n.o(i2, i5)) {
                            if (!b(i5, str)) {
                                return false;
                            }
                            if (i2 == 135 && l(0) == 0 && i5 == 1) {
                                int progress = this.w[i5].getProgress();
                                if (progress >= this.ao) {
                                    return gs.d(this, R.string.f_not_that_many_actions, str);
                                }
                                if (progress == this.ak) {
                                    return gs.d(this, R.string.f_goto_targets_itself, str);
                                }
                                intValue = Integer.MAX_VALUE;
                                if (intValue == Integer.MAX_VALUE) {
                                }
                            } else {
                                intValue = this.w[i5].getProgress();
                                int j = n.j(i2, i5);
                                if (j > Integer.MIN_VALUE) {
                                    intValue += j;
                                }
                                if (intValue == Integer.MAX_VALUE) {
                                    continue;
                                } else {
                                    int g = i2 == 810 ? 9999 : n.g(i2, i5);
                                    int j2 = n.j(i2, i5);
                                    if (intValue < j2 || intValue > g) {
                                        return gs.a(this, str + ": " + ct.a(this, R.string.aeedit_err_int_out_of_bounds, new Object[0]) + " (" + j2 + "-" + g + ")", new Object[0]);
                                    }
                                }
                            }
                        } else if (n.a(getResources(), i2, i5, this.aj) == null) {
                            if (i2 != 888 && i2 != 890 && (i2 != 133 || !af())) {
                                if (i2 == 133 && l(0) == 26 && a6 != null && a6.startsWith("0")) {
                                    return gs.d(this, R.string.f_not_allowed_start_with, str, "0");
                                }
                                if (editText.length() != 0) {
                                    String a7 = gs.a((TextView) editText);
                                    if (!gx.c(a7) && !gx.f(a7)) {
                                        Integer c3 = gs.c(a7);
                                        if (c3 == null) {
                                            return gs.a(this, str + ConstantsCommonTaskerServer.ID_SEPARATOR + ct.a(this, R.string.f_not_numeric_or_variable, new Object[0]), new Object[0]);
                                        }
                                        intValue = c3.intValue();
                                        if (intValue == Integer.MAX_VALUE) {
                                        }
                                    }
                                } else if (i2 == 193) {
                                    intValue = 0;
                                    if (intValue == Integer.MAX_VALUE) {
                                    }
                                } else if (!g(i2, i5)) {
                                    return gs.d(this, R.string.f_zero_length_num, str);
                                }
                            }
                            intValue = Integer.MAX_VALUE;
                            if (intValue == Integer.MAX_VALUE) {
                            }
                        }
                        i5++;
                        i3 = 5;
                        break;
                    case 1:
                        String a8 = gs.a((TextView) editText);
                        if (i2 != 999) {
                            if (F(i5)) {
                                if (this.g[i5] && !gx.c(a6)) {
                                    return gs.d(this, R.string.err_bad_variable_name, str);
                                }
                            } else if (!D(i5) && ((i2 != 135 || l(0) == 1) && (i2 != 105 || i5 != 0 || this.z[1].isChecked()))) {
                                if (editText.length() == 0) {
                                    Boolean i6 = this.f10856a.i(i5);
                                    if (!(i6 == null ? !n.d(i2, i5) : i6.booleanValue()) && this.u[i5].getVisibility() == 0) {
                                        return gs.d(this, R.string.f_zero_length_string, str);
                                    }
                                } else {
                                    if (i2 == 135 && l(0) == 1 && gs.a((TextView) this.X).equals(a8)) {
                                        return gs.d(this, R.string.f_goto_targets_itself, str);
                                    }
                                    if (n.u(i2, i5) && e().t(a8)) {
                                        ch a9 = n.a(getResources(), i2, i5, e().y(a8));
                                        if (a9 != null) {
                                            a9.a(this);
                                            return false;
                                        }
                                    } else {
                                        String f2 = n.f(i2, i5);
                                        if (f2.equals("rtn")) {
                                            if (a8.startsWith("%")) {
                                                if (!gx.c(a8)) {
                                                    return gs.d(this, R.string.err_bad_variable_name, str);
                                                }
                                            } else if (a8.length() > 0) {
                                                int c4 = c(i2);
                                                int a10 = ds.a(c4);
                                                com.joaomgcd.taskerm.util.bw b2 = com.joaomgcd.taskerm.util.bw.b((Context) this);
                                                if (!b2.f()) {
                                                    this.f10856a.a(b2);
                                                    return false;
                                                }
                                                if (!ds.a(a8) && ds.a(this, c4, a8) == null) {
                                                    return gs.d(this, R.string.f_unknown_ringtone, ct.a(this, R.array.ringtone_types)[a10], a8);
                                                }
                                            }
                                        } else if (f2.equals("pv")) {
                                            if (a8.startsWith("%") && !gx.g(a8)) {
                                                return gs.d(this, R.string.err_bad_variable_name, str);
                                            }
                                        } else if (f2.equals("latlong")) {
                                            if (!a8.startsWith("%") && bn.b(a8) == null) {
                                                return gs.d(this, R.string.f_bad_latlong, str, a8);
                                            }
                                        } else if (f2.equals("c")) {
                                            if (a8.length() == 0 || !TextUtils.isDigitsOnly(a8)) {
                                                return gs.d(this, R.string.f_zero_length_num, str);
                                            }
                                        } else if (f2.equals("cv")) {
                                            if (a8.length() == 0 || (!TextUtils.isDigitsOnly(a8) && !gx.h(a8))) {
                                                return gs.d(this, R.string.f_zero_length_num, str);
                                            }
                                        } else if (f2.equals("v")) {
                                            if (n.a(a8) == null && !gx.c(a8)) {
                                                return gs.a(this, str + ct.a(this, R.string.aeedit_err_vibrate_pattern_format, new Object[0]), new Object[0]);
                                            }
                                        } else if (f2.equals("jfu")) {
                                            if (!bg.u(a8)) {
                                                return gs.d(this, R.string.f_invalid_value, str);
                                            }
                                        } else if (f2.equals("col")) {
                                            if (a8.startsWith("%")) {
                                                if (!gx.g(a8)) {
                                                    return gs.d(this, R.string.f_bad_variable_reference, str);
                                                }
                                            } else if (!cd.a(a8)) {
                                                return gs.a(this, ct.a(this, R.string.f_bad_colour, new Object[0]), str);
                                            }
                                        } else if (f2.equals("sname")) {
                                            if (a8.startsWith("%")) {
                                                if (!gx.c(a8)) {
                                                    return gs.d(this, R.string.err_bad_variable_name, str);
                                                }
                                            } else if (i2 != 47 && i2 != 46 && !a(a8)) {
                                                return gs.d(this, R.string.f_unknown_scene, a8);
                                            }
                                        } else if (f2.equals("act")) {
                                            int b3 = n.b(a8);
                                            if (b3 == -1) {
                                                return gs.d(this, R.string.aeedit_err_bad_action, new Object[0]);
                                            }
                                            if (n.y(b3)) {
                                                return gs.a(this, ct.a(this, R.string.word_action, new Object[0]).toLowerCase() + " " + a8 + " " + ct.a(this, R.string.f_cant_query, new Object[0]), new Object[0]);
                                            }
                                        } else if ((i2 != 415 && i2 != 416) || i5 != 1 || a8.startsWith("%")) {
                                            if (i2 == 877 && i5 == 8) {
                                                if (a8.length() > 0) {
                                                    if (gs.a((TextView) this.f11152d[7]).length() == 0) {
                                                        return gs.a(this, str + ": " + ct.a(this, R.string.f_send_intent_need_package_with_class, new Object[0]), new Object[0]);
                                                    }
                                                }
                                            } else if (i2 == 109) {
                                                if (!a8.startsWith("content://") && !a8.endsWith(".jpg") && !a8.endsWith(".png") && !a8.endsWith(".jpeg") && !a8.endsWith(".JPG") && !a8.endsWith(".PNG") && !a8.endsWith(".JPEG")) {
                                                    gs.c(this, R.string.aeedit_err_wallpaper_filetype, new Object[0]);
                                                }
                                            } else if (f2.equals("var") || f2.equals("uvar")) {
                                                if (i2 == 549) {
                                                    if (!this.z[1].isChecked() && !a8.startsWith("%")) {
                                                        return gs.d(this, R.string.err_bad_variable_name, a8);
                                                    }
                                                } else {
                                                    if (gx.b(a8) && i2 != 590 && ((i2 != 598 || this.z[6].isChecked()) && ((i2 != 596 || TextUtils.isEmpty(gs.a((TextView) this.f11152d[2]))) && (i2 != 597 || TextUtils.isEmpty(gs.a((TextView) this.f11152d[4])))))) {
                                                        return gs.d(this, R.string.aeedit_err_builtin_var, new Object[0]);
                                                    }
                                                    if (!gx.c(a8) && (!gx.g(a8) || n.Q(i2) || i2 == 592)) {
                                                        return gs.d(this, R.string.f_bad_variable_reference, a8);
                                                    }
                                                    if (gx.o(a8)) {
                                                        if (this.al == b.UI) {
                                                            return gs.d(this, R.string.f_no_local_vars, str);
                                                        }
                                                        if (f2.equals("uvar")) {
                                                            z5 = true;
                                                        } else if (i2 != 590 && n.f(i2).intValue() == 120) {
                                                            return gs.d(this, R.string.f_no_local_vars, str);
                                                        }
                                                    }
                                                }
                                            }
                                            if (i2 == 101 && i5 == 1) {
                                                a2 = gs.a((TextView) editText);
                                                if (!a2.endsWith(".jpg")) {
                                                    gs.b(this, str + ct.a(this, R.string.aeedit_warn_jpg_suffix, new Object[0]), new Object[0]);
                                                    editText.setText(a2.substring(0, a2.length() - ".jpg".length()));
                                                }
                                            }
                                            i5++;
                                            i3 = 5;
                                        } else if (gs.c(a8) == null) {
                                            return gs.a(this, str + ConstantsCommonTaskerServer.ID_SEPARATOR + ct.a(this, R.string.f_not_numeric_or_variable, new Object[0]), new Object[0]);
                                        }
                                    }
                                }
                            }
                        }
                        if (i2 == 101) {
                            a2 = gs.a((TextView) editText);
                            if (!a2.endsWith(".jpg")) {
                            }
                        }
                        i5++;
                        i3 = 5;
                        break;
                    case 2:
                        if (this.f11152d[i5].getVisibility() != 0 && !this.aj.k(i5).g() && this.u[i5].getVisibility() == 0 && ((this.aj.i() != 443 || i5 != 2) && (this.aj.i() != 104 || i5 != 1))) {
                            return gs.a(this, str + ct.a(this, R.string.aeedit_err_noappselected, new Object[0]), new Object[0]);
                        }
                        i5++;
                        i3 = 5;
                        break;
                    case 3:
                        if (i2 == 47 && i5 == i3 && this.z[i5].isChecked() && l(1) == dt.b.Overlay.ordinal()) {
                            df.a(this, R.string.word_warning, R.string.dc_overlay_with_exit_button);
                            return false;
                        }
                        i5++;
                        i3 = 5;
                    case 4:
                    case 6:
                        i5++;
                        i3 = 5;
                    case 5:
                        if (n.s(i2) && !this.aj.i(i5).d()) {
                            return gs.d(this, R.string.f_no_plugin_config_data, new Object[0]);
                        }
                        i5++;
                        i3 = 5;
                        break;
                    default:
                        bo.c("ActionEdit", "validateUIValues: code: " + this.aj.i() + ": arg " + i5 + ": bad arg type: " + this.aj.m(i5));
                        i5++;
                        i3 = 5;
                }
            }
            if (n.O(i2)) {
                String a11 = gs.a((TextView) this.f11152d[0]);
                String a12 = gs.a((TextView) this.f11152d[1]);
                if (gx.h(a11)) {
                    if (gx.e(a11) && !gx.g(a11)) {
                        return gs.d(this, R.string.f_bad_var_or_single_arr_ref, ct.a(this, R.string.pl_scene_name, new Object[0]));
                    }
                } else if (gx.h(a12)) {
                    if (gx.e(a12) && !gx.g(a12)) {
                        return gs.d(this, R.string.f_bad_var_or_single_arr_ref, ct.a(this, R.string.pl_element_name, new Object[0]));
                    }
                } else {
                    boolean z6 = (this.ag != null && this.ag.contains(a11)) || e().a(69, 0, a11);
                    if (i2 != 65 && i2 != 50) {
                        if (i2 != 69) {
                            du.e b4 = b(a11, a12);
                            if (b4 == null) {
                                if (!z6) {
                                    return gs.d(this, R.string.f_unknown_scene_element, a11, a12);
                                }
                            } else if (gs.a(i2, du.a(b4)) == -1) {
                                return gs.d(this, R.string.f_bad_scene_element_action, du.a(this.f11154f, b4));
                            }
                        }
                    }
                }
            }
            if (i2 == 47) {
                String a13 = gs.a((TextView) this.f11152d[0]);
                if (dt.a(dt.b.values()[l(1)])) {
                    fz e2 = e();
                    if (e2.t(a13) && !e2.v(a13)) {
                        return gs.d(this, R.string.f_overlay_restricted_elements, new Object[0]);
                    }
                }
            } else if ((i2 == 250 || i2 == 111) && gs.l() >= 19) {
                String str2 = null;
                if (i2 == 250) {
                    c2 = 1;
                } else {
                    str2 = gs.a((TextView) this.f11152d[3]);
                    c2 = 2;
                }
                String a14 = gs.a((TextView) this.f11152d[0]);
                if (gs.a((TextView) this.f11152d[c2]).length() <= 0 && TextUtils.isEmpty(str2)) {
                    z2 = false;
                    if ((a14.length() <= 0) && z2) {
                        return gs.d(this, R.string.f_only_one_of, ct.a(this, R.string.pl_recipient, new Object[0]), ct.a(this, R.string.pl_content, new Object[0]));
                    }
                }
                z2 = true;
                if (a14.length() <= 0) {
                    return gs.d(this, R.string.f_only_one_of, ct.a(this, R.string.pl_recipient, new Object[0]), ct.a(this, R.string.pl_content, new Object[0]));
                }
            } else if (i2 == 915) {
                int l2 = l(0);
                String a15 = gs.a((TextView) this.f11152d[1]);
                String a16 = gs.a((TextView) this.f11152d[2]);
                String a17 = gs.a((TextView) this.f11152d[3]);
                Integer c5 = gs.c(a16);
                Integer c6 = gs.c(a17);
                if (a15.startsWith("%")) {
                    if (!gx.c(a15)) {
                        return gs.d(this, R.string.err_bad_variable_name, a15);
                    }
                } else if (!v.a(l2, a15, true)) {
                    return gs.d(this, R.string.f_unknown_value, ct.a(this, R.string.pl_governor, new Object[0]), a15);
                }
                if (!a(l2, a16, c5) || !a(l2, a17, c6)) {
                    return false;
                }
                if (c5 != null && c6 != null && c5.intValue() > c6.intValue()) {
                    return gs.d(this, R.string.f_min_smaller_max, new Object[0]);
                }
            } else if (i2 == 545) {
                Integer c7 = gs.c(gs.a((TextView) this.f11152d[1]));
                Integer c8 = gs.c(gs.a((TextView) this.f11152d[2]));
                if (c7 != null && c8 != null && c7.intValue() >= c8.intValue()) {
                    return gs.d(this, R.string.f_min_smaller_max, new Object[0]);
                }
            } else if (i2 == 420) {
                if (gs.a((TextView) this.f11152d[0]).contains("\n") && gs.a((TextView) this.f11152d[3]).length() == 0) {
                    return gs.d(this, R.string.f_need_value, ct.a(this, R.string.pl_output_file, new Object[0]));
                }
            } else if (i2 == 567) {
                String a18 = gs.a((TextView) this.f11152d[0]);
                if (a18.length() > 0) {
                    String[] split = a18.split(Pattern.quote("/"));
                    if (!a18.endsWith("/") && !a18.startsWith("/") && split.length >= 1 && split.length <= 2) {
                        while (i < split.length) {
                            String trim = split[i].trim();
                            i = (!TextUtils.isEmpty(trim) && (gs.c(trim) != null || gx.c(trim))) ? i + 1 : 0;
                            return gs.a(this, ct.a(this, R.string.f_bad_in_for, new Object[0]) + ": " + trim, new Object[0]);
                        }
                    }
                    return gs.a(this, ct.a(this, R.string.f_bad_in_for, new Object[0]) + ": " + a18, new Object[0]);
                }
            } else if (i2 == 135 && l(0) == 1) {
                String a19 = gs.a((TextView) this.f11152d[2]);
                if (this.am == null || !this.am.contains(a19)) {
                    gs.c(this, R.string.f_goto_unknown_label, a19);
                }
            }
            return !(z5 && gi.b(this, 1, R.string.tip_local_var, 1)) && this.f10856a.m();
        } catch (NullPointerException unused) {
            return gs.a(this, "data validation error, please contact the developer to fix", new Object[0]);
        }
    }

    private void K() {
        if (this.aj.i() == 47) {
            String a2 = gs.a((TextView) this.f11152d[0]);
            dt.b bVar = dt.b.values()[l(1)];
            if (bVar == dt.b.Overlay) {
                fz e2 = e();
                if (e2.t(a2) && e2.w(a2)) {
                    df.a(this, R.string.word_warning, R.string.dc_non_blocking_overlay_interactive_scene);
                }
            }
            if (dt.b(bVar)) {
                this.f10856a.b(com.joaomgcd.taskerm.dialog.y.c(this, R.string.pl_allow_outside_boundaries, R.string.help_interactive_out_of_bounds_scenes));
            }
        }
    }

    private boolean a(int i, String str, Integer num) {
        if (str.startsWith("%")) {
            if (!gx.c(str)) {
                return gs.d(this, R.string.err_bad_variable_name, str);
            }
        } else {
            if (num == null) {
                return gs.a(this, str + ": " + ct.a(this, R.string.f_not_numeric_or_variable, new Object[0]), new Object[0]);
            }
            if (!v.a(i, num.intValue())) {
                return gs.d(this, R.string.f_unknown_value, ct.a(this, R.string.pl_min_freq, new Object[0]), str);
            }
        }
        return true;
    }

    private void d(int i, int i2) {
        if (i == 65 && i2 == 3) {
            A(4);
        }
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
        String num;
        int i2;
        if (z) {
            seekBar.requestFocus();
            if (this.w == null) {
                bo.c("ActionEdit", "onProgressChanged: null seekers");
                return;
            }
            if (this.y == null) {
                bo.c("ActionEdit", "onProgressChanged: null seekers");
                return;
            }
            if (this.aj == null) {
                bo.c("ActionEdit", "onProgressChanged: null action");
                return;
            }
            int i3 = 0;
            while (i3 < this.aj.h()) {
                if (this.w[i3] == null) {
                    bo.c("ActionEdit", "onProgressChanged: null seeker index " + i3);
                } else if (this.y[i3] == null) {
                    bo.c("ActionEdit", "onProgressChanged: null text view index " + i3);
                } else if (seekBar.equals(this.w[i3])) {
                    int i4 = this.aj.i();
                    String e2 = e(i3, i4);
                    int progress = seekBar.getProgress();
                    int j = F(i3) ? 1 : n.j(i4, i3);
                    if (j > Integer.MIN_VALUE) {
                        progress += j;
                    }
                    d(i4, i3);
                    boolean z2 = i3 == 2;
                    if (n.P(i4) != -1 && i + j == 600) {
                        num = ct.a(this, R.string.word_never, new Object[0]);
                    } else if (n.s(i4)) {
                        if (i == 0) {
                            num = ct.a(this, R.string.word_none, new Object[0]);
                        } else if (j + i == n.g(i4, i3)) {
                            num = ct.a(this, R.string.word_never, new Object[0]);
                        } else {
                            num = Integer.toString(progress);
                        }
                    } else if (i4 == 47 && (i3 == 3 || z2)) {
                        if (progress == 100) {
                            i2 = R.string.word_centre;
                        } else if (progress == 0) {
                            if (!z2) {
                                i2 = R.string.word_top;
                            }
                            i2 = R.string.word_left;
                        } else if (progress == 200) {
                            if (!z2) {
                                i2 = R.string.word_bottom;
                            }
                            i2 = R.string.word_right;
                        } else if (progress < 100) {
                            if (!z2) {
                                i2 = R.string.word_up;
                            }
                            i2 = R.string.word_left;
                        } else {
                            if (!z2) {
                                i2 = R.string.word_down;
                            }
                            i2 = R.string.word_right;
                        }
                        num = ct.a(this, i2, new Object[0]);
                    } else {
                        num = Integer.toString(progress);
                    }
                    if (e2 != null) {
                        num = num + e2;
                    }
                    this.y[i3].setText(num);
                    int g = n.g(i4);
                    if (g != -1) {
                        try {
                            AudioManager audioManager = (AudioManager) df.a(this, "audio", "ActionEdit", "opc");
                            if (audioManager != null) {
                                a(true, i4);
                                gs.b(this, g);
                                audioManager.setStreamVolume(g, progress, 4);
                            }
                        } catch (SecurityException unused) {
                            c(true);
                        }
                    }
                    this.f10856a.f(i3, i);
                    return;
                }
                i3++;
            }
        }
    }

    private String e(int i, int i2) {
        String m = n.m(i2, i);
        return m == null ? this.f10856a.k(i) : m;
    }

    private void c(final boolean z) {
        this.f10856a.a(com.joaomgcd.taskerm.dialog.y.a((Activity) this), new b.a.d.f() {
            @Override
            public final void accept(Object obj) {
                ActionEdit.this.a(z, (com.joaomgcd.taskerm.dialog.x) obj);
            }
        });
    }

    public void a(boolean z, com.joaomgcd.taskerm.dialog.x xVar) throws Exception {
        if (xVar.d()) {
            B(64);
        } else if (z) {
            d();
        } else {
            G();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        this.f10856a.p();
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        boolean z = false;
        if (!super.a(i, i2, intent)) {
            if (i == 61) {
                G();
            } else if (i == 64) {
                if (!dc.a()) {
                    d();
                }
            } else if (i == 62) {
                at.a(this, i2, intent);
                G();
            } else if (i == 63) {
                if (i2 == -1) {
                    bm bmVar = new bm(new dh(intent.getBundleExtra("item")));
                    ef x = this.aj.x();
                    if (this.l == -1) {
                        x.a(bmVar);
                        Y();
                        this.ab.fullScroll(130);
                        this.l = x.aG() - 1;
                    } else {
                        x.aF().set(this.l, bmVar);
                    }
                    if (bmVar.d()) {
                        x.W(this.l);
                    } else {
                        x.U(this.l);
                    }
                    x.aJ();
                }
            } else if (i == 60) {
                if (i2 == -1 && intent.hasExtra("el")) {
                    Bundle bundleExtra = intent.getBundleExtra("el");
                    if (bundleExtra == null) {
                        bo.d("ActionEdit", "no result bundle");
                    } else {
                        gs.b(this.f11152d[3], du.a(new dh(bundleExtra)).a(0).b(0));
                    }
                }
            } else if (i == 6) {
                if (i2 == -1) {
                    q qVar = new q(new dh(intent.getBundleExtra("ssc")));
                    if (this.aj.m(this.l) == 2) {
                        if (this.aj.i() == 173) {
                            d k = this.aj.k(this.l);
                            k.e();
                            for (int i3 = 0; i3 < qVar.f(); i3++) {
                                k.b(qVar.d(i3), qVar.b(i3), qVar.c(i3));
                            }
                        } else {
                            this.aj.b(this.l, qVar.g(), qVar.h(), qVar.i());
                        }
                        if (!x(this.l)) {
                            A(this.l);
                        }
                        if (this.aj.i() == 18) {
                            gi.b(this, 1, R.string.tip_kill_app, 1);
                        }
                        this.f10856a.f(this.l);
                    } else if (this.aj.i() == 344 && this.l == 1) {
                        gs.b(this.f11152d[this.l], qVar.g());
                    } else {
                        this.aj.e(this.l).b(qVar.g(), qVar.h());
                        a(this.aj, this.l);
                    }
                }
            } else if (i == 7) {
                if (i2 == -1) {
                    String string = intent.getExtras().getString("path");
                    int i4 = this.aj.i();
                    a(string, n.f(i4, this.l), i4 == 118 || i4 == 116, this.aj.i() == 420 && this.l == 0);
                }
            } else if (i == 59) {
                gi.a(this, R.string.tip_js_edit);
            } else if (i == 56) {
                if (i2 == -1) {
                    df.a(this, R.string.word_warning, R.string.dc_device_admin_uninstall);
                }
            } else if (i == 5) {
                if (i2 == -1) {
                    Bundle bundleExtra2 = intent.getBundleExtra("actisss");
                    if (bundleExtra2 == null) {
                        bo.c("ActionEdit", "oar: null action bundle");
                    } else {
                        this.aj.x().a(e(), getPackageManager(), this.l, new c(new dh(bundleExtra2)), (Z() && n.R(this.aj.i())) ? false : true);
                        E();
                    }
                }
            } else if (i == 3) {
                if (i2 == -1) {
                    this.aj.e(this.l).b(this.n.getPath());
                    A(this.l);
                }
            } else if (i == 55) {
                if (i2 == -1) {
                    String dataString = intent.getDataString();
                    if (dataString == null) {
                        dataString = "";
                    }
                    this.f11152d[this.l].setText(dataString);
                }
            } else if (i == 58 || i == 4) {
                if (i2 == -1) {
                    if (this.aj == null) {
                        bo.c("ActionEdit", "oar: icon select: no action");
                    } else if (this.l == -1) {
                        bo.c("ActionEdit", "oar: icon select: no editingArgNo");
                    } else {
                        g a2 = ImageSelect.a(intent);
                        if (i == 58) {
                            if (a2 == null) {
                                this.aj.e(this.l).d();
                            } else {
                                this.aj.a(this.l, a2);
                            }
                            A(this.l);
                            if (a2 != null && gs.r() && n.R(this.aj.i()) && (!a2.y() || (a2.x() != 0 && a2.x() != -1))) {
                                gi.b(this, 1, R.string.tip_notification_icon_colour, 1);
                            }
                        } else {
                            this.aj.x().a(getPackageManager(), this.l, a2);
                            if (n.R(this.aj.i()) && gs.r()) {
                                gi.b(this, 1, R.string.tip_notification_action_icons, 1);
                            }
                        }
                    }
                }
            } else if (i == 53) {
                if (i2 == -1) {
                    String str = null;
                    if (intent == null) {
                        bo.d("ActionEdit", "imageSelectResult: no data intent");
                    } else {
                        str = gs.a(getContentResolver(), intent.getData(), "_data");
                    }
                    if (str == null) {
                        gs.d(this, R.string.f_cant_find_image, new Object[0]);
                    } else {
                        String b2 = gs.b(str);
                        this.f11152d[this.l].setText(b2);
                        this.aj.b(this.l, b2);
                        X();
                    }
                }
            } else if (ce.a(i)) {
                int i5 = this.aj.i();
                if (!ce.a(i, i2, intent, getContentResolver(), this.f11152d[this.l], (i5 == 95 || i5 == 99) ? 2 : (i5 == 41 || i5 == 41 || i5 == 250 || i5 == 111) ? 1 : 0, true)) {
                    gs.c(this, R.string.f_cant_get_contact_data, new Object[0]);
                }
            } else if (i == 52) {
                if (i2 == -1) {
                    int c2 = c(this.aj.i());
                    Bundle extras = intent.getExtras();
                    if (extras != null) {
                        String a3 = ds.a(this, c2, ds.a(extras), true);
                        bo.b("ActionEdit", "--------title: " + a3);
                        if (a3 == null) {
                            a3 = "";
                        }
                        this.f11152d[this.l].setText(a3);
                    }
                }
            } else if (i == 51) {
                this.l = 0;
                if (i2 == -1) {
                    Bundle a4 = di.a(intent);
                    if (a4 != null) {
                        if (di.a(a4)) {
                            if (ga.c.b(a4)) {
                                h g = this.aj.g(3);
                                if (!this.g[3] && (!g.g() || g.h() == 0)) {
                                    int j = n.j(this.aj.i(), 3);
                                    int g2 = n.g(this.aj.i(), 3);
                                    int c3 = ga.c.c(a4);
                                    int i6 = c3 / 1000;
                                    if (i6 < j) {
                                        i6 = j;
                                    } else if (i6 > g2) {
                                        i6 = g2;
                                    }
                                    bo.b("ActionEdit", "timeout req " + c3 + "ms min: " + j + "s max " + g2 + "s used: " + i6 + "s");
                                    this.aj.a(3, i6);
                                }
                                ga.c.f(a4);
                            } else {
                                this.aj.a(3, 0);
                            }
                            this.aj.a(0, a4);
                            di.a(this.aj, this.aj.i(), di.a.Action);
                            A(-1);
                        } else {
                            gs.d(this, R.string.f_plugin_data_too_large, new Object[0]);
                        }
                    }
                } else if (i2 == 0) {
                    bo.b("ActionEdit", "Cancelled");
                } else {
                    bo.b("ActionEdit", "R: " + i2);
                }
            } else if (i == 50) {
                if (i2 == 1 || (this.U != null && this.U.equals("com.svox.classic") && i2 == 0)) {
                    if (intent == null) {
                        gs.d(this, R.string.f_tts_data_info_null, new Object[0]);
                    } else if (intent.getExtras() == null) {
                        gs.d(this, R.string.f_tts_data_extras_null, new Object[0]);
                    } else {
                        if (intent.hasExtra("availableVoices")) {
                            bo.b("ActionEdit", "try get voices from EXTRA_AVAILABLE_VOICES");
                            P = intent.getStringArrayListExtra("availableVoices");
                        }
                        if (gs.a((Collection<?>) P)) {
                            bo.b("ActionEdit", "no voices so far...");
                            if (intent.hasExtra("dataFilesInfo")) {
                                bo.b("ActionEdit", "try get voices from EXTRA_VOICE_DATA_FILES_INFO");
                                String[] stringArrayExtra = intent.getStringArrayExtra("dataFilesInfo");
                                if (!gs.a((Object[]) stringArrayExtra)) {
                                    bo.b("ActionEdit", "array empty");
                                    P = new ArrayList<>();
                                    for (String str2 : stringArrayExtra) {
                                        bo.b("ActionEdit", "found file: " + stringArrayExtra);
                                        if (!P.contains(str2)) {
                                            P.add(str2);
                                        }
                                    }
                                }
                            }
                        }
                        if (gs.a((Collection<?>) P)) {
                            gs.d(this, R.string.f_tts_engine_no_voices, new Object[0]);
                        } else {
                            A(1);
                            this.l = 1;
                            ah();
                        }
                    }
                } else if (i2 == -2) {
                    gs.b(this, R.string.actionedit_installing_tts_data, new Object[0]);
                    b(new Intent("android.speech.tts.engine.INSTALL_TTS_DATA"), 57);
                    z = this.k;
                } else {
                    gs.a(this, ct.a(this, R.string.f_tts_data_check_failed, new Object[0]) + ": " + i2, new Object[0]);
                }
            }
        }
        this.k = z;
    }

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

    private boolean L() {
        int i;
        int length;
        int i2;
        boolean z;
        if (J()) {
            I();
            if (this.aj != null && this.aj.i() == 16 && !MyDeviceAdminReceiver.c(this)) {
                gf.a(this, new Handler() {
                    @Override
                    public void handleMessage(Message message) {
                        if (message.what != 0) {
                            ActionEdit.this.G();
                            return;
                        }
                        ActionEdit.this.k = false;
                        ActionEdit.this.b(MyDeviceAdminReceiver.e(ActionEdit.this), 56);
                        ActionEdit.this.k = true;
                    }
                }, R.string.dt_need_device_admin, ct.a(this, R.string.dc_need_device_admin, new Object[0]), R.string.button_label_ok, R.string.button_label_no, -1, 0).a(this);
            } else if (this.aj != null && n.a(this, this.aj) && MyAccessibilityService.b() && !MyAccessibilityService.c()) {
                gf.a(this, new Handler() {
                    @Override
                    public void handleMessage(Message message) {
                        if (message.what != 0) {
                            ActionEdit.this.G();
                        } else {
                            ActionEdit.this.k = true;
                            MyAccessibilityService.a((Activity) ActionEdit.this);
                        }
                    }
                }, R.string.dialog_title_need_accessibility, ct.a(this, R.string.dc_need_accessibility, new Object[0]), R.string.button_label_ok, R.string.button_label_no, -1, 0).a(this);
            } else if (this.aj != null && this.aj.a(this, (HashMap<String, List<String>>) null).containsKey("android.permission.SYSTEM_ALERT_WINDOW") && bq.c() && !bq.d(this)) {
                b(bq.g(this), 61);
            } else if (this.aj != null && this.aj.a(this, (HashMap<String, List<String>>) null).containsKey("android.permission.WRITE_SETTINGS") && bq.a() && !bq.a(this)) {
                b(bq.c(this), 61);
            } else if (this.aj != null && this.aj.i() == 173) {
                try {
                    Intent prepare = VpnService.prepare(this);
                    if (prepare != null) {
                        bo.b("ActionEdit", "request VPN access");
                        try {
                            b(prepare, 61);
                        } catch (IllegalStateException e2) {
                            bo.a("ActionEdit", "failed to prepare VPN", (Exception) e2);
                            P();
                            return true;
                        }
                    } else {
                        G();
                        return true;
                    }
                } catch (Exception e3) {
                    com.joaomgcd.taskerm.rx.h.a(this, e3);
                }
            } else if (this.aj != null && this.aj.i() == 902 && !this.aj.h(3).b()) {
                this.f10856a.a(com.joaomgcd.taskerm.dialog.y.a(this, com.joaomgcd.taskerm.util.an.a(R.string.dc_notify_get_location_2, this, com.joaomgcd.taskerm.util.an.a(R.string.an_get_current_location, this, new Object[0]))), new b.a.d.f() {
                    @Override
                    public final void accept(Object obj) {
                        ActionEdit.this.a((com.joaomgcd.taskerm.dialog.x) obj);
                    }
                });
            } else if (this.aj != null && ((n.f(this.aj.i()).intValue() == 50 || this.f10856a.w() != null) && (this.aj.i() != 667 || F() != n.e.TableURIFormatted))) {
                int i3 = -1;
                Integer[] w = this.f10856a.w();
                if (w != null) {
                    i = w.length > 0 ? w[0].intValue() : 0;
                    if (w.length > 1) {
                        i3 = w[1].intValue();
                    }
                } else {
                    i = 0;
                }
                int i4 = this.aj.i();
                if (i4 != 342) {
                    if (i4 != 400) {
                        if (i4 != 667 && i4 != 775) {
                            switch (i4) {
                            }
                            int[] iArr = {i, i3};
                            length = iArr.length;
                            i2 = 0;
                            while (true) {
                                if (i2 < length) {
                                    int i5 = iArr[i2];
                                    if (i5 >= 0) {
                                        String c2 = this.aj.j(i5).c();
                                        z = c2.startsWith(File.separator) && !gx.h(c2) && at.a((Context) this, new File(c2), false, true, true);
                                    }
                                    i2++;
                                }
                            }
                            if (z) {
                                at.a(this, new Handler() {
                                    @Override
                                    public void handleMessage(Message message) {
                                        if (message.what != 0) {
                                            ActionEdit.this.G();
                                        } else {
                                            ActionEdit.this.k = true;
                                            ActionEdit.this.b(at.a(true), 62);
                                        }
                                    }
                                });
                            } else {
                                G();
                                return true;
                            }
                        }
                    }
                    i3 = 1;
                    i = 0;
                    int[] iArr2 = {i, i3};
                    length = iArr2.length;
                    i2 = 0;
                    while (true) {
                        if (i2 < length) {
                        }
                        i2++;
                    }
                    if (z) {
                    }
                }
                i = 1;
                int[] iArr22 = {i, i3};
                length = iArr22.length;
                i2 = 0;
                while (true) {
                    if (i2 < length) {
                    }
                    i2++;
                }
                if (z) {
                }
            } else if (this.aj != null && this.aj.i() == 312 && !dc.a(this)) {
                c(false);
            } else {
                G();
                return true;
            }
        }
        return false;
    }

    public void a(com.joaomgcd.taskerm.dialog.x xVar) throws Exception {
        G();
    }

    private void B(int i) {
        this.k = false;
        try {
            b(dc.h(), i);
            this.k = true;
        } catch (ActivityNotFoundException unused) {
            gs.d(this, R.string.f_cant_open_settings, new Object[0]);
            G();
        }
    }

    private void M() {
        du duVar;
        if (this.aj.i() == 69) {
            String a2 = gs.a((TextView) this.f11152d[3]);
            du.e eVar = du.a()[l(1)];
            if (a2.length() > 0) {
                try {
                    duVar = du.a(new dh(a2));
                } catch (Exception e2) {
                    gs.a(this, "oops: " + e2.toString(), new Object[0]);
                    duVar = null;
                }
                if (duVar == null) {
                    gs.a(this, "oops", new Object[0]);
                } else if (duVar.t() != eVar) {
                    du.e[] a3 = du.a();
                    int i = 0;
                    while (i < a3.length && a3[i] != duVar.t()) {
                        i++;
                    }
                    this.A[1].setSelection(i, false);
                }
            } else {
                duVar = du.b(this, eVar);
            }
            if (duVar != null) {
                startActivityForResult(new Intent(this, (Class<?>) SceneEditElement.class).putExtra("el", duVar.a(0).c()).putExtra("sc", new dt().a(0).c()).putExtra("flags", 264), 60);
            }
        }
    }

    public void b(Intent intent, int i) {
        this.k = true;
        try {
            startActivityForResult(intent, i);
        } catch (SecurityException unused) {
            this.k = false;
            gs.d(this, R.string.err_permission, new Object[0]);
        } catch (Exception e2) {
            this.k = false;
            gs.a(this, e2.toString(), new Object[0]);
        }
    }

    private void N() {
        for (int i = 0; i < this.aj.h(); i++) {
            int m = this.aj.m(i);
            boolean z = m == 0 && this.aj.g(i).e();
            if (!z && m == 2) {
                d k = this.aj.k(i);
                z = k.l() > 0 && gx.h(k.i());
            }
            this.g[i] = z;
        }
    }

    @Override
    public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
        KeyguardManager keyguardManager;
        int i2 = this.aj.i();
        int i3 = 0;
        while (true) {
            if (i3 >= this.aj.h()) {
                i3 = -1;
                break;
            } else if (adapterView.equals(this.A[i3])) {
                break;
            } else {
                i3++;
            }
        }
        int i4 = 5;
        if (i2 == 165 && i3 == 0) {
            A(2);
            A(1);
            A(3);
        } else if (i2 == 69 && i3 == 1) {
            if (!this.f10858c) {
                this.f10858c = true;
            } else {
                gs.b(this.f11152d[3], "");
            }
        } else if (i2 == 314 && i3 == 0) {
            A(2);
            A(4);
            A(5);
            A(8);
            A(9);
            if (H() == com.joaomgcd.taskerm.action.input.s.Biometric && com.joaomgcd.taskerm.util.g.l()) {
                com.joaomgcd.taskerm.rx.h.a(com.joaomgcd.taskerm.dialog.y.e(this, 28), this);
            }
            if (H() == com.joaomgcd.taskerm.action.input.s.Credentials && (keyguardManager = (KeyguardManager) getSystemService("keyguard")) != null && keyguardManager.createConfirmDeviceCredentialIntent("bla", "blu") == null) {
                gi.b(this, 1, R.string.tip_no_credentials_set_up, 1);
            }
        } else if (gd.a(i2) && i == 0) {
            A(1);
        } else if (i2 == 490 && i3 == 0) {
            A(1);
        } else if (i2 == 596 && i3 == 1) {
            A(3);
        } else if (i2 == 162 && i3 == 0) {
            A(1);
        }
        if (i2 == 457 || i2 == 192) {
            if (i3 == 0) {
                String a2 = gs.a((TextView) this.f11152d[1]);
                if (a2.length() > 0 && ds.a(this, ds.b(i), a2) == null) {
                    this.aj.b(1, "");
                    A(1);
                }
                if (i2 == 192) {
                    int b2 = ds.b(i);
                    if (b2 == 4) {
                        i4 = 4;
                    } else if (b2 != 2) {
                        if (b2 == 1) {
                            i4 = 2;
                        } else {
                            bo.c("ActionEdit", "unexpected ringtone type " + b2);
                            i4 = -1;
                        }
                    }
                    if (i4 != -1) {
                        this.A[2].setSelection(i4, true);
                    }
                }
            }
        } else if (i2 == 101) {
            if (i3 == 0) {
                ac();
                A(6);
                A(8);
                A(9);
                A(7);
                A(5);
            }
        } else if (i2 == 53) {
            A(3);
        } else if (i2 == 612) {
            A(3);
        } else if (i2 == 185) {
            A(1);
        } else if (i2 == 64) {
            A(3);
        } else if (i2 == 135) {
            A(1);
            A(2);
        } else if (i2 == 173) {
            if (MyVpnService.a(i)) {
                this.aj.k(1).e();
            } else if (!bw.ay.b()) {
                gs.c(this, R.string.f_network_access_no_app_spec, new Object[0]);
            }
            A(1);
        } else if (i2 == 667 && i3 == 0) {
            this.aj.a(0, l(0));
            this.aj.b(4, "");
            A(2);
            A(4);
            A(3);
            A(6);
            A(1);
            A(9);
        } else if (i2 == 47) {
            this.aj.a(1, l(1));
            this.aj.a(4, l(4));
            A(2);
            A(3);
            A(4);
            A(6);
            A(8);
            A(9);
            A(10);
            K();
        } else if (i2 == 119) {
            A(1);
            A(4);
            A(3);
        } else if (i2 == 999) {
            this.aj.a(1, 0);
            A(1);
        } else if (i2 == 552) {
            this.aj.a(1, i);
            X();
        } else if (i2 == 133 && i3 == 0) {
            this.aj.a(0, i);
            A(2);
            A(1);
        } else if (i2 == 559) {
            if (i != 3) {
                gi.b(this, 1, R.string.tip_say_channel, 1);
            }
        } else if (i2 == 444 || i2 == 442) {
            A(1);
        } else if (gd.a(i2)) {
            A(1);
        } else if (i2 == 643 && i == 0) {
            A(1);
        }
        this.f10856a.e(i3, i);
    }

    private String O() {
        return gs.a((TextView) this.f11152d[1]);
    }

    private void P() {
        ExecuteService.a(this);
        finish();
    }

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        net.dinglisch.android.taskerm.a.b(this, 8, R.string.word_action, menu);
        if (this.aj != null && this.aj.u() != null) {
            net.dinglisch.android.taskerm.a.v(this, 7777, menu);
        }
        return super.a(menu, R.string.ml_help_this_screen, R.string.ml_action_help_index);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        int itemId = menuItem.getItemId();
        if (itemId == 6) {
            d();
            return true;
        }
        if (itemId == 8) {
            this.l = -1;
            ak();
            return true;
        }
        if (itemId == 7777) {
            if (this.aj.u() != null) {
                this.f10856a.a(com.joaomgcd.taskerm.util.bw.e((Activity) this), new b.a.d.f() {
                    @Override
                    public final void accept(Object obj) {
                        ActionEdit.this.a((Boolean) obj);
                    }
                });
            }
            return true;
        }
        if (itemId == 16908332) {
            L();
            return true;
        }
        return a(menuItem, "help/ah_index.html", "activity_actionedit.html");
    }

    public void a(Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            this.f10856a.b(com.joaomgcd.taskerm.dialog.y.d(this, R.string.word_error, R.string.cant_check_help_files_without_file_permissions));
            return;
        }
        this.k = true;
        if (this.aj.i() == 915) {
            HTMLView.a(this, "cpu.html", -1, HTMLView.c.Inform);
        } else {
            c();
        }
    }

    public void c() {
        if (this.aj == null) {
            return;
        }
        this.f10856a.a(this.aj.M(), new c.f.a.a() {
            @Override
            public final Object invoke() {
                c.s ap;
                ap = ActionEdit.this.ap();
                return ap;
            }
        });
    }

    public c.s ap() {
        a(this, this.aj.u(), (String) null);
        return c.s.f2131a;
    }

    public void d() {
        if (this.al != b.None) {
            P();
        } else {
            finish();
        }
    }

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

    private boolean a(String str) {
        return (this.ae != null && this.ae.equals(str)) || e().t(str) || ex.c(str);
    }

    private du.e b(String str, String str2) {
        if (this.ae != null && this.ae.equals(str)) {
            Iterator<String> it = this.af.iterator();
            while (it.hasNext()) {
                String[] split = it.next().split("::dvd::");
                if (split[0].equals(str2)) {
                    return du.e.valueOf(split[1]);
                }
            }
            return null;
        }
        fz e2 = e();
        if (e2.t(str) && e2.a(str, str2, false)) {
            return e2.a(str, str2);
        }
        return null;
    }

    private List<String> b(String str) {
        return a(str, -1);
    }

    private List<String> c(String str) {
        return a(str, this.aj.i());
    }

    private List<String> a(String str, int i) {
        if (this.ae != null && this.ae.equals(str)) {
            ArrayList arrayList = new ArrayList();
            Iterator<String> it = this.af.iterator();
            while (it.hasNext()) {
                String[] split = it.next().split("::dvd::");
                if (i == -1 || i == 143) {
                    arrayList.add(split[0]);
                } else {
                    int[] a2 = du.a(du.e.valueOf(split[1]));
                    int length = a2.length;
                    int i2 = 0;
                    while (true) {
                        if (i2 >= length) {
                            break;
                        }
                        if (a2[i2] == i) {
                            arrayList.add(split[0]);
                            break;
                        }
                        i2++;
                    }
                }
            }
            return arrayList;
        }
        fz e2 = e();
        if (e2.t(str)) {
            return e2.c(str, i);
        }
        return new ArrayList();
    }

    public int R() {
        return l(0);
    }

    private List<String> S() {
        ArrayList<String> a2 = e().a(-2, dt.f.Alpha, true);
        if (this.ae != null && !a2.contains(this.ae)) {
            a2.add(0, this.ae);
            gs.e(a2);
        }
        return a2;
    }

    private boolean T() {
        return eu.S(l(2));
    }

    private boolean U() {
        return et.S(l(2));
    }

    private boolean V() {
        eh.a aVar = eh.a.values()[l(2)];
        return aVar == eh.a.MoveToMarker || aVar == eh.a.MoveToMarkerAnimated || aVar == eh.a.MoveToPoint || aVar == eh.a.MoveToPointAnimated || aVar == eh.a.SetZoom;
    }

    public boolean W() {
        if (O == null) {
            O = getPackageManager().queryIntentActivities(new Intent("android.speech.tts.engine.CHECK_TTS_DATA"), 0);
        }
        boolean z = !gs.a((Collection<?>) O);
        if (!z) {
            gs.c(this, R.string.f_no_tts_engines, new Object[0]);
        }
        return z;
    }

    @Override
    public void afterTextChanged(Editable editable) {
        if (this.aj == null || this.aj.i() != 60) {
            return;
        }
        A(4);
        A(5);
        A(7);
    }

    @Override
    public fz e() {
        return this.al == b.Exe ? fy.c(this) : fy.b(this);
    }

    private boolean C(int i) {
        return this.aj.i() == 64 && i == 3;
    }

    private boolean D(int i) {
        return (!C(i) || E(i) || F(i)) ? false : true;
    }

    private boolean E(int i) {
        if (!C(i)) {
            return false;
        }
        int l = l(2);
        return l == eh.a.MoveToPoint.ordinal() || l == eh.a.MoveToPointAnimated.ordinal();
    }

    private boolean F(int i) {
        return C(i) && l(2) == eh.a.SetZoom.ordinal();
    }

    public void X() {
        if (this.aj != null) {
            int i = this.aj.i();
            if (n.M(i)) {
                A(n.P(i));
            }
        }
    }

    private void Y() {
        if (Z()) {
            ListAdapter adapter = this.ad.getAdapter();
            int count = adapter == null ? 0 : adapter.getCount();
            gs.b(this.ad, bl.a(this));
            this.ad.setVisibility(count > 0 ? 0 : 8);
            r1 = 0;
        }
        this.ac.setVisibility(r1);
    }

    private boolean Z() {
        if (this.aj == null) {
            return false;
        }
        int i = this.aj.i();
        return i == 551 || i == 157 || (n.R(i) && bw.af.c());
    }

    private void aa() {
        if (Z()) {
            D();
            this.aj.a(this, ef.a.Standard);
            this.aj.x().a(ed.a.Single);
            ef x = this.aj.x();
            x.a(this.aj.i() == 551 ? ed.a.Single : ed.a.None);
            bl a2 = x.a(this, this.aa, bl.e.Build, (Bundle) null);
            this.ad.setAdapter((ListAdapter) a2);
            a(a2);
            this.ab.setNestingWorkaround(true);
        } else {
            this.ab.setNestingWorkaround(false);
        }
        Y();
    }

    private void ab() {
        this.aj.x().aJ();
        Y();
        X();
    }

    private void ac() {
        if (this.S != null) {
            this.S.release();
            this.S = null;
        }
    }

    private Camera ad() {
        if (this.S == null) {
            int l = l(0);
            int a2 = CameraProxy.a(l != 0 ? 1 : 0);
            if (a2 == -1) {
                bo.d("ActionEdit", "couldn't get cam index for tasker index " + l);
            } else {
                this.S = CameraProxy.a(a2, "ActionEdit", "getSelectedCamera");
            }
        }
        return this.S;
    }

    private void a(String str, String str2, boolean z) {
        if (this.T != null) {
            bo.d("ActionEdit", "jsi not null");
            return;
        }
        if (str.length() > 0) {
            this.T = bf.runPureScript(this, bf.ACTION_EDIT_ID, null, 100, z, str, str2, new Bundle(), new a(this, this.l));
            if (this.T != null) {
                this.D[0].setVisibility(4);
            }
        }
    }

    public void ae() {
        bo.b("ActionEdit", "stop JSI");
        if (this.T == null) {
            bo.d("ActionEdit", "stopJSI: null");
        } else {
            this.T._stop();
            this.T = null;
        }
        this.D[0].setVisibility(0);
    }

    private boolean af() {
        return n.S(l(0));
    }

    private void G(int i) {
        o.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 0) {
                    gs.b(ActionEdit.this.f11152d[ActionEdit.this.l], cd.a(message.getData().getInt("colour")));
                }
            }
        }, i).a(this);
    }

    private void a(int i, int i2, String[] strArr, int i3) {
        a(i, i2, strArr, i3, false);
    }

    private void a(final int i, int i2, String[] strArr, int i3, boolean z) {
        this.l = i;
        if (strArr.length == 0 && i3 != -1) {
            gs.c(this, i3, new Object[0]);
            return;
        }
        dp a2 = dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1) {
                    ActionEdit.this.f11152d[i].setText(message.getData().getString("text"));
                }
            }
        }, i2);
        a2.a(strArr);
        if (z) {
            a2.c();
        }
        a2.a(this);
    }

    private void a(int i, int i2, Collection<String> collection, int i3) {
        a(i, i2, collection, i3, false);
    }

    private void a(int i, int i2, Collection<String> collection, int i3, boolean z) {
        a(i, i2, collection, i3, z, (b.a.d.f<Integer>) null);
    }

    private void a(final int i, int i2, Collection<String> collection, int i3, boolean z, final b.a.d.f<Integer> fVar) {
        if (collection == null) {
            return;
        }
        this.l = i;
        if (collection.size() == 0 && i3 != -1) {
            gs.c(this, i3, new Object[0]);
            return;
        }
        dp a2 = dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1) {
                    ActionEdit.this.f11152d[i].setText(message.getData().getString("text"));
                    if (fVar != null) {
                        try {
                            fVar.accept(Integer.valueOf(message.getData().getInt("index")));
                        } catch (Exception e2) {
                            e2.printStackTrace();
                        }
                    }
                }
            }
        }, i2);
        if (collection.getClass() == List.class || collection.getClass() == ArrayList.class || collection.getClass() == LinkedList.class) {
            a2.a((List<String>) collection);
        } else {
            a2.a((Set<String>) collection);
        }
        if (z) {
            a2.c();
        }
        a2.a(this);
    }

    private void ag() {
        String[] strArr = new String[O.size()];
        for (int i = 0; i < strArr.length; i++) {
            strArr[i] = getPackageManager().getApplicationLabel(O.get(i).activityInfo.applicationInfo).toString();
            if (TextUtils.isEmpty(strArr[i])) {
                strArr[i] = "<" + ct.a(this, R.string.word_unknown, new Object[0]).toLowerCase() + ">";
            }
        }
        dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1 && ActionEdit.this.W()) {
                    int unused = ActionEdit.Q = message.getData().getInt("index");
                    ActivityInfo activityInfo = ((ResolveInfo) ActionEdit.O.get(ActionEdit.Q)).activityInfo;
                    Intent intent = new Intent();
                    intent.setComponent(new ComponentName(activityInfo.packageName, activityInfo.name));
                    intent.setAction("android.speech.tts.engine.CHECK_TTS_DATA");
                    ActionEdit.this.U = activityInfo.packageName;
                    try {
                        ActionEdit.this.b(intent, 50);
                        ActionEdit.this.k = true;
                    } catch (ActivityNotFoundException unused2) {
                        gs.d(ActionEdit.this, R.string.f_engine_not_found, new Object[0]);
                    }
                }
            }
        }, R.string.ttsengineselect_title).a(strArr).a(this);
    }

    private void ah() {
        dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1 && ActionEdit.this.W()) {
                    String string = message.getData().getString("text");
                    String str = ((ResolveInfo) ActionEdit.O.get(ActionEdit.Q)).activityInfo.packageName;
                    ActionEdit.this.f11152d[ActionEdit.this.l].setText(str + ConstantsCommonTaskerServer.ID_SEPARATOR + string);
                }
            }
        }, R.string.ttslocaleselect_title).a(P).a(this);
    }

    private void ai() {
        dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1) {
                    String string = message.getData().getString("text");
                    ActionEdit.this.f11152d[ActionEdit.this.l].setText(string);
                    int parseInt = Integer.parseInt(string);
                    SharedPreferences h = gs.h(ActionEdit.this);
                    int R = ActionEdit.this.R();
                    v.a(h, R);
                    int b2 = v.b(h, R);
                    if (b2 <= 0 || parseInt <= b2) {
                        return;
                    }
                    gi.b(ActionEdit.this, 1, R.string.tip_setcpu_max_freq, 1);
                }
            }
        }, R.string.dt_cpu_freq_select).a(v.f(R())).a(this);
    }

    private void f(final int i, final int i2) {
        dp a2 = dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                String string;
                if (message.what != 1 || (string = message.getData().getString("text")) == null) {
                    return;
                }
                String a3 = ex.a(ActionEdit.this, string);
                int i3 = ActionEdit.this.aj.i();
                ch chVar = null;
                if (n.u(i3, i) && !n.a(a3, i3, i)) {
                    fz e2 = ActionEdit.this.e();
                    if (e2.t(a3)) {
                        chVar = n.a(ActionEdit.this.getResources(), i3, i, e2.y(a3));
                    } else {
                        chVar = new ch(R.string.f_unknown_scene, new String[]{a3});
                    }
                }
                if (chVar == null) {
                    ActionEdit.this.f11152d[i].setText(a3);
                    ActionEdit.this.y[i].setText(a3);
                    ActionEdit.this.aj.b(i, a3);
                    ActionEdit.this.x(i);
                    if (i2 == R.string.dt_scene_select) {
                        if (n.O(i3)) {
                            ActionEdit.this.A(1);
                        } else {
                            ActionEdit.this.A(i);
                        }
                    }
                    if (ActionEdit.this.aj.i() == 51) {
                        ActionEdit.this.aj.b(4, gs.a((TextView) ActionEdit.this.f11152d[4]));
                        ActionEdit.this.A(4);
                        return;
                    }
                    return;
                }
                chVar.a(ActionEdit.this);
            }
        }, i2);
        if (i2 == R.string.dt_scene_element_select) {
            a2.a(c(aj()));
        } else {
            List<String> S = S();
            for (String str : n.v(this.aj.i(), i)) {
                if (str != null && !S.contains(str)) {
                    S.add(0, ex.b(this, str));
                }
            }
            a2.a(S);
        }
        a2.a(this);
    }

    private String aj() {
        String a2 = gs.a((TextView) this.f11152d[0]);
        return (!a2.startsWith("%") || this.ae == null) ? a2 : this.ae;
    }

    public int a(EditText editText) {
        if (this.aj != null && editText != null) {
            for (int i = 0; i < this.aj.h(); i++) {
                if (editText.equals(this.f11152d[i])) {
                    return i;
                }
            }
        }
        return -1;
    }

    public class AnonymousClass9 extends Handler {

        final int f10904a;

        AnonymousClass9(int i) {
            this.f10904a = i;
        }

        @Override
        public void handleMessage(Message message) {
            try {
                if (message.what == 1 || message.what == 2) {
                    final String string = message.getData().getString("text");
                    int i = message.getData().getInt("index");
                    int i2 = message.getData().getInt("boo");
                    if (i < i2 && !string.startsWith("%")) {
                        string = di.a(string);
                    }
                    final int i3 = this.f10904a == R.string.dialog_title_variable_select ? i - i2 : i;
                    if (i >= i2) {
                        ArrayList arrayList = new ArrayList();
                        gx.a((Context) ActionEdit.this, (List<String>) null, (List<Integer>) arrayList, false);
                        i3 = ((Integer) arrayList.get(i3)).intValue();
                    }
                    if (message.what == 2) {
                        ActionEdit.this.i.b(new com.joaomgcd.taskerm.util.b() {
                            @Override
                            public final void call(Object obj) {
                                ActionEdit.AnonymousClass9.this.a(i3, string, (ArrayList) obj);
                            }
                        });
                        if (message.what != 2) {
                            ActionEdit.this.as = null;
                            return;
                        }
                        return;
                    }
                    a(string, i3);
                }
            } finally {
                if (message.what != 2) {
                    ActionEdit.this.as = null;
                }
            }
        }

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

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

        private void a(String str, int i) {
            EditText a2 = ActionEdit.this.a(ActionEdit.this.aj);
            if (a2 == null) {
                bo.c("ActionEdit", "no text focus on return from variable select");
                return;
            }
            if (!gx.f(ActionEdit.this, i)) {
                gs.d(ActionEdit.this, R.string.variable_unavailable, new Object[0]);
                return;
            }
            int a3 = ActionEdit.this.aj.i() == 129 ? -1 : gs.a(ActionEdit.this, a2, 524289);
            String a4 = gs.a((TextView) a2);
            boolean z = true;
            boolean z2 = a4.startsWith("%") && a4.endsWith("(");
            int a5 = ActionEdit.this.a(a2);
            if (z2 || a5 == -1 || ((ActionEdit.this.aj.i() != 345 || a5 != 1) && !n.f(ActionEdit.this.aj.i(), a5).equals("uvar"))) {
                z = false;
            }
            if (!str.startsWith("%")) {
                str = gx.a(i);
            }
            if (ActionEdit.this.aj.i() == 129 && a5 == 0) {
                str = gx.q(str);
            }
            if (z) {
                gs.b(a2, str);
            } else {
                gx.a(ActionEdit.this, str, a2);
                if (z2) {
                    gs.a((Context) ActionEdit.this, a2, ")");
                }
            }
            if (a3 != -1) {
                gs.a(ActionEdit.this, a2, a3);
            }
            gx.i(ActionEdit.this, i);
        }
    }

    private void H(int i) {
        super.a(i, false, (av) this.aj, (Handler) new AnonymousClass9(i), new com.joaomgcd.taskerm.util.b() {
            @Override
            public final void call(Object obj) {
                ActionEdit.this.a((dp) obj);
            }
        });
    }

    public void a(dp dpVar) {
        this.as = dpVar;
    }

    @Override
    public void a(com.joaomgcd.taskerm.util.bw bwVar, com.joaomgcd.taskerm.util.cs csVar) {
        if (Arrays.asList(bwVar.j()).contains("android.permission.NOTIFICATION_ACCESS")) {
            c(true);
        } else {
            if (this.f10856a.a(bwVar, csVar)) {
                return;
            }
            this.f10856a.c(new Runnable() {
                @Override
                public final void run() {
                    ActionEdit.this.ak();
                }
            });
        }
    }

    @Override
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        this.f10856a.a(i, strArr, iArr);
    }

    public void ak() {
        final k kVar = new k(this);
        this.m = false;
        if (this.aj == null) {
            kVar.a(true, this.al != b.None);
        } else {
            kVar.b(this.aj.i());
            kVar.a(false, this.al != b.None, n.f(this.aj.i()).intValue());
        }
        kVar.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public final void onDismiss(DialogInterface dialogInterface) {
                ActionEdit.this.a(kVar, dialogInterface);
            }
        });
        final MyScrollView myScrollView = this.ab;
        kVar.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public final void onCancel(DialogInterface dialogInterface) {
                ActionEdit.this.a(myScrollView, dialogInterface);
            }
        });
        if (myScrollView != null) {
            myScrollView.setVisibility(4);
        }
        this.f10856a.j();
        kVar.show();
        this.h = kVar;
    }

    public void a(k kVar, DialogInterface dialogInterface) {
        if (!this.m) {
            c(kVar.b(), kVar.f());
        }
        this.h = null;
    }

    public void a(MyScrollView myScrollView, DialogInterface dialogInterface) {
        this.m = true;
        if (this.aj == null) {
            d();
        } else if (myScrollView != null) {
            myScrollView.setVisibility(0);
        }
        this.h = null;
    }

    private void c(int i, String str) {
        boolean z = true;
        if (i != -1) {
            this.f10856a.c(i);
            this.f10856a.r(i);
            com.joaomgcd.taskerm.util.bq.a(this, i);
            if (this.l != -1) {
                this.f11152d[this.l].setText(n.u(i));
            } else {
                if (this.aj != null) {
                    a(false, this.aj.i());
                }
                this.aj = new c(i);
                if (i == 38 || i == 40) {
                    L();
                    z = false;
                } else {
                    invalidateOptionsMenu();
                    N();
                    if (i == 35 || i == 37) {
                        this.aj.a(new z(new y()));
                    } else if (i == 130) {
                        this.g[1] = true;
                        this.aj.g(1).b("%priority");
                    } else if (i == 256) {
                        gi.b(this, 1, R.string.tip_ringer_vibrate, 1);
                    } else if (i == 235) {
                        gi.a(this, R.string.tip_custom_setting_getting_started_find);
                    } else if (i == 307) {
                        this.f10856a.b(R.string.tip_media_volume_sometimes_not_work_use_accessibility_volume_instead);
                    } else if (i == 915) {
                        gi.b(this, 1, R.string.tip_setcpu_general, 1);
                    } else if (i == 551) {
                        this.f10856a.b(R.string.tip_menu_list_dialog);
                    } else if (i == 254) {
                        this.f10856a.a(R.string.tip_speakerphone, "https://issuetracker.google.com/issues/141889136");
                    } else if (i == 244 && com.joaomgcd.taskerm.util.g.g()) {
                        this.f10856a.a(R.string.tip_toggle_app_dock_not_supported, "https://issuetracker.google.com/issues/225186417");
                    } else if (i == 95 || i == 97) {
                        gi.a(this, R.string.tip_call_diversion);
                    } else if (i == 150) {
                        gi.b(this, 1, R.string.tip_keyguard, 1);
                    } else if (i == 3877) {
                        gi.b(this, 1, R.string.tip_plugin_apndroid, 1);
                    } else if (i == 3155) {
                        gi.a(this, R.string.tip_plugin_newsrob);
                    } else if (i == 1221) {
                        gi.b(this, 1, R.string.tip_plugin_ase, 1);
                    } else if (i == 42) {
                        gi.b(this, 1, R.string.tip_send_data_sms, 1);
                    } else if (i == 444) {
                        gi.b(this, 1, R.string.tip_strobe, 1);
                    } else if (i == 525 || i == 536 || i == 538) {
                        df.a(this, R.string.warning_dialog_title, R.string.tip_old_notify);
                    } else if (i == 118 || i == 116 || i == 117) {
                        df.a(this, R.string.warning_dialog_title, R.string.tip_old_http, new Handler() {
                            @Override
                            public void handleMessage(Message message) {
                                ActionEdit.this.f10856a.x();
                            }
                        });
                    } else if (com.joaomgcd.taskerm.util.g.p() && i == 523) {
                        gi.b(this, 1, R.string.tip_notify_needs_category, 1);
                    } else if (i == 176) {
                        this.f10856a.b(com.joaomgcd.taskerm.dialog.y.g(this));
                    } else if (this.f10856a.s(i)) {
                        this.f10856a.a((com.joaomgcd.taskerm.helper.actions.d) this.aj);
                    } else if (i == 113 && gs.r()) {
                        df.a(this, R.string.an_tether_wifi, R.string.dc_tether_wifi);
                    } else {
                        n.j(i);
                    }
                    A(-1);
                    this.f10856a.a(this.aj, str);
                    aa();
                    C();
                    if (this.aj.h() > 0 && this.aj.m(0) == 2) {
                        this.l = 0;
                        b(AppSelect.a(this, true, this.aj.i() == 20, false, false, this.aj.i() == 20, true, null, null), 6);
                    }
                }
            }
        }
        if (z) {
            this.ab.setVisibility(0);
        }
    }

    @Override
    public void a(fa.b bVar, int i) {
        List<Integer> linkedList;
        if (u()) {
            linkedList = ((bz) this.ad.getAdapter()).k();
            v();
        } else {
            linkedList = new LinkedList<>();
            linkedList.add(Integer.valueOf(this.aa.f()));
        }
        if (bVar == fa.b.DropBin) {
            a(linkedList);
        } else if (i != -1) {
            a(linkedList, i);
        }
    }

    public void a(List<Integer> list) {
        this.aj.x().a(list);
        ab();
    }

    private void a(List<Integer> list, int i) {
        this.aj.x().a(list, i);
        ab();
    }

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

    private void al() {
        if (this.aa != null) {
            this.aa.b();
            this.aa = null;
        }
        this.R = null;
        O = null;
        P = null;
        this.S = null;
        this.T = null;
        this.W = null;
        this.V = null;
        this.X = null;
        this.Z = null;
        this.ab = null;
        this.ac = null;
        this.ad = null;
        this.af = null;
        this.aj = null;
        this.f10857b = null;
        this.am = null;
        this.f10856a.b();
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        EditText a2 = a(this.aj);
        if (c(a2)) {
            a2.clearFocus();
        }
    }

    protected boolean b(int i) {
        if (p()) {
            return super.a(false, true, true);
        }
        if (i == 35 || i == 37) {
            return gs.d(this, R.string.f_enter_condition, new Object[0]);
        }
        return true;
    }

    public void f() {
        int i = this.aj == null ? -1 : this.aj.i();
        super.v((i == 300 || i == 40 || i == 38 || this.al != b.None) ? 8 : 0);
        q();
    }

    private void am() {
        if (J()) {
            I();
            ExecuteService.a((Context) this, new c[]{this.aj}, TaskerAppWidgetConfigure.a(this), true);
        }
    }

    private void a(View view, final EditText editText) {
        cl clVar = new cl(this, view);
        int[] a2 = bu.a();
        for (int i = 0; i < a2.length; i++) {
            clVar.a(i, a2[i]);
        }
        clVar.a(new cl.c() {
            @Override
            public void onDismiss(cl clVar2) {
                if (clVar2.h()) {
                    return;
                }
                gs.b(editText, bu.a(clVar2.g()));
            }
        }).show();
    }

    private n.b an() {
        return n.b.values()[l(0)];
    }

    private void a(final String str, final EditText editText) {
        this.f10856a.a(new com.joaomgcd.taskerm.util.b() {
            @Override
            public final void call(Object obj) {
                ActionEdit.this.b(str, editText, (HashMap) obj);
            }
        });
    }

    public void b(String str, final EditText editText, HashMap hashMap) {
        final ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        ArrayList arrayList3 = new ArrayList();
        ArrayList arrayList4 = new ArrayList();
        bg.c a2 = bg.a(ao(), str, bg.a.Both, (gt) null, (Bundle) null, (Class<?>) null, (HashMap<String, String>) hashMap, "listFuncs");
        bg.a(ao(), a2, arrayList, arrayList3, arrayList4, arrayList2, (HashMap<String, String>) hashMap);
        int g = go.g(this);
        int a3 = go.a(this, R.attr.colourRed, "ActionEdit/sjf2");
        if (arrayList.isEmpty()) {
            gs.a(this, R.string.f_nothing_found, new Object[0]);
            return;
        }
        final String[] strArr = new String[arrayList.size()];
        int[] iArr = new int[arrayList.size()];
        for (int i = 0; i < arrayList.size(); i++) {
            String str2 = null;
            if (((String) arrayList.get(i)).equals(a2.f12196a)) {
                arrayList.set(i, "new");
                if (a2.f12201f != null) {
                    str2 = bg.f(a2.f12201f);
                }
            }
            strArr[i] = bg.a((Class<?>) arrayList3.get(i), (List<Class<?>>) arrayList4.get(i), str2);
            iArr[i] = (((Integer) arrayList2.get(i)).intValue() & 1) > 0 ? g : a3;
        }
        dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1) {
                    int i2 = message.getData().getInt("index");
                    String str3 = ((String) arrayList.get(i2)) + "\n" + strArr[i2];
                    gs.b(editText, str3);
                    ActionEdit.this.aj.b(2, str3);
                    for (int i3 = 3; i3 <= 9; i3++) {
                        ActionEdit.this.A(i3);
                        if (ActionEdit.this.f11152d[i3].getVisibility() != 0) {
                            gs.b(ActionEdit.this.f11152d[i3], "");
                        } else if (i3 == 3) {
                            ActionEdit.this.f11152d[3].requestFocus();
                        }
                    }
                    ActionEdit.this.A(0);
                    if (ActionEdit.this.f11152d[0].getVisibility() == 0) {
                        ActionEdit.this.f11152d[0].requestFocus();
                    } else {
                        gs.b(ActionEdit.this.f11152d[0], "");
                    }
                }
            }
        }, R.string.pl_function).a(arrayList).b(strArr).a(iArr).a(this);
    }

    private void a(final EditText editText, final boolean z) {
        String[] b2 = bg.b(ao());
        final ArrayList arrayList = new ArrayList();
        final ArrayList arrayList2 = new ArrayList();
        int[] iArr = new int[b2.length];
        int g = go.g(this);
        int a2 = go.a(this, R.attr.colourRed, "ActionEdit/sjfc2");
        int length = b2.length;
        int i = 0;
        int i2 = 0;
        while (i < length) {
            String str = b2[i];
            int lastIndexOf = str.lastIndexOf(46);
            arrayList.add(str.substring(lastIndexOf + 1, str.length()));
            arrayList2.add(str.substring(0, lastIndexOf));
            int i3 = i2 + 1;
            iArr[i2] = bw.a(bg.g(str)[0]) == null ? a2 : g;
            i++;
            i2 = i3;
        }
        if (arrayList.size() == 0) {
            gs.a(this, R.string.f_nothing_found, new Object[0]);
        } else {
            dp.a(this, new Handler() {
                @Override
                public void handleMessage(Message message) {
                    if (message.what == 1) {
                        int i4 = message.getData().getInt("index");
                        String str2 = ((String) arrayList2.get(i4)) + "." + ((String) arrayList.get(i4));
                        String f2 = bg.f(str2);
                        if (f2 != null) {
                            str2 = f2;
                        }
                        if (z) {
                            String[] k = bg.k(gs.a((TextView) editText));
                            gs.b(editText, bg.m(str2) + " " + k[1]);
                            return;
                        }
                        gs.b(editText, str2);
                        gs.b(ActionEdit.this.f11152d[2], "");
                        for (int i5 = 3; i5 <= 9; i5++) {
                            gs.b(ActionEdit.this.f11152d[i5], "");
                        }
                        gs.b(ActionEdit.this.f11152d[2], "");
                        return;
                    }
                    if (message.what == 2) {
                        int i6 = message.getData().getInt("index");
                        ActionEdit.this.b(bg.d(bg.c(((String) arrayList2.get(i6)) + "." + ((String) arrayList.get(i6)))), 57);
                    }
                }
            }, R.string.pl_class).a(R.string.tip_dialog_long_click).a(arrayList).b(arrayList2).a(iArr).a(this);
        }
    }

    private void a(final int i, final int i2, final boolean z) {
        this.f10856a.a(new com.joaomgcd.taskerm.util.b() {
            @Override
            public final void call(Object obj) {
                ActionEdit.this.a(z, i2, i, (HashMap) obj);
            }
        });
    }

    public void a(boolean z, final int i, int i2, HashMap hashMap) {
        int i3;
        String f2;
        gt gtVar = bg.f12182a;
        int size = hashMap == null ? 0 : hashMap.size();
        List<String> b2 = gtVar.b();
        String[] a2 = z ? bg.a() : new String[0];
        final String[] strArr = new String[size + b2.size() + a2.length];
        String[] strArr2 = new String[strArr.length];
        if (hashMap != null) {
            i3 = 0;
            for (Map.Entry entry : hashMap.entrySet()) {
                if (gx.o((String) entry.getKey())) {
                    strArr[i3] = (String) entry.getKey();
                    strArr2[i3] = bg.f((String) entry.getValue());
                    i3++;
                } else {
                    b2.add(((String) entry.getKey()) + '\n' + ((String) entry.getValue()));
                }
            }
        } else {
            i3 = 0;
        }
        Collections.sort(b2);
        int i4 = 0;
        while (i4 < b2.size()) {
            String str = b2.get(i4);
            if (str.contains("\n")) {
                String[] split = str.split("\\n");
                String str2 = split[0];
                f2 = split[1];
                str = str2;
            } else {
                Class<?> d2 = gtVar.d(b2.get(i4));
                f2 = d2 != null ? bg.f(d2.getName()) : "";
            }
            strArr[i3] = str;
            strArr2[i3] = f2;
            i4++;
            i3++;
        }
        Class<?>[] b3 = bg.b();
        int i5 = 0;
        while (i5 < a2.length) {
            strArr[i3] = a2[i5];
            strArr2[i3] = bg.f(b3[i5].getName());
            i5++;
            i3++;
        }
        if (strArr.length == 0) {
            gs.a(this, R.string.f_nothing_found, new Object[0]);
        } else {
            dp.a(this, new Handler() {
                @Override
                public void handleMessage(Message message) {
                    if (message.what == 1) {
                        String str3 = strArr[message.getData().getInt("index")];
                        EditText a3 = i == -1 ? ActionEdit.this.a(ActionEdit.this.aj) : ActionEdit.this.f11152d[i];
                        if (a3 != null) {
                            gs.b(a3, str3);
                        }
                    }
                }
            }, i2).a(strArr).b(strArr2).a(this);
        }
    }

    private void b(final String str, final EditText editText) {
        this.f10856a.a(new com.joaomgcd.taskerm.util.b() {
            @Override
            public final void call(Object obj) {
                ActionEdit.this.a(str, editText, (HashMap) obj);
            }
        });
    }

    public void a(String str, final EditText editText, HashMap hashMap) {
        LinkedList linkedList = new LinkedList();
        LinkedList linkedList2 = new LinkedList();
        bg.c a2 = bg.a(ao(), str, bg.a.Both, (gt) null, (Bundle) null, (Class<?>) null, (HashMap<String, String>) hashMap, "lookupFields");
        if (a2.f12196a != null) {
            bg.a(ao(), a2, linkedList, linkedList2);
        }
        if (linkedList.isEmpty()) {
            gs.a(this, R.string.f_nothing_found, new Object[0]);
            return;
        }
        String[] strArr = new String[linkedList.size()];
        for (int i = 0; i < strArr.length; i++) {
            strArr[i] = bg.f(((Class) linkedList2.get(i)).getName());
        }
        dp.a(this, new Handler() {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 1) {
                    String string = message.getData().getString("text");
                    if (!editText.getText().toString().endsWith(".")) {
                        string = "." + string;
                    }
                    editText.append(string);
                }
            }
        }, R.string.pl_field).a(linkedList).b(strArr).a(this);
    }

    private String d(String str) {
        String[] s = bg.s(str);
        if (s != null) {
            return bg.d(s[1], false);
        }
        return null;
    }

    private String[] e(String str) {
        return bg.r(str);
    }

    public int c(int i) {
        if (i == 566) {
            return 4;
        }
        if (i == 457) {
            return ds.b(l(0));
        }
        return ds.b(l(0));
    }

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

    private boolean g(int i, int i2) {
        if (i == 188) {
            return true;
        }
        return i == 133 && i2 == 1 && l(0) == 26;
    }

    @Override
    public void a(int i) {
        A(i);
    }

    private void a(bz bzVar) {
        this.ad.setMultiChoiceModeListener(new co(this, bzVar, this.R, null, null) {
            @Override
            public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
                super.onCreateActionMode(actionMode, menu);
                return ActionEdit.this.a(actionMode);
            }

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

            @Override
            public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
                switch (menuItem.getItemId()) {
                    case 2:
                        ActionEdit.this.a(d().k());
                        ActionEdit.this.v();
                        return true;
                    case 3:
                        a(ActionEdit.this.ad);
                        return true;
                    default:
                        return true;
                }
            }

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

    public void I(int i) {
        this.l = i;
        Intent intent = new Intent(this, (Class<?>) ListItemEdit.class);
        boolean z = false;
        if (i != -1) {
            intent.putExtra("item", this.aj.x().T(i).a(0).c());
        }
        ef x = this.aj.x();
        if (x != null && x.aO()) {
            z = true;
        }
        intent.putExtra("showSelect", z);
        intent.putExtra("imageSelectFlags", n.R(this.aj.i()) ? 36 : 383);
        startActivityForResult(intent, 63);
    }

    public static class a extends Handler {

        WeakReference<ActionEdit> f10906a;

        int f10907b;

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

        @Override
        public void handleMessage(Message message) {
            ActionEdit actionEdit = this.f10906a.get();
            switch (message.what) {
                case 1:
                    bo.a("ActionEdit", "ae exit");
                    gs.a(actionEdit, R.string.button_label_ok, new Object[0]);
                    actionEdit.ae();
                    return;
                case 2:
                    Bundle data = message.getData();
                    int i = data.getInt("l");
                    gs.a(actionEdit, data.getString("m").replaceFirst("\\s*Uncaught\\s*SyntaxError:\\s*", ""), new Object[0]);
                    gs.a(actionEdit.f11152d[this.f10907b], i);
                    actionEdit.ae();
                    return;
                default:
                    return;
            }
        }
    }
}