forked from ZeroingIn/AutoInputBootPin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.sh
61 lines (56 loc) · 1.05 KB
/
service.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
#!/system/bin/sh
MODDIR=${0%/*}
#encryption detection
# [ $(getprop ro.crypto.state) = "encrypted" ] || echo "unencrypted"
#boot detection
until [ $(getprop init.svc.bootanim) = "stopped" ]
do
sleep 2
done
# 7 --> "KEYCODE_0" 48
# 16 --> "KEYCODE_9" 57
# 66 --> "KEYCODE_ENTER"
#convert char to keyCode
# function convert()
# {
# #A-Za-z0-9
# char=$1
# charASCII=$( printf "%d" "'${char}" )
# keyCode=$((10#${charASCII}-41))
# echo $keyCode
# return $keyCode
# }
source /data/AutoInputBootPIN/config
#input sim 1 pin
# for i in `seq 1 ${#PIN1}`
# do
# c=${PIN1:$i-1:1}
# echo $c
# code=$(convert $c)
# input keyevent $code
# done
sleep 2
input text $PIN1
input keyevent 66
sleep $TimeInterval
#input sim 2 pin
# for i in `seq 1 ${#PIN2}`
# do
# c=${PIN2:$i-1:1}
# echo $c
# code=$(convert $c)
# input keyevent $code
# done
input text $PIN2
input keyevent 66
sleep $TimeInterval
#input phone pin
# for i in `seq 1 ${#PIN3}`
# do
# c=${PIN3:$i-1:1}
# echo $c
# code=$(convert $c)
# input keyevent $code
# done
input text $PIN3
input keyevent 66