导航菜单

页面标题

页面副标题

Tasker v6.5.11 - ActivityReceiveKey.java 源代码

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

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


package com.joaomgcd.taskerm.navigationbar;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import ji.n;
import kotlin.collections.l;
import kotlin.collections.r;
import lj.e0;
import lj.j;
import lj.k;
import net.dinglisch.android.taskerm.ExecuteService;
import net.dinglisch.android.taskerm.r7;
import pg.w0;
import yj.p;
import yj.q;

public final class ActivityReceiveKey extends Activity {
    private final j i = k.b(new a());
    private final j q = k.b(e.i);
    private final j r = k.b(new b());
    private mi.b s;

    static final class a extends q implements xj.a<String> {
        a() {
            super(0);
        }

        @Override
        public final String invoke() {
            Intent selector;
            Set<String> categories;
            Intent intent = ActivityReceiveKey.this.getIntent();
            if (intent == null || (selector = intent.getSelector()) == null || (categories = selector.getCategories()) == null) {
                return null;
            }
            return (String) r.c0(categories);
        }
    }

    static final class b extends q implements xj.a<n<cg.b>> {
        b() {
            super(0);
        }

        @Override
        public final n<cg.b> invoke() {
            ij.b k = ActivityReceiveKey.this.k();
            p.h(k, "access$getPublisher(...)");
            return w0.g0(k, 500L, TimeUnit.MILLISECONDS);
        }
    }

    static final class c extends q implements xj.a<e0> {
        c() {
            super(0);
        }

        public final void a() {
            cg.b b = new cg.c(ActivityReceiveKey.this).b(ActivityReceiveKey.this.h());
            if (b == null) {
                ActivityReceiveKey.this.n("Not found executing task");
                return;
            }
            String[] a = b.a();
            if (a == null) {
                ActivityReceiveKey.this.n("task names to execute is null. Can't execute");
                return;
            }
            if (a.length == 0) {
                ActivityReceiveKey.this.n("No task names to execute");
                return;
            }
            if (a.length > 1) {
                if (ActivityReceiveKey.this.s == null) {
                    ActivityReceiveKey activityReceiveKey = ActivityReceiveKey.this;
                    activityReceiveKey.s = activityReceiveKey.j();
                }
                ActivityReceiveKey.this.k().f(b);
                return;
            }
            String str = (String) l.R(a);
            if (str == null) {
                ActivityReceiveKey.this.n("No first task name to execute");
                return;
            }
            ActivityReceiveKey.this.m("Executing task " + str);
            ExecuteService.q7(ActivityReceiveKey.this, str);
            ActivityReceiveKey.this.finish();
        }

        @Override
        public e0 invoke() {
            a();
            return e0.a;
        }
    }

    static final class d extends q implements xj.l<List<cg.b>, e0> {
        d() {
            super(1);
        }

        public final void a(List<cg.b> list) {
            try {
                int size = list.size();
                p.f(list);
                cg.b bVar = (cg.b) r.f0(list);
                if (bVar == null) {
                    ActivityReceiveKey.this.m("No task for multi-click (" + size + ")");
                } else {
                    String[] a = bVar.a();
                    if (a == null) {
                        ActivityReceiveKey.this.n("task names for multi-click (" + size + ") to execute is null. Can't execute");
                    } else {
                        if (a.length != 0) {
                            String str = (String) l.a0(a, size - 1);
                            if (str == null) {
                                str = (String) l.m0(a);
                            }
                            ActivityReceiveKey.this.m("Executing task for multi-click (" + size + ") " + str);
                            ExecuteService.q7(ActivityReceiveKey.this, str);
                            return;
                        }
                        ActivityReceiveKey.this.m("No task names for multi-click (" + size + ")");
                    }
                }
            } finally {
                ActivityReceiveKey.this.finish();
            }
        }

        @Override
        public e0 invoke(List<cg.b> list) {
            a(list);
            return e0.a;
        }
    }

    static final class e extends q implements xj.a<ij.b<cg.b>> {
        public static final e i = new e();

        e() {
            super(0);
        }

        @Override
        public final ij.b<cg.b> invoke() {
            return ij.b.A0();
        }
    }

    public final String h() {
        return (String) this.i.getValue();
    }

    private final n<cg.b> i() {
        return (n) this.r.getValue();
    }

    public final mi.b j() {
        ji.r<List<cg.b>> w0 = i().w0();
        p.h(w0, "toList(...)");
        return w0.F1(w0, this, new d());
    }

    public final ij.b<cg.b> k() {
        return (ij.b) this.q.getValue();
    }

    private final void l() {
        w0.m0(new c());
    }

    public final void m(String str) {
        r7.f("KEYTASKS", str + ": from category " + h());
    }

    public final void n(String str) {
        m(str);
        finish();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        l();
    }

    @Override
    protected void onDestroy() {
        mi.b bVar = this.s;
        if (bVar != null) {
            bVar.d();
        }
        this.s = null;
        super.onDestroy();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        l();
    }
}