forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_tether
More file actions
executable file
·155 lines (120 loc) · 2.76 KB
/
add_tether
File metadata and controls
executable file
·155 lines (120 loc) · 2.76 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
############################################################################
#
# Copyright (c) 2011 - 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.
#
############################################################################
clear
echo
echo "-----------------------------------------------------------------"
echo
echo "The Wireless Tethering option adds an app that allows your device"
echo "to act as a wireless router. Devices with Android 2.2 (Froyo) or"
echo "later usually have this feature built into the operating system."
echo ""
echo "The app will be added under the folder /data/app. If /data/app"
echo "functionality was not already enabled then the script will do it"
echo "automatically."
echo
echo "-----------------------------------------------------------------"
echo
scripts/pre_froyo_check
is_old=$?
if [ "$is_old" == "1" ]
then
echo -n "Proceed with Wireless Tethering (y/n)? (default: y): "
read do_tether
if [ "$do_tether" == "n" ]
then
exit 0
fi
elif [ "$is_old" == "2" ]
then
echo "Error: No system folder found!"
exit 0
else
echo -n "ROM is newer than Android 2.1, add app anyway (y/n)? (default: n): "
read do_tether
if [ "$do_tether" != "y" ]
then
exit 0
fi
fi
scripts/ensure_boot_extracted
if [ ! -d WORKING_* ]
then
exit 0
fi
if [ -d BOOT-EXTRACTED ]
then
echo
else
echo "BOOT-EXTRACTED folder not found"
exit 0
fi
#
# Check for root (just look at default.prop in boot.img)
#
echo "Wireless tethering requires a rooted ROM"
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
if [ "`grep -m 1 ro.secure default.prop`" == "ro.secure=1" ]
then
echo "ROM is not fully rooted, because ro.secure=1 in default.prop."
echo "We will root it now ..."
echo
echo "Press Enter when you are ready"
read enterKey
cd ../..
rm -rf BOOT-EXTRACTED
scripts/do_root
else
echo "Boot.img is already unsecure"
cd ../..
rm -rf BOOT-EXTRACTED
fi
if [ -d WORKING_* ]
then
echo
else
exit 0
fi
#
# Copy APK
#
tether_file=wireless_tether*
cd WORKING_*
tether_list=( wireless_tether* android.tether* )
tether_found=0
for find_tether in ${tether_list[@]}
do
res=`find . -name $find_tether`
if [ "$res" != "" ]
then
echo "$res already found"
tether_found=1
fi
done
if [ $tether_found == 1 ]
then
cd ..
exit 0
else
cd ..
scripts/add_data_app dont_ask
cd WORKING_*
echo
echo "Copying app ..."
cp -v ../tools/apps/$tether_file data/app/
cd ..
fi
echo
echo "Done"