This is much easier to read from the system properties:
String version = System.getProperty("os.version"); if (version.contains("cyanogenmod")) { isCyanogenMode = true; }
On my os.version device os.version is 2.6.37.6-cyanogenmod-01509-g8913be8
Alternatively, you can also rely on the Build.USER constant, which bears the name of the person who assembled the assembly. For CyanogenMod, this is often a “shadow” (another nickname for Steve Condick, as well as Cyanogen).
There is also a special property, ro.modversion , but as far as I can see, you need access to the SystemProperties inner class to read it programmatically.
source share