diff --git a/README.md b/README.md index 4e70086..925e355 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,81 @@ -# app-manager (CLI) -Manage Android application in Linux (CLI) +

app-manager

+
+ +[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://gitHub.com/ASHWIN990/app-manager/graphs/commit-activity) +[![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJb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8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) + + +
+ +

Manage Android application in GNU/Linux (CLI) 🖥️

+ +

+ +**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. + +

+ + +## Funtions + +``` +1. Get Device Detail +2. Uninstall Application +3. Install Application 'apk' +4. Disable Application +5. Enable Application + +6. List Applications (Multiple) + 6.1. List All Application + 6.2. List Enabled Application + 6.3. List Disabled Application + 6.4. List System Application + 6.5. List Third Party Application +``` + +## Installation + +```bash +git clone https://github.com/ASHWIN990/app-manager.git + +cd app-manager + +sudo chmod +x app-manager +``` + +## Usage + +```bash +# Go to the directory where you cloned the app-manager repo + +./app-manager + +# or you can do + +bash app-manager +``` + + +## Screenshots + +

+ + +

+ + +## Contributing + +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + + +## Support Me + +Buy Me A Coffee + + +## Author + +- **ASHWINI SAHU** - _WHOLE WORK_ - (https://github.com/ASHWIN990) \ No newline at end of file diff --git a/app-manager.sh b/app-manager.sh index a29ace3..677e738 100755 --- a/app-manager.sh +++ b/app-manager.sh @@ -3,19 +3,63 @@ #Tool = app-manager #Version = 0.1 #Author = ASHWINI SAHU +#GitHub = ASHWIN990 #Date = 10/07/2021 #Written in Bash # Usage and Help Documentaion. function usage() { - echo "Help" + + cat << "EOF" + +app-manager - Manage Android application in Linux (CLI) + +USAGE :- + app-manager [options] + +OPTIONS :- + -s, --serial Pass the serial number of device. + -h, --help Print the Help message. +EOF +} + +# Usage and Help Documentaion. +function usage_full() { + + cat << "EOF" + +app-manager - Manage Android application in Linux (CLI) + +USAGE :- + app-manager [options] + +OPTIONS :- + -s, --serial Pass the serial number of device. + -h, --help Print the Help message + +Functions :- + 1. Get Device Detail + 2. Uninstall Application + 3. Install Application 'apk' + 4. Disable Application + 5. Enable Application + 6. List Applications (Multiple) + 6.1. List All Application + 6.2. List Enabled Application + 6.3. List Disabled Application + 6.4. List System Application + 6.5. List Third Party Application +EOF } # Checking if help agrument is passed or not. for i in "$@"; do - if [[ $i == "-h" ]] || [[ $i == "--help" ]]; then + if [[ $i == "-h" ]]; then usage exit 0 + elif [[ $i == "--help" ]]; then + usage_full + exit 0 fi done @@ -109,7 +153,7 @@ for ((i = 1; i <= $#; i++)); do j=$((i + 1)) if [[ "${!i}" == "-s" ]] || [[ "${!i}" == "--serial" ]]; then - if [[ "${!j}" == "" ]]; then + if [[ -z "${!j}" ]]; then echo -e "\n\e[1;91mError : \e[0mNo Serial no. passed.\e[0m\n" echo -e "\e[32mUse\e[0m : -s or --help\e[0m" exit 1 @@ -181,7 +225,7 @@ function option_2() { read -rp $'\e[1;93m\nEnter the package name to uninstall : \e[21;92m' uninstall_pkg - if [ "$uninstall_pkg" == "" ]; then + if [ -z "$uninstall_pkg" ]; then echo -e "\n\e[1;91mError : \e[0mNo package name was provided\e[0m" exit 1 else @@ -215,7 +259,7 @@ function option_3() { read -rp $'\e[1;93m\nEnter the path of the apk file : \e[21;92m' apk_file_paths - if [ "$apk_file_paths" = "" ]; then + if [ -z "$apk_file_paths" ]; then echo -e "\n\e[1;91mError : \e[0mNo apk was provided\e[0m" exit 1 else @@ -234,7 +278,7 @@ function option_3() { function option_4() { read -rp $'\e[1;93m\nEnter the package name to disable : \e[21;92m' disable_pkg - if [ "$disable_pkg" == "" ]; then + if [ -z "$disable_pkg" ]; then echo -e "\n\e[1;91mError : \e[0mNo package was provided\e[0m" exit 1 else @@ -254,7 +298,7 @@ function option_4() { function option_5() { read -rp $'\e[1;93m\nEnter the package name to enable : \e[21;92m' enable_pkg - if [ "$enable_pkg" == "" ]; then + if [ -z "$enable_pkg" ]; then echo -e "\n\e[1;91mError : \e[0mNo package was provided\e[0m" exit 1 else @@ -293,7 +337,8 @@ function list_application() { counter="1" while read -r line; do set "$line" - echo "$counter : ${1#*:}" counter=$((counter + 1)) >>"$temp_file2" + echo "$counter : ${1#*:}" >>"$temp_file2" + counter=$((counter + 1)) done <"$temp_file1" $LESS -R "${temp_file2}" # Displaying all the apps @@ -463,7 +508,7 @@ function list_application() { break ;; [Ee]*) - echo -e "\n\e[1;93mWarning : \e[0mExiting.....\n" + echo -e "\n\e[1;93mWarning : \e[0mExiting....." break exit 0 ;; @@ -522,7 +567,7 @@ function option_picker() { break ;; [Ee]*) - echo -e "\n\e[1;93mWarning : \e[0mExiting.....\n" + echo -e "\n\e[1;93mWarning : \e[0mExiting....." break exit 0 ;; @@ -550,4 +595,4 @@ function main() { #### Calling the main function #### -main +main \ No newline at end of file diff --git a/launcher b/launcher deleted file mode 100644 index 20d602b..0000000 --- a/launcher +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash - diff --git a/screenshot/am.png b/screenshot/am.png new file mode 100644 index 0000000..6d6a575 Binary files /dev/null and b/screenshot/am.png differ diff --git a/screenshot/am1.png b/screenshot/am1.png new file mode 100644 index 0000000..8e1db18 Binary files /dev/null and b/screenshot/am1.png differ diff --git a/screenshot/la.png b/screenshot/la.png new file mode 100644 index 0000000..bb9622c Binary files /dev/null and b/screenshot/la.png differ diff --git a/screenshot/la1.png b/screenshot/la1.png new file mode 100644 index 0000000..07074bb Binary files /dev/null and b/screenshot/la1.png differ