forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo_root_boot_img
More file actions
executable file
·111 lines (87 loc) · 2.27 KB
/
do_root_boot_img
File metadata and controls
executable file
·111 lines (87 loc) · 2.27 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
############################################################################
#
# Copyright (c) 2012 - dsixda ([email protected])
#
# Android Kitchen is 100% free. This script file is intended for personal
# and/or educational use only. It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################
scripts/ensure_boot_extracted no_clear
if [ -d BOOT-EXTRACTED ]
then
if [ -d WORKING_* ]
then
echo -n
else
exit 0
fi
else
exit 0
fi
echo
if [ -d BOOT-EXTRACTED/boot.img-ramdisk ]
then
cd BOOT-EXTRACTED/boot.img-ramdisk
else
echo "Error: BOOT-EXTRACTED/boot.img-ramdisk folder not found!"
exit 0
fi
changed=0
echo "Checking default.prop ..."
if [ "`grep -om 1 ro.secure=1 default.prop`" == "ro.secure=1" ]
then
echo "Set: ro.secure=0"
perl -pi -e 's/ro.secure=1/ro.secure=0/g' default.prop
changed=1
fi
if [ "`grep -om 1 ro.debuggable=0 default.prop`" == "ro.debuggable=0" ]
then
echo "Set: ro.debuggable=1"
perl -pi -e 's/ro.debuggable=0/ro.debuggable=1/g' default.prop
changed=1
fi
# Enable ADB in ICS and newer
usb_config=`grep ^persist.sys.usb.config default.prop`
if [ "$usb_config" != "" ]
then
if [ "`echo $usb_config | grep ,adb`" == "" ]
then
sed -i -e 's/^\(persist.sys.usb.config=.*\)[ ]*$/\1,adb/g' default.prop
echo "Set: `grep persist.sys.usb.config default.prop`"
changed=1
fi
# Enable ADB in versions older than ICS
else
adb_enable=`grep persist.service.adb.enable default.prop`
if [ "$adb_enable" != "" ]
then
if [ "`grep -om 1 persist.service.adb.enable=0 default.prop`" == "persist.service.adb.enable=0" ]
then
echo "Set: persist.service.adb.enable=1"
perl -pi -e 's/persist.service.adb.enable=0/persist.service.adb.enable=1/g' default.prop
changed=1
fi
else
echo "Add: persist.service.adb.enable=1"
echo "persist.service.adb.enable=1" >> default.prop
changed=1
fi
fi
if [ $changed == 1 ]
then
echo
echo New default.prop:
more default.prop
echo
if [ -e default.prop.bak ]
then
rm default.prop.bak
fi
cd ../..
scripts/build_boot_img
else
echo "No changes to default.prop made"
cd ../..
rm -rf BOOT-EXTRACTED
fi