forked from pwelyn/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck_which_update_binary
More file actions
executable file
·130 lines (100 loc) · 2.69 KB
/
Copy pathcheck_which_update_binary
File metadata and controls
executable file
·130 lines (100 loc) · 2.69 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
############################################################################
#
# Copyright (c) 2013 - dsixda (dislam@rocketmail.com)
# Copyright (c) 2014 - 越狱 (http://weibo.com/206021119)
#
# Android 厨房是100%免费。此脚本文件仅供个人或学习使用
# by hwh132 越狱 汉化
#
############################################################################
cd WORKING_*
working_folder=`pwd`
cd META-INF/com/google/android
update_dir=`pwd`
if [ ! -e updater-script ]
then
echo
echo "错误: 未发现 updater-script"
cd ../../../../..
exit 0
fi
if [ -e update-binary.orig ]
then
echo
echo "复制原始 update-binary"
cp -vf update-binary.orig update-binary
elif [ -e update-binary ]
then
echo
echo "使用现有的 update-binary"
echo
else
cd ../../../../..
scripts/check_galaxy_s2
sgs2=$?
if [ "$sgs2" != "1" ]
then
scripts/check_galaxy_s2x
sgs2x=$?
if [ "$sgs2x" != "1" ]
then
scripts/check_galaxy_s3_common
sgs3_common=$?
if [ "$sgs3_common" != "1" ]
then
scripts/check_galaxy_s4_common
sgs4_common=$?
if [ "$sgs4_common" != "1" ] && [ -e $working_folder/boot.img ]
then
scripts/check_mt65xx_bootimg
mt65xx=$?
fi
fi
fi
fi
device_name=`scripts/get_device_name`
cd $update_dir
echo
echo "复制 update-binary ..."
if [ "$sgs2" == "1" ] || [ "$sgs2x" = "1" ]
then
cp -vf ../../../../../tools/update_files/sgs2-update-binary update-binary
elif [ "$sgs3_common" == "1" ] || [ "$sgs4_common" == "1" ]
then
cp -vf ../../../../../tools/update_files/sgs3-update-binary update-binary
elif [ "$device_name" == "GT-I9103" ]
then
cp -vf ../../../../../tools/update_files/emmc-not-neon-update-binary update-binary
else
grep_emmc=`grep -c "mount(.*,.*,.*,.*)" updater-script`
if [ $grep_emmc -gt 0 ]
then
#
# 四个参数用于 mount
#
# 例如: mount("ext3", "EMMC", "/dev/block/mmcblk0p26", "/data");
# 例如: mount("yaffs2", "MTD", "userdata", "/data");
#
if [ "$mt65xx" == "1" ]
then
cp -vf ../../../../../tools/update_files/emmc-mt65xx-update-binary update-binary
else
cp -vf ../../../../../tools/update_files/emmc-update-binary update-binary
fi
else
#
# 三个参数为 mount, 但没有 MTD 或 assert
#
# mount("ext3", "/dev/block/mmcblk0p25", "/system");
#
# 或
#
# 三个参数, 可以使用 MTD 和 assert
#
# 例如: mount("MTD", "userdata", "/data");
#
cp -vf ../../../../../tools/update_files/mtd-update-binary update-binary
fi
fi
fi
cd ../../../../..