| 309 | } |
| 310 | |
| 311 | String OS_Android::get_version() const { |
| 312 | const Vector<const char *> roms = { "ro.havoc.version", "org.pex.version", "org.pixelexperience.version", |
| 313 | "ro.potato.version", "ro.xtended.version", "org.evolution.version", "ro.corvus.version", "ro.pa.version", |
| 314 | "ro.crdroid.version", "ro.syberia.version", "ro.arrow.version", "ro.lineage.version" }; |
| 315 | for (int i = 0; i < roms.size(); i++) { |
| 316 | String rom_version = get_system_property(roms[i]); |
| 317 | if (!rom_version.is_empty()) { |
| 318 | return rom_version; |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | String mod_version = get_system_property("ro.modversion"); // Handles other Android custom ROMs. |
| 323 | if (!mod_version.is_empty()) { |
| 324 | return mod_version; |
| 325 | } |
| 326 | |
| 327 | // Handles stock Android. |
| 328 | String sdk_version = get_system_property("ro.build.version.sdk"); |
| 329 | String build = get_system_property("ro.build.version.incremental"); |
| 330 | if (!sdk_version.is_empty()) { |
| 331 | if (!build.is_empty()) { |
| 332 | return vformat("%s.%s", sdk_version, build); |
| 333 | } |
| 334 | return sdk_version; |
| 335 | } |
| 336 | |
| 337 | return ""; |
| 338 | } |
| 339 | |
| 340 | String OS_Android::get_version_alias() const { |
| 341 | String release = get_system_property("ro.build.version.release_or_codename"); |
no test coverage detected