Skip to content

Commit 23bae20

Browse files
Updated README.md
1 parent 0ff86ba commit 23bae20

4 files changed

Lines changed: 170 additions & 46 deletions

File tree

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
**Version Number Format:** `major.minor.patch`
6+
**Release Date Format:** `yyyy-mm-dd`
7+
8+
**Types of Changes:**
9+
- **Added** for new features.
10+
- **Changed** for changes in existing functionality.
11+
- **Deprecated** for soon-to-be removed features.
12+
- **Removed** for now removed features.
13+
- **Fixed** for any bug fixes.
14+
- **Security** in case of vulnerabilities.
15+
##
16+
17+
18+
## [Unreleased]
19+
20+
`-`
21+
22+
23+
## [0.1.0] - 2020-01-13
24+
25+
`-`
26+
##
27+
28+
29+
[unreleased]: https://github.com/Taskomater/tasker_package_utils/compare/v0.1.0...HEAD
30+
[0.1.0]: https://github.com/Taskomater/tasker_package_utils/releases/tag/v0.1.0

FAQs_And_FUQs.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Frequently Asked Questions(FAQs)
2+
3+
`-`
4+
##
5+
6+
7+
### Frequently Unasked Questions(FUQs)
8+
9+
`-`
10+
##
11+

README.md

Lines changed: 110 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,81 @@
1-
# Tasker Package Utils
1+
# tasker_package_utils
2+
3+
This is a project to provide some utils related to [Tasker App] package.
4+
##
5+
6+
7+
### Contents
8+
- [Compatibility](#Compatibility)
9+
- [Dependencies](#Dependencies)
10+
- [Downloads](#Downloads)
11+
- [Install Instructions For Termux In Android](#Install-Instructions-For-Termux-In-Android)
12+
- [tasker_package_utils Script Usage](#tasker_package_utils-Script-Usage)
13+
- [Current Features](#Current-Features)
14+
- [Planned Features](#Planned-Features)
15+
- [Issues](#Issues)
16+
- [Worthy Of Note](#Worthy-Of-Note)
17+
- [FAQs And FUQs](#FAQs-And-FUQs)
18+
- [Changelog](#Changelog)
19+
- [Contributions](#Contributions)
20+
##
21+
22+
23+
### Compatibility
24+
25+
- Android using [Termux App].
26+
- Linux distros.
27+
- Windows using [cygwin].
28+
##
29+
30+
31+
### Dependencies
32+
33+
- Android users should install [Termux App].
34+
- Windows users should install [cygwin] and use cygwin shell to run scripts.
35+
- `GNU` variant of `sed` should be installed in your system.
36+
- Termux (non-root shell): `apt install sed`
37+
- Linux distros: `sudo apt install sed`
38+
- Windows: It should ideally be installed by default with cygwin. If not, then run cygwin installer and search package and install.
39+
##
240

3-
This is a project to provide some utils related to Tasker App package.
441

542
### Downloads
6-
Download latest release from [here](https://github.com/Taskomater/Tasker-Package-Utils/releases).
43+
44+
- [GitHub releases](https://github.com/Taskomater/tasker_package_utils/releases).
45+
##
46+
47+
48+
### Install Instructions For Termux In Android
49+
50+
The `tasker_package_utils` file should be placed in termux `bin` directory `/data/data/com.termux/files/usr/bin` and it should have `termux` `uid:gid` ownership and have executable `700` permission before it can be run in the termux terminal without specifying its path.
51+
1. Copy the file to termux bin directory:
52+
Either `cd` to the download/extraction directory and run following commands
53+
54+
```
55+
cat tasker_package_utils > /data/data/com.termux/files/usr/bin/tasker_package_utils
56+
```
57+
58+
Or use a file browser like root explorer to copy the file to the termux bin directory.
59+
60+
2. Set correct ownership and permission:
61+
Either run following commands to set them automatically, requires su binary to be in `$PATH`.
62+
63+
```
64+
export termux_bin_path="/data/data/com.termux/files/usr/bin"; export owner="$(stat -c "%u" "$termux_bin_path")"; for f in tasker_package_utils; do if [ -f "$termux_bin_path/$f" ]; then su -c "chown $owner:$owner \"$termux_bin_path/$f\" && chmod 700 \"$termux_bin_path/$f\""; fi; done;
65+
```
66+
67+
Or manually set them with your file browser. You can find `termux` `uid` and `gid` by running the command `id -u` in a non root shell in termux or by checking the properties of the termux `bin` directory from your file browser.
768
##
869

970

10-
### **`tasker_package_utils script:`**
71+
### tasker_package_utils Script Usage
1172

12-
You can run the script placed in the current directory without setting the ownership and permission by running the command `bash tasker_package_utils`.
73+
You may optionally run the script placed in the current directory without setting the ownership and permission by running the command `bash tasker_package_utils`.
1374
If you are not running the script in termux, set the shebang of the script correctly (the first line of the script).
1475

15-
##### Usage:
76+
- **`tasker_package_utils`**
77+
78+
##### Help:
1679

1780
```
1881
Usage:
@@ -34,10 +97,10 @@ Use \"tasker_package_utils command [ -h | --help ]\" for more help about a comma
3497

3598
- **`tasker_package_utils convert_system_priv`**
3699

37-
##### Usage:
38-
39100
**`tasker_package_utils convert_system_priv`** command is used to convert tasker user app to system privileged app.
40101

102+
##### Help:
103+
41104
```
42105
tasker_package_utils convert_system_priv command is used to convert tasker user app to system privileged app.
43106
@@ -85,7 +148,7 @@ bash tasker_package_utils convert_system_priv -d
85148

86149
**This is currently unsupported and will be implemented later.**
87150

88-
##### Usage:
151+
##### Help:
89152

90153
```
91154
tasker_package_utils convert_user command is used to convert tasker system privileged app to user app.
@@ -120,7 +183,7 @@ bash tasker_package_utils convert_user
120183

121184
**`tasker_package_utils uninstall`** command is used to to uninstall tasker. The tasker system privileged apk will also be removed provided that `tasker_package_utils convert_system_priv` command was used to install it as a system privileged app.
122185

123-
##### Usage:
186+
##### Help:
124187

125188
```
126189
tasker_package_utils uninstall command is used to uninstall tasker.
@@ -148,7 +211,7 @@ bash tasker_package_utils uninstall
148211

149212
**`tasker_package_utils perms`** command is used to manage tasker package permissions. This command supports the script to be run directly on the device itself in a root shell like in termux or to be run over adb.
150213

151-
##### Usage:
214+
##### Help:
152215

153216
```
154217
tasker_package_utils perms command is used manage tasker package permissions.
@@ -248,35 +311,51 @@ bash tasker_package_utils perms list | grep READ_LOGS
248311
##
249312

250313

251-
### Dependencies:
314+
### Current Features
252315

253-
You should have GNU sed installed in your system.
254-
- Termux (non-root shell): `apt install sed`
255-
- Linux distros: `sudo apt install sed`
256-
- Windows: You can use cygwin installer.
316+
- Convert Tasker user app to system privileged app.
317+
- Uninstall Tasker
318+
- Grant/Revoke/List Tasker package permissions.
319+
- Run Commands in a root shell on the device or over adb with or without root.
257320
##
258321

259322

260-
### Install Instructions For Termux In Android:
323+
### Planned Features
261324

262-
The `tasker_package_utils` file should be placed in termux `bin` directory `/data/data/com.termux/files/usr/bin` and it should have `termux` uid:gid ownership and have executable `700` permission before it can be run in the termux terminal without specifying its path.
263-
1. Copy the file to termux bin directory:
264-
Either `cd` to the download/extraction directory and run following commands
325+
- Convert Tasker system privileged app to user app.
326+
##
265327

266-
```
267-
cat tasker_package_utils > /data/data/com.termux/files/usr/bin/tasker_package_utils
268-
```
269328

270-
Or use a file browser like root explorer to copy the file to the termux bin directory.
329+
### Issues
271330

272-
2. Set correct ownership and permission:
273-
Either run following commands to set them automatically, requires su binary to be in `$PATH`.
331+
`-`
332+
##
274333

275-
```
276-
export termux_bin_path="/data/data/com.termux/files/usr/bin"; export owner="$(stat -c "%u" "$termux_bin_path")"; for f in tasker_package_utils; do if [ -f "$termux_bin_path/$f" ]; then su -c "chown $owner:$owner \"$termux_bin_path/$f\" && chmod 700 \"$termux_bin_path/$f\""; fi; done;
277-
```
278334

279-
Or manually set them with your file browser. You can find `termux` `uid` and `gid` by running the command `id -u` in a non root shell in termux or by checking the properties of the termux `bin` directory from your file browser.
335+
### Worthy Of Note
336+
337+
`-`
338+
##
339+
340+
341+
### FAQs And FUQs
342+
343+
Check [FAQs_And_FUQs.md](FAQs_And_FUQs.md) file for the **Frequently Asked Questions(FAQs)** and **Frequently Unasked Questions(FUQs)**.
344+
##
345+
346+
### Changelog
347+
348+
Check [CHANGELOG.md](CHANGELOG.md) file for the **Changelog**.
280349

281-
You may optionally run the script placed in the current directory without setting the ownership and permission by running the command `bash tasker_package_utils`.
282350
##
351+
352+
353+
### Contributions
354+
355+
`-`
356+
##
357+
358+
359+
[Tasker App]: https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
360+
[Termux App]: https://github.com/termux/termux-app
361+
[cygwin]: https://cygwin.com/index.html

tasker_package_utils

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
#bash version: 4.0 or higher
1515
#credits: -
1616
#license: MIT License
17-
version=1.0
17+
version=0.1.0
1818

1919

20-
##### Install Instructions For Termux In Android:
2120

22-
#The `tasker_package_utils` file should be placed in termux `bin` directory `/data/data/com.termux/files/usr/bin` and it should have `termux` uid:gid ownership and have executable `700` permission before it can be run in the termux terminal without specifying its path.
21+
### Install Instructions For Termux In Android:
22+
23+
#The `tasker_package_utils` file should be placed in termux `bin` directory `/data/data/com.termux/files/usr/bin` and it should have `termux` `uid:gid` ownership and have executable `700` permission before it can be run in the termux terminal without specifying its path.
2324
#1. Copy the file to termux bin directory:
2425
# Either `cd` to the download/extraction directory and run following commands
2526
#
@@ -41,7 +42,9 @@ version=1.0
4142
#You can run the script placed in the current directory without setting the ownership and permission by running the command `bash tasker_package_utils`.
4243
#If you are not running the script in termux, set the shebang of the script correctly (the first line of the script).
4344

44-
#Usage:
45+
46+
47+
### Usage Examples:
4548

4649
#Convert tasker user app to system privileged app in normal mode
4750
#this will uninstall tasker and you will loose all tasker data and desktop shortcuts
@@ -114,7 +117,8 @@ version=1.0
114117
#bash tasker_package_utils perms list | grep READ_LOGS
115118

116119

117-
#define user modifiable variables start
120+
121+
### Set User Modifiable Variables Start
118122

119123
#set permissions to grant or revoke
120124
#the permissions_list contains all permissions declared by tasker till version '5.9.rc.3'
@@ -197,11 +201,11 @@ declare -ga permissions_list=(
197201
#"net.dinglisch.android.zoom.permission.MAKE_CHANGES"
198202
)
199203

200-
#define user modifiable variables end
204+
### Set User Modifiable Variables End
201205

202206

203-
#define default variables start
204-
#do not modify below values unless you know what you are doing
207+
### Set Default Variables Start
208+
#The following variables must not be modified unless you know what you are doing
205209

206210
command_type="" #default to no command
207211
conversion_mode="" #default to none
@@ -223,7 +227,7 @@ system_priv_apk_install_path="/system/priv-app"
223227
android_packages_xml_file="/data/system/packages.xml"
224228
android_runtime_permissions_xml_file="/data/system/users/0/runtime-permissions.xml"
225229

226-
#define default variables end
230+
### Set Default Variables End
227231

228232

229233
[[ x"${BASH_SOURCE[0]}" == x"$0" ]] && tasker_package_utils_exit_command="exit" || tasker_package_utils_exit_command="return"
@@ -922,7 +926,7 @@ process_tasker_package_utils_parameters () {
922926
tasker_package_utils_log_arg_errors "Invalid option or parameters not allowed for option: '--${OPTARG%=*}'"
923927
exit_tasker_package_utils_on_error "$command_type"
924928
;;
925-
'' ) #"--" terminates argument processing to support non-options that convert_system_priv with dashes
929+
'' ) #"--" terminates argument processing to support non-options that start with dashes
926930
tasker_package_utils_log_args "Parsing option: '--'"
927931
break
928932
;;
@@ -988,7 +992,7 @@ process_tasker_package_utils_parameters () {
988992
tasker_package_utils_log_arg_errors "Invalid option or parameters not allowed for option: '--${OPTARG%=*}'"
989993
exit_tasker_package_utils_on_error "$command_type"
990994
;;
991-
'' ) #"--" terminates argument processing to support non-options that convert_user with dashes
995+
'' ) #"--" terminates argument processing to support non-options that start with dashes
992996
tasker_package_utils_log_args "Parsing option: '--'"
993997
break
994998
;;
@@ -1054,7 +1058,7 @@ process_tasker_package_utils_parameters () {
10541058
tasker_package_utils_log_arg_errors "Invalid option or parameters not allowed for option: '--${OPTARG%=*}'"
10551059
exit_tasker_package_utils_on_error "$command_type"
10561060
;;
1057-
'' ) #"--" terminates argument processing to support non-options that uninstall with dashes
1061+
'' ) #"--" terminates argument processing to support non-options that start with dashes
10581062
tasker_package_utils_log_args "Parsing option: '--'"
10591063
break
10601064
;;
@@ -1106,7 +1110,7 @@ process_tasker_package_utils_parameters () {
11061110
tasker_package_utils_log_arg_errors "Invalid option or parameters not allowed for option: '--${OPTARG%=*}'"
11071111
exit_tasker_package_utils_on_error "$command_type"
11081112
;;
1109-
'' ) #"--" terminates argument processing to support non-options that perms with dashes
1113+
'' ) #"--" terminates argument processing to support non-options that start with dashes
11101114
tasker_package_utils_log_args "Parsing option: '--'"
11111115
break
11121116
;;
@@ -1151,7 +1155,7 @@ process_tasker_package_utils_parameters () {
11511155
shift $((OPTIND -1)) #remove already processed arguments from argument list
11521156

11531157
if [ $# -lt 1 ]; then
1154-
tasker_package_utils_log_arg_errors "Invalid number of args passed. \"tasker_package_utils perms\" command expects atleast 1 arg: perms_mode"
1158+
tasker_package_utils_log_arg_errors "Invalid parameter count. \"tasker_package_utils perms\" command expects at least 1 parameter: perms_mode"
11551159
$tasker_package_utils_exit_command 1
11561160
fi
11571161

@@ -1175,7 +1179,7 @@ process_tasker_package_utils_parameters () {
11751179
#if perms_mode is "list"
11761180
elif [[ "$perms_mode" == "list" ]]; then
11771181
if [ $# -ne 0 ]; then
1178-
tasker_package_utils_log_arg_errors "Invalid number of args passed. \"tasker_package_utils perms list\" command expects no args"
1182+
tasker_package_utils_log_arg_errors "Invalid parameter count. \"tasker_package_utils perms list\" command expects no parameters"
11791183
$tasker_package_utils_exit_command 1
11801184
fi
11811185
else

0 commit comments

Comments
 (0)