-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathapp_file_to_working_folder
executable file
·82 lines (66 loc) · 1.71 KB
/
app_file_to_working_folder
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
############################################################################
#
# Copyright (c) 2011 - dsixda (dislam@rocketmail.com)
#Copyright (c) 2014 - 越狱 (http://weibo.com/206021119)
#
# Android 厨房是100%免费。此脚本文件仅供个人或学习使用
# by hwh132 越狱 汉化
#
############################################################################
#
# 此脚本具有两个参数:
#
# $1 = original_update中的文件名称 (强制性)
# $2 = "kernel_only" 或 "name_given" - 如果这被指定则是强制性 $1
#
update_file=$1
echo "选择 $update_file"
# 剪裁空格的文件名称
update_file2=`echo $update_file | tr ' ' '_'`
if [ "$update_file" != "$update_file2" ]
then
echo "重命名为 $update_file2"
mv "original_update/$update_file" original_update/$update_file2
update_file=$update_file2
fi
#
# Working 文件夹名称
#
build_dir=`scripts/set_working_folder_name $2`
#
# 创建文件夹结构
#
echo
echo "创建 Working 文件夹 $build_dir ..."
mkdir $build_dir
echo "复制 $update_file 到 $build_dir ..."
cp original_update/$update_file $build_dir
cd $build_dir
if [ "$update_file" != "UPDATA.APP" ]
then
echo "重命名为 UPDATA.APP ..."
mv -f $update_file UPDATA.APP
fi
echo
echo "使用 ZeBadger 脚本解包 System.img 和 boot.img ..."
temp=`perl ../tools/huawei_files/split_updata.pl 2>/dev/null`
if [ ! -e output/system.img ]
then
echo "错误: 未发现 system.img"
fi
if [ ! -e output/boot.img ]
then
echo "错误: 未发现 boot.img"
fi
if [ ! -e output/system.img ] || [ ! -e output/boot.img ]
then
cd ..
exit 1
fi
mv -f output/boot.img .
mv -f output/system.img .
rm -rf output
rm -f UPDATA.APP
cd ..
scripts/img_files_to_working_folder no_create $2
exit $?