How to recognize that CyanogenMod is on the board?

I checked a lot of fields from http://developer.android.com/reference/android/os/Build.html .

However, I cannot get clear information that a particular device is using CyanogenMod.

here is what i get:

NETWORK_TYPE="0" SDK_INT="10" CODENAME="REL" INCREMENTAL="eng.android.20110308.014205" RELEASE="2.3.3" SDK="10" Build.BOARD=bravo BOOTLOADER=0.93.0001 BRAND=htc_wwe CPU_ABI=armeabi-v7a CPU_ABI2=armeabi DEVICE=bravo DISPLAY=GRI40 FINGERPRINT=htc_wwe/htc_bravo/bravo/bravo:2.2/FRF91/226611:user/release-keys HARDWARE=bravo HOST=giulio-desktop ID=FRF91 MANUFACTURER=HTC MODEL=HTC Desire PRODUCT=htc_bravo RADIO=unknown TAGS=release-keys TIME=0 TYPE=userdebug USER=android 

 NETWORK_TYPE="0" SDK_INT="10" CODENAME="REL" INCREMENTAL="eng.shade.20110307.195429" RELEASE="2.3.3" SDK="10" Build.BOARD=mahimahi BOOTLOADER=0.35.0017 BRAND=google CPU_ABI=armeabi-v7a CPU_ABI2=armeabi DEVICE=passion DISPLAY=GRI40 FINGERPRINT=google/passion/passion:2.3.3/GRI40/102588:user/release-keys HARDWARE=mahimahi HOST=toxygene ID=GRI40 MANUFACTURER=HTC MODEL=Nexus One PRODUCT=passion RADIO=unknown TAGS=test-keys TIME=0 TYPE=user USER=shade 
+4
source share
6 answers

The easiest way I've found is to read the / proc / version file, which contains information about the kernel version.

Phones with cyanogenmod give something like:

 Linux version 2.6.37.2-cyanogenmod-01149-g8cdf03e 

Reading this file does not require root privileges (runnung uname -r ).

0
source

PackageManager.hasSystemFeature("com.cyanogenmod.android") will be more consistent.

+6
source

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.

+3
source

On my device, System.getProperty("os.version") has something like 3.0.64-CM-g9d16c8a . Checking for cyanogenmod in the version number no longer works. I have added more information to this post .

+1
source

The following code will work. I tested it.

 public static boolean isCyanogenMod() { try { return Class.forName("cyanogenmod.os.Build") != null; } catch (Exception ignored) {} return false; } 
+1
source

The kernel is always downloaded by end users, so using System.getProperty ("os.version") or reading from / proc / version are not good indicators of whether the cyanogenmod device is working. Let me rephrase, using them only as an indicator, this is not a good idea. You will need to use a combination of methods. As @kakopappa pointed out in his other post where he reads os.version and / proc / version, you should also check

 android.os.Build.HOST 

From my experience, which contained a cyanogen mode 9 times out of 10. To be safe, you will want to use other methods, but since the HOST variable can be changed using build.prop → ro.build.host

0
source

Source: https://habr.com/ru/post/1346030/


All Articles