forked from WSA-Community/WSAGAScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract_gapps_pico.sh
38 lines (26 loc) · 1.13 KB
/
extract_gapps_pico.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
#!/bin/bash
. ./VARIABLES.sh
rm -rf $GAppsOutputFolder
rm -rf $GAppsTmpFolder
rm -rf $GAppsExtractFolder
mkdir -p $GAppsOutputFolder
mkdir -p $GAppsTmpFolder
mkdir -p $GAppsExtractFolder
echo "Unzipping OpenGApps"
for file in "$GAppsRoot/"*.zip; do unzip -q "$file" -d $GAppsExtractFolder; done
echo "Extracting Core Google Apps"
for f in "$GAppsExtractFolder/Core/"*.lz; do tar --lzip -xvf "$f" -C $GAppsTmpFolder &>/dev/null; done
echo "Extracting Google Apps"
for f in "$GAppsExtractFolder/GApps/"*.lz; do tar --lzip -xvf "$f" -C $GAppsTmpFolder &>/dev/null; done
echo "Deleting duplicates & conflicting apps"
rm -rf "$GAppsTmpFolder/setupwizardtablet-x86_64" # We already have setupwizard "default"
echo "Merging folders"
for D in $GAppsTmpFolder/*; do [ -d "${D}" ] && cp -r ${D}/* $GAppsOutputFolder; done
echo "Merging subfolders"
for D in $GAppsOutputFolder/*; do [ -d "${D}" ] && cp -r ${D}/* $GAppsOutputFolder && rm -rf ${D}; done
echo "Post merge operation"
cp -ra $GAppsOutputFolder/product/* $GAppsRoot/product_output/
echo "Deleting temporary files"
rm -rf $GAppsTmpFolder
rm -rf $GAppsExtractFolder
echo "!! GApps folder ready !!"