导航菜单

页面标题

页面副标题

Tasker v6.5.11 - Settings.java 源代码

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

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


package net.dinglisch.android.taskerm;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.joaomgcd.oldtaskercompat.fcm.ServiceFCM;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityConfigureNotificationChannel;
import com.joaomgcd.taskerm.genericaction.GenericActionActivityPickFile;
import com.joaomgcd.taskerm.spawn.RFactory;
import com.joaomgcd.taskerm.util.ExtensionsContextKt;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.Settings;
import net.dinglisch.android.taskerm.g6;
import net.dinglisch.android.taskerm.kp;
import net.dinglisch.android.taskerm.mh;
import net.dinglisch.android.taskerm.tn;
import net.dinglisch.android.taskerm.tp;
import net.dinglisch.android.taskerm.yd;
import net.dinglisch.android.taskerm.zh;

public class Settings extends MyActivity implements View.OnClickListener, SensorEventListener, SeekBar.OnSeekBarChangeListener, AdapterView.OnItemSelectedListener, pf.a {
    private static final int[] m1 = {2131891206, 2131889089, 2131889090, 2131891121};
    private static final int[] n1 = {2131891113, 2131888748};
    private static final int[] o1 = {2131888961, 2131888960, 2131888901, 2131888900, 2131888831, 2131889091, 2131891153};
    private static final int[] p1 = {2131297550, 2131297554, 2131297553, 2131297547};
    private static final int[] q1 = {2131494235, 2131494233, 2131494231, 2131494232};
    private static final int[] r1 = {2131890547, 2131890546, 2131890544, 2131890545};
    private static final int[] s1 = {2131297403, 2131297402, 2131297409, 2131297408, 2131297404, 2131297405, 2131297406, 2131297407, 2131297401, 2131297399, 2131297400};
    private static final int[] t1 = {2131297400, 2131296889};
    private static final int[] u1 = {2131296417, 2131296757, 2131296759, 2131297216, 2131296960, 2131297481, 2131296423, 2131297403, 2131297070, 2131297068, 2131297407, 2131297406, 2131297034, 2131296796, 2131297702, 2131296443, 2131296940, 2131297066, 2131296942, 2131297193, 2131297195, 2131297704, 2131296445, 2131296375, 2131296926, 2131296922, 2131296924, 2131297218, 2131297112, 2131296597, 2131296812, 2131297074, 2131296885};
    private static final int[] v1 = {2131297015, 2131296914, 2131297033, 2131297065, 2131296939, 2131296941, 2131297701, 2131297703, 2131296442, 2131296444, 2131297192, 2131297194, 2131296921, 2131296925, 2131296923};
    private static final int[] w1;
    private static int x1;
    private final int[] A;
    private Spinner A0;
    private final int[] B;
    private Spinner B0;
    private final int[] C;
    private CheckBox C0;
    private final int[] D;
    private EditText D0;
    int E;
    private EditText E0;
    int F;
    private EditText F0;
    int G;
    private EditText G0;
    int H;
    private EditText H0;
    int I;
    private EditText I0;
    int J;
    private EditText J0;
    private RelativeLayout K;
    private EditText K0;
    private zh L;
    private EditText L0;
    private Bundle M;
    private EditText M0;
    private BroadcastReceiver N;
    private EditText N0;
    private ProgressDialog O;
    private EditText O0;
    private Button P;
    private EditText P0;
    private ImageButton Q;
    private EditText Q0;
    private ImageButton R;
    private EditText R0;
    private Button S;
    private EditText S0;
    private ImageButton T;
    private EditText[] T0;
    private Button U;
    private EditText[] U0;
    private boolean V;
    private EditText[] V0;
    private SharedPreferences W;
    private int[] W0;
    private boolean X;
    private int[] X0;
    private ImageView Y;
    private int[] Y0;
    private String Z;
    private int[] Z0;
    private Button a0;
    private int[] a1;
    private SeekBar b0;
    private int[] b1;
    private SeekBar c0;
    private int[] c1;
    private SeekBar d0;
    private CheckBox[] d1;
    private ImageButton e0;
    private View[] e1;
    private int f0;
    private float f1;
    private TextView g0;
    private long g1;
    private TextView h0;
    private SensorManager h1;
    private TextView i0;
    private ViewPager i1;
    private Spinner j0;
    private n j1;
    private Spinner k0;
    private com.joaomgcd.taskerm.helper.e<Settings> k1;
    private Spinner l0;
    private AtomicBoolean l1;
    private Spinner m0;
    private Spinner n0;
    private Spinner o0;
    private Spinner p0;
    private Spinner q0;
    private Spinner r0;
    private Spinner s0;
    private Spinner t0;
    private Spinner u0;
    private final com.joaomgcd.taskerm.settings.o0 v;
    private Spinner v0;
    private final int[] w;
    private Spinner w0;
    private final boolean[] x;
    private Spinner x0;
    private final String[] y;
    private Spinner y0;
    private final int[] z;
    private Spinner z0;

    class a implements TextWatcher {
        a() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
            Settings.x1 |= 2;
        }

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

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

    class b implements mh.f {
        final EditText a;

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

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

    class c extends Handler {
        c() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                Settings.this.f0 = message.getData().getInt("colourIndex");
                Settings.this.g3();
                Settings.x1 |= 128;
                lp.d(Settings.this, 2131890909);
            }
        }
    }

    class d extends Handler {
        d() {
        }

        @Override
        public void handleMessage(Message message) {
            Settings.this.l1.set(false);
            if (message.what != 0) {
                Settings.this.finish();
            } else {
                Settings.this.n3();
            }
        }
    }

    class e implements View.OnClickListener {
        e() {
        }

        @Override
        public void onClick(View view) {
            Settings.this.z3();
        }
    }

    class f implements View.OnClickListener {
        final int i;

        f(int i) {
            this.i = i;
        }

        @Override
        public void onClick(View view) {
            Settings settings = Settings.this;
            settings.H3(view, settings.T0[this.i]);
        }
    }

    class g implements View.OnClickListener {
        final int i;

        g(int i) {
            this.i = i;
        }

        @Override
        public void onClick(View view) {
            Settings settings = Settings.this;
            settings.H3(view, settings.U0[this.i]);
        }
    }

    class h implements View.OnClickListener {
        final int i;

        h(int i) {
            this.i = i;
        }

        @Override
        public void onClick(View view) {
            Settings settings = Settings.this;
            settings.H3(view, settings.V0[this.i]);
        }
    }

    class i extends Handler {
        i() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                Settings settings = Settings.this;
                settings.startActivityForResult(Settings.G1(settings), -1);
            }
        }
    }

    class j extends BroadcastReceiver {
        j() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            com.joaomgcd.taskerm.util.f1.e(intent);
            Settings.this.q1();
            Settings.this.m3();
        }
    }

    class k extends Handler {
        k() {
        }

        @Override
        public void handleMessage(Message message) {
            Settings.this.V = true;
            Settings.this.e3();
        }
    }

    class l implements zh.j {
        l() {
        }

        @Override
        public void a(int i, int i2, boolean z) {
        }

        @Override
        public void b(boolean z) {
        }

        @Override
        public void c(int i) {
        }

        @Override
        public void d(int i) {
        }

        @Override
        public void e(int i, int i2, int i3, int i4) {
        }

        @Override
        public boolean f(int i, int i2, boolean z) {
            Settings.this.i1.setCurrentItem(i2);
            return true;
        }

        @Override
        public boolean g(int i) {
            return false;
        }
    }

    private enum m {
        UI,
        Monitor,
        Action,
        Misc
    }

    public class n extends PagerAdapter implements ViewPager.OnPageChangeListener {
        private ViewPager a;
        private Context b;

        public n(Activity activity, ViewPager viewPager) {
            this.b = activity;
            this.a = viewPager;
            viewPager.setAdapter(this);
            this.a.setOnPageChangeListener(this);
        }

        public void c() {
            Settings.this.findViewById(2131296341).setVisibility(8);
        }

        public void d(Boolean bool) throws Exception {
            if (bool.booleanValue() || com.joaomgcd.taskerm.util.k.n()) {
                Settings.this.k1.r(new Runnable() {
                    @Override
                    public final void run() {
                        Settings.n.this.c();
                    }
                });
            }
        }

        public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
            viewGroup.removeView((ScrollView) obj);
        }

        public void e() {
            this.b = null;
            this.a = null;
            Settings.this.K = null;
            Settings.this.L.M();
            Settings.this.L = null;
        }

        public int getCount() {
            return m.values().length;
        }

        public Object instantiateItem(ViewGroup viewGroup, int i) {
            ScrollView scrollView = (ScrollView) LayoutInflater.from(this.b).inflate(Settings.q1[i], (ViewGroup) null);
            viewGroup.addView(scrollView, 0);
            if (i == 0) {
                Settings.this.O2(scrollView);
                Settings.this.t3();
                Settings.this.findViewById(2131297071).setOnClickListener(Settings.this);
                Settings.this.y0.setOnItemSelectedListener(Settings.this);
                Settings.this.p0.setOnItemSelectedListener(Settings.this);
                Settings.this.l0.setOnItemSelectedListener(Settings.this);
                Settings.this.m0.setOnItemSelectedListener(Settings.this);
                Settings settings = Settings.this;
                settings.J = settings.y0.getSelectedItemPosition();
                Settings settings2 = Settings.this;
                settings2.I = settings2.p0.getSelectedItemPosition();
                Settings settings3 = Settings.this;
                settings3.F = settings3.l0.getSelectedItemPosition();
                Settings settings4 = Settings.this;
                settings4.E = settings4.m0.getSelectedItemPosition();
                Settings.this.m3();
                Settings settings5 = Settings.this;
                settings5.D3(Settings.j1(settings5.W));
            } else if (i == 1) {
                Settings.this.N2(scrollView);
                Settings.this.p3();
                Settings.this.findViewById(2131297122).setOnClickListener(Settings.this);
                Settings settings6 = Settings.this;
                settings6.H = settings6.k0.getSelectedItemPosition();
                Settings.this.k0.setOnItemSelectedListener(Settings.this);
                if ((Settings.this.getIntent().getIntExtra("flags", 0) & 1) > 0) {
                    Settings.this.P.setFocusable(true);
                    Settings.this.P.setFocusableInTouchMode(true);
                    Settings.this.P.requestFocus();
                }
                if (dq.g() < 17) {
                    Settings.this.findViewById(2131297176).setVisibility(8);
                }
                Settings.this.k1.R(s5.w(), new oi.d() {
                    @Override
                    public final void accept(Object obj) {
                        Settings.n.this.d((Boolean) obj);
                    }
                });
                if (!pp.d(Settings.this)) {
                    Settings.this.findViewById(2131297495).setVisibility(8);
                }
                if (!yd.c.b()) {
                    Settings.this.findViewById(2131296273).setVisibility(8);
                }
                Settings settings7 = Settings.this;
                boolean T3 = Settings.T3(settings7.W);
                Settings settings8 = Settings.this;
                settings7.F3(T3, Settings.R3(settings8, settings8.W));
                Settings settings9 = Settings.this;
                settings9.B3(Settings.j1(settings9.W));
            } else if (i == 2) {
                Settings.this.L2(scrollView);
                Settings.this.h3();
                Settings.this.findViewById(2131296377).setOnClickListener(Settings.this);
            } else if (i == 3) {
                Settings.this.M2(scrollView);
                Settings.this.o3();
                Settings settings10 = Settings.this;
                settings10.G = settings10.B0.getSelectedItemPosition();
                Settings.this.B0.setOnItemSelectedListener(Settings.this);
            }
            Settings.this.l3(scrollView);
            Settings.this.j3(scrollView);
            Settings.this.w3(scrollView);
            Settings.this.v3(scrollView);
            Settings.this.x3(scrollView);
            Settings.this.i3();
            Settings.this.v.E(Settings.this.W);
            return scrollView;
        }

        public boolean isViewFromObject(View view, Object obj) {
            return view == obj;
        }

        public void onPageScrollStateChanged(int i) {
        }

        public void onPageScrolled(int i, float f, int i2) {
        }

        public void onPageSelected(int i) {
            if (Settings.this.L.r() != i) {
                Settings.this.L.S(i);
            }
        }
    }

    static {
        w1 = new int[]{2131890505, 2131890421, dq.P1() ? 2131890510 : 2131890509, 2131890513, 2131890426, 2131890428, 2131890555, 2131890557, 2131890376, 2131890378, 2131890529, 2131890531, 2131890422, 2131890424, 2131890423};
        x1 = 0;
    }

    public Settings() {
        com.joaomgcd.taskerm.settings.o0 b2 = com.joaomgcd.taskerm.settings.q0.b(this);
        this.v = b2;
        int[] d2 = com.joaomgcd.taskerm.settings.p0.d(b2);
        this.w = d2;
        this.x = com.joaomgcd.taskerm.settings.p0.c(b2);
        this.y = com.joaomgcd.taskerm.settings.p0.e(b2);
        this.z = com.joaomgcd.taskerm.settings.p0.b(b2);
        this.A = com.joaomgcd.taskerm.settings.p0.a(b2);
        this.B = com.joaomgcd.taskerm.settings.p0.h(b2);
        this.C = com.joaomgcd.taskerm.settings.p0.f(b2);
        this.D = com.joaomgcd.taskerm.settings.p0.g(b2);
        this.M = null;
        this.N = null;
        this.O = null;
        this.X = false;
        this.f0 = -1;
        this.T0 = new EditText[3];
        this.U0 = new EditText[yi.h()];
        this.V0 = new EditText[wm.f()];
        this.W0 = new int[]{2131296798, 2131296802, 2131296800};
        this.X0 = new int[]{2131296797, 2131296801, 2131296799};
        this.Y0 = new int[]{2131297289, 2131297293, 2131297291};
        this.Z0 = new int[]{2131297288, 2131297292, 2131297290};
        this.a1 = new int[]{2131296383, 2131296387, 2131296385, 2131296380};
        this.b1 = new int[]{2131296382, 2131296386, 2131296384, 2131296379};
        this.c1 = new int[]{2131297033, 2131296442, 2131297701, 2131296939, 2131297065, 2131296941, 2131297192, 2131297194, 2131297703, 2131296444, 2131296921, 2131296923, 2131296925};
        this.d1 = new CheckBox[d2.length];
        this.e1 = new View[u1.length];
        this.f1 = 0.0f;
        this.h1 = null;
        this.k1 = new com.joaomgcd.taskerm.helper.e<>(this);
        this.l1 = new AtomicBoolean(false);
    }

    public static int A1(Context context) {
        return B1(dq.R0(context));
    }

    private void A3(boolean z) {
        findViewById(2131296378).setVisibility(z ? 0 : 8);
    }

    public static int B1(SharedPreferences sharedPreferences) {
        if (!sharedPreferences.contains("dragMode")) {
            return sharedPreferences.getInt("dragModeNew", 4);
        }
        sharedPreferences.edit().remove("dragMode").commit();
        return 4;
    }

    public static void B2(Activity activity) {
        activity.getWindow().setFlags(1024, 1024);
    }

    public void B3(boolean z) {
        findViewById(2131296375).setVisibility((!MyAccessibilityService.a() || z) ? 8 : 0);
    }

    public static String C1(Context context) {
        return dq.R0(context).getString("googleDriveBackupsAccount", null);
    }

    public void C2() {
        this.C0.setChecked(false);
    }

    private void C3() {
        for (int i2 : t1) {
            findViewById(i2).setVisibility(8);
        }
    }

    public static Intent D1(Context context, boolean z, int i2) {
        Intent intent = new Intent("net.dinglisch.android.tasker.ACTION_OPEN_PREFS");
        intent.setPackage(context.getPackageName());
        if (i2 > 0) {
            intent.putExtra("tno", i2);
        }
        intent.putExtra("launchedExternal", z);
        return intent;
    }

    public lj.e0 D2() {
        pg.w0.p0(new Runnable() {
            @Override
            public final void run() {
                Settings.this.C2();
            }
        });
        return lj.e0.a;
    }

    public void D3(boolean z) {
        findViewById(2131297666).setVisibility((!dq.S1() || z) ? 8 : 0);
    }

    public static String E1(int i2) {
        if (i2 == 0) {
            return "custntaskone";
        }
        if (i2 == 1) {
            return "custntasktwo";
        }
        if (i2 != 2) {
            r7.k("Settings", "gmnctk: bad index: " + i2);
        }
        return "custntaskthree";
    }

    public void E2(CompoundButton compoundButton, boolean z) {
        if (z) {
            com.joaomgcd.taskerm.util.k8.l(this, new xj.a() {
                @Override
                public final Object invoke() {
                    lj.e0 D2;
                    D2 = Settings.this.D2();
                    return D2;
                }
            });
        } else {
            k3(this, null);
        }
    }

    private void E3(boolean z) {
        findViewById(2131297123).setVisibility(z ? 0 : 8);
    }

    public static String F1(Context context, int i2) {
        return dq.R0(context).getString(E1(i2), null);
    }

    private boolean F2() {
        return this.X;
    }

    public void F3(boolean z, boolean z2) {
        int i2 = ((z || z2) && !j1(this.W)) ? 0 : 8;
        findViewById(2131297130).setVisibility(z ? 0 : 8);
        findViewById(2131296796).setVisibility(i2);
    }

    public static Intent G1(Context context) {
        return s1(context.getPackageName());
    }

    public static boolean G2(Context context) {
        return dq.R0(context).getBoolean("lockIconColour", true);
    }

    private void G3() {
        startActivityForResult(ImageSelect.s0(this, 3616), 3);
    }

    public static HashMap<String, List<String>> H1(Context context, HashMap<String, List<String>> hashMap) {
        kp.a y1 = y1(context);
        if (y1 == kp.a.Always || y1 == kp.a.WhenOff) {
            f1(context, hashMap, 2131889394, "android.permission.SCHEDULE_EXACT_ALARM");
        }
        return hashMap;
    }

    public static boolean H2(Context context) {
        return dq.R0(context).getBoolean("notactions", false);
    }

    public void H3(View view, EditText editText) {
        mh mhVar = new mh(this, view);
        ArrayList<tn> K = to.h2(this).K(-2, tn.f.Alpha);
        if (K.size() == 0) {
            dq.j0(this, 2131887867, new Object[0]);
            return;
        }
        Iterator<tn> it = K.iterator();
        while (it.hasNext()) {
            tn next = it.next();
            mhVar.u(next.P0(), next.getName(), next.getIcon(), mh.d.Bottom);
        }
        if (mhVar.y() > 1) {
            mhVar.E(this.W.getInt("lTsk", -1), true, true);
        }
        mhVar.F(new b(editText)).J(TextUtils.TruncateAt.MIDDLE).show();
    }

    public static String I1(Context context, int i2) {
        return z1(context, i2, dq.R0(context).getString(L1(i2), null));
    }

    public static void I2(Context context) {
        Intent D1 = D1(context, false, -1);
        D1.setFlags(268435456);
        context.startActivity(D1);
    }

    private void I3() {
        SensorManager sensorManager = this.h1;
        if (sensorManager != null) {
            sensorManager.unregisterListener(this);
            this.h1 = null;
        }
    }

    public static String J1(Context context, int i2) {
        return z1(context, i2, dq.R0(context).getString(K1(i2), null));
    }

    public void y2(final int i2, String str, String str2, final com.joaomgcd.taskerm.util.c<String> cVar) {
        this.k1.o1(com.joaomgcd.taskerm.util.e5.x(this), new Runnable() {
            @Override
            public final void run() {
                Settings.this.x2(i2, cVar);
            }
        });
    }

    public static void J3(Context context, String str, boolean z) {
        dq.R0(context).edit().putBoolean(str, !r0.getBoolean(str, z)).commit();
    }

    public static String K1(int i2) {
        return "qstcommdoub" + i2;
    }

    private void K2(final int i2, final String str, final String str2, final com.joaomgcd.taskerm.util.c<String> cVar) {
        final Runnable runnable = new Runnable() {
            @Override
            public final void run() {
                Settings.this.y2(i2, str, str2, cVar);
            }
        };
        if (com.joaomgcd.taskerm.signin.a.a(this)) {
            runnable.run();
        } else {
            this.k1.p(new Runnable() {
                @Override
                public final void run() {
                    Settings.this.z2(runnable);
                }
            });
        }
    }

    public static boolean K3(Context context) {
        return dq.R0(context).getBoolean("adbLogcat", false);
    }

    public static String L1(int i2) {
        return "qstcomm" + i2;
    }

    public static boolean L3(Context context) {
        return dq.R0(context).getBoolean("newCellApi", false);
    }

    public static String M1(Context context, int i2) {
        return z1(context, i2, dq.R0(context).getString(N1(i2), null));
    }

    public static boolean M3(Context context) {
        return false;
    }

    public static String N1(int i2) {
        return "qstcommlong" + i2;
    }

    public static boolean N3(Context context) {
        return dq.R0(context).getBoolean("anm", false);
    }

    public static String O1(Context context, int i2) {
        return dq.R0(context).getString(P1(i2), null);
    }

    public void O2(ScrollView scrollView) {
        Button button = (Button) findViewById(2131296516);
        this.a0 = button;
        button.setOnClickListener(this);
        SeekBar seekBar = (SeekBar) findViewById(2131296424);
        this.c0 = seekBar;
        seekBar.setMax(6);
        this.c0.setOnSeekBarChangeListener(this);
        this.i0 = (TextView) findViewById(2131296425);
        SeekBar seekBar2 = (SeekBar) findViewById(2131297275);
        this.b0 = seekBar2;
        seekBar2.setMax(32);
        this.b0.setOnSeekBarChangeListener(this);
        this.h0 = (TextView) findViewById(2131297276);
        Spinner spinner = (Spinner) findViewById(2131297031);
        this.l0 = spinner;
        spinner.setAdapter((SpinnerAdapter) dq.f1(this, RFactory.layout.runlog_headers));
        Spinner spinner2 = (Spinner) findViewById(2131297217);
        this.m0 = spinner2;
        spinner2.setAdapter((SpinnerAdapter) dq.f1(this, 2130903176));
        Spinner spinner3 = (Spinner) findViewById(2131296961);
        this.o0 = spinner3;
        spinner3.setAdapter((SpinnerAdapter) dq.h1(this, vh.s(getResources(), m1)));
        Spinner spinner4 = (Spinner) findViewById(2131296853);
        this.p0 = spinner4;
        spinner4.setAdapter((SpinnerAdapter) dq.h1(this, vh.s(getResources(), o1)));
        Spinner spinner5 = (Spinner) findViewById(2131297628);
        this.y0 = spinner5;
        spinner5.setAdapter((SpinnerAdapter) dq.h1(this, vp.k(this)));
        ImageButton imageButton = (ImageButton) findViewById(2131296277);
        this.e0 = imageButton;
        imageButton.setOnClickListener(new e());
        this.E0 = (EditText) findViewById(2131297069);
    }

    public static boolean O3(Context context) {
        return dq.R0(context).getInt("clock_alarm", g6.i.b) == kp.a.Always.ordinal();
    }

    public static String P1(int i2) {
        return "qstcommprefix" + i2;
    }

    public static void P2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(L1(i2), str).commit();
    }

    public static boolean P3(Context context) {
        return dq.R0(context).getInt("clock_alarm", g6.i.b) == kp.a.WhenOff.ordinal();
    }

    public static String Q1(Context context, int i2) {
        return dq.R0(context).getString(Y1(i2), null);
    }

    public static void Q2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(K1(i2), str).commit();
    }

    public static boolean Q3(Context context) {
        return dq.R0(context).getBoolean("googleDriveBackups", false);
    }

    public static String R1(Context context, int i2, Bundle bundle) {
        return kq.N(context, dq.R0(context).getString(S1(i2), null), bundle);
    }

    public static void R2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(N1(i2), str).commit();
    }

    public static boolean R3(Context context, SharedPreferences sharedPreferences) {
        if (com.joaomgcd.taskerm.util.p.f(context)) {
            return true;
        }
        return sharedPreferences.getBoolean("mFn", true);
    }

    public static String S1(int i2) {
        return "qstico" + i2;
    }

    public static void S2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(P1(i2), str).commit();
    }

    public static boolean S3(Context context) {
        return T3(dq.R0(context));
    }

    public static String T1(Context context, int i2, Bundle bundle) {
        return kq.N(context, dq.R0(context).getString(U1(i2), null), bundle);
    }

    public static void T2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(S1(i2), str).commit();
    }

    public static boolean T3(SharedPreferences sharedPreferences) {
        return sharedPreferences.getBoolean("mSi", true);
    }

    public static String U1(int i2) {
        return "qstlab" + i2;
    }

    public static void U2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(U1(i2), str).commit();
    }

    public static boolean U3(Context context) {
        if (dq.S1()) {
            return j1(dq.R0(context)) ? g6.i.b.a : dq.R0(context).getBoolean("hardwareAccel", g6.i.b.a);
        }
        return true;
    }

    public static String V1(Context context, int i2) {
        return dq.R0(context).getString(a2(i2), null);
    }

    public static void V2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(X1(i2), str).commit();
    }

    public static boolean V3(Context context) {
        return dq.R0(context).getBoolean("sigmotion", false);
    }

    public static String W1(Context context, int i2, Bundle bundle) {
        return kq.N(context, dq.R0(context).getString(X1(i2), null), bundle);
    }

    public static void W2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(u1(i2), str).commit();
    }

    public static String X1(int i2) {
        return "qstst" + i2;
    }

    public static void X2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(Y1(i2), str).commit();
    }

    public static String Y1(int i2) {
        return "qstdc" + i2;
    }

    public static void Y2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(a2(i2), str).commit();
    }

    public static String Z1(int i2) {
        return "qst" + i2;
    }

    public static void Z2(Context context, int i2, String str) {
        dq.R0(context).edit().putString(Z1(i2), str).commit();
    }

    public static String a2(int i2) {
        return "qstlc" + i2;
    }

    public static void a3(Context context, int i2, int i3) {
        dq.R0(context).edit().putInt(d2(i2), i3).commit();
    }

    public static String b2(Context context, int i2) {
        return dq.R0(context).getString(Z1(i2), null);
    }

    public static void b3(Context context, int i2, Integer num, Integer num2, Integer num3) {
        dq.R0(context).edit().putString(f2(i2), kg.a1.d(num, num2, num3)).commit();
    }

    public static int c2(Context context, int i2) {
        return dq.R0(context).getInt(d2(i2), yi.a().ordinal());
    }

    public static void c3(final Activity activity) {
        final int i2 = 0;
        int i3 = dq.R0(activity).getInt("uiori", 0);
        if (i3 == 1) {
            i2 = 1;
        } else if (i3 != 2) {
            i2 = 2;
        }
        pg.w0.c0(new Runnable() {
            @Override
            public final void run() {
                com.joaomgcd.taskerm.util.x2.Y4(activity, i2, "requestPreferredOrientation");
            }
        }).h();
    }

    public static String d2(int i2) {
        return "qsts" + i2;
    }

    public static void d3(final Activity activity) {
        int i2 = dq.R0(activity).getInt("hideStatusBar", 1);
        if (i2 == 3 || ((i2 == 1 && (activity.getClass() == SceneEdit.class || activity.getClass() == SceneEditElement.class)) || (i2 == 2 && dq.Q1(activity)))) {
            pg.w0.c0(new Runnable() {
                @Override
                public final void run() {
                    Settings.B2(activity);
                }
            }).h();
        }
    }

    public static kg.a1 e2(Context context, int i2) {
        return kg.y0.b(dq.R0(context).getString(f2(i2), null));
    }

    public boolean e3() {
        boolean z = false;
        if (!q3(this.W)) {
            if (this.V || this.W.getString("lcD", "").length() <= 0) {
                r3(this.W);
                setResult(-1, null);
                finish();
                z = true;
            } else {
                TextBoxDialogFragment.F(this, new k(), 2131887461, vh.g(this, 2131887151, new Object[0]), 2131886891, 2131886867, -1, 196).E(this);
            }
        }
        if (z) {
            i1();
        }
        return z;
    }

    private static void f1(Context context, HashMap<String, List<String>> hashMap, int i2, String... strArr) {
        StringBuilder sb = new StringBuilder();
        sb.append(vh.g(context, 2131891241, new Object[0]));
        sb.append(" ");
        sb.append(context.getString(i2));
        String sb2 = sb.toString();
        for (String str : strArr) {
            dq.m(hashMap, str, sb2);
        }
    }

    public static String f2(int i2) {
        return "qstexcont" + i2;
    }

    public static boolean f3(Context context) {
        return dq.R0(context).getBoolean("saveMemory", true);
    }

    public static boolean g1(Context context) {
        return dq.R0(context).getBoolean("aExt", false);
    }

    public static String[] g2(Resources resources) {
        return vh.s(resources, r1);
    }

    public void g3() {
        int i2 = this.f0;
        up.x(this, this.e0, i2 == -1 ? up.a(this) : tp.a(this, i2));
    }

    public static boolean h1(Context context) {
        return dq.R0(context).getBoolean("asactions", true);
    }

    public static tp.a h2(SharedPreferences sharedPreferences) {
        if (!sharedPreferences.contains("theme")) {
            tp.a aVar = tp.a.values()[sharedPreferences.getInt("themeMaterial", g6.i.b.a.a)];
            return (aVar == tp.a.MaterialYou && com.joaomgcd.taskerm.util.k.l()) ? tp.a.Auto : aVar;
        }
        int i2 = sharedPreferences.getInt("theme", 3);
        sharedPreferences.edit().remove("theme").commit();
        return i2 != 0 ? i2 != 1 ? i2 != 2 ? tp.a.LightDarkAB : tp.a.Light : tp.a.Dark : tp.a.DefaultDark;
    }

    private void i1() {
        if ((x1 & 128) > 0) {
            to.h2(this).E0(this);
        }
        if ((x1 & 16) > 0) {
            w6.f(getBaseContext(), this.W);
        }
        if ((x1 & 64) > 0) {
            to.s4(getResources(), this.W.getInt("lph", 0));
        }
        if ((x1 & 4) > 0) {
            r7.t(this.W);
        }
        if ((x1 & 2) > 0) {
            if (F2()) {
                MonitorService.j8(this, true);
            } else {
                MonitorService.z8(this, true);
            }
        }
        yi.k();
        wm.i(this, true);
        this.k1.b1(2131296937, "gcsa");
        this.k1.b1(2131296935, "gcfb");
        this.k1.c1();
    }

    private String[] i2() {
        return j2(getResources());
    }

    public void i3() {
        int i2 = 0;
        while (true) {
            CheckBox[] checkBoxArr = this.d1;
            if (i2 >= checkBoxArr.length) {
                break;
            }
            CheckBox checkBox = checkBoxArr[i2];
            if (checkBox != null && !checkBox.isChecked()) {
                checkBox.setOnCheckedChangeListener(null);
                checkBox.setChecked(this.W.getBoolean(this.y[i2], this.x[i2]));
            }
            i2++;
        }
        CheckBox checkBox2 = this.C0;
        if (checkBox2 != null) {
            checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    Settings.this.E2(compoundButton, z);
                }
            });
        }
        CheckBox checkBox3 = this.d1[27];
        if (checkBox3 != null) {
            checkBox3.setChecked(hg.r1.m(this, "M"));
        }
    }

    public static boolean j1(SharedPreferences sharedPreferences) {
        return false;
    }

    public static String[] j2(Resources resources) {
        return vh.s(resources, new int[]{2131886889, 2131889092, 2131886907, 2131889095});
    }

    private void k1(Bundle bundle, SharedPreferences sharedPreferences) {
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.clear();
        for (String str : bundle.keySet()) {
            Object obj = bundle.get(str);
            if (obj instanceof Boolean) {
                edit.putBoolean(str, ((Boolean) obj).booleanValue());
            } else if (obj instanceof Float) {
                edit.putFloat(str, ((Float) obj).floatValue());
            } else if (obj instanceof Integer) {
                edit.putInt(str, ((Integer) obj).intValue());
            } else if (obj instanceof Long) {
                edit.putLong(str, ((Long) obj).longValue());
            } else if (obj instanceof String) {
                edit.putString(str, (String) obj);
            } else {
                r7.k("Settings", "unhandled type set:string");
            }
        }
        edit.commit();
    }

    public static void k2(Context context, String str, String str2) {
        for (int i2 = 0; i2 < 3; i2++) {
            if (str.equals(F1(context, i2))) {
                dq.R0(context).edit().putString(E1(i2), str2).commit();
            }
        }
        for (int i3 = 0; i3 < yi.h(); i3++) {
            if (str.equals(b2(context, i3))) {
                Z2(context, i3, str2);
            }
        }
        for (int i4 = 0; i4 < wm.f(); i4++) {
            if (str.equals(v1(context, i4))) {
                W2(context, i4, str2);
            }
        }
    }

    public static void k3(Context context, String str) {
        dq.R0(context).edit().putString("googleDriveBackupsAccount", str).commit();
    }

    private void l1() {
        SensorManager sensorManager = (SensorManager) oi.d(this, "sensor", "Settings", "cal");
        this.h1 = sensorManager;
        if (sensorManager == null) {
            dq.a0(this, 2131887720, new Object[0]);
            return;
        }
        Sensor defaultSensor = sensorManager.getDefaultSensor(1);
        if (defaultSensor == null) {
            this.h1 = null;
            dq.a0(this, 2131887856, vh.g(this, 2131891112, new Object[0]));
        } else {
            if (!this.h1.registerListener(this, defaultSensor, 0)) {
                dq.a0(this, 2131887856, vh.g(this, 2131891112, new Object[0]));
                return;
            }
            com.joaomgcd.taskerm.util.x2.Y4(this, 5, "calibrateGestures");
            this.g1 = System.currentTimeMillis();
            dq.h0(this, 2131887756, new Object[0]);
        }
    }

    private void l2() {
        I3();
        EditText editText = this.Q0;
        if (editText == null) {
            r7.G("Settings", "gestureEnd: no radius edit field");
        } else {
            editText.setText(Float.toString(this.f1 / 4.0f));
        }
        dq.j0(this, 2131888716, new Object[0]);
        SharedPreferences sharedPreferences = this.W;
        if (sharedPreferences == null) {
            r7.G("Settings", "gestureEnd: no settings");
        } else {
            sharedPreferences.edit().putFloat("accMax", this.f1).commit();
        }
        x1 |= 2;
    }

    private void m1() {
        if (this.l1.getAndSet(true)) {
            return;
        }
        String action = getIntent().getAction();
        if (action == null || !action.equals("net.dinglisch.android.tasker.ACTION_OPEN_PREFS")) {
            sp.o0("Settings checkShowGateLock");
        }
        if (sp.r0(this)) {
            sp.t0(this, new d()).E(this);
        } else {
            this.l1.set(false);
            n3();
        }
    }

    public void m3() {
        String str = vh.i(this, RFactory.layout.runlog_item)[this.l0.getSelectedItemPosition()];
        File v0 = HTMLView.v0(str);
        this.a0.setVisibility((v0 == null || new File(v0, HTMLView.u0(getResources(), str)).exists()) ? 8 : 0);
    }

    public static boolean n1(Activity activity, boolean z, Handler handler) {
        if (dq.g() < 27 || lp.g(activity, 2131887292) || z) {
            return false;
        }
        TextBoxDialogFragment.F(activity, handler, 2131887515, vh.g(activity, 2131887292, new Object[0]), 2131886891, 2131891241, -1, 0).E(activity);
        lp.c(activity, 2131887292);
        return true;
    }

    private void n2() {
        int intExtra;
        if (r1()) {
            intExtra = 1;
        } else {
            intExtra = getIntent().getIntExtra("tno", -1);
            if (intExtra == -1) {
                intExtra = getSharedPreferences(g6.j, 0).getInt("slTab", 0);
            }
        }
        this.i1.setCurrentItem(intExtra);
    }

    public void n3() {
        EditText editText = this.E0;
        if (editText == null) {
            return;
        }
        editText.setText(this.W.getString("lcD", ""));
    }

    private void o1() {
        if (this.Z.equals("icon_transparent") && this.k0.getSelectedItemPosition() == 0 && dq.g() < 16) {
            lp.d(this, 2131890963);
        }
    }

    public static void o2(Context context) {
    }

    public static void p1(SharedPreferences sharedPreferences, SharedPreferences sharedPreferences2) {
        if (sharedPreferences2.contains("ipnu")) {
            return;
        }
        if (sharedPreferences.contains("ipn")) {
            sharedPreferences.edit().putInt("ipn", net.dinglisch.android.taskerm.g.j0(sharedPreferences.getInt("ipn", 0))).commit();
        }
        sharedPreferences2.edit().putBoolean("ipnu", true).commit();
    }

    private void p2() {
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(2131297548);
        this.K = relativeLayout;
        relativeLayout.removeAllViews();
        this.L = zh.A(this, this.K, 0, 0, tp.x(this));
        if (tp.k(this) == tp.a.Tangerine) {
            this.L.P(2130968984);
        }
        this.L.V(new l());
        this.L.U(12);
        for (int i2 = 0; i2 < p1.length; i2++) {
            this.L.m(this, true);
            this.L.J(i2, vh.g(this, r1[i2], new Object[0]));
            this.L.G(i2);
        }
        this.j1.notifyDataSetChanged();
    }

    public void q1() {
        BroadcastReceiver broadcastReceiver = this.N;
        if (broadcastReceiver != null) {
            unregisterReceiver(broadcastReceiver);
            this.N = null;
        }
        ProgressDialog progressDialog = this.O;
        if (progressDialog != null) {
            progressDialog.dismiss();
            this.O = null;
        }
    }

    public Boolean q2(String str, boolean z) {
        boolean m2 = hg.r1.m(this, str);
        return (z && m2) ? Boolean.TRUE : (z || m2) ? Boolean.FALSE : Boolean.TRUE;
    }

    private boolean q3(android.content.SharedPreferences r25) {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.Settings.q3(android.content.SharedPreferences):boolean");
    }

    private boolean r1() {
        return yi.e().equals(getIntent().getAction());
    }

    public static void r2(CheckBox checkBox, Boolean bool) {
        checkBox.setChecked(bool.booleanValue());
    }

    public static Intent s1(String str) {
        Intent intent = new Intent();
        intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.fromParts("package", str, null));
        return intent;
    }

    public void s2(final String str, final boolean z, final CheckBox checkBox) {
        xj.a aVar = new xj.a() {
            @Override
            public final Object invoke() {
                Boolean q2;
                q2 = Settings.this.q2(str, z);
                return q2;
            }
        };
        try {
            if (((Boolean) aVar.invoke()).booleanValue()) {
                return;
            }
            if (((we.l0) com.joaomgcd.taskerm.dialog.a.o3(this, 2131887515, 2131887291).f()).o()) {
                if (new GenericActionActivityConfigureNotificationChannel(str).run(this).f().b()) {
                    if (((Boolean) aVar.invoke()).booleanValue()) {
                        return;
                    }
                    com.joaomgcd.taskerm.dialog.a.d1(this, 2131887515, 2131887293).f();
                }
            }
        } finally {
            final Boolean valueOf = Boolean.valueOf(hg.r1.m(this, str));
            pg.w0.p0(new Runnable() {
                @Override
                public final void run() {
                    Settings.r2(checkBox, valueOf);
                }
            });
        }
    }

    private void s3() {
        t3();
        p3();
        h3();
        o3();
        i3();
        this.v.E(this.W);
    }

    public static String[] t1(Resources resources) {
        return vh.s(resources, n1);
    }

    public void t2(String str, com.joaomgcd.taskerm.dialog.l lVar) {
        String str2;
        try {
            this.k1.u0(str).h();
            str2 = getString(2131888084);
        } catch (Throwable th2) {
            try {
                String str3 = getString(2131888083) + ": " + th2.getMessage();
                pg.w0.X0(this, th2);
                lVar.c();
                str2 = str3;
            } finally {
                lVar.c();
            }
        }
        com.joaomgcd.taskerm.dialog.a.e1(this, 2131887488, str2).f();
    }

    public static String u1(int i2) {
        return "ast" + i2;
    }

    public void u2(final String str) {
        final com.joaomgcd.taskerm.dialog.l l2 = com.joaomgcd.taskerm.dialog.l.l(this, 2131890790);
        this.k1.p(new Runnable() {
            @Override
            public final void run() {
                Settings.this.t2(str, l2);
            }
        });
    }

    public static boolean u3(Context context, kp.a aVar) {
        return dq.R0(context).edit().putInt("clock_alarm", aVar.ordinal()).commit();
    }

    public static String v1(Context context, int i2) {
        return dq.R0(context).getString(u1(i2), null);
    }

    public void v2(String str) {
        this.k1.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131887487, !ServiceFCM.D(this, str) ? 2131888081 : 2131888082));
    }

    public void v3(ScrollView scrollView) {
        boolean U3 = U3(this);
        int i2 = 0;
        while (true) {
            int[] iArr = this.w;
            if (i2 >= iArr.length) {
                return;
            }
            CheckBox checkBox = (CheckBox) scrollView.findViewById(iArr[i2]);
            if (checkBox != null) {
                if (U3) {
                    checkBox.setLayerType(1, null);
                }
                this.d1[i2] = checkBox;
                checkBox.setOnClickListener(this);
            }
            i2++;
        }
    }

    public static int w1(Context context, SharedPreferences sharedPreferences) {
        int i2 = sharedPreferences.getInt("appcheckMethod", g6.i.a.a(context));
        if (i2 != 0 || MyAccessibilityService.a()) {
            return i2;
        }
        return 1;
    }

    public void w2(int i2, com.joaomgcd.taskerm.util.c cVar, com.joaomgcd.taskerm.util.s6 s6Var) throws Exception {
        if (s6Var.b() && (s6Var instanceof com.joaomgcd.taskerm.util.x6)) {
            String W = com.joaomgcd.taskerm.util.g8.W((Uri) ((com.joaomgcd.taskerm.util.x6) s6Var).d(), this);
            EditText editText = (EditText) findViewById(i2);
            if (editText != null) {
                editText.setText(W);
            }
            if (cVar != null) {
                cVar.a(W);
            }
        }
    }

    public static final int x1() {
        return x1;
    }

    public void x2(final int i2, final com.joaomgcd.taskerm.util.c cVar) {
        this.k1.R(new GenericActionActivityPickFile(true).run(this), new oi.d() {
            @Override
            public final void accept(Object obj) {
                Settings.this.w2(i2, cVar, (com.joaomgcd.taskerm.util.s6) obj);
            }
        });
    }

    public static kp.a y1(Context context) {
        return (kp.a) com.joaomgcd.taskerm.util.x2.I4(dq.R0(context).getInt("clock_alarm", g6.i.b), kp.a.class);
    }

    private boolean y3(SharedPreferences sharedPreferences, Bundle bundle) {
        for (Map.Entry<String, ?> entry : sharedPreferences.getAll().entrySet()) {
            Object value = entry.getValue();
            String key = entry.getKey();
            if (value instanceof Boolean) {
                bundle.putBoolean(key, ((Boolean) value).booleanValue());
            } else if (value instanceof Float) {
                bundle.putFloat(key, ((Float) value).floatValue());
            } else if (value instanceof Integer) {
                bundle.putInt(key, ((Integer) value).intValue());
            } else if (value instanceof Long) {
                bundle.putLong(key, ((Long) value).longValue());
            } else if (value instanceof String) {
                bundle.putString(key, (String) value);
            } else {
                r7.k("Settings", "unhandled type set:string");
            }
        }
        return false;
    }

    private static String z1(Context context, int i2, String str) {
        String O1 = O1(context, i2);
        if (TextUtils.isEmpty(O1)) {
            return str;
        }
        return O1 + "=:=" + str;
    }

    public void z2(Runnable runnable) {
        if (!((we.l0) com.joaomgcd.taskerm.dialog.a.w3(this, 2131890598, 2131888282).f()).o()) {
            runnable.run();
        } else {
            com.joaomgcd.taskerm.signin.a.b(this).f();
            runnable.run();
        }
    }

    public void L2(ScrollView scrollView) {
        Button button = (Button) findViewById(2131296558);
        this.U = button;
        button.setOnClickListener(this);
        this.U.setText(vh.g(this, 2131890383, new Object[0]));
        for (int i2 = 0; i2 < yi.h(); i2++) {
            findViewById(this.Z0[i2]).setOnClickListener(new g(i2));
        }
        for (int i3 = 0; i3 < yi.h(); i3++) {
            this.U0[i3] = (EditText) findViewById(this.Y0[i3]);
        }
        for (int i4 = 0; i4 < yi.h(); i4++) {
            this.U0[i4].setHint(yi.c(getResources(), i4));
        }
        for (int i5 = 0; i5 < wm.f(); i5++) {
            findViewById(this.b1[i5]).setOnClickListener(new h(i5));
        }
        for (int i6 = 0; i6 < wm.f(); i6++) {
            this.V0[i6] = (EditText) findViewById(this.a1[i6]);
        }
        for (int i7 = 0; i7 < wm.f(); i7++) {
            this.V0[i7].setHint(wm.c(this, i7, false));
        }
        SeekBar seekBar = (SeekBar) findViewById(2131297113);
        this.d0 = seekBar;
        seekBar.setOnSeekBarChangeListener(this);
        this.g0 = (TextView) findViewById(2131297114);
        Spinner spinner = (Spinner) findViewById(2131296352);
        this.j0 = spinner;
        spinner.setAdapter((SpinnerAdapter) dq.f1(this, RFactory.layout.geomeditview));
        this.G0 = (EditText) findViewById(2131297015);
        this.F0 = (EditText) findViewById(2131296914);
        ((LinearLayout) findViewById(2131296868)).setVisibility(8);
        ((LinearLayout) findViewById(2131296869)).setVisibility(8);
    }

    public void M2(ScrollView scrollView) {
        Spinner spinner = (Spinner) findViewById(2131296598);
        this.B0 = spinner;
        spinner.setAdapter((SpinnerAdapter) dq.f1(this, RFactory.layout.button_plus_row));
        this.C0 = (CheckBox) findViewById(2131296938);
        ImageButton imageButton = (ImageButton) scrollView.findViewById(2131296503);
        this.Q = imageButton;
        imageButton.setOnClickListener(this);
        ImageButton imageButton2 = (ImageButton) scrollView.findViewById(2131296501);
        this.R = imageButton2;
        imageButton2.setOnClickListener(this);
        C3();
    }

    public void N2(ScrollView scrollView) {
        Button button = (Button) findViewById(2131296496);
        this.P = button;
        button.setOnClickListener(this);
        this.P.setText(vh.g(this, 2131890380, new Object[0]));
        Button button2 = (Button) findViewById(2131296514);
        this.S = button2;
        button2.setOnClickListener(this);
        this.S.setText(vh.g(this, 2131890382, new Object[0]));
        ImageButton imageButton = (ImageButton) findViewById(2131296515);
        this.T = imageButton;
        imageButton.setOnClickListener(this);
        ImageView imageView = (ImageView) findViewById(2131297183);
        this.Y = imageView;
        imageView.setBackgroundColor(tp.v(this));
        this.Y.setOnClickListener(this);
        for (int i2 = 0; i2 < 3; i2++) {
            findViewById(this.X0[i2]).setOnClickListener(new f(i2));
        }
        Spinner spinner = (Spinner) findViewById(2131297215);
        this.n0 = spinner;
        spinner.setAdapter((SpinnerAdapter) dq.f1(this, RFactory.layout.mytab));
        Spinner spinner2 = (Spinner) findViewById(2131296376);
        this.A0 = spinner2;
        spinner2.setAdapter((SpinnerAdapter) dq.h1(this, t1(getResources())));
        Spinner spinner3 = (Spinner) findViewById(2131297262);
        this.q0 = spinner3;
        spinner3.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner4 = (Spinner) findViewById(2131297588);
        this.r0 = spinner4;
        spinner4.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner5 = (Spinner) findViewById(2131297531);
        this.x0 = spinner5;
        spinner5.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner6 = (Spinner) findViewById(2131296970);
        this.s0 = spinner6;
        spinner6.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner7 = (Spinner) findViewById(2131296275);
        this.w0 = spinner7;
        spinner7.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner8 = (Spinner) findViewById(2131297053);
        this.t0 = spinner8;
        spinner8.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner9 = (Spinner) findViewById(2131297080);
        this.u0 = spinner9;
        spinner9.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner10 = (Spinner) findViewById(2131297285);
        this.v0 = spinner10;
        spinner10.setAdapter((SpinnerAdapter) dq.h1(this, i2()));
        Spinner spinner11 = (Spinner) findViewById(2131296804);
        this.k0 = spinner11;
        spinner11.setAdapter((SpinnerAdapter) dq.f1(this, RFactory.layout.geomeditviewdim));
        this.D0 = (EditText) findViewById(2131297033);
        for (int i3 = 0; i3 < 3; i3++) {
            this.T0[i3] = (EditText) findViewById(this.W0[i3]);
        }
        if (!sp.l0(this)) {
            this.T0[0].setHint(vh.g(this, 2131888819, new Object[0]));
        }
        this.H0 = (EditText) findViewById(2131297065);
        this.K0 = (EditText) findViewById(2131296939);
        this.L0 = (EditText) findViewById(2131296941);
        this.M0 = (EditText) findViewById(2131297701);
        this.P0 = (EditText) findViewById(2131297703);
        this.N0 = (EditText) findViewById(2131296442);
        this.O0 = (EditText) findViewById(2131296444);
        this.I0 = (EditText) findViewById(2131297192);
        this.J0 = (EditText) findViewById(2131297194);
        this.Q0 = (EditText) findViewById(2131296921);
        this.R0 = (EditText) findViewById(2131296925);
        this.S0 = (EditText) findViewById(2131296923);
        Spinner spinner12 = (Spinner) findViewById(2131296708);
        this.z0 = spinner12;
        spinner12.setAdapter((SpinnerAdapter) dq.h1(this, kp.c1(getResources())));
    }

    @Override
    public void g(com.joaomgcd.taskerm.util.e5 e5Var, com.joaomgcd.taskerm.util.t6 t6Var) {
    }

    public void h3() {
        for (int i2 = 0; i2 < yi.h(); i2++) {
            this.U0[i2].setText(this.W.getString(Z1(i2), ""));
        }
        for (int i3 = 0; i3 < wm.f(); i3++) {
            this.V0[i3].setText(this.W.getString(u1(i3), ""));
        }
        this.G0.setText(Integer.toString(this.W.getInt("kit", 1001)));
        this.F0.setText(Integer.toString(this.W.getInt("csnipD", 2)));
        this.d0.setProgress(this.W.getInt("mqt", 10));
        this.j0.setSelection(dq.v3(this.W.getString("kcph", "PBEWithMD5And128BitAES-CBC-OpenSSL"), vh.i(this, RFactory.layout.geocoder_item)));
        if (!yi.i()) {
            findViewById(2131297287).setVisibility(8);
        }
        if (wm.h()) {
            A3(h1(this));
        } else {
            findViewById(2131296381).setVisibility(8);
        }
    }

    public void j3(ScrollView scrollView) {
        int c2 = tp.e0() ? up.c(this) : yd.k0.c(getResources(), tp.W(this), null);
        for (int i2 : s1) {
            View findViewById = findViewById(i2);
            if (findViewById != null) {
                findViewById.setBackgroundColor(c2);
            }
        }
    }

    public void l3(ScrollView scrollView) {
        int i2 = 0;
        while (true) {
            int[] iArr = this.A;
            if (i2 >= iArr.length) {
                return;
            }
            TextView textView = (TextView) scrollView.findViewById(iArr[i2]);
            if (textView != null) {
                textView.setText(vh.k(this, this.A[i2] == 2131297432 ? g1.r1(this) ? 2131890510 : 2131890509 : this.z[i2], new Object[0]));
            }
            i2++;
        }
    }

    public void m2(final CheckBox checkBox, final boolean z, final String str) {
        if (checkBox != null && com.joaomgcd.taskerm.util.k.r()) {
            pg.w0.l0(new Runnable() {
                @Override
                public final void run() {
                    Settings.this.s2(str, z, checkBox);
                }
            });
        }
    }

    public void o3() {
        this.B0.setSelection(this.W.getInt("lph", 0));
    }

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

    @Override
    protected void onActivityResult(int i2, int i3, Intent intent) {
        r7.f("Settings", "oar: req: " + i2 + " result: " + i3);
        if (i3 == -1 && i2 == 3) {
            net.dinglisch.android.taskerm.g r0 = ImageSelect.r0(intent);
            if (r0 == null) {
                this.Z = "cust_notification";
                r0 = new net.dinglisch.android.taskerm.g("cust_notification");
            } else {
                this.Z = r0.getName();
            }
            this.Y.setImageDrawable(r0.E(this));
            x1 |= 2;
        }
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (this.d1[20].equals(view)) {
            E3(((CheckBox) view).isChecked());
            return;
        }
        if (this.d1[25].equals(view)) {
            x1 |= 128;
            return;
        }
        if (this.d1[11].equals(view)) {
            if (((CheckBox) view).isChecked()) {
                this.k1.y0();
                return;
            }
            return;
        }
        if (this.d1[13].equals(view)) {
            x1 |= 128;
            return;
        }
        if (this.d1[23].equals(view)) {
            A3(((CheckBox) view).isChecked());
            return;
        }
        if (this.d1[0].equals(view)) {
            x1 |= 4;
            lp.e(this, 1, 2131890956, 1);
            return;
        }
        if (this.d1[3].equals(view)) {
            x1 |= 4;
            return;
        }
        if (this.d1[2].equals(view)) {
            x1 |= 4;
            lp.e(this, 1, 2131890941, 1);
            return;
        }
        if (this.d1[4].equals(view)) {
            x1 |= 2;
            boolean isChecked = ((CheckBox) view).isChecked();
            F3(this.d1[27].isChecked(), isChecked);
            if (isChecked) {
                return;
            }
            pg.w0.D1(com.joaomgcd.taskerm.dialog.a.s1(this, 2131891282, 2131887191), this);
            return;
        }
        if (this.d1[27].equals(view)) {
            x1 |= 2;
            CheckBox checkBox = (CheckBox) view;
            boolean isChecked2 = checkBox.isChecked();
            F3(isChecked2, this.d1[4].isChecked());
            if (hg.e2.b(this)) {
                m2(checkBox, isChecked2, "M");
                return;
            } else {
                n1(this, this.d1[27].isChecked(), new i());
                return;
            }
        }
        if (this.d1[14].equals(view)) {
            x1 |= 8;
            return;
        }
        if (this.Y.equals(view)) {
            G3();
            return;
        }
        if (this.P.equals(view)) {
            l1();
            x1 |= 2;
            return;
        }
        if (this.S.equals(view)) {
            x1 |= 2;
            com.joaomgcd.taskerm.settings.q0.E(this);
            return;
        }
        if (this.T.equals(view)) {
            pg.w0.D1(com.joaomgcd.taskerm.dialog.a.d1(this, 2131890382, 2131890476), this);
            return;
        }
        if (this.U.equals(view)) {
            com.joaomgcd.taskerm.settings.q0.G(this);
            return;
        }
        if (this.Q.equals(view)) {
            K2(2131296937, "gcsa", "application/json", new com.joaomgcd.taskerm.util.c() {
                @Override
                public final void a(Object obj) {
                    Settings.this.u2((String) obj);
                }
            });
            return;
        }
        if (this.R.equals(view)) {
            K2(2131296935, "gcfb", "application/json", new com.joaomgcd.taskerm.util.c() {
                @Override
                public final void a(Object obj) {
                    Settings.this.v2((String) obj);
                }
            });
            return;
        }
        if (this.d1[8].equals(view)) {
            lp.d(this, 2131890960);
            return;
        }
        if (!this.a0.equals(view)) {
            int J1 = dq.J1(id, this.C);
            if (J1 != -1) {
                oi.h(this, this.B[J1], this.D[J1]);
                return;
            }
            return;
        }
        this.a0.setVisibility(8);
        String str = vh.i(this, RFactory.layout.runlog_item)[this.l0.getSelectedItemPosition()];
        q1();
        j jVar = new j();
        this.N = jVar;
        ExtensionsContextKt.V2(this, jVar, TaskerIntent.c(vh.g(this, 2131887474, new Object[0])));
        if (!HTMLView.r0(this, str)) {
            this.a0.setVisibility(0);
        } else if (this.O == null) {
            this.O = HTMLView.F0(this);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        setResult(0);
        super.onCreate(bundle);
        this.k1.I();
        if (this.C.length != this.D.length) {
            r7.k("Settings", "bad internal data");
            finish();
            return;
        }
        setContentView(2131494230);
        this.W = dq.R0(this);
        ViewPager findViewById = findViewById(2131297223);
        this.i1 = findViewById;
        findViewById.setOffscreenPageLimit(3);
        this.j1 = new n(this, this.i1);
        net.dinglisch.android.taskerm.a.T(this, false);
        if (tp.f()) {
            nq.a(getActionBar(), 0.0f);
        }
        p2();
        n2();
        setTitle(vh.g(this, 2131886730, new Object[0]));
        x1 = 0;
        Bundle bundle2 = new Bundle();
        this.M = bundle2;
        y3(this.W, bundle2);
        this.V = this.W.getString("lcD", "").length() > 0;
        this.X = getIntent().getBooleanExtra("launchedExternal", true);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        net.dinglisch.android.taskerm.a.d(this, 3, menu);
        menu.add(0, 2, 0, vh.g(this, 2131890379, new Object[0]));
        menu.add(0, 0, 0, vh.g(this, 2131888879, new Object[0]));
        menu.add(0, 1, 0, vh.g(this, 2131889085, new Object[0]));
        return true;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.i1 = null;
        this.j1.e();
        this.j1 = null;
        this.M = null;
        this.N = null;
        this.O = null;
        this.P = null;
        this.U = null;
        this.W = null;
        this.k1.J();
    }

    @Override
    public void onItemSelected(AdapterView<?> adapterView, View view, int i2, long j2) {
        int i3;
        int id = adapterView.getId();
        if (id == 2131296376) {
            x1 |= 2;
        }
        if (id == 2131296804) {
            if (i2 != this.H) {
                x1 |= 2;
                o1();
                return;
            }
            return;
        }
        if (id == 2131296598 && i2 != (i3 = this.G)) {
            x1 |= 64;
            if (i2 < i3 && i2 != 1) {
                lp.e(this, 1, 2131890871, 1);
                return;
            } else {
                if (i2 != i3) {
                    lp.e(this, 1, 2131890844, 1);
                    return;
                }
                return;
            }
        }
        if (id == 2131296853 && i2 != this.I) {
            x1 |= 512;
            return;
        }
        if (id == 2131297628) {
            this.e0.setVisibility(i2 == tp.a.MaterialYou.ordinal() ? 8 : 0);
            if (i2 != this.J) {
                x1 |= 128;
                if (i2 == tp.a.Auto.ordinal() || i2 == tp.a.AutoDefault.ordinal()) {
                    com.joaomgcd.taskerm.dialog.a.a3(this, 2131887132);
                    return;
                } else {
                    lp.d(this, 2131890909);
                    return;
                }
            }
            return;
        }
        if (id == 2131297217) {
            if (i2 != this.E) {
                x1 |= 32;
            }
        } else if (id == 2131297031) {
            if (this.l0.getSelectedItemPosition() != this.F) {
                x1 |= 16;
                if (w6.c(HTMLView.A0(getResources(), this.l0.getSelectedItemPosition()))) {
                    lp.d(this, 2131890888);
                } else {
                    dq.i0(this, "Warning: no userguide for this language yet", new Object[0]);
                }
            }
            m3();
        }
    }

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

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

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        int itemId = menuItem.getItemId();
        if (itemId == 0) {
            HTMLView.H0(this, "gestures.html", -1, HTMLView.g.Inform);
        } else if (itemId == 1) {
            HTMLView.G0(this, "index.html");
        } else if (itemId == 2) {
            this.W.edit().clear().commit();
            s3();
            x1 = 1791;
        } else if (itemId == 3) {
            Bundle bundle = this.M;
            if (bundle != null) {
                k1(bundle, this.W);
            }
            finish();
        } else {
            if (itemId != 16908332) {
                return false;
            }
            e3();
        }
        return true;
    }

    @Override
    protected void onPause() {
        SharedPreferences.Editor edit = getSharedPreferences(g6.j, 0).edit();
        edit.putInt("slTab", this.L.r());
        edit.commit();
        I3();
        q1();
        if (this.X) {
            sp.o0("Settings onPause");
        }
        super.onPause();
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i2, boolean z) {
        if (seekBar.equals(this.d0)) {
            this.g0.setText(Integer.toString(this.d0.getProgress()));
        } else if (seekBar.equals(this.c0)) {
            this.i0.setText(Integer.toString(this.c0.getProgress()));
        } else {
            this.h0.setText(Integer.toString(this.b0.getProgress() + 8));
            x1 |= 1;
        }
    }

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

    @Override
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
    }

    @Override
    public void onSensorChanged(SensorEvent sensorEvent) {
        float[] fArr = sensorEvent.values;
        float f2 = fArr[0];
        float f3 = fArr[1];
        float f4 = fArr[2];
        if (Math.abs(f2) > this.f1) {
            this.f1 = Math.abs(f2);
        }
        if (Math.abs(f3) > this.f1) {
            this.f1 = Math.abs(f3);
        }
        if (Math.abs(f4) > this.f1) {
            this.f1 = Math.abs(f4);
        }
        if (System.currentTimeMillis() - this.g1 > 4000.0f) {
            l2();
        }
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    @Override
    protected void onUserLeaveHint() {
        super.onUserLeaveHint();
        sp.o0("Settings onUserLeaveHint");
    }

    public void p3() {
        if (dq.S1()) {
            findViewById(2131296803).setVisibility(8);
        }
        this.A0.setSelection(w1(this, this.W));
        this.z0.setSelection(this.W.getInt("clock_alarm", g6.i.b));
        this.Z = this.W.getString("cust_notification", MonitorService.M3(this));
        this.Y.setImageResource(getResources().getIdentifier(this.Z, "drawable", getPackageName()));
        this.Q0.setText(Float.toString(this.W.getFloat("accMR", 3.5f)));
        this.R0.setText(Long.toString(this.W.getLong("acMSr", 300L)));
        this.S0.setText(Long.toString(this.W.getLong("acrmd", 1200L)));
        this.D0.setText(Long.toString(this.W.getLong("lperiod", 1500L)));
        for (int i2 = 0; i2 < 3; i2++) {
            this.T0[i2].setText(this.W.getString(E1(i2), ""));
        }
        this.H0.setText(Long.toString(this.W.getLong("luped", 30L)));
        this.K0.setText(Long.toString(this.W.getLong("guped", 120L)));
        this.L0.setText(Long.toString(this.W.getLong("gupt", 90L)));
        this.M0.setText(Long.toString(this.W.getLong("wfpiod", 120L)));
        this.P0.setText(Long.toString(this.W.getLong("wip", 10L)));
        this.N0.setText(Long.toString(this.W.getLong("btpiod", 120L)));
        this.O0.setText(Long.toString(this.W.getLong("bttp", 15L)));
        this.I0.setText(Long.toString(this.W.getLong("lfdd", 600L)));
        this.J0.setText(Long.toString(this.W.getLong("sows", 60L)));
        this.n0.setSelection(this.W.getInt("oss", 0));
        this.A0.setSelection(this.W.getInt("appcheckMethod", g6.i.a.a(this)));
        this.k0.setSelection(this.W.getInt("sbl", 0));
        this.v0.setSelection(this.W.getInt("proxWhenOff", 1));
        this.w0.setSelection(this.W.getInt("accelWhenOff", 1));
        this.t0.setSelection(this.W.getInt("lightWhenOff", 1));
        this.u0.setSelection(this.W.getInt("magnetWhenOff", 2));
        this.q0.setSelection(this.W.getInt("pressureWhenOff", 1));
        this.r0.setSelection(this.W.getInt("tempWhenOff", 2));
        this.x0.setSelection(this.W.getInt("stepsWhenOff", 2));
        this.s0.setSelection(this.W.getInt("humidityWhenOff", 2));
        if (yd.f0.h()) {
            E3(H2(this));
        } else {
            findViewById(2131296796).setVisibility(8);
        }
        if (!yd.c.b()) {
            findViewById(2131296273).setVisibility(8);
        }
        if (!pp.d(this)) {
            findViewById(2131297495).setVisibility(8);
        }
        if (com.joaomgcd.taskerm.util.p.f(this)) {
            findViewById(2131297129).setVisibility(8);
        }
    }

    public void r3(SharedPreferences sharedPreferences) {
        SharedPreferences.Editor editor;
        if (sharedPreferences.contains("listMarginWidthPercent")) {
            editor = null;
        } else {
            editor = sharedPreferences.edit();
            editor.putInt("listMarginWidthPercent", 20);
        }
        if (editor != null) {
            editor.commit();
        }
    }

    public void t3() {
        this.c0.setProgress(this.W.getInt("apl", 4));
        this.b0.setProgress(this.W.getInt("pTs", 17) - 8);
        this.l0.setSelection(HTMLView.B0(getResources(), w6.b(this.W)));
        this.m0.setSelection(this.W.getInt("uiori", 0));
        this.o0.setSelection(this.W.getInt("hideStatusBar", 1));
        this.p0.setSelection(B1(this.W));
        this.y0.setSelection(h2(this.W).ordinal());
        this.f0 = this.W.getInt("accentIndex", -1);
        g3();
        m1();
    }

    public void w3(ScrollView scrollView) {
        int i2 = 0;
        while (true) {
            int[] iArr = this.C;
            if (i2 >= iArr.length) {
                return;
            }
            ImageButton imageButton = (ImageButton) scrollView.findViewById(iArr[i2]);
            if (imageButton != null) {
                imageButton.setOnClickListener(this);
            }
            i2++;
        }
    }

    public void x3(ScrollView scrollView) {
        for (int i2 : this.c1) {
            EditText editText = (EditText) findViewById(i2);
            if (editText != null) {
                editText.addTextChangedListener(new a());
            }
        }
    }

    public void z3() {
        e5.F(this, new c(), 1).C(this);
    }
}