Taken from=>https://github.com/CyanogenMod/android_build/blob/cm-10.1/tools/releasetools/common.py

https://github.com/CyanogenMod/android_build/blob/cm-10.1/tools/releasetools/common.py