forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_file_to_working_folder
More file actions
executable file
·83 lines (66 loc) · 1.77 KB
/
app_file_to_working_folder
File metadata and controls
executable file
·83 lines (66 loc) · 1.77 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
############################################################################
#
# 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.
#
############################################################################
#
# This script has two arguments:
#
# $1 = file name in original_update (mandatory)
# $2 = "kernel_only" or "name_given" - if this is specified then $1 is mandatory
#
update_file=$1
echo "Selected $update_file"
# Trim spaces in file name
update_file2=`echo $update_file | tr ' ' '_'`
if [ "$update_file" != "$update_file2" ]
then
echo "Renaming to $update_file2"
mv "original_update/$update_file" original_update/$update_file2
update_file=$update_file2
fi
#
# Working folder name
#
build_dir=`scripts/set_working_folder_name $2`
#
# Creating folder structure
#
echo
echo "Creating working folder $build_dir ..."
mkdir $build_dir
echo "Copying $update_file to $build_dir ..."
cp original_update/$update_file $build_dir
cd $build_dir
if [ "$update_file" != "UPDATA.APP" ]
then
echo "Renaming to UPDATA.APP ..."
mv -f $update_file UPDATA.APP
fi
echo
echo "Extracting system.img and boot.img using ZeBadger's script ..."
temp=`perl ../tools/huawei_files/split_updata.pl 2>/dev/null`
if [ ! -e output/system.img ]
then
echo "Error: system.img not found"
fi
if [ ! -e output/boot.img ]
then
echo "Error: boot.img not found"
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 $?