-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetlocalprop
More file actions
executable file
·45 lines (39 loc) · 924 Bytes
/
setlocalprop
File metadata and controls
executable file
·45 lines (39 loc) · 924 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
45
#!/bin/bash
# Nome: Zhenlei Ji
# Email: zhenlei.ji@gmail.com
#
# Easy way to enable log on device with verbose priority.
#
# HOW TO USE
# Commands:
# ~$ ./setlocalprop [TAG] [TAG] [TAG]..
#
# Example :
# ~$ ./setlocalprop ZenModeHelper ZenModePanel ZenModeController VolumeUI ManagedServices
if [ "$#" -eq 0 ]; then
echo "Forgot to add tags as parameter."
else
echo "Creating local.prop file..."
LOCAL_PROP="local.prop"
# Set root mode
adb root
# Delay to connect
sleep 1
# Waiting for connection
while [ `adb devices | wc -l` -ne 3 ]; do
sleep 1
done
if [ -f $LOCAL_PROP ]; then
rm $LOCAL_PROP
fi
for tag in "$@"; do
echo log.tag.$tag=VERBOSE >> $LOCAL_PROP
done
echo "Adding local.prop file into device..."
adb push $LOCAL_PROP /data/$LOCAL_PROP
adb shell chmod 644 /data/$LOCAL_PROP
adb shell chown root.root /data/$LOCAL_PROP
adb reboot
echo "Reboot device..."
rm $LOCAL_PROP
fi