Skip to content

Automating Save APK #1968

@pudah

Description

@pudah

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • I have read the docs
  • I know that generating a report, in whole part or in part, using AI/LLM is prohibited

Describe the existing feature/documentation

According to the App Manager documentation at https://muntashir.dev/AppManager/en/#toc:sec:automating-tasks, profiles can be triggered from automation apps using intents.

I want to take advantage of that capability to save APK(S) whenever certain apps are updated.

Describe your problem(s)

I was able to trigger a profile from Tasker. But I do have a couple of questions.

Unless I missed something, I would have to create individual profiles for every app for which I might want to save an apk. Is there a way to create generic profiles that could accept as input something like a package name?

When the profile is triggered, App Manager launches, comes to the foreground, does the initialization process, then disappears to the background. But it still appears in the recents menu and must be closed manually. Is this because of the way I've constructed the intent? Or is it because the automation facility in App Manager is set up as an Activity instead of a BroadcastReceiver?

Additional context

This is the Tasker Java Code I am using to build the intent:

import android.content.Intent;
import android.content.ComponentName;
import com.joaomgcd.taskerm.action.java.JavaCodeException;

/* Get Tasker variables */

pkg = tasker.getVariable("pkg");

className = tasker.getVariable("class");

authk = tasker.getVariable("authk");

prof = tasker.getVariable("prof");

/* Create and configure new intent */
intent = new Intent();

intent.setComponent(new ComponentName(pkg, className));

intent.putExtra("auth", authk);
intent.putExtra("feature", "profile");
intent.putExtra("prof",prof);
intent.putExtra("state","on");

/*
 * When starting an Activity from a Service context (which Tasker's Java Code is),
 * FLAG_ACTIVITY_NEW_TASK is mandatory.
 */

intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);

/* Start the activity with the configured intent. */
context.startActivity(intent);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions