Repository navigation
Expand file tree
/
Copy pathadd_busybox
More file actions
executable file
·129 lines (104 loc) · 2.44 KB
/
Copy pathadd_busybox
File metadata and controls
executable file
·129 lines (104 loc) · 2.44 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
############################################################################
#
# Copyright (c) 2012 - dsixda (dislam@rocketmail.com)
#
# 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.
#
############################################################################
#
# exit 1 = busybox not created
# exit 0 = busybox is now in working folder
#
if [ "$1" == "" ]
then
clear
elif [ "$1" == "show_help" ]
then
clear
echo
echo "-----------------------------------------------------------------"
echo
echo "BusyBox is an executable file that combines tiny versions of"
echo "many common UNIX utilities. It is required for some root-enabled"
echo "applications."
echo
echo "-----------------------------------------------------------------"
echo
echo -n "Add BusyBox (y/n)? (default: y): "
read do_bb
if [ "$do_bb" == "n" ]
then
exit 1
fi
fi
if [ ! -d WORKING_* ]
then
echo No working folder found!
exit 1
fi
cd WORKING_*
su_path=`find . -name su`
if [ "$su_path" == "" ]
then
echo "'su' binary not found under working folder!"
cd ..
exit 1
else
echo
echo "Found $su_path"
fi
version=`more ../tools/busybox_files/version.txt | sed -e 's/BusyBox \(.*\)$/\1/g'`
if [ -e system/bin/busybox ]
then
echo
echo "Working folder already has /system/bin/busybox"
if [ "$1" == "show_help" ]
then
echo -n "Replace with BusyBox $version (y/n)? (default: y): "
read replace_bin_bb
echo
if [ "$replace_bin_bb" == "n" ]
then
echo "Cancelled"
else
echo "Replacing /system/bin/busybox"
cp -f ../tools/busybox_files/busybox system/bin/
fi
fi
cd ..
exit 0
fi
echo
if [ -d system/xbin ]
then
echo Found /system/xbin
if [ -e system/xbin/busybox ]
then
echo
echo "Working folder already has /system/xbin/busybox"
if [ "$1" == "show_help" ]
then
echo -n "Replace with BusyBox $version (y/n)? (default: y): "
read replace_bb
echo
else
replace_bb=n
fi
if [ "$replace_bb" == "n" ]
then
cd ..
exit 0
fi
echo "Replacing /system/xbin/busybox"
fi
else
echo Creating /system/xbin
mkdir system/xbin
fi
echo "Adding /system/xbin/busybox"
cp -f ../tools/busybox_files/busybox system/xbin/
cd ..
scripts/add_busybox_to_update_script
exit 0