diff --git a/src/Helpers/Build.php b/src/Helpers/Build.php index 78663e266cf271ea61b933ba4f7c4ffe0bf8dec7..ac6b925060d519f21846c19990ecc537492d105d 100644 --- a/src/Helpers/Build.php +++ b/src/Helpers/Build.php @@ -89,7 +89,14 @@ $this->incremental = $this->getBuildPropValue('ro.build.version.incremental') ?? ''; $this->apiLevel = $this->getBuildPropValue('ro.build.version.sdk') ?? ''; $this->model = $this->getBuildPropValue('ro.lineage.device') ?? $this->getBuildPropValue('ro.cm.device') ?? ($tokens[1] == 'cm' ? $tokens[9] : $tokens[8]); - $this->version = $tokens[2]; + $completeVersion = explode(".",$tokens[2]); + $this->version = $completeVersion[0]; + if(sizeof($completeVersion) == 2) + $this->version .= ".".$completeVersion[1]; + if(sizeof($completeVersion) == 3) + $this->maintenance = $completeVersion[2]; + else + $this->maintenance = 0; $this->preversion = $tokens[3]; $this->displayVersion = $this->getBuildPropValue('ro.cm.display.version') ?? $this->getBuildPropValue('ro.lineage.display.version') ?? ''; $this->androidVersion = $this->getBuildPropValue('ro.build.version.release') ?? ''; @@ -350,6 +357,15 @@ return $this->version; } + /** + * Get the maintenance version of the current build + * @return string the maintenance version value + */ + public function getMaintenance() + { + return $this->maintenance; + } + /** * Get the preversion of the current build (alpha, beta.3, etc) * @return string the preversion value diff --git a/src/Helpers/Builds.php b/src/Helpers/Builds.php index fc9d7f0ceeb431ad86a8b4a35f5b522eb4aa1041..471ba425418c3d14cad2d867d5065f8757953aef 100644 --- a/src/Helpers/Builds.php +++ b/src/Helpers/Builds.php @@ -100,6 +100,7 @@ 'romtype' => $build->getChannel(), 'datetime' => $build->getTimestamp(), 'version' => $build->getVersion(), + 'maintenance' => $build->getMaintenance(), 'pre_version' => $build->getPreversion(), 'display_version' => $build->getDisplayVersion(), 'android_version' => $build->getAndroidVersion(),