1
0
mirror of https://github.com/danog/mklwp.git synced 2024-11-26 12:04:55 +01:00

Fix some bugs

This commit is contained in:
Daniil Gentili 2016-06-13 01:25:37 +02:00
parent c435f7b052
commit e6f7943f13
10 changed files with 35964 additions and 16 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*~
token

5
CO137823737 Normal file
View File

@ -0,0 +1,5 @@
Custom LWP 2.6
Thanks : andrew121 for the app this script modifies
Thanks : olivvv59 for the added # of images
Thanks : danogentili for linux version and telegram bot (http://daniil.it)
Send me the app icon (preferrably square).

6
CO138398578 Normal file
View File

@ -0,0 +1,6 @@
Custom LWP 2.6
Thanks : andrew121 for the app this script modifies
Thanks : olivvv59 for the added # of images
Thanks : danogentili for linux version and telegram bot (http://daniil.it)
Send me the app icon (preferrably square).
Send me your device's screen size (can be obtained using https://play.google.com/store/apps/details?id=lt.andro.screensize).

View File

@ -7,11 +7,12 @@
# which is MIT/Apache-licensed
# And on tmux (https://github.com/tmux/tmux),
# which is BSD-licensed
cd $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# This file is public domain in the USA and all free countries.
# If you're in Europe, and public domain does not exist, then haha.
source token
URL='https://api.telegram.org/bot'$TOKEN
FORWARD_URL=$URL'/forwardMessage'
@ -26,6 +27,8 @@ VOICE_URL=$URL'/sendVoice'
LOCATION_URL=$URL'/sendLocation'
ACTION_URL=$URL'/sendChatAction'
FORWARD_URL=$URL'/forwardMessage'
ME_URL=$URL'/getMe'
ME=$(curl -s $ME_URL | ./JSON.sh -s | egrep '\["result","username"\]' | cut -f 2 | cut -d '"' -f 2)
FILE_URL='https://api.telegram.org/file/bot'$TOKEN'/'
UPD_URL=$URL'/getUpdates?offset='
@ -124,7 +127,7 @@ send_file() {
esac
send_action $chat_id $STATUS
res=$(curl -s "$CUR_URL" -F "chat_id=$chat_id" -F "$WHAT=@$file" -F "caption=$3")
rm -rf "/tmp/${USER[ID]}"
rm -rf "/mnt/vdb/${USER[ID]}"
}
# typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location
@ -149,7 +152,7 @@ startproc() {
rm -r $copname
mkfifo $copname
tmux kill-session -t $copname
tmux new-session -d -s $copname "./run.sh bashbot ${USER[ID]} &>$copname"
TMUX= tmux new-session -d -s $copname "./run.sh bashbot ${USER[ID]} &>$copname"
while tmux ls | grep -q $copname;do
read -t 10 line
[ "$line" != "" ] && send_message "${USER[ID]}" "$line"
@ -210,13 +213,11 @@ process_client() {
'/info')
send_message "${USER[ID]}" "This is bashbot, the Telegram bot written entirely in bash."
;;
'/start')
startproc
'/start'*)
startproc&
;;
'')
;;
*)
send_message "${USER[ID]}" "$MESSAGE"
esac
else
case $MESSAGE in
@ -226,15 +227,19 @@ process_client() {
;;
'/cancel')
tmux kill-session -t $copname
rm -r $copname /tmp/"${USER[ID]}"
rm -r $copname /mnt/vdb/"${USER[ID]}"
send_message "${USER[ID]}" "Command canceled."
;;
*) inproc;;
esac
fi
tmpcount="COUNT${USER[ID]}"
cat count | grep -q "$tmpcount" || echo "$tmpcount">>count
# To get user count execute bash bashbot.sh count
}
while true; do {
while [ "$1" == "startbot" ]; do {
res=$(curl -s $UPD_URL$OFFSET | ./JSON.sh -s)
@ -254,3 +259,33 @@ while true; do {
}; done
case "$1" in
"outproc")
until [ "$line" = "imprettydarnsuredatdisisdaendofdacmd" ];do
line=
read -t 10 line
[ "$line" != "" -a "$line" != "imprettydarnsuredatdisisdaendofdacmd" ] && send_message "$2" "$line"
done </tmp/$3
rm -r /tmp/$3
;;
"count")
echo "A total of $(wc -l count | sed 's/count//g')users used me."
;;
"broadcast")
echo "Sending the broadcast $* to $(wc -l count | sed 's/count//g')users."
[ $(wc -l count | sed 's/ count//g') -gt 100 ] && sleep="sleep 1"
shift
for f in $(cat count);do send_message ${f//COUNT} "$*"; $sleep;done
;;
"start")
tmux kill-session -t $ME&>/dev/null
tmux new-session -d -s $ME "bash -c \"while :;do bash ./bashbot.sh startbot $ME;done\"" && echo "Bot started successfully. Tmux session name is $ME" || echo "An error occurred while starting the bot."
;;
"kill")
tmux kill-session -t $ME &>/dev/null
echo "Bot was killed successfully. "
;;
"help")
cat README.md
;;
esac

141
count Normal file
View File

@ -0,0 +1,141 @@
COUNT169113237
COUNT219474624
COUNT146990721
COUNT112717454
COUNT137823737
COUNT101374607
COUNT204450671
COUNT203887950
COUNT140639228
COUNT66295747
COUNT97345575
COUNT171503875
COUNT124474493
COUNT91213430
COUNT171482996
COUNT191099793
COUNT55008740
COUNT172543574
COUNT45516361
COUNT180529531
COUNT199553108
COUNT86097946
COUNT-113630796
COUNT209499097
COUNT92518527
COUNT138919269
COUNT185693228
COUNT76990431
COUNT72740807
COUNT49531290
COUNT-14775267
COUNT43002686
COUNT92957853
COUNT70127314
COUNT120206367
COUNT191981035
COUNT122265925
COUNT28558988
COUNT200119930
COUNT176017594
COUNT77968925
COUNT117766932
COUNT122261675
COUNT104483647
COUNT175806957
COUNT115223123
COUNT45045655
COUNT135019937
COUNT200015153
COUNT138398578
COUNT156251965
COUNT203428056
COUNT194539211
COUNT184498666
COUNT28942769
COUNT192701212
COUNT33357114
COUNT178542886
COUNT65296920
COUNT118606001
COUNT200335339
COUNT89093089
COUNT136504145
COUNT108466571
COUNT53834395
COUNT65240257
COUNT65429570
COUNT86363475
COUNT132911565
COUNT58561173
COUNT71319977
COUNT161274437
COUNT95273486
COUNT53821293
COUNT79204752
COUNT11051750
COUNT28419549
COUNT70033624
COUNT177288610
COUNT39749977
COUNT233273320
COUNT172567155
COUNT21305161
COUNT31703503
COUNT212557310
COUNT148082843
COUNT77626666
COUNT9711513
COUNT184050109
COUNT47897728
COUNT29113349
COUNT16418154
COUNT89337193
COUNT148843717
COUNT135759227
COUNT23892477
COUNT17811113
COUNT162955019
COUNT175525761
COUNT131658265
COUNT31245003
COUNT185430085
COUNT198026858
COUNT110762353
COUNT59625577
COUNT186732807
COUNT26648516
COUNT178701192
COUNT38492342
COUNT153954695
COUNT178597388
COUNT151580624
COUNT86725394
COUNT37721897
COUNT176021300
COUNT74950413
COUNT-112689616
COUNT203953614
COUNT195250801
COUNT221491980
COUNT159985979
COUNT75641111
COUNT129223825
COUNT93940340
COUNT161223832
COUNT38051420
COUNT203710501
COUNT166250055
COUNT217263734
COUNT120423273
COUNT70385517
COUNT217956197
COUNT98360860
COUNT64804108
COUNT21179827
COUNT51478338
COUNT39573599
COUNT184518835
COUNT152955588
COUNT88538814
COUNT4240000

35756
o Normal file

File diff suppressed because it is too large Load Diff

18
run.sh
View File

@ -5,17 +5,19 @@ rm -rf out &>/dev/null
cp -a other/backup out
first=$2
[ "$1" = "bashbot" ] && {
error() { cd /tmp; rm -rf /tmp/$first; echo "I'm sorry, it seems an error occurred ($*). Please type /start to restart the process. If you want you can report this error to the creator of this bot by sending a screenshot of this chat @danogentili"; sleep 2;exit; }
mktmpdir() { rm -rf /tmp/$1 &>/dev/null; cp -a $PWD /tmp/$1; cd /tmp/$1; }
error() { cd /mnt/vdb; rm -rf /mnt/vdb/$first; echo "I'm sorry, it seems an error occurred ($*). Please type /start to restart the process. If you want you can report this error to the creator of this bot by sending a screenshot of this chat @danogentili"; sleep 2;exit; }
mktmpdir() { rm -rf /mnt/vdb/$1 &>/dev/null; cp -a $PWD /mnt/vdb/$1; cd /mnt/vdb/$1; }
echo "Custom LWP 2.6
Thanks : andrew121 for the app this script modifies
Thanks : olivvv59 for the added # of images
Thanks : danogentili for linux version and telegram bot (http://daniil.it)
Thanks : olivvv59 for adding the # of images
Thanks : @danogentili for linux version and telegram bot (http://daniil.it)
Send me the app icon (preferrably square)."
mktmpdir $2 || error "couldn't create tmp dir"
read icon
convert "$icon" placeimages/icon.png || error "couldn't download icon"
wget "$icon" -qO placeimages/$(basename "$icon") && convert placeimages/$(basename "$icon") placeimages/icon.png && rm placeimages/$(basename "$icon") || error "couldn't download icon"
echo "Send me your device's screen size (can be obtained using https://play.google.com/store/apps/details?id=lt.andro.screensize)."
read size
@ -54,7 +56,8 @@ Send me the app icon (preferrably square)."
until [ "$n" = "301" ];do
read img
[ "${img,,}" = "done" ] && break
convert "$img" placeimages/images/n$n".png" && echo ok || error "couldn't download $img"
wget "$img" -qO placeimages/images/"$(basename "$img")" && convert placeimages/images/"$(basename "$img")" placeimages/images/n$n".png" && rm placeimages/images/"$(basename "$img")" && echo ok || error "couldn't download the image"
n=$(($n + 1))
done
weird=n
@ -90,7 +93,7 @@ pkgname=$(printf "%q" "$pkgname")
echo "Converting images (might take up to five minutes)..."
n=0
p=0
for f in placeimages/images/*;do n=$(($n+1)); [ "$n" = 10 ] && p=; convert $f -resize "$screensize" "out/res/drawable-hdpi-v4/n"$p$n".png";done
for f in placeimages/images/*;do n=$(($n+1)); [ "$n" = 10 ] && p=; convert "$f" -resize "$screensize" "out/res/drawable-hdpi-v4/n"$p$n".png";done
n=$(printf "%x" $n)
counter=1
@ -141,6 +144,7 @@ Ur device must be connected to ur pc and adb must be in ur PATH (y/n). " -n 1 -r
echo "This bot is based on https://github.com/topkecleon/telegram-bot-bash
You can also contribute to the development by sending a pull request @ https://github.com/danog/mklwp
Thanks for having used mklwp! To restart the process type /start.
Do check out my other projects @ https://daniil.it and do Check out my other bots: @video_dl_bot, @mklwp_bot, @caption_ai_bot, @cowsaysbot, @cowthinksbot, @figletsbot, @lolcatzbot, @filtersbot, @id3bot, @pwrtelegrambot!
Remember to set the correct resolution of your lwp by going in the lwp settings and setting the default resultion.
Sending apk...
There U go myfilelocationstartshere $PWD/$pkgname"-signed.apk