Created
July 20, 2021 22:38
-
-
Save Dixzz/270e6f677a957570e73310743e5d61dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHAT_ID="<your_tg_id>" | |
number_reg='^[1-9]+$' | |
function message(){ | |
for chat in $CHAT_ID | |
do | |
curl -s "https://api.telegram.org/bot471977941:AAG76tYc8jCmQgcqGbVVF0KYyBQiYPb-DOE/sendmessage" --data "text=${*}&chat_id=$CHAT_ID&parse_mode=Markdown" > /dev/null | |
done | |
echo -e | |
} | |
function askUser(){ | |
echo -e "\n\033[0;33m######### Launching options for: $codename #######\033[0m\n" | |
toExec="" | |
proc_res=$(nproc --all) | |
echo -e "\033[0;31m------------\033[0m" | |
echo -e "0. Exit\n1. Settings\n2. SystemUI\n3. Dialer\n4. Build\nChoose number" | |
echo -e "\033[0;31m------------\033[0m" | |
read opt | |
if [[ $opt =~ $number_reg ]] ; then | |
ROOT_PATH=$PWD | |
BUILD_PATH="$ROOT_PATH/out/target/product/$codename" | |
rm -rf $BUILD_PATH/*.zip | |
. b*/e* | |
lunch octavi_$codename-userdebug | |
currDate=$(date +%Y%m%d-%H%M) | |
case $opt in | |
1) | |
if make Settings -j$proc_res; then | |
toExec="rclone copy -P $BUILD_PATH/system/system_ext/priv-app/Settings/Settings.apk x: && message "'Link: $(rclone link x:Settings.apk)'"" | |
fi | |
;; | |
2) | |
if make SystemUI -j$proc_res; then | |
toExec="rclone copy -P $BUILD_PATH/system/system_ext/priv-app/SystemUI/SystemUI.apk x: && message "'Link: $rclone link x:SystemUI.apk)'"" | |
fi | |
;; | |
3) | |
if make Dialer -j$proc_res; then | |
toExec="rclone copy -P $BUILD_PATH/system/product/priv-app/Dialer/Dialer.apk x: && message "'Link: $(rclone link x:Dialer.apk)'"" | |
fi | |
;; | |
4) | |
if make octavi -j$proc_res; then | |
FINALZIP=$(ls $BUILD_PATH/OctaviOS-v*-*$currDate*.zip) | |
if [ -n "$FINALZIP" ]; then | |
toExec="rclone copy -P $BUILD_PATH//$FINALZIP x:rom && message "'Link: $(rclone link x:rom/$FINALZIP)'"" | |
else | |
ls $BUILD_PATH/OctaviOS-v*-*$currDate*.zip | |
fi | |
fi | |
;; | |
*) | |
askUser | |
;; | |
esac | |
if [ -n "$toExec" ]; then | |
eval $toExec | |
fi | |
elif [ $opt == "0" ]; then | |
return 0 | |
else | |
askUser | |
fi | |
} | |
function askDevice(){ | |
echo "Enter device" | |
read codename | |
if [ -n "$codename" ]; then | |
askUser | |
else | |
askDevice | |
fi | |
} | |
# main -> | |
echo "You can also pass device name in arguments" | |
if [ -z "$1" ]; then | |
askDevice | |
else | |
codename=$1 | |
askUser | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment