Skip to content

Instantly share code, notes, and snippets.

@SDRausty
Created July 20, 2019 18:13
Show Gist options
  • Save SDRausty/1b1a6e7fa8941d294fa0c0b560e7f6be to your computer and use it in GitHub Desktop.
Save SDRausty/1b1a6e7fa8941d294fa0c0b560e7f6be to your computer and use it in GitHub Desktop.
setup.buildAPKs.bash from https://github.com/BuildAPKs/buildAPKs
#!/bin/env bash
# Copyright 2017-2019 (c) all rights reserved by S D Rausty
#####################################################################
set -Eeuo pipefail
shopt -s nullglob globstar
_SUPTRPERROR_() { # Run on script error.
local RV="$?"
printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs setupBuildAPKs.sh ERROR: Signal %s received!\\e[0m\\n" "$RV"
printf "\\e[?25h\\e[0m\\n"
exit 201
}
_SUPTRPEXIT_() { # Run on exit.
local RV="$?"
sleep 0.04
if [[ "$RV" = 0 ]] ; then
printf "\\a\\e[1;7;38;5;155m%s %s \\a\\e[0m\\e[1;34m: \\a\\e[1;32m%s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$ARGS" "DONE 🏁 "
printf "\\e]2; %s: %s \\007" "${0##*/} $ARGS" "DONE 🏁 "
else
printf "\\a\\e[1;7;38;5;88m%s %s \\a\\e[0m\\e[1;34m: \\a\\e[1;32m%s %s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$ARGS" "[Exit Signal $RV]" "DONE 🏁 "
printf "\033]2; %s: %s %s \\007" "${0##*/} $ARGS" "[Exit Signal $RV]" "DONE 🏁 "
fi
printf "\\e[?25h\\e[0m"
set +Eeuo pipefail
exit
}
_SUPTRPSIGNAL_() { # Run on signal.
local RV="$?"
printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs setupBuildAPKs.sh WARNING: Signal %s received!\\e[0m\\n" "$RV"
exit 211
}
_SUPTRPQUIT_() { # Run on quit.
local RV="$?"
printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs setupBuildAPKs.sh WARNING: Quit signal %s received!\\e[0m\\n" "$RV"
exit 221
}
trap '_SUPTRPERROR_ $LINENO $BASH_COMMAND $?' ERR
trap _SUPTRPEXIT_ EXIT
trap _SUPTRPSIGNAL_ HUP INT TERM
trap _SUPTRPQUIT_ QUIT
declare -a ARGS="$@"
if [[ -z "${1:-}" ]]
then
ARGS=""
fi
STRING="COMMAND \`au\` enables rollback, available at https://github.com/sdrausty/au IS NOT FOUND: Continuing... "
STRING2="Cannot update ~/buildAPKs prerequisites: Continuing..."
printf "\\n\\e[1;38;5;116m%s\\n\\e[0m" "Beginning buildAPKs setup:"
declare COMMANDIF=""
COMMANDIF="$(command -v au)" || (printf "%s\\n\\n" "$STRING")
if [[ "$COMMANDIF" = au ]]
then
(au aapt apksigner curl dx ecj findutils git) || (printf "%s\\n\\n" "$STRING2")
else
(pkg install aapt apksigner curl dx ecj findutils git) || (printf "%s\\n\\n" "$STRING2")
fi
cd "$HOME"
(git clone https://github.com/BuildAPKs/buildAPKs) || (printf "%s\\n\\n" "$STRING2")
./buildAPKs/scripts/bash/build/build.entertainment.bash
#EOF
@SDRausty
Copy link
Author

buildAPKs

BuildAPKs has source code and scripts in order to build APKs (Android Package Kits) on Android handhelds, and similar. Quick setup instructions can be found here at https://buildapks.github.io/docsBuildAPKs/setup and also https://buildapks.github.io/docsBuildAPKs/reallyEasilyBuildAndroidAPKsOnDevice right here.

You can try building hundreds of exciting, amazing and beautiful APKs by running shell scripts from this directory. It is simple! The minimal install size to start building your first apps (6) is about 10MB! Have fun and enjoy compiling, hacking, modifying and running these select APKs!

Cloning and updating submodules is automated into the build*.bash scripts. If you recieve a history error message from git pull, the simplest solution is mv ~/buildAPKs ~/b0 and then reclone into the $HOME folder. The ~/buildAPKs/sources/ directory can be a symbolic link to external storage space to save native space on device. Prefix the build*.bash scripts with bash to run buildAPKs in external storage, e.g. $ bash buildFlashlights.bash.

Build Android APKs on device (smartphone and tablet).

Build Android APKs on device, on your smartphone and tablet with Termux; Make applications for your Android smartphone and tablet! This repository contains source code for various Android applications that have been successfully built in Termux.

Have you ever wanted to build your own application? Something that you can distribute over the Internet, and can be used on Android smartphones and tablets worldwide. Would you dare to try to spend some time learning something new to do so?

BuildAPKs is a repository of source code designed just for this purpose. Source code is the way programs are written in a human understandable language for applications to compile and then to be run on an Android device. These programs have been tested and were built successfully on device, a smartphone. First successful builds on Sun May 28 2017 in Termux (Android 6.0.1 aarch64).

See https://buildapks.github.io/docsBuildAPKs/reallyEasilyBuildAndroidAPKsOnDevice for quick setup instructions and https://sdrausty.github.io/docsBuildAPKs for the documentation website for this project.

Really Easily Build an Android APK on an Android Device (Smartphone and Tablet).

Prefix these bash scripts by typing dot slash ./ on your Android smartphone and tablet in Termux, i.e. type ./b at the prompt ($), press TAB TAB (x2). The prompt should magically add uild; Then add a capitol A. Press TAB TAB (x2) again. This should build the following command on the command line ./buildAll.bash for you. Press enter (return) in ~/buildAPKs/. Additional CLI information at The Linux Documentation Project.

The built APKs will be deposited into Download/builtAPKs for installing on smartphone and tablet through browsers, and download and file managers. The minimal install size to start building your first applications is about 10MB. Have fun and enjoy compiling, hacking, modifying and running these select APKs on device!

The buildAll.bash command can build hundreds of APKs on your device. Maximum space allotment for complete build of everything included (755) is about 850MB for buildAPKs, plus about 74MB for the finished products deposited into /storage/emulated/0/Download/builtAPKs; More than seven hundred and fifty five (755) Android applications can be made from source code on device today.

Contribute to this project through both the issues page and pull requests. Enjoy building these select APKs for Termux projects, and find the time to post your feelings here, and at this wiki.

If you're confused by this page try this link, and you might want to try this one. Post your what you have found at the wiki.

πŸ›³β›΄πŸ›₯πŸš’πŸš€πŸš£β›΅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment