-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecorder.sh
66 lines (58 loc) · 1.97 KB
/
recorder.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# ---------------------------------------------
# _ _ _
# | | (_) | |
# __ _ _ __ __| |_ __ ___ _ __| |
# / _` | '_ \ / _` | '__/ _ \| |/ _` |
# | (_| | | | | (_| | | | (_) | | (_| |
# \__,_|_| |_|\__,_|_| \___/|_|\__,_|
#
# ___ ___ _ __ ___ ___ _ __
# / __|/ __| '__/ _ \/ _ \ '_ \
# \__ \ (__| | | __/ __/ | | |
# |___/\___|_| \___|\___|_| |_|
#
# _
# | |
# _ __ ___ ___ ___ _ __ __| | ___ _ __
# | '__/ _ \/ __/ _ \| '__/ _` |/ _ \ '__|
# | | | __/ (_| (_) | | | (_| | __/ |
# |_| \___|\___\___/|_| \__,_|\___|_|
#
# --------------------------------------------
# Created BY Sebastian Cipolat
# @seba_cipolat
# Argentina 2023
# --------------------------------------------
# Screen Recording Script
# --------------------------------------------
recorder(){
cat logo.txt
echo ""
if [ -e "video_counter.txt" ]; then
rm "video_counter.txt"
fi
adb shell rm -f *"/sdcard/screen_recorder/"*
adb shell mkdir "/sdcard/screen_recorder/"
# make sure SIGINT always works even in presence of infinite loops
close() {
trap - SIGINT SIGTERM SIGTERM # clear the trap
tput cnorm
adb shell echo \04; wait
exit
}; trap exitScript SIGINT SIGTERM # set trap
record(){
printf "\n\n%*s\n\n" $((0)) "Use CTRL-C to stop the recording.."
videoCounter=0
while true; do
fileName="rec.$videoCounter.mp4"
videoCounter=$((videoCounter + 1))
printf "\n%*s\n\n" $((0)) "Starting new recording: $fileName"
echo $videoCounter > video_counter.txt
adb shell screenrecord /sdcard/screen_recorder/$fileName || adb shell echo \04
wait; continue
done
}
record && close
}
(recorder) && printf "\ncontinue main loop\n"; exit