导航菜单

页面标题

页面副标题

Tasker v6.5.11 - KidConfig.java 源代码

正在查看: Tasker v6.5.11 应用的 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.hk;
import net.dinglisch.android.taskerm.tn;

public class KidConfig extends HasArgsEdit implements pf.a {
    protected static final in r0 = new in(6, 1, 2131889840, "t:1", 0, -1, 2131887217, 1, 2131890060, "t:1", 0, -1, 2131887219, 1, 2131889746, "let:1:?", 0, -1, 2131887221, 1, 2131889716, "m:1", 0, -1, 2131887211, 3, 2131889602, "", 0, -1, -1, 0, 2131889771, "", 0, -1, 2131887216, 0, 2131889997, "", 0, -1, 2131887218, 3, 2131889708, "", 0, -1, 2131887210);
    LinearLayout m0;
    private com.joaomgcd.taskerm.helper.e n0 = new com.joaomgcd.taskerm.helper.e(this);
    private xi o0;
    private to p0;
    private boolean q0;

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

        a(v6 v6Var, v6 v6Var2) {
            this.a = v6Var;
            this.b = v6Var2;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                dq.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) {
                dq.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(2131297020)).setText(vh.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 v6 Y2() {
        in inVar = r0;
        v6 v6Var = null;
        if (!z0(this, inVar)) {
            return null;
        }
        String m1 = dq.m1(this.v[0]);
        String m12 = dq.m1(this.v[2]);
        String m13 = dq.m1(this.v[3]);
        Integer E3 = dq.E3(dq.m1(this.v[5]));
        int intValue = E3.intValue();
        int intValue2 = dq.E3(dq.m1(this.v[6])).intValue();
        int n = this.p0.n(m13);
        if (!m3(m1)) {
            dq.a0(this, 2131887813, new Object[0]);
        } else if (!this.o0.V(n)) {
            dq.a0(this, 2131887913, new Object[0]);
        } else if (this.p0.X2(0, hk.k.MAP) && m12.length() == 0) {
            dq.a0(this, 2131887925, vh.g(this, inVar.c(2), new Object[0]));
        } else if (intValue < 21) {
            dq.a0(this, 2131887920, vh.g(this, inVar.c(5), new Object[0]), 21);
        } else if (intValue2 < intValue) {
            dq.a0(this, 2131887920, vh.g(this, inVar.c(6), new Object[0]), E3);
        } else if (intValue2 >= 30) {
            this.n0.Q(com.joaomgcd.taskerm.dialog.a.d1(this, 2131891164, 2131890716));
        } else {
            v6Var = new v6();
            v6Var.L(m1);
            v6Var.N(dq.m1(this.v[1]));
            v6Var.K(intValue);
            v6Var.R(intValue2);
            v6Var.I(n);
            v6Var.T(this.U[7].isChecked());
            if (m12.length() > 0) {
                v6Var.J(m12);
            }
            v6 m = this.o0.m();
            if (m != null) {
                v6Var.O(m.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)) {
                        v6Var.G((String) ((TextView) childAt.findViewById(2131296893)).getTag(), ((CheckBox) childAt.findViewById(2131296892)).isChecked());
                    } else if ("p".equals(str)) {
                        String obj = ((EditText) childAt.findViewById(2131296861)).getText().toString();
                        if (!TextUtils.isEmpty(obj) && (!sd.b.equals(obj) || v6Var.W() || this.q0)) {
                            v6Var.a(obj);
                        }
                    } else if (str.startsWith("plugintag")) {
                        String substring = str.substring(9);
                        if (!((CheckBox) childAt.findViewById(2131296892)).isChecked()) {
                            v6Var.b(substring);
                        }
                    }
                }
            }
        }
        return v6Var;
    }

    public void Z2(int i, int i2, View view) {
        oi.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.m(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.n3();
                }
            });
            to toVar = new to();
            this.p0 = toVar;
            toVar.o1(this, "KidConfig", jr.b(bArr));
            this.o0 = this.p0.w(0);
            r3().h();
            this.n0.m(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.a3();
                }
            });
            final boolean z = dq.S0(this).getBoolean("kadv", false);
            this.n0.m(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.b3(z);
                }
            });
        } catch (Exception e) {
            com.joaomgcd.taskerm.util.o2.i(e, this);
        }
    }

    public void d3(Set set, LayoutInflater layoutInflater, v6 v6Var) {
        if (set.size() > 0) {
            W2(layoutInflater, 2131889903, 2131887214);
            Iterator it = set.iterator();
            while (it.hasNext()) {
                String str = (String) it.next();
                V2(layoutInflater, null, str, sd.e(str), true, false);
            }
        }
        W2(layoutInflater, 2131889605, 2131887212);
        if (v6Var.r()) {
            Iterator<String> it2 = v6Var.g().iterator();
            while (it2.hasNext()) {
                U2(layoutInflater, "p", it2.next(), -1);
            }
        }
        X2(layoutInflater);
        HashMap<String, String> y2 = this.p0.y2(getPackageManager(), false);
        if (y2.size() > 0) {
            W2(layoutInflater, 2131889904, 2131887215);
            for (Map.Entry<String, String> entry : y2.entrySet()) {
                V2(layoutInflater, "plugintag" + entry.getKey(), null, entry.getValue(), !v6Var.E(entry.getKey()), true);
            }
        }
    }

    public void e3() {
        this.p0.p4();
        final boolean d4 = this.p0.d4();
        final boolean z = d4 || this.p0.X2(0, hk.k.WEB);
        this.n0.m(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.j3(d4, z);
            }
        });
        final v6 m = this.o0.m();
        if (m == null) {
            m = new v6();
        }
        this.n0.m(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.k3(m, z);
            }
        });
        final LayoutInflater from = LayoutInflater.from(this);
        this.p0.p4();
        final Set<String> h = hn.h(this, this.p0, m.W());
        if (h.size() > 0) {
            this.n0.m(new Runnable() {
                @Override
                public final void run() {
                    KidConfig.this.l3(from, h, m);
                }
            });
        }
        final Set<String> i = hn.i(this, this.p0, false);
        String str = sd.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 (m.W()) {
            i.add(str);
            i.add(sd.e);
        }
        this.n0.m(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.d3(i, from, m);
            }
        });
    }

    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(v6 v6Var, boolean z) {
        this.U[7].setChecked(v6Var.W());
        if (v6Var.n() != null) {
            dq.W2(this.v[0], v6Var.n());
        }
        if (v6Var.y()) {
            dq.W2(this.v[1], v6Var.o());
        }
        if (z && v6Var.w()) {
            dq.W2(this.v[2], v6Var.j());
        }
        dq.W2(this.v[5], String.valueOf(Math.max(v6Var.k(), 21)));
        dq.W2(this.v[6], String.valueOf(Math.min(29, Math.max(v6Var.q(), v6Var.k()))));
        setTitle(vh.g(this, 2131887455, this.o0.getName() + " [" + v6Var.p() + "]"));
        String l = this.p0.l(v6Var.i());
        if (l == null) {
            l = this.p0.a2() == 1 ? this.p0.l(this.o0.K().get(0).intValue()) : "";
        }
        dq.W2(this.v[3], l);
        if (this.p0.e2() == 1) {
            this.N[3].setVisibility(8);
        }
    }

    public void l3(LayoutInflater layoutInflater, Set set, v6 v6Var) {
        W2(layoutInflater, 2131889902, 2131887213);
        Iterator it = set.iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            V2(layoutInflater, "f", str, rd.b(str), (v6Var == null || !v6Var.s(str)) ? true : v6Var.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(2131296767));
        t1(r0.i(), 66603);
        this.m0 = (LinearLayout) findViewById(2131296887);
    }

    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);
        dq.S0(this).edit().putBoolean("kadv", z).commit();
    }

    public void q3(v6 v6Var) {
        setResult(-1, new Intent().putExtra("b", v6Var.U(0).c0()));
    }

    private void s3() {
        ArrayList<tn> K = this.p0.v2(getPackageManager(), this.o0).K(-2, tn.f.Alpha);
        wj.D(this, new d(), 2131890732).L(this.p0.O(K), this.p0.g(K)).C(this);
    }

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

    @Override
    public void U1(int i) {
        this.n0.Y(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(2131296861);
        ImageButton imageButton = (ImageButton) linearLayout.findViewById(2131296531);
        imageButton.setVisibility(0);
        imageButton.setOnClickListener(new b(linearLayout));
        editText.setHint(vh.g(this, 2131891213, new Object[0]));
        dq.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(2131296893);
        CheckBox checkBox = (CheckBox) linearLayout.findViewById(2131296892);
        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.e5 e5Var, com.joaomgcd.taskerm.util.t6 t6Var) {
    }

    @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.f1.e(intent);
        final byte[] byteArrayExtra = bundle == null ? intent.getByteArrayExtra("d") : bundle.getByteArray("d");
        this.n0.v0(2131887300, new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.c3(byteArrayExtra);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.r1(menu, 2131888880, -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", jr.d(this.p0.U(0).e0(0)));
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    public ji.b r3() {
        return pg.w0.Y(new Runnable() {
            @Override
            public final void run() {
                KidConfig.this.e3();
            }
        });
    }
}