forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchange_api_level
More file actions
executable file
·72 lines (60 loc) · 2.01 KB
/
change_api_level
File metadata and controls
executable file
·72 lines (60 loc) · 2.01 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
############################################################################
#
# Copyright (c) 2013 - 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
if [ ! -e tools/deodex_files/api_level.txt ]
then
echo "Error: Cannot find tools/deodex_files/api_level.txt"
scripts/press_enter
exit 0
fi
api_level=`scripts/get_api_level`
echo
echo "The kitchen has the current API level set to: $api_level"
echo "Ensure you have set the correct API level for your ROM!"
echo
echo "Each API level corresponds to at least one Android OS version."
echo
echo "e.g."
echo " Android 4.2-4.2.2 = API Level 17"
echo " Android 4.1-4.1.1 = API Level 16"
echo " Android 4.0.3-4.0.4 = API Level 15"
echo " Android 4.0-4.0.2 = API Level 14"
echo " Android 3.2 = API Level 13"
echo " Android 3.1.x = API Level 12"
echo " Android 3.0.x = API Level 11"
echo " Android 2.3.3+ = API Level 10"
echo
echo "NOTE: The above is not the full list."
echo
echo "The complete set of mappings is found at:"
echo "http://developer.android.com/guide/appendix/api-levels.html"
echo
echo -n "Please enter new level number, or 0 to cancel (currently: $api_level): "
read set_level
if [ "`echo $set_level | sed 's/[0-9]*//'`" != "" ] || [ "$set_level" == "" ]
then
echo
echo "Warning: Invalid input - nothing will be changed"
elif [ "$set_level" == "0" ]
then
echo
echo "OK, nothing will be changed"
else
echo $set_level > tools/deodex_files/api_level.txt
current_level=`scripts/get_api_level`
echo
echo "In api_level.txt, the API level is now set to: $current_level"
if [ "$current_level" != "$set_level" ]
then
echo
echo "Warning: Name is not the same as specified"
fi
fi
scripts/press_enter