bliss: Add Internal Bliss OTA Updater (BlissOTA) [3/4]
If your device is Officially Supported by BlissRoms,
then maintainers whenever you build a new build a ota.xml file will be generated automatically.
Device maintainers have to upload ota.xml with every build to reflact the new changes.
backuptool.sh updated to use different build.prop entry
for version check.
Added to build an automatic ota.xml generation script.
In .bashrc add the following line (and reopen terminal):
export BLISS_DEVELOPER=yourXDAname
export BLISS_DONATE=yourDonateURL
Important: use goo.gl for donate URL!
Thanks to Kryten2k35 for the source, nicholaschum, tobitege, jackeagle and
genesixxbf3 for the implementation!
Change-Id: Ibc84c9620a38603b5944203193b220fbe669ad28
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
diff --git a/config/bliss_ota.mk b/config/bliss_ota.mk
new file mode 100644
index 0000000..ed47cb8
--- /dev/null
+++ b/config/bliss_ota.mk
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2014 The BlissRoms Project
+#
+# 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.
+#
+
+# BlissRoms OTA Updater
+ifeq ($(BLISS_DONATE),)
+ BLISS_DONATE =: http://goo.gl/tymMFo
+endif
+BLISS_OTA_BUILDDIR := Official
+ifeq ($(BLISS_BUILDTYPE),NIGHTLY)
+ BLISS_OTA_BUILDDIR := Nightlies
+endif
+BLISS_BASE_URL := https://downloads.blissroms.com
+BLISS_DEVICE_URL := $(BLISS_BASE_URL)/$(BLISS_OTA_BUILDDIR)/$(BLISS_BUILD)
+BLISS_OTA_VERSION := $(shell date +%Y%m%d)
+BLISS_ROM_NAME := BlissRoms
+
+PRODUCT_PROPERTY_OVERRIDES = \
+ ro.ota.systemname=$(BLISS_ROM_NAME) \
+ ro.ota.version=$(BLISS_OTA_VERSION) \
+ ro.ota.device=$(BLISS_BUILD) \
+ ro.ota.manifest=$(BLISS_DEVICE_URL)/ota.xml
+
+export BLISS_OTA_ROM=$(BLISS_ROM_NAME)
+export BLISS_OTA_VERNAME=$(BLISS_VERSION)
+export BLISS_OTA_VER=$(BLISS_OTA_VERSION)
+export BLISS_OTA_URL=$(BLISS_DEVICE_URL)/$(BLISS_VERSION).zip
diff --git a/config/bliss_packages.mk b/config/bliss_packages.mk
index 34909b8..7888552 100644
--- a/config/bliss_packages.mk
+++ b/config/bliss_packages.mk
@@ -80,4 +80,5 @@
# Bliss Custom Apps
PRODUCT_PACKAGES += \
- ThemeInterfacer
+ ThemeInterfacer \
+ BlissOTA
diff --git a/config/common.mk b/config/common.mk
index 39ee678..44f75e7 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -1,3 +1,18 @@
+#
+# Copyright (C) 2015 BlissRoms Project
+#
+# Licensed under the Attribution-NonCommercial-ShareAlike 4.0 International
+# (the "License") you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
+#
+# 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.
+
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
PRODUCT_PROPERTY_OVERRIDES += \
@@ -89,13 +104,15 @@
PRODUCT_PACKAGE_OVERLAYS += \
vendor/bliss/overlay/common
-# Proprietary latinime libs needed for Keyboard swyping
+# Proprietary libs for BlissOTA and keyboard swyping
ifneq ($(filter arm64,$(TARGET_ARCH)),)
PRODUCT_COPY_FILES += \
- vendor/bliss/prebuilt/common/lib/libjni_latinime.so:system/lib/libjni_latinime.so
+ vendor/bliss/prebuilt/common/lib/libjni_latinime.so:system/lib/libjni_latinime.so \
+ vendor/bliss/prebuilt/common/lib/libbypass.so:system/lib/libbypass.so
else
PRODUCT_COPY_FILES += \
- vendor/bliss/prebuilt/common/lib64/libjni_latinime.so:system/lib64/libjni_latinime.so
+ vendor/bliss/prebuilt/common/lib64/libjni_latinime.so:system/lib64/libjni_latinime.so \
+ vendor/bliss/prebuilt/common/lib64/libbypass.so:system/lib64/libbypass.so
endif
# by default, do not update the recovery with system updates
@@ -115,6 +132,9 @@
# Bliss Packages
-include vendor/bliss/config/bliss_packages.mk
+# Bliss OTA System
+-include vendor/bliss/config/bliss_ota.mk
+
# Bliss Versioning System
-include vendor/bliss/config/versions.mk
diff --git a/ota.xml b/ota.xml
new file mode 100755
index 0000000..626d538
--- /dev/null
+++ b/ota.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2014 BlissRoms Project
+
+ 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.
+-->
+
+<ROM>
+ <!--ROM Name-->
+ <RomName>BLISS_OTA_ROM</RomName>
+
+ <!--THIS NEEDS TO BE EDITED EVERY NEW UPDATE-->
+ <VersionName>BLISS_OTA_VERNAME</VersionName>
+
+ <!--THIS NEEDS TO BE EDITED EVERY NEW UPDATE-->
+ <VersionNumber type="integer">BLISS_OTA_VERSION</VersionNumber>
+
+ <!--THIS NEEDS TO BE EDITED EVERY NEW UPDATE-->
+ <DirectUrl>BLISS_OTA_URL</DirectUrl>
+
+ <!--Do not edit this!-->
+ <HttpUrl>BlissRoms Server</HttpUrl>
+
+ <!--BlissRoms Android Version-->
+ <Android>7.1.1</Android>
+
+ <!--THIS NEEDS TO BE EDITED EVERY NEW UPDATE-->
+ <!-- You can disable MD5 checking like this: <CheckMD5 nil="true" />-->
+ <CheckMD5>BLISS_OTA_MD5</CheckMD5>
+
+ <!--THIS NEEDS TO BE EDITED EVERY NEW UPDATE-->
+ <!--Please enter this in BYTES only. Otherwise an incorrect value will be shown-->
+ <FileSize type="integer">BLISS_OTA_FILESIZE</FileSize>
+
+ <!--Maintainer Name/Last Uploader's Name-->
+ <Developer>BLISS_DEVELOPER</Developer>
+
+ <!--Official Bliss Website-->
+ <WebsiteURL>http://blissroms.com/</WebsiteURL>
+
+ <!-- Your Donate URL (Please use goo.gl to shorten to avoid CDATA requirement -
+ Default: http://goo.gl/tymMFo will go to Team Bliss)-->
+ <DonateURL>BLISS_DONATE</DonateURL>
+
+ <!--Put the changelog here... Use DaringFireball's Markdown to format it-->
+ <!--Surround special characters with the CDATA tags or your XML will NOT parse-->
+ <Changelog>
+ ### Changelog BLISS_OTA_VERSION
+
+ https://downloads.blissroms.com/Bliss/Changelog/CHANGELOG-bliss.txt
+ </Changelog>
+
+ <!--Number of addons and the target addons xml. Remove both if no addons available! -->
+ <AddonCount>2</AddonCount>
+ <AddonsURL>https://downloads.blissroms.com/Add-ons/addons.xml</AddonsURL>
+
+</ROM>
diff --git a/prebuilt/common/lib/libbypass.so b/prebuilt/common/lib/libbypass.so
new file mode 100644
index 0000000..ffbd08f
--- /dev/null
+++ b/prebuilt/common/lib/libbypass.so
Binary files differ
diff --git a/prebuilt/common/lib64/libbypass.so b/prebuilt/common/lib64/libbypass.so
new file mode 100644
index 0000000..7f093c9
--- /dev/null
+++ b/prebuilt/common/lib64/libbypass.so
Binary files differ
diff --git a/tools/otaxml b/tools/otaxml
new file mode 100755
index 0000000..d3acd0c
--- /dev/null
+++ b/tools/otaxml
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# BlissRoms OTA Updater ota.xml generator
+#
+# Copyright (C) 2014 tobitege and BlissRoms
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Exports
+
+. $ANDROID_BUILD_TOP/vendor/bliss/tools/colors
+
+export otaxml=ota.xml
+
+if [ -f $otaxml ];
+then
+ rm -f $otaxml
+fi
+
+cp vendor/bliss/ota.xml $otaxml
+
+touch $otaxml
+
+BLISS_OTA_MD5=$(cat "$OUT/$BLISS_OTA_VERNAME.zip.md5sum" | cut -d ' ' -f 1)
+BLISS_OTA_FILESIZE=$(ls -la "$OUT/$BLISS_OTA_VERNAME.zip" | cut -d ' ' -f 5)
+
+sed -i "s/BLISS_OTA_ROM/${BLISS_OTA_ROM}/g" $otaxml
+sed -i "s/BLISS_OTA_VERNAME/${BLISS_OTA_VERNAME}/g" $otaxml
+sed -i "s/BLISS_OTA_VERSION/${BLISS_OTA_VER}/g" $otaxml
+sed -i "s|BLISS_OTA_URL|${BLISS_OTA_URL}|g" $otaxml
+sed -i "s/BLISS_OTA_MD5/${BLISS_OTA_MD5}/g" $otaxml
+sed -i "s/BLISS_OTA_FILESIZE/${BLISS_OTA_FILESIZE}/g" $otaxml
+sed -i "s/BLISS_DEVELOPER/${BLISS_DEVELOPER}/g" $otaxml
+sed -i "s|BLISS_DONATE|${BLISS_DONATE}|g" $otaxml
+
+cp $otaxml $OUT/
+rm $otaxml
+
+echo ${bldppl}"ota.xml generated."${txtrst}