导航菜单

页面标题

页面副标题

Tasker v6.5.11 - ActivityAssistantActions.java 源代码

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

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


package com.joaomgcd.taskerm.util;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import cyanogenmod.app.ProfileManager;
import java.util.Iterator;
import net.dinglisch.android.taskerm.ExecuteService;
import net.dinglisch.android.taskerm.to;

public final class ActivityAssistantActions extends Activity {

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

        public final void a() {
            String action;
            Intent intent = ActivityAssistantActions.this.getIntent();
            if (intent == null || (action = intent.getAction()) == null) {
                return;
            }
            Intent intent2 = ActivityAssistantActions.this.getIntent();
            net.dinglisch.android.taskerm.r7.f("AssistantActions", "Received assistant request: " + action + "; data: " + (intent2 != null ? intent2.getData() : null));
            if (yj.p.d(action, "android.intent.action.VIEW")) {
                ActivityAssistantActions.this.e();
            } else if (yj.p.d(action, "ACTION_COMMAND")) {
                ActivityAssistantActions.this.f();
            }
        }

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

    private final hk.k c() {
        return new hk.k("(.+?) with (.+)");
    }

    private final hk.k d() {
        return new hk.k("(.+?) with (.+) and (.+)");
    }

    public final void e() {
        Intent intent;
        Uri data;
        Object obj;
        try {
            intent = getIntent();
        } finally {
            try {
                return;
            } finally {
            }
        }
        if (intent != null && (data = intent.getData()) != null) {
            i6 h = h(data);
            if (h == null && (h = g(data)) == null) {
                return;
            }
            Iterator<T> it = to.u1(this).P1().keySet().iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                String str = (String) obj;
                if (str != null) {
                    String lowerCase = str.toLowerCase();
                    yj.p.h(lowerCase, "toLowerCase(...)");
                    String lowerCase2 = h.c().toLowerCase();
                    yj.p.h(lowerCase2, "toLowerCase(...)");
                    if (yj.p.d(lowerCase, lowerCase2)) {
                        break;
                    }
                }
            }
            String str2 = (String) obj;
            if (str2 != null && str2.length() != 0) {
                ExecuteService.t7(this, str2, h.a(), h.b());
                return;
            }
            if (ExtensionsContextKt.u2(this, 2093, 2131887594, 2131887127, "https://youtu.be/gGa4OfxmlzU")) {
            }
        }
    }

    public final void f() {
        Uri data;
        String queryParameter;
        Intent intent = getIntent();
        if (intent == null || (data = intent.getData()) == null || (queryParameter = data.getQueryParameter("command")) == null) {
            return;
        }
        ExtensionsContextKt.C3(this, queryParameter, null, 2, null);
    }

    private final i6 g(Uri uri) {
        String str;
        String queryParameter = uri.getQueryParameter("task");
        String str2 = null;
        if (queryParameter == null) {
            return null;
        }
        com.joaomgcd.taskerm.event.app.c.a(this, queryParameter);
        String queryParameter2 = uri.getQueryParameter("par1");
        String queryParameter3 = uri.getQueryParameter("par2");
        hk.i c = hk.k.c(d(), queryParameter, 0, 2, null);
        if (c != null) {
            hk.g gVar = c.b().get(1);
            if (gVar == null || (str = gVar.a()) == null) {
                return null;
            }
            if (queryParameter2 == null) {
                hk.g gVar2 = c.b().get(2);
                queryParameter2 = gVar2 != null ? gVar2.a() : null;
            }
            if (queryParameter3 == null) {
                hk.g gVar3 = c.b().get(3);
                if (gVar3 != null) {
                    str2 = gVar3.a();
                }
            } else {
                str2 = queryParameter3;
            }
            queryParameter3 = str2;
        } else {
            hk.i c2 = hk.k.c(c(), queryParameter, 0, 2, null);
            if (c2 != null) {
                hk.g gVar4 = c2.b().get(1);
                if (gVar4 == null || (str = gVar4.a()) == null) {
                    return null;
                }
                if (queryParameter2 == null) {
                    hk.g gVar5 = c2.b().get(2);
                    if (gVar5 != null) {
                        str2 = gVar5.a();
                    }
                } else {
                    str2 = queryParameter2;
                }
                queryParameter2 = str2;
            } else {
                str = queryParameter;
            }
        }
        return new i6(queryParameter, str, queryParameter2, queryParameter3);
    }

    private final i6 h(Uri uri) {
        String queryParameter = uri.getQueryParameter(ProfileManager.EXTRA_PROFILE_NAME);
        if (queryParameter == null) {
            return null;
        }
        return new i6(queryParameter, queryParameter, null, null, 12, null);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        pg.w0.m0(new a());
    }
}