.
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | [](https://www.gnu.org/licenses/gpl-3.0)
4 | [](https://gitHub.com/ASHWIN990/app-manager/graphs/commit-activity)
5 | [](https://www.gnu.org/software/bash/)
6 | [](https://ashwini.codes)
7 |
8 |
9 |
10 |
11 |
12 | 
13 |
14 |
15 |
16 | Manage Android application in GNU/Linux (CLI) 🖥️
17 |
18 |
19 |
20 | **app-manager** is a BASH Script to handle **_Android Application_** from the fancy of your terminal screen, i got the idea of it when i wanted to disable some non uninstallable _bloatware_ so i had to take the help of _ADB_ and it worked great and now i'm shraing this to all.
21 |
22 |
23 |
24 | ## Functions
25 |
26 | ```
27 | 1. Get Device Detail
28 | 2. Uninstall Application
29 | 3. Install Application 'apk'
30 | 4. Disable Application
31 | 5. Enable Application
32 |
33 | 6. List Applications (Multiple)
34 | 6.1. List All Application
35 | 6.2. List Enabled Application
36 | 6.3. List Disabled Application
37 | 6.4. List System Application
38 | 6.5. List Third Party Application
39 | ```
40 |
41 |
42 | ## Prerequisite
43 |
44 | * Install ```adb``` for your distro
45 |
46 | Generally ```adb``` comes bundled with package ```android-tools```
47 |
48 |
49 | ## Installation
50 |
51 | **Arch linux** and **Arch based distro** (**_AUR_**)
52 |
53 | - yay -S [app-manager](https://aur.archlinux.org/packages/app-manager/)
54 |
55 | **Normal Installation**
56 |
57 | ```console
58 | foo@bar:~$ git clone https://github.com/ASHWIN990/app-manager.git
59 |
60 | foo@bar:~$ cd app-manager
61 |
62 | foo@bar:~$ chmod +x app-manager
63 | ```
64 |
65 | ## Usage
66 |
67 | ```console
68 | #Go to the directory where you cloned the app-manager repo
69 |
70 | foo@bar:~$ ./app-manager
71 |
72 | #or you can do
73 |
74 | foo@bar:~$ bash app-manager
75 | ```
76 |
77 | ## Options
78 |
79 | ```bash
80 | -s, --serial Pass the serial number of device.
81 |
82 | -h, --help Print the Help message.
83 | ```
84 |
85 | ## Screenshots
86 |
87 |
88 |
89 |
90 |
91 |
92 | ## Contributing
93 |
94 | Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
95 |
96 | ## Support Me
97 |
98 |
99 |
100 | ## Author
101 |
102 | * **[ASHWINI SAHU](https://ashwini.codes)**
103 | * **Email me at : *ashwinisahu990@gmail.com***
104 | * **Follow me at : *[Instagram](https://instagram.com/kumar_ashwin_sahu) , [Twitter](https://twitter.com/ashwinisahu990)***
105 |
--------------------------------------------------------------------------------
/app-manager:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #Tool = app-manager
4 | #Version = 0.1
5 | #Author = ASHWINI SAHU
6 | #GitHub = ASHWIN990
7 | #Date = 10/07/2021
8 | #Written in Bash
9 |
10 | # Usage and Help Documentaion.
11 | function usage() {
12 |
13 | cat << "EOF"
14 |
15 | [01;94mapp-manager [01;91m- [01;92mManage Android application in Linux (CLI)
16 | [0m
17 | USAGE :-
18 | app-manager [options]
19 |
20 | OPTIONS :-
21 | -s, --serial Pass the serial number of device.
22 | -h, --help Print the Help message.[0m
23 | EOF
24 | }
25 |
26 | # Usage and Help Documentaion.
27 | function usage_full() {
28 |
29 | cat << "EOF"
30 |
31 | [01;94mapp-manager [01;91m- [01;92mManage Android application in Linux (CLI)
32 | [0m
33 | USAGE :-
34 | app-manager [options]
35 |
36 | OPTIONS :-
37 | -s, --serial Pass the serial number of device.
38 | -h, --help Print the Help message
39 |
40 | Functions :-
41 | 1. Get Device Detail
42 | 2. Uninstall Application
43 | 3. Install Application 'apk'
44 | 4. Disable Application
45 | 5. Enable Application
46 | 6. List Applications (Multiple)
47 | 6.1. List All Application
48 | 6.2. List Enabled Application
49 | 6.3. List Disabled Application
50 | 6.4. List System Application
51 | 6.5. List Third Party Application[0m
52 | EOF
53 | }
54 |
55 | # Checking if help agrument is passed or not.
56 | for i in "$@"; do
57 | if [[ $i == "-h" ]]; then
58 | usage
59 | exit 0
60 | elif [[ $i == "--help" ]]; then
61 | usage_full
62 | exit 0
63 | fi
64 | done
65 |
66 | # Ascii art banner main.
67 | function banner() {
68 |
69 | cat <<"EOF"
70 | [01;94m __ _ _ __ _ __ [01;92m _ __ ___ __ _ _ __ __ _ __ _ ___ _ __
71 | [01;94m / _` | '_ \| '_ \ [01;91m _____ [01;92m| '_ ` _ \ / _` | '_ \ / _` |/ _` |/ _ \ '__|
72 | [01;94m| (_| | |_) | |_) | [01;91m|_____| [01;92m| | | | | | (_| | | | | (_| | (_| | __/ |
73 | [01;94m \__,_| ___/| .__/ [01;91m [01;92m|_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|_|
74 | [01;94m |_| |_| [01;92m |___/
75 | [0m
76 | EOF
77 | echo -e "\t\t\t\e[93mMade with \e[91m❤️\e[93m by \e[1;92mASHWINI SAHU\e[0m\n"
78 |
79 | }
80 |
81 | # Print the banner and check the terminal size.
82 | function print_banner_main() {
83 |
84 | TERM_COLUMN=$(stty size | cut -d" " -f2)
85 |
86 | if [[ "$TERM_COLUMN" -ge "70" ]]; then
87 | banner
88 | else
89 | echo -e "\n\e[1;93mWarning : \e[0mTerminal size too small.\n"
90 | fi
91 | }
92 |
93 | # Ascii art banner list application.
94 | function list_app_banner() {
95 |
96 | cat <<"EOF"
97 | [01;94m _ _ _
98 | [01;94m| (_) | |
99 | [01;94m| |_ ___| |_ [01;91m ______ [01;92m __ _ _ __ _ __
100 | [01;94m| | / __| __| [01;91m|______|[01;92m / _` | '_ \| '_ \
101 | [01;94m| | \__ \ |_ [01;92m| (_| | |_) | |_) |
102 | [01;94m|_|_|___/\__| [01;92m \__,_| .__/| .__/
103 | [01;92m| | | |
104 | [01;92m|_| |_|
105 | [0m
106 | EOF
107 | echo -e "\t\e[93mMade with \e[91m❤️\e[93m by \e[1;92mASHWINI SAHU\e[0m\n"
108 |
109 | }
110 |
111 | # Print the banner and check the terminal size.
112 | function print_banner_list_app() {
113 |
114 | TERM_COLUMN=$(stty size | cut -d" " -f2)
115 |
116 | if [[ "$TERM_COLUMN" -ge "43" ]]; then
117 | list_app_banner
118 | else
119 | echo -e "\n\e[1;93mWarning : \e[0mTerminal size too small.\n"
120 | fi
121 | }
122 |
123 | ################ Main logic starts ################
124 |
125 | # Checking if ADB command exist or not.
126 | if ! [ "$(command -v adb)" ]; then
127 | echo -e "\n\e[1;91mError : \e[0mCommand \e[93madb\e[0m is not installed on system.\e[0m"
128 | exit 1
129 | else
130 | ADB=$(which adb)
131 | fi
132 |
133 | # Checking if less command exist or not.
134 | if ! [ "$(command -v less)" ]; then
135 | echo -e "\n\e[1;91mError : \e[0mCommand \e[93mless\e[0m is not installed on system.\e[0m"
136 | exit 1
137 | else
138 | LESS=$(which less)
139 | fi
140 |
141 | # Check device valid or not.
142 | function device_valid_or_not() {
143 | if ! $ADB -s "$SERIAL_NO" get-state 1>/dev/null 2>&1; then
144 | echo -e "\n\e[1;91mError : \e[0mSerial : \e[93m'$SERIAL_NO'\e[0m not connected.\e[0m\n"
145 | echo -e "\e[32mUse\e[0m : -s specify the serial no.\e[0m"
146 | exit 1
147 | fi
148 | }
149 |
150 | # Check if serial no. is passed or not.
151 | for ((i = 1; i <= $#; i++)); do
152 |
153 | j=$((i + 1))
154 |
155 | if [[ "${!i}" == "-s" ]] || [[ "${!i}" == "--serial" ]]; then
156 | if [[ -z "${!j}" ]]; then
157 | echo -e "\n\e[1;91mError : \e[0mNo Serial no. passed.\e[0m\n"
158 | echo -e "\e[32mUse\e[0m : -s or --help\e[0m"
159 | exit 1
160 | else
161 | SERIAL_NO="${!j}"
162 | device_valid_or_not "$SERIAL_NO"
163 | fi
164 | fi
165 |
166 | done
167 |
168 | # Get device Info.
169 | function get_device_info() {
170 |
171 | # Check if device is connected or not.
172 | if ! $ADB -s "$SERIAL_NO" get-state 1>/dev/null 2>&1; then
173 | echo -e "\n\e[1;91mError : \e[21;93mMultiple or No Device Connected\e[0m\n"
174 | echo -e "\e[32mUse\e[0m : -s or --help\e[0m"
175 | exit 1
176 | else
177 | SERIAL_NO=$($ADB -s "$SERIAL_NO" get-serialno)
178 | MODEL=$($ADB -s "$SERIAL_NO" shell getprop ro.product.model)
179 | DEVICE_NAME=$($ADB -s "$SERIAL_NO" shell getprop ro.product.name)
180 | DEVICE_MANUFATURER=$($ADB -s "$SERIAL_NO" shell getprop ro.product.manufacturer)
181 |
182 | fi
183 |
184 | }
185 |
186 | ###### OPTION 1 "GET SYSTEM DETAIL" ######
187 |
188 | function option_1() {
189 |
190 | ### Fetching all the data ###
191 |
192 | MODEL=$($ADB -s "$SERIAL_NO" shell getprop ro.product.model)
193 | DEVICE_NAME=$($ADB -s "$SERIAL_NO" shell getprop ro.product.name)
194 | DEVICE_MANUFATURER=$($ADB -s "$SERIAL_NO" shell getprop ro.product.manufacturer)
195 | ANDROID=$($ADB -s "$SERIAL_NO" shell getprop ro.build.version.release)
196 | SECURITY_PATCH=$($ADB -s "$SERIAL_NO" shell getprop ro.build.version.security_patch)
197 | GSM_SIM=$($ADB -s "$SERIAL_NO" shell getprop gsm.sim.operator.alpha)
198 | ENCRYPTION_STATE=$($ADB -s "$SERIAL_NO" shell getprop ro.crypto.state)
199 | BUILD_DATE=$($ADB -s "$SERIAL_NO" shell getprop ro.build.date)
200 | SDK_VERSION=$($ADB -s "$SERIAL_NO" shell getprop ro.build.version.sdk)
201 | WIFI_INTERFACE=$($ADB -s "$SERIAL_NO" shell getprop wifi.interface)
202 |
203 | ### Printing all the data ###
204 |
205 | echo -e "\n\e[93mThe Details for device \e[1;92m'$MODEL' \e[21;93mare :- \n"
206 | echo -e "\e[21;95mModel \e[1;94m= \e[1;93m$MODEL"
207 | echo -e "\e[21;95mDevice \e[1;94m= \e[1;93m$DEVICE_NAME"
208 | echo -e "\e[21;95mManufacturer \e[1;94m= \e[1;93m$DEVICE_MANUFATURER"
209 | echo -e "\e[21;95mBuild Date \e[1;94m= \e[1;93m$BUILD_DATE"
210 | echo -e "\e[21;95mAndroid \e[1;94m= \e[1;93m$ANDROID"
211 | echo -e "\e[21;95mSDK Version \e[1;94m= \e[1;93m$SDK_VERSION"
212 | echo -e "\e[21;95mSim Card \e[1;94m= \e[1;93m$GSM_SIM"
213 | echo -e "\e[21;95mSecurity Patch \e[1;94m= \e[1;93m$SECURITY_PATCH"
214 | echo -e "\e[21;95mEncryption State \e[1;94m= \e[1;93m$ENCRYPTION_STATE"
215 | echo -e "\e[21;95mWiFi Interface \e[1;94m= \e[1;93m$WIFI_INTERFACE\e[0m\n"
216 |
217 | # Exiting the Script
218 | exit 0
219 |
220 | }
221 |
222 | ###### OPTION 2 "UNINSTALL A APPLICATION" ######
223 |
224 | function option_2() {
225 |
226 | read -rp $'\e[1;93m\nEnter the package name to uninstall : \e[21;92m' uninstall_pkg
227 |
228 | if [ -z "$uninstall_pkg" ]; then
229 | echo -e "\n\e[1;91mError : \e[0mNo package name was provided\e[0m"
230 | exit 1
231 | else
232 | if $ADB -s "$SERIAL_NO" uninstall "$uninstall_pkg" &>/dev/null; then
233 | echo -e "\n\e[1;92mSuccess : \e[0mUninstalled the \e[33m'$uninstall_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
234 | exit 0
235 | else
236 | echo -e "\n\e[1;91mError : \e[0mFailed uninstalling \e[33m'$uninstall_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
237 | exit 1
238 | fi
239 | fi
240 |
241 | }
242 |
243 | ###### OPTION 3 "INSTALL A APPLICATION" ######
244 |
245 | function option_3() {
246 |
247 | function apk_install() {
248 |
249 | echo -e "\n\e[1;93m*Note* : \e[0mCheck the device."
250 | if $ADB -s "$SERIAL_NO" install -r "$apk_file_paths" &>/dev/null; then
251 | echo -e "\n\e[1;92mSuccess : \e[0mInstalled the \e[33m'$apk_file_paths' \e[0mto \e[33m'$MODEL'\e[0m"
252 | exit 0
253 | else
254 | echo -e "\n\e[1;91mError : \e[0mFailed installing \e[33m'$apk_file_paths' \e[0mto \e[33m'$MODEL'\e[0m"
255 | exit 1
256 | fi
257 |
258 | }
259 |
260 | read -rp $'\e[1;93m\nEnter the path of the apk file : \e[21;92m' apk_file_paths
261 |
262 | if [ -z "$apk_file_paths" ]; then
263 | echo -e "\n\e[1;91mError : \e[0mNo apk was provided\e[0m"
264 | exit 1
265 | else
266 | if [ -f "$apk_file_paths" ]; then
267 | apk_install
268 | else
269 | echo -e "\n\e[1;91mError : \e[0mThe provided apk file does not exist\e[0m"
270 | exit 1
271 | fi
272 | fi
273 |
274 | }
275 |
276 | ###### OPTION 4 "DISABLE APPLICATION" ######
277 |
278 | function option_4() {
279 |
280 | read -rp $'\e[1;93m\nEnter the package name to disable : \e[21;92m' disable_pkg
281 | if [ -z "$disable_pkg" ]; then
282 | echo -e "\n\e[1;91mError : \e[0mNo package was provided\e[0m"
283 | exit 1
284 | else
285 | if $ADB -s "$SERIAL_NO" shell pm disable-user --user 0 "$disable_pkg" &>/dev/null; then
286 | echo -e "\n\e[1;92mSuccess : \e[0mDisabled \e[33m'$disable_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
287 | exit 0
288 | else
289 | echo -e "\n\e[1;91mError : \e[0mFailed disabling \e[33m'$disable_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
290 | exit 1
291 | fi
292 | fi
293 |
294 | }
295 |
296 | ###### OPTION 5 "ENABLE APPLICATION" ######
297 |
298 | function option_5() {
299 |
300 | read -rp $'\e[1;93m\nEnter the package name to enable : \e[21;92m' enable_pkg
301 | if [ -z "$enable_pkg" ]; then
302 | echo -e "\n\e[1;91mError : \e[0mNo package was provided\e[0m"
303 | exit 1
304 | else
305 | if $ADB -s "$SERIAL_NO" shell pm enable "$enable_pkg" &>/dev/null; then
306 | echo -e "\n\e[1;92mSuccess : \e[0mEnabled \e[33m'$enable_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
307 | exit 0
308 | else
309 | echo -e "\n\e[1;91mError : \e[0mFailed enabling \e[33m'$enable_pkg' \e[0mfrom \e[33m'$MODEL'\e[0m"
310 | exit 1
311 | fi
312 | fi
313 |
314 | }
315 |
316 | ###### OPTION 6 "LIST APPLICATION" ######
317 |
318 | function list_application() {
319 |
320 | ###### OPTION 1 "LIST ALL APPLICATION" ######
321 |
322 | function option_list_1() {
323 |
324 | echo -e "\n\e[1;92mListing all packages in : \e[33m'$MODEL'\e[0m\n"
325 | echo -e "\n\e[1;93m*Note* : \e[0mPress \e[1;93mq\e[0m to stop in viewing."
326 |
327 | sleep 1s # Giving time to read the note
328 |
329 | temp_file1=$(mktemp) # creating a temp file to store output
330 | temp_file2=$(mktemp) # creating a temp file to filter
331 |
332 | if ! $ADB -s "$SERIAL_NO" shell cmd package list packages >"$temp_file1"; then
333 | echo -e "\n\e[1;91mError : \e[0mSome error occured.\e[0m"
334 | exit 1
335 | fi
336 |
337 | counter="1"
338 | while read -r line; do
339 | set "$line"
340 | echo "[94m$counter [93m: [92m${1#*:}[0m" >>"$temp_file2"
341 | counter=$((counter + 1))
342 | done <"$temp_file1"
343 |
344 | $LESS -R "${temp_file2}" # Displaying all the apps
345 |
346 | rm "${temp_file1}" # Deleting the temp file
347 | rm "${temp_file2}" # Deleting the temp file
348 |
349 | }
350 |
351 | ###### OPTION 2 "LIST ENABLED APPLICATION" ######
352 |
353 | function option_list_2() {
354 |
355 | echo -e "\n\e[1;92mListing all enabled packages in : \e[33m'$MODEL'\e[0m\n"
356 | echo -e "\n\e[1;93m*Note* : \e[0mPress \e[1;93mq\e[0m to stop in viewing."
357 |
358 | sleep 1s # Giving time to read the note
359 |
360 | temp_file1=$(mktemp) # creating a temp file to store output
361 | temp_file2=$(mktemp) # creating a temp file to filter
362 |
363 | if ! $ADB -s "$SERIAL_NO" shell cmd package list packages -e >"$temp_file1"; then
364 | echo -e "\n\e[1;91mError : \e[0mSome error occured.\e[0m"
365 | exit 1
366 | fi
367 |
368 | counter="1"
369 | while read -r line; do
370 | set "$line"
371 | echo "[94m$counter [93m: [92m${1#*:}[0m" >>"$temp_file2"
372 | counter=$((counter + 1))
373 | done <"$temp_file1"
374 |
375 | $LESS -R "${temp_file2}" # Displaying all the apps
376 |
377 | rm "${temp_file1}" # Deleting the temp file
378 | rm "${temp_file2}" # Deleting the temp file
379 |
380 | }
381 |
382 | ###### OPTION 3 "LIST DISABLED APPLICATION" ######
383 |
384 | function option_list_3() {
385 |
386 | echo -e "\n\e[1;92mListing all disabled packages in : \e[33m'$MODEL'\e[0m\n"
387 | echo -e "\n\e[1;93m*Note* : \e[0mPress \e[1;93mq\e[0m to stop in viewing."
388 |
389 | sleep 1s # Giving time to read the note
390 |
391 | temp_file1=$(mktemp) # creating a temp file to store output
392 | temp_file2=$(mktemp) # creating a temp file to filter
393 |
394 | if ! $ADB -s "$SERIAL_NO" shell cmd package list packages -d >"$temp_file1"; then
395 | echo -e "\n\e[1;91mError : \e[0mSome error occured.\e[0m"
396 | exit 1
397 | fi
398 |
399 | counter="1"
400 | while read -r line; do
401 | set "$line"
402 | echo "[94m$counter [93m: [92m${1#*:}[0m" >>"$temp_file2"
403 | counter=$((counter + 1))
404 | done <"$temp_file1"
405 |
406 | $LESS -R "${temp_file2}" # Displaying all the apps
407 |
408 | rm "${temp_file1}" # Deleting the temp file
409 | rm "${temp_file2}" # Deleting the temp file
410 |
411 | }
412 |
413 | ###### OPTION 4 "LIST SYSTEM APPLICATION" ######
414 |
415 | function option_list_4() {
416 |
417 | echo -e "\n\e[1;92mListing all system packages in : \e[33m'$MODEL'\e[0m\n"
418 | echo -e "\n\e[1;93m*Note* : \e[0mPress \e[1;93mq\e[0m to stop in viewing."
419 |
420 | sleep 1s # Giving time to read the note
421 |
422 | temp_file1=$(mktemp) # creating a temp file to store output
423 | temp_file2=$(mktemp) # creating a temp file to filter
424 |
425 | if ! $ADB -s "$SERIAL_NO" shell cmd package list packages -s >"$temp_file1"; then
426 | echo -e "\n\e[1;91mError : \e[0mSome error occured.\e[0m"
427 | exit 1
428 | fi
429 |
430 | counter="1"
431 | while read -r line; do
432 | set "$line"
433 | echo "[94m$counter [93m: [92m${1#*:}[0m" >>"$temp_file2"
434 | counter=$((counter + 1))
435 | done <"$temp_file1"
436 |
437 | $LESS -R "${temp_file2}" # Displaying all the apps
438 |
439 | rm "${temp_file1}" # Deleting the temp file
440 | rm "${temp_file2}" # Deleting the temp file
441 |
442 | }
443 |
444 | ###### OPTION 5 "LIST THIRD PARTY APPLICATION" ######
445 |
446 | function option_list_5() {
447 |
448 | echo -e "\n\e[1;92mListing all third party packages in : \e[33m'$MODEL'\e[0m\n"
449 | echo -e "\n\e[1;93m*Note* : \e[0mPress \e[1;93mq\e[0m to stop in viewing."
450 |
451 | sleep 1s # Giving time to read the note
452 |
453 | temp_file1=$(mktemp) # creating a temp file to store output
454 | temp_file2=$(mktemp) # creating a temp file to filter
455 |
456 | if ! $ADB -s "$SERIAL_NO" shell cmd package list packages -3 >"$temp_file1"; then
457 | echo -e "\n\e[1;91mError : \e[0mSome error occured.\e[0m"
458 | exit 1
459 | fi
460 |
461 | counter="1"
462 | while read -r line; do
463 | set "$line"
464 | echo "[94m$counter [93m: [92m${1#*:}[0m" >>"$temp_file2"
465 | counter=$((counter + 1))
466 | done <"$temp_file1"
467 |
468 | $LESS -R "${temp_file2}" # Displaying all the apps
469 |
470 | rm "${temp_file1}" # Deleting the temp file
471 | rm "${temp_file2}" # Deleting the temp file
472 |
473 | }
474 |
475 | echo -e "\033[2J\033[1;1H" # Might replace with 'clear' later
476 | list_app_banner
477 | echo -e "\e[1;93m 1. \e[1;92mList All Application\n"
478 | echo -e "\e[1;93m 2. \e[1;92mList Enabled Application"
479 | echo -e "\e[1;93m 3. \e[1;92mList Disabled Application"
480 | echo -e "\e[1;93m 4. \e[1;92mList System Application"
481 | echo -e "\e[1;93m 5. \e[1;92mList Third Party Application\n"
482 | echo -e "\e[1;93m E. \e[1;92mExit"
483 | echo -e "$revised"
484 | read -rp $' \e[1;4;91mEnter\e[1;24;91m \e[1;4;91m$\e[1;24;91m\e[24;1;97m : \e[0m' options_list_application
485 |
486 | while true; do
487 |
488 | case $options_list_application in
489 |
490 | "1")
491 | option_list_1
492 | break
493 | ;;
494 | "2")
495 | option_list_2
496 | break
497 | ;;
498 | "3")
499 | option_list_3
500 | break
501 | ;;
502 | "4")
503 | option_list_4
504 | break
505 | ;;
506 | "5")
507 | option_list_5
508 | break
509 | ;;
510 | [Ee]*)
511 | echo -e "\n\e[1;93mWarning : \e[0mExiting....."
512 | break
513 | exit 0
514 | ;;
515 | *)
516 | revised="\n\e[1;91m Enter the right option :-)\e[0m\n"
517 | list_application
518 | break
519 | ;;
520 |
521 | esac
522 |
523 | done
524 |
525 | }
526 |
527 | # Option list
528 | function option_picker() {
529 |
530 | print_banner_main
531 | echo -e "\e[1;93m 1. \e[1;92mGet Device detail\n"
532 | echo -e "\e[1;93m 2. \e[1;92mUninstall Application"
533 | echo -e "\e[1;93m 3. \e[1;92mInstall Application 'apk'"
534 | echo -e "\e[1;93m 4. \e[1;92mDisable Application"
535 | echo -e "\e[1;93m 5. \e[1;92mEnable Application\n"
536 | echo -e "\e[1;93m 6. \e[1;92mList Applications (Multiple)\n"
537 | echo -e "\e[1;93m E. \e[1;92mExit"
538 | echo -e "$revised"
539 | read -rp $' \e[1;4;91mEnter\e[1;24;91m \e[1;4;91m$\e[1;24;91m\e[24;1;97m : \e[0m' options
540 |
541 | while true; do
542 |
543 | case $options in
544 |
545 | "1")
546 | option_1
547 | break
548 | ;;
549 | "2")
550 | option_2
551 | break
552 | ;;
553 | "3")
554 | option_3
555 | break
556 | ;;
557 | "4")
558 | option_4
559 | break
560 | ;;
561 | "5")
562 | option_5
563 | break
564 | ;;
565 | "6")
566 | list_application
567 | break
568 | ;;
569 | [Ee]*)
570 | echo -e "\n\e[1;93mWarning : \e[0mExiting....."
571 | break
572 | exit 0
573 | ;;
574 | *)
575 | echo -e "\033[2J\033[1;1H" # Might replace with 'clear' later
576 | revised="\n\e[1;91m Enter the right option :-)\e[0m\n"
577 | option_picker
578 | break
579 | ;;
580 |
581 | esac
582 |
583 | done
584 |
585 | }
586 |
587 | ##################### MAIN FUNCTION #####################
588 |
589 | function main() {
590 |
591 | get_device_info # Getting device info and checking ia any valid device connected or not
592 | option_picker # Option picker dialog
593 |
594 | }
595 |
596 | #### Calling the main function ####
597 |
598 | main
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #Tool = app-manager installer
4 | #Version = 0.1
5 | #Author = ASHWINI SAHU
6 | #GitHub = ASHWIN990
7 | #Date = 12/10/2022
8 | #Written in Bash
9 |
10 | # set -euo pipefail
11 |
12 | function install() {
13 |
14 | if [ "$1" == "file" ]; then
15 | echo -e "Installing from the existing file"
16 | echo -e "File path : $PWD/app-manager"
17 | elif [ "$1" == "internet" ]; then
18 | echo -e "Installing from the internet"
19 | echo -e "URL : https://raw.githubusercontent.com/ASHWIN990/app-manager/main/app-manager"
20 | fi
21 |
22 | if [ ! -d "$HOME/.local/bin/" ]; then
23 | mkdir -p "$HOME/.local/bin/"
24 | fi
25 |
26 | if [ "$(command -v app-manager)" ]; then
27 |
28 | message=$(echo -e "\napp-manager already installed in $(command -v app-manager)\nInstall it anyway : (Y/n) ? : ")
29 | read -rp "$message" yn
30 |
31 | case $yn in
32 | [Nn]*)
33 | echo -e "\nAborting the installation !"
34 | exit 0
35 | ;;
36 | esac
37 | fi
38 |
39 | if [ "$1" == "internet" ]; then
40 | echo "Downloading the app-manager" && wget -q "https://raw.githubusercontent.com/ASHWIN990/app-manager/main/app-manager"
41 | fi
42 |
43 | chmod +x "$PWD/app-manager"
44 | cp "$PWD/app-manager" "$HOME/.local/bin/"
45 | echo -e "\nInstallation done succesfully in $(command -v app-manager)"
46 | }
47 |
48 | if [ -e app-manager ]; then
49 | install "file"
50 | else
51 | install "internet"
52 | fi
53 |
--------------------------------------------------------------------------------
/screenshot/am.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ASHWIN990/app-manager/6fc2010d5b110c57917844191e685e1cf94e37f9/screenshot/am.png
--------------------------------------------------------------------------------
/screenshot/am1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ASHWIN990/app-manager/6fc2010d5b110c57917844191e685e1cf94e37f9/screenshot/am1.png
--------------------------------------------------------------------------------
/screenshot/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ASHWIN990/app-manager/6fc2010d5b110c57917844191e685e1cf94e37f9/screenshot/banner.png
--------------------------------------------------------------------------------
/screenshot/la.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ASHWIN990/app-manager/6fc2010d5b110c57917844191e685e1cf94e37f9/screenshot/la.png
--------------------------------------------------------------------------------
/screenshot/la1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ASHWIN990/app-manager/6fc2010d5b110c57917844191e685e1cf94e37f9/screenshot/la1.png
--------------------------------------------------------------------------------