-
Notifications
You must be signed in to change notification settings - Fork 9
/
android-run.sh
executable file
·56 lines (43 loc) · 1.83 KB
/
android-run.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
#!/bin/sh
PUSH=false
adb shell ls -l /data/local/tmp/pulseaudio | grep rwx || PUSH=true
[ -n "$1" ] && PUSH=true
if $PUSH; then
adb shell 'sh -c "rm -r /data/local/tmp/*"'
adb push busybox /data/local/tmp/
adb push arm64-v8a/json-c-12916e229c769da4929f6df7f038ab51cf0cb067/install/lib/libjson-c.so /data/local/tmp/
adb push arm64-v8a/libsndfile-1.0.25/install/lib/libsndfile.so /data/local/tmp/
adb push arm64-v8a/libtool-master/install/lib/libltdl.so /data/local/tmp/
adb push arm64-v8a/install/bin/pulseaudio /data/local/tmp/
adb push arm64-v8a/install/lib/libpulse.so /data/local/tmp/libpulse.so
adb push arm64-v8a/install/lib/pulseaudio/libpulsecore-13.0.so /data/local/tmp/
adb push arm64-v8a/install/lib/pulseaudio/libpulsecommon-13.0.so /data/local/tmp/
adb push android-pulseaudio.conf /data/local/tmp/pulseaudio.conf
for f in arm64-v8a/install/lib/pulse-13.0/modules/*.so; do
adb push $f /data/local/tmp/
done
else
adb push arm64-v8a/install/lib/pulse-13.0/modules/module-opensles.so /data/local/tmp/
fi
trap_ctrlc () {
# perform cleanup here
echo
echo "Ctrl-C caught...performing clean up"
adb shell "killall pulseaudio"
echo
echo "clean up done"
# exit shell script with error code 2
# if omitted, shell script will continue execution
exit 2
}
# initialise trap to call trap_ctrlc function
# when signal 2 (SIGINT) is received
trap "trap_ctrlc" 2
{
sleep 2
#env PULSE_SERVER=tcp:192.168.42.129:4713 pavucontrol &
env PULSE_SERVER=tcp:192.168.42.129:4713 paplay music.ogg
} &
adb shell "cd /data/local/tmp ; HOME=/data/local/tmp TMPDIR=/data/local/tmp LD_LIBRARY_PATH=/data/local/tmp \
./pulseaudio --disable-shm -n -F pulseaudio.conf --dl-search-path=/data/local/tmp \
--daemonize=false --use-pid-file=false --log-target=stderr --log-level=debug --exit-idle-time=31622400 --disallow-exit"