|
| 1 | +# TaskerLauncherShortcut Tasker Project |
| 2 | + |
| 3 | +`TaskerLauncherShortcut Tasker Project` is a sample project for the [Tasker App] to run [TaskerLauncherShortcut App] shortcut intents. It requires [Tasker App] to be granted either `root` or `ADB` access for launching shortcuts with the `com.android.launcher3.DEEP_SHORTCUT` category in android `>=7.1`. |
| 4 | +## |
| 5 | + |
| 6 | + |
| 7 | +### Contents |
| 8 | +- [How Project Works](#How-Project-Works) |
| 9 | +- [Compatibility](#Compatibility) |
| 10 | +- [Dependencies](#Dependencies) |
| 11 | +- [Downloads](#Downloads) |
| 12 | +- [Install Instructions For Tasker In Android](#Install-Instructions-For-Tasker-In-Android) |
| 13 | +- [Usage](#Usage) |
| 14 | +- [Current Features](#Current-Features) |
| 15 | +- [Planned Features](#Planned-Features) |
| 16 | +- [Issues](#Issues) |
| 17 | +- [Worthy Of Note](#Worthy-Of-Note) |
| 18 | +- [FAQs And FUQs](#FAQs-And-FUQs) |
| 19 | +- [Changelog](#Changelog) |
| 20 | +- [Contributions](#Contributions) |
| 21 | +## |
| 22 | + |
| 23 | + |
| 24 | +### How Project Works |
| 25 | + |
| 26 | +As already mentioned in the [TaskerLauncherShortcut App] info, the shortcuts with the `com.android.launcher3.DEEP_SHORTCUT` category require the app starting the shortcut to be the default launcher app or currently be the active voice interaction service, so the `TaskerLauncherShortcut` must be the default launcher app when the plugin is called. To change the default launcher app without using touch simulation or [AutoInput](https://play.google.com/store/apps/details?id=com.joaomgcd.autoinput&hl=en) and just using background commands requires either `root` or `ADB`. The `cmd package set-home-activity %launcher_package_and_activity_name` command can be used for this. Setting tasker as the device owner (not device administrator) may work but requires more work. The `Send Shortcut Intent With TaskerLauncherShortcut` task is provided that takes cares of everything for the user. It takes an intent `Uri` as input `%par1` and if it's a `DEEP_SHORTCUT`, then it automatically sets the `TaskerLauncherShortcut` app as the default launcher, starts the shortcut and then resets the user's normal launcher app as the default launcher. The default launchers are set by the `Get And Set Default Launcher` task. This is done in the background and does not require any interaction. The plugin action in the `Send Shortcut Intent With TaskerLauncherShortcut` task uses a local variable so that same action can be used dynamically for different intents received as parameters to the task, **do not** edit it. |
| 27 | + |
| 28 | +For shortcuts without the `com.android.launcher3.DEEP_SHORTCUT` category, changing the default launcher is not required and so neither is `root` or `ADB` and you may use the plugin directly in any task as a standalone action instead of using the `Send Shortcut Intent With TaskerLauncherShortcut` task. A template task `TaskerLauncherShortcut Non DEEP_SHORTCUT Template` is given for this. |
| 29 | + |
| 30 | +The project and the app has been tested on an Android 7.0 device and Android 8.1 and 10 emulators, but the Android 10 emulator didn't have root and `ADB Wi-Fi` likely can't work, so haven't tested changing the default launcher commands on it, but the intents work. There could still be issues because of android 10 background activity start restrictions but hopefully the `Draw Over Other Apps` permission should fix that. |
| 31 | + |
| 32 | +Check [TaskerLauncherShortcut Project Info](projects/TaskerLauncherShortcut.prj.md) file for more info of the profiles and tasks. |
| 33 | +## |
| 34 | + |
| 35 | + |
| 36 | +### Compatibility |
| 37 | + |
| 38 | +- Android using [Tasker App]. |
| 39 | +## |
| 40 | + |
| 41 | + |
| 42 | +### Dependencies |
| 43 | + |
| 44 | +- [TaskerLauncherShortcut App] |
| 45 | +- Requires [Tasker App] to be granted either `root` or `ADB` access for launching shortcuts with the `com.android.launcher3.DEEP_SHORTCUT` category in android `>=7.1`. |
| 46 | +## |
| 47 | + |
| 48 | + |
| 49 | +### Downloads |
| 50 | + |
| 51 | +- [GitHub releases](https://github.com/agnostic-apollo/TaskerLauncherShortcut-Tasker-Project/releases). |
| 52 | +- [Taskernet](https://taskernet.com/shares/?user=AS35m8mXdvaT1Vj8TwkSaCaoMUv220IIGtHe3pG4MymrCUhpgzrat6njEOnDVVulhAIHLi6BPUt1&id=Project%3ATaskerLauncherShortcut) |
| 53 | +## |
| 54 | + |
| 55 | + |
| 56 | +### Install Instructions For Tasker In Android |
| 57 | + |
| 58 | +1. Import `projects/TaskerLauncherShortcut.prj.xml` Project file into Tasker. |
| 59 | + |
| 60 | +## |
| 61 | + |
| 62 | + |
| 63 | +### Usage |
| 64 | + |
| 65 | +**DEEP_SHORTCUT shortcuts**: |
| 66 | + |
| 67 | +1. You need to set the `%normal_default_launcher_package_and_activity_name variable` in the `Send Shortcut Intent With TaskerLauncherShortcut` task. It defines the package and activity name of the normal default launcher that should be reverted back to after the shortcut has been sent. By default this is set to nova launcher. If you use a different launcher, then just run the `Get And Set Default Launcher` task directly from the tasker UI and the package and activity name of your current launcher will be copied to the clipboard. Paste that in the `Variable Set` action of the `%normal_default_launcher_package_and_activity_name` variable in the `Send Shortcut Intent With TaskerLauncherShortcut` task. |
| 68 | + |
| 69 | +2. You need to find the shortcut intent `Uri` that needs to be passed to the `Send Shortcut Intent With TaskerLauncherShortcut` task as `%par1`. Open the `TaskerLauncherShortcut` app, and from its options, click `Search Shortcuts`. You will be asked to set the app as the default launcher. Make sure to select `Always` or `Use as default app` instead of `Just Once`, depending on android version. Press `Home` button to make sure its set as the default and that no prompt is shown. Some devices make require going into android settings to set the default launcher. Once its set, then return to the `Shortcut Chooser` activity. For static and dynamic shortcuts, just clicking on the shortcut will copy the intent `Uri`. For static shortcuts, you may be taken to a configuration screen. For pinned shortcuts, you will be asked to go to the app for which you want to create a pinned shortcut for and create it and then return. Once you go to the app like chrome and click something like `Add to Home screen` and return to Shortcut Chooser activity from recents menu, the shortcut intent `Uri` will be copied to the clipboard. Use that intent `Uri` in a tasker task and send it as `%par1` to the `Send Shortcut Intent With TaskerLauncherShortcut` task with a `Perform Task` action to start the shortcut. A template task `TaskerLauncherShortcut DEEP_SHORTCUT Template` is given for this. |
| 70 | + |
| 71 | +**Non DEEP_SHORTCUT shortcuts**: |
| 72 | + |
| 73 | +1. Open the `TaskerLauncherShortcut Non DEEP_SHORTCUT Template` task. Select the `TaskerLauncherShortcut` action and search and select the desired shortcut by pressing the search icon in the plugin configuration activity. Then run the task. Make sure the intent `Uri` for the selected intent does not have the `com.android.launcher3.DEEP_SHORTCUT` category, otherwise shortcut will not work unless the TaskerLauncherShortcut app is the default launcher. |
| 74 | +## |
| 75 | + |
| 76 | + |
| 77 | +### Current Features |
| 78 | + |
| 79 | +- Tasks to start `DEEP_SHORTCUT` and `Non DEEP_SHORTCUT` shortcuts |
| 80 | +- Tasks to change default launcher using `root` or `ADB` |
| 81 | +## |
| 82 | + |
| 83 | + |
| 84 | +### Planned Features |
| 85 | + |
| 86 | +- Change default launcher using Device owner APIs. |
| 87 | +## |
| 88 | + |
| 89 | + |
| 90 | +### Issues |
| 91 | + |
| 92 | +`-` |
| 93 | +## |
| 94 | + |
| 95 | + |
| 96 | +### Worthy Of Note |
| 97 | + |
| 98 | +`-` |
| 99 | +## |
| 100 | + |
| 101 | + |
| 102 | +### FAQs And FUQs |
| 103 | + |
| 104 | +Check [FAQs_And_FUQs.md](FAQs_And_FUQs.md) file for the **Frequently Asked Questions(FAQs)** and **Frequently Unasked Questions(FUQs)**. |
| 105 | +## |
| 106 | + |
| 107 | + |
| 108 | +### Changelog |
| 109 | + |
| 110 | +Check [CHANGELOG.md](CHANGELOG.md) file for the **Changelog**. |
| 111 | +## |
| 112 | + |
| 113 | + |
| 114 | +### Contributions |
| 115 | + |
| 116 | +`-` |
| 117 | +## |
| 118 | + |
| 119 | + |
| 120 | +[Tasker App]: https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm |
| 121 | +[TaskerLauncherShortcut App]: https://github.com/agnostic-apollo/TaskerLauncherShortcut |
0 commit comments