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