From 78b9042bd262c17245fab992f6f1cbbc1b56f21c Mon Sep 17 00:00:00 2001 From: D4rkia <49065066+D4rkia@users.noreply.github.com> Date: Mon, 4 Jan 2021 21:46:19 +0100 Subject: [PATCH] Check automatically when the permission is granted --- sndcpy | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sndcpy b/sndcpy index ad9b58b..cf90394 100755 --- a/sndcpy +++ b/sndcpy @@ -24,6 +24,17 @@ fi "$ADB" $serial forward tcp:$SNDCPY_PORT localabstract:sndcpy "$ADB" $serial shell am start com.rom1v.sndcpy/.MainActivity -echo "Press Enter once audio capture is authorized on the device to start playing..." -read dummy +string='com.rom1v.sndcpy/com.rom1v.sndcpy.MainActivity/android.view.ViewRootImpl' +while true; do + if "$ADB" shell dumpsys gfxinfo com.rom1v.sndcpy | grep -q $string; then + break + fi +done +while true; do + if "$ADB" shell dumpsys gfxinfo com.rom1v.sndcpy | grep -q $string; then + echo "waiting" + else + break + fi +done "$VLC" -Idummy --demux rawaud --network-caching=0 --play-and-exit tcp://localhost:"$SNDCPY_PORT"