blob: d3acd0c9983effcf262f349a4115311a9765f8ec [file] [log] [blame]
tobitege9d0fcb02015-03-30 15:23:19 +02001#!/bin/bash
2#
3# BlissRoms OTA Updater ota.xml generator
4#
5# Copyright (C) 2014 tobitege and BlissRoms
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20# Exports
21
22. $ANDROID_BUILD_TOP/vendor/bliss/tools/colors
23
24export otaxml=ota.xml
25
26if [ -f $otaxml ];
27then
28 rm -f $otaxml
29fi
30
31cp vendor/bliss/ota.xml $otaxml
32
33touch $otaxml
34
35BLISS_OTA_MD5=$(cat "$OUT/$BLISS_OTA_VERNAME.zip.md5sum" | cut -d ' ' -f 1)
36BLISS_OTA_FILESIZE=$(ls -la "$OUT/$BLISS_OTA_VERNAME.zip" | cut -d ' ' -f 5)
37
38sed -i "s/BLISS_OTA_ROM/${BLISS_OTA_ROM}/g" $otaxml
39sed -i "s/BLISS_OTA_VERNAME/${BLISS_OTA_VERNAME}/g" $otaxml
40sed -i "s/BLISS_OTA_VERSION/${BLISS_OTA_VER}/g" $otaxml
41sed -i "s|BLISS_OTA_URL|${BLISS_OTA_URL}|g" $otaxml
42sed -i "s/BLISS_OTA_MD5/${BLISS_OTA_MD5}/g" $otaxml
43sed -i "s/BLISS_OTA_FILESIZE/${BLISS_OTA_FILESIZE}/g" $otaxml
44sed -i "s/BLISS_DEVELOPER/${BLISS_DEVELOPER}/g" $otaxml
45sed -i "s|BLISS_DONATE|${BLISS_DONATE}|g" $otaxml
46
47cp $otaxml $OUT/
48rm $otaxml
49
50echo ${bldppl}"ota.xml generated."${txtrst}