导航菜单

页面标题

页面副标题

Tasker v6.6.3 - KidConfig.java 源代码

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

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


package net.dinglisch.android.taskerm;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import net.dinglisch.android.taskerm.fn;
import net.dinglisch.android.taskerm.qj;

public class KidConfig extends HasArgsEdit implements xf.a, ze.e {
    protected static final um r0 = new um(6, 1, 2131889854, "t:1", 0, -1, 2131887223, 1, 2131890075, "t:1", 0, -1, 2131887225, 1, 2131889760, "let:1:?", 0, -1, 2131887227, 1, 2131889730, "m:1", 0, -1, 2131887217, 3, 2131889616, "", 0, -1, -1, 0, 2131889785, "", 0, -1, 2131887222, 0, 2131890011, "", 0, -1, 2131887224, 3, 2131889722, "", 0, -1, 2131887216);
    LinearLayout m0;
    private com.joaomgcd.taskerm.helper.h n0 = new com.joaomgcd.taskerm.helper.h(this);
    private pi o0;
    private fo p0;
    private boolean q0;

    class a extends Handler {
        final s6 a;
        final s6 b;

        a(s6 s6Var, s6 s6Var2) {
            this.a = s6Var;
            this.b = s6Var2;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                pp.W2(KidConfig.this.v[0], this.b.n());
            } else {
                KidConfig.this.q3(this.a);
                KidConfig.this.finish();
            }
        }
    }

    class b implements View.OnClickListener {
        final LinearLayout i;

        b(LinearLayout linearLayout) {
            this.i = linearLayout;
        }

        @Override
        public void onClick(View view) {
            KidConfig.this.m0.removeView(this.i);
        }
    }

    class c implements View.OnClickListener {
        final ViewGroup i;
        final LayoutInflater q;

        c(ViewGroup viewGroup, LayoutInflater layoutInflater) {
            this.i = viewGroup;
            this.q = layoutInflater;
        }

        @Override
        public void onClick(View view) {
            KidConfig.this.U2(this.q, "p", "", KidConfig.this.m0.indexOfChild(this.i));
        }
    }

    class d extends Handler {
        d() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                pp.W2(KidConfig.this.v[3], message.getData().getString("text"));
            }
        }
    }

    private void W2(LayoutInflater layoutInflater, final int i, final int i2) {
        LinearLayout linearLayout = (LinearLayout) layoutInflater.inflate(2131492905, (ViewGroup) null);
        ((TextView) linearLayout.findViewById(2131297021)).setText(oh.g(this, i, new Object[0]));
        this.m0.addView(linearLayout);
        ((ImageView) linearLayout.findViewById(2131296510)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                KidConfig.this.Z2(i, i2, view);
            }
        });
    }

    private s6 Y2() {
        um umVar = r0;
        s6 s6Var = null;
        if (!z0(this, umVar)) {
            return null;
        }
        String m1 = pp.m1(this.v[0]);
        String m12 = pp.m1(this.v[2]);
        String m13 = pp.m1(this.v[3]);
        Integer E3 = pp.E3(pp.m1(this.v[5]));
        int intValue = E3.intValue();
        int intValue2 = pp.E3(pp.m1(this.v[6])).intValue();
        int n = this.p0.n(m13);
        if (!m3(m1)) {
            pp.a0(this, 2131887820, new Object[0]);
        } else if (!this.o0.U(n)) {
            pp.a0(this, 2131887920, new Object[0]);
        } else if (this.p0.b3(0, qj.k.MAP) && m12.length() == 0) {
            pp.a0(this, 2131887932, oh.g(this, umVar.c(2), new Object[0]));
        } else if (intValue < 21) {
            pp.a0(this, 2131887927, oh.g(this, umVar.c(5), new Object[0]), 21);
        } else if (intValue2 < intValue) {
            pp.a0(this, 2131887927, oh.g(this, umVar.c(6), new Object[0]), E3);
        } else if (intValue2 >= 30) {
            this.n0.p0(com.joaomgcd.taskerm.dialog.a.R3(this, 2131891186, 2131890734));
        } else {
            s6Var = new s6();
            s6Var.L(m1);
            s6Var.M(pp.m1(this.v[1]));
            s6Var.K(intValue);
            s6Var.T(intValue2);
            s6Var.I(n);
            s6Var.U(this.U[7].isChecked());
            if (m12.length() > 0) {
                s6Var.J(m12);
            }
            s6 l = this.o0.l();
            if (l != null) {
                s6Var.N(l.p());
            }
            for (int i = 0; i < this.m0.getChildCount(); i++) {
                View childAt = this.m0.getChildAt(i);
                String str = (String) childAt.getTag();
                if (str != null) {
                    if ("f".equals(str)) {
                        s6Var.F((String) ((TextView) childAt.findViewById(2131296894)).getTag(), ((CheckBox) childAt.findViewById(2131296893)).isChecked());
                    } else if ("p".equals(str)) {
                        String obj = ((EditText) childAt.findViewById(2131296862)).getText().toString();
                        if (!TextUtils.isEmpty(obj) && (!od.b.equals(obj) || s6Var.W() || this.q0)) {
                            s6Var.a(obj);
                        }
                    } else if (str.startsWith("plugintag")) {
                        String substring = str.substring(9);
                        if (!((CheckBox) childAt.findViewById(2131296893)).isChecked()) {
                            s6Var.b(substring);
                        }
                    }
                }
            }
        }
        return s6Var;
    }

    public void Z2(int i, int i2, View view) {
        gi.h(this, i, i2);
    }

    public void a3() {
        Q1(this, r0);
    }

    public void b3(boolean z) {
        this.U[4].setChecked(z);
        p3(z);
    }

    public void c3(byte[] bArr) {
        try {
            this.n0.F(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.n3();
                }
            });
            fo foVar = new fo();
            this.p0 = foVar;
            foVar.q1(this, "KidConfig", or.b(bArr));
            this.o0 = this.p0.w(0);
            r3().h();
            this.n0.F(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.a3();
                }
            });
            final boolean z = pp.S0(this).getBoolean("kadv", false);
            this.n0.F(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.b3(z);
                }
            });
        } catch (Exception e) {
            com.joaomgcd.taskerm.util.h5.n(e, this);
        }
    }

    public void d3(Set set, LayoutInflater layoutInflater, s6 s6Var) {
        if (set.size() > 0) {
            W2(layoutInflater, 2131889917, 2131887220);
            Iterator it = set.iterator();
            while (it.hasNext()) {
                String str = (String) it.next();
                V2(layoutInflater, null, str, od.e(str), true, false);
            }
        }
        W2(layoutInflater, 2131889619, 2131887218);
        if (s6Var.r()) {
            Iterator<String> it2 = s6Var.g().iterator();
            while (it2.hasNext()) {
                U2(layoutInflater, "p", it2.next(), -1);
            }
        }
        X2(layoutInflater);
        HashMap<String, String> A2 = this.p0.A2(getPackageManager(), false);
        if (A2.size() > 0) {
            W2(layoutInflater, 2131889918, 2131887221);
            for (Map.Entry<String, String> entry : A2.entrySet()) {
                V2(layoutInflater, "plugintag" + entry.getKey(), null, entry.getValue(), !s6Var.E(entry.getKey()), true);
            }
        }
    }

    public void e3() {
        this.p0.u4();
        final boolean i4 = this.p0.i4();
        final boolean z = i4 || this.p0.b3(0, qj.k.WEB);
        this.n0.F(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.j3(i4, z);
            }
        });
        final s6 l = this.o0.l();
        if (l == null) {
            l = new s6();
        }
        this.n0.F(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.k3(l, z);
            }
        });
        final LayoutInflater from = LayoutInflater.from(this);
        this.p0.u4();
        final Set<String> h = rm.h(this, this.p0, l.W());
        if (h.size() > 0) {
            this.n0.F(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.l3(from, h, l);
                }
            });
        }
        final Set<String> i = rm.i(this, this.p0, false);
        String str = od.b;
        boolean contains = i.contains(str);
        this.q0 = contains;
        if (contains) {
            i.add("android.permission.READ_EXTERNAL_STORAGE");
            i.add("android.permission.WRITE_EXTERNAL_STORAGE");
        }
        if (l.W()) {
            i.add(str);
            i.add(od.e);
        }
        this.n0.F(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.d3(i, from, l);
            }
        });
    }

    public void f3(View view) {
        p3(this.U[4].isChecked());
    }

    public void g3(View view) {
        s3();
    }

    public void h3(View view) {
        b2(5);
    }

    public void i3(View view) {
        b2(6);
    }

    public void j3(boolean r11, boolean r12) {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.KidConfig.j3(boolean, boolean):void");
    }

    public void k3(s6 s6Var, boolean z) {
        this.U[7].setChecked(s6Var.W());
        if (s6Var.n() != null) {
            pp.W2(this.v[0], s6Var.n());
        }
        if (s6Var.z()) {
            pp.W2(this.v[1], s6Var.o());
        }
        if (z && s6Var.w()) {
            pp.W2(this.v[2], s6Var.j());
        }
        pp.W2(this.v[5], String.valueOf(Math.max(s6Var.k(), 21)));
        pp.W2(this.v[6], String.valueOf(Math.min(29, Math.max(s6Var.q(), s6Var.k()))));
        setTitle(oh.g(this, 2131887462, this.o0.getName() + " [" + s6Var.p() + "]"));
        String l = this.p0.l(s6Var.i());
        if (l == null) {
            l = this.p0.c2() == 1 ? this.p0.l(this.o0.J().get(0).intValue()) : "";
        }
        pp.W2(this.v[3], l);
        if (this.p0.g2() == 1) {
            this.N[3].setVisibility(8);
        }
    }

    public void l3(LayoutInflater layoutInflater, Set set, s6 s6Var) {
        W2(layoutInflater, 2131889916, 2131887219);
        Iterator it = set.iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            V2(layoutInflater, "f", str, nd.b(str), (s6Var == null || !s6Var.s(str)) ? true : s6Var.f(str), true);
        }
    }

    private boolean m3(String str) {
        if (!str.matches("^[\\.a-z0-9_]+$") || !str.matches("^[a-z].*") || str.matches(".*\\.\\.*") || str.startsWith("net.dinglisch") || str.startsWith(".") || str.endsWith(".")) {
            return false;
        }
        String[] split = str.split(Pattern.quote("."));
        if (split.length < 2) {
            return false;
        }
        for (String str2 : split) {
            if (str2.matches("^[0-9]+$")) {
                return false;
            }
        }
        return true;
    }

    public void n3() {
        x1((MyScrollView) findViewById(2131296768));
        t1(r0.i(), 66603);
        this.m0 = (LinearLayout) findViewById(2131296888);
    }

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

    private void p3(boolean z) {
        int i = z ? 0 : 8;
        for (int i2 = 5; i2 < r0.i(); i2++) {
            this.N[i2].setVisibility(i);
        }
        this.m0.setVisibility(i);
        pp.S0(this).edit().putBoolean("kadv", z).commit();
    }

    public void q3(s6 s6Var) {
        setResult(-1, new Intent().putExtra("b", s6Var.X(0).c0()));
    }

    private void s3() {
        ArrayList<fn> K = this.p0.x2(getPackageManager(), this.o0).K(-2, fn.f.Alpha);
        fj.D(this, new d(), 2131890750).L(this.p0.N(K), this.p0.g(K)).C(this);
    }

    @Override
    public w4 O0() {
        return null;
    }

    @Override
    public void U1(int i) {
        this.n0.y0(r3());
    }

    public void U2(LayoutInflater layoutInflater, String str, String str2, int i) {
        LinearLayout linearLayout = (LinearLayout) layoutInflater.inflate(2131493232, (ViewGroup) null);
        EditText editText = (EditText) linearLayout.findViewById(2131296862);
        ImageButton imageButton = (ImageButton) linearLayout.findViewById(2131296531);
        imageButton.setVisibility(0);
        imageButton.setOnClickListener(new b(linearLayout));
        editText.setHint(oh.g(this, 2131891235, new Object[0]));
        pp.W2(editText, str2);
        if (str != null) {
            linearLayout.setTag(str);
        }
        if (i == -1) {
            this.m0.addView(linearLayout);
        } else {
            this.m0.addView(linearLayout, i);
            editText.requestFocus();
        }
    }

    public void V2(LayoutInflater layoutInflater, String str, String str2, String str3, boolean z, boolean z2) {
        LinearLayout linearLayout = (LinearLayout) layoutInflater.inflate(2131493552, (ViewGroup) null);
        linearLayout.setTag(str);
        TextView textView = (TextView) linearLayout.findViewById(2131296894);
        CheckBox checkBox = (CheckBox) linearLayout.findViewById(2131296893);
        textView.setText(str3);
        if (str2 != null) {
            textView.setTag(str2);
        }
        if (str != null) {
            linearLayout.setTag(str);
        }
        checkBox.setChecked(z);
        checkBox.setEnabled(z2);
        this.m0.addView(linearLayout);
    }

    public void X2(LayoutInflater layoutInflater) {
        ViewGroup viewGroup = (ViewGroup) layoutInflater.inflate(2131493113, (ViewGroup) null);
        ((ImageButton) viewGroup.findViewById(2131296547)).setOnClickListener(new c(viewGroup, layoutInflater));
        this.m0.addView(viewGroup);
    }

    @Override
    public void g(com.joaomgcd.taskerm.util.ac acVar, com.joaomgcd.taskerm.util.se seVar) {
    }

    @Override
    public void onBackPressed() {
        o3();
    }

    @Override
    public void onClick(View view) {
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.p1(bundle, 2131492909);
        Intent intent = getIntent();
        com.joaomgcd.taskerm.util.t2.e(intent);
        final byte[] byteArrayExtra = bundle == null ? intent.getByteArrayExtra("d") : bundle.getByteArray("d");
        this.n0.o1(2131887306, new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.c3(byteArrayExtra);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.r1(menu, 2131888892, -1);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.o0 = null;
        this.p0 = null;
        this.m0 = null;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 6) {
            finish();
            return true;
        }
        if (menuItem.getItemId() != 16908332) {
            return s1(menuItem, null, "appcreation.html");
        }
        o3();
        return true;
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putByteArray("d", or.d(this.p0.X(0).e0(0)));
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    public ti.b r3() {
        return xg.e2.F0(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.e3();
            }
        });
    }
}