mirror of
git://f0xx.org/android_cast
synced 2026-07-29 05:37:52 +03:00
sync
This commit is contained in:
18
scripts/grant-dev-adb-perms.sh
Executable file
18
scripts/grant-dev-adb-perms.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# One-time grants while device is connected (usually USB). Debug package only.
|
||||
set -euo pipefail
|
||||
|
||||
PACKAGE="${1:-com.foxx.androidcast}"
|
||||
|
||||
if ! adb get-state >/dev/null 2>&1; then
|
||||
echo "ERROR: no adb device in 'device' state" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Granting dev adb permissions to ${PACKAGE}"
|
||||
adb shell pm grant "${PACKAGE}" android.permission.WRITE_SECURE_SETTINGS
|
||||
adb shell pm grant "${PACKAGE}" android.permission.DUMP
|
||||
adb shell am broadcast \
|
||||
-a com.foxx.androidcast.dev.REFRESH_ADB_WIFI \
|
||||
-n "${PACKAGE}/.dev.DevAdbWifiReceiver"
|
||||
echo "OK. Re-check: curl -s http://DEVICE:5039/adb.json | grep secure_settings_granted"
|
||||
Reference in New Issue
Block a user