-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathraidlindex
More file actions
executable file
·44 lines (38 loc) · 894 Bytes
/
raidlindex
File metadata and controls
executable file
·44 lines (38 loc) · 894 Bytes
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
#!/bin/bash
! which adb > /dev/null && echo "Could not find adb in path." && exit 1
dev=""
lst=""
usage() {
echo "Usage: raidlindex [-l | -s <serial number>]" > /dev/stderr
}
while getopts ":s:l" opt; do
case $opt in
a)
dev="-s $OPTARG"
;;
l)
lst="-l"
;;
:)
echo "Option -$OPTARG requires an argument." >&2
usage
exit 1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
usage
exit 1
;;
esac
done
services=$(adb shell raidl list | tail -n +2 | awk '{print $2}' | tr -d ':')
for s in $services; do
echo -n "Dumping AIDL for $s... "
adb $dev shell "raidl iface $lst $s 2> /dev/null" > $s.aidl
if [ ! -s $s.aidl ]; then
rm $s.aidl
echo "FAIL"
else
echo "OK"
fi
done