-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-themes.sh
executable file
·154 lines (140 loc) · 7.43 KB
/
update-themes.sh
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
# Copyright (C) 2015 DirtyUnicorns
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
WORKING_DIR=~/ctr8952
function delete_useless () {
declare -a array=($@)
for i in `seq 0 $(( ${#array[@]} - 1 ))`
do
rm -rf "${array[i]}"
done
}
function process_all () {
declare -a array=($@)
for i in `seq 0 $(( ${#array[@]} - 1 ))`
do
echo "Removing unneeded items in ${array[i]}"
if [[ ${array[i]} == frameworks* ]]; then
cd $WORKING_DIR/${array[i]}
echo $WORKING_DIR/${array[i]}
else
cd $WORKING_DIR/packages/apps
fi
if [ -d ${array[i]} ]; then
cd ${array[i]}
delete_useless ${common[@]}
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
else
echo "${array[i]]} package not found"
fi
cd $WORKING_DIR
done
}
function copy_all () {
declare -a array=($@)
for i in `seq 0 $(( ${#array[@]} - 1 ))`
do
cd $WORKING_DIR/packages/apps
cp -r ${array[i]} $WORKING_DIR/LemonadeStore/themes-resources/packages/apps/
done
}
declare -a root=('LemonadeStore' 'abi' 'bionic' 'art' 'bootable' 'build' 'dalvik' 'development' 'device' 'external' 'frameworks' 'hardware' 'kernel' 'libcore' 'libnativehelper' 'manifest' 'ndk' 'out' 'packages' 'pdk' 'prebuilts'
'sdk' 'system' 'tools' 'vendor')
declare -a frameworks=('api' 'cmds' 'data' 'docs' 'drm' 'graphics' 'include' 'keystore' 'libs' 'location' 'media' 'native' 'nfc-extras' 'obex' 'opengl' 'policy' 'rs' 'samples' 'sax' 'security-bridge' 'services' 'telecomm'
'telephony' 'test-runner' 'tests' 'tools' 'wifi')
declare -a common=('common.mk' '.classpath' '.git' '.gitignore' '.idea' '.project' 'assets' 'build.gradle' 'src' 'tests' 'Android.mk' 'CleanSpec.mk' 'lint.xml' 'MODULE_LICENSE_APACHE2' 'NOTICE' 'preloaded-classes'
'proguard.cfg' 'proguard.flags' 'proguard-test.flags' 'wrap_alpha.py' 'tools' 'tests' 'extensions_src' 'mkprojectfile' 'project.properties' 'hero.png' 'LICENSE' 'README.md' 'script' 'jni' 'res_p' 'sounds'
'src_pd' 'src_pd_gcam' 'tests_camera' 'version.mk' 'COPYING' 'ReadMe.md' 'WallpaperPicker' 'protos' 'util' 'fill_screens.py' 'print_db.py' 'update_gallery_files.py' 'update_system_wallpaper_cropper.py'
'cyanoden-dsp' 'emailcommon' 'transition' 'TestCommon' 'provider_src' 'gallerycommon' 'jni_jpegstream' 'apptests' 'libs' 'info_lookup' 'src_plugin' 'perf-tests' 'app-perf-tests' 'src-N' 'src-pre-N' 'build-app.gradle' 'build-library.gradle' 'local.properties' 'gradlew.bat' 'gradlew' 'gradle' 'build.gradle' '.idea' 'settings.gradle' 'gradle.properties' 'proguard-rules.pro' 'v' '*.jar' 'build' 'ForceProguard.mk' 'proguard-release.flags' 'Readme.md')
declare -a packages=('StatementService' 'BackupRestoreConfirmation' 'CaptivePortalLogin' 'DefaultContainerService' 'ExternalStorageProvider' 'FakeOemFeatures' 'FusedLocation' 'InputDevices' 'Keyguard' 'PrintSpooler' 'SettingsProvider'
'SharedStorageBackup' 'Shell' 'VpnDialogs' 'WAPPushManager' 'WAPPushManager' 'WallpaperCropper' 'services' 'WallpaperBackup' 'PrintRecommendationService' 'Osu' 'MtpDocumentsProvider' 'ExtShared' 'ExtServices' 'CtsShim')
declare -a res=('Android.mk' 'AndroidManifest.xml' 'MODULE_LICENSE_APACHE2' 'NOTICE' 'lint.xml' 'assets' 'menu*' 'values-*' 'xml*' 'interpolator' 'raw*' 'anim*' 'animator' 'transition' 'MakeJavaSymbols.sed' 'tests' 'src' 'build.gradle' 'proguard.flags' 'setting' 'gradlew' 'gradlew.bat')
declare -a values=('all_search_engines.xml' 'appmsg_colors.xml' 'arrays.xml' 'attrs_manifest.xml' 'bookmarks_icons.xml' 'bools.xml' 'config.xml' 'defaults.xml' 'donottranslate.xml' 'donottranslate_config.xml'
'aliases.xml' 'crop_colors.xml' 'dslv_attrs.xml' 'animation_constants.xml' 'donottranslate-cldr.xml' 'donottranslate-maps.xml' 'donottranslate-names.xml' 'donottranslate_material.xml'
'donottranslate-search_engines.xml' 'custom_arrays.xml' 'custom_strings.xml' 'custom_symbols.xml' 'custom_dimens.xml' 'custom_attrs.xml' 'custom_colors.xml' 'fractions.xml' 'ids.xml' 'integers.xml' 'internal.xml' 'keys.xml' 'lland_config.xml' 'lland_strings.xml' 'plurals.xml'
'public.xml' 'strings.xml' 'symbols.xml' 'vpi_attrs.xml' 'vpi_defaults.xml' 'cm_arrays.xml' 'cm_plurals.xml' 'cm_strings.xml' 'custom_strings.xml' 'custom_arrays.xml' 'vpi__defaults.xml' 'vpi__attrs.xml'
'nontranslatables.xml' 'accountprovider.xml' 'constants.xml' 'codeaurora_strings.xml' 'filtershow_ids.xml' 'filtershow_strings.xml' 'filtershow_values.xml' 'filtershow_values_attrs.xml' 'projekt_colors.xml' 'projekt_config.xml' 'projekt_symbols.xml' 'projekt_styles.xml' 'projekt_symbols.xml' 'projekt_colors.xml' 'projekt_strings.xml')
declare -a core=('java' 'jni' 'tests' 'src')
declare -a theme_packages=('Calculator' 'Calendar' 'Camera2' 'Contacts' 'ContactsCommon' 'DUI' 'CustomSquash' 'DeskClock' 'Dialer' 'Gallery2'
'Launcher3' 'Messaging' 'PhoneCommon' 'Settings' 'Stk')
declare -a extra=('java' '.idea' 'gradle' '.gitignore' 'build.gradle' 'gradlew' 'gradlew.bat' 'local.properties' 'proguard-rules.pro' 'proguard.flags')
cd $WORKING_DIR
echo "Removing files so we can clean sync"
delete_useless ${root[@]}
echo "Repo Syncing........."
repo sync -c --no-tags >> /dev/null
if [ $? -eq 0 ]; then
echo "Repo Sync success"
else
echo "Repo Sync failure"
exit 1
fi
echo "Cloning Theme Resources repo"
git clone https://github.com/Citrus-CAF/LemonadeStore.git
echo "Removing unneeded files"
cd frameworks/base
delete_useless ${frameworks[@]}
cd packages
delete_useless ${packages[@]}
cd SystemUI
delete_useless ${common[@]}
rm -rf docs
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
cd ../../../SettingsLib
delete_useless ${common[@]}
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
cd ../../../DocumentsUI
delete_useless ${common[@]}
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
cd ../../../EasterEgg
delete_useless ${common[@]}
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
cd ../../../../core
delete_useless ${core[@]}
cd res
delete_useless ${res[@]}
cd res
delete_useless ${res[@]}
cd values
delete_useless ${values[@]}
rm -rf $WORKING_DIR/LemonadeStore/themes-resources/frameworks
cd $WORKING_DIR
process_all ${theme_packages[@]}
echo "Cleaning target folders"
rm -rf LemonadeStore/themes-resources/packages
mkdir LemonadeStore/themes-resources/packages
mkdir LemonadeStore/themes-resources/packages/apps
mkdir LemonadeStore/themes-resources/frameworks
echo "Copying all files to $WORKING_DIR/LemonadeStore/themes-resources"
copy_all ${theme_packages[@]}
cp -r $WORKING_DIR/frameworks/base/core $WORKING_DIR/frameworks/base/packages $WORKING_DIR/LemonadeStore/themes-resources/frameworks
cd ~/ctr8952/LemonadeStore/themes-resources
cd $WORKING_DIR/LemonadeStore/themes-resources/packages/apps/Dialer/InCallUI
delete_useless ${res[@]}
cd $WORKING_DIR/LemonadeStore/themes-resources