diff --git a/src/Helpers/Build.php b/src/Helpers/Build.php index 937582b0783f9bad3ffe2546ed6da30d395f2183..376dbc9ebf7a52e1e97be6918ff49052e3b6f6f5 100644 --- a/src/Helpers/Build.php +++ b/src/Helpers/Build.php @@ -90,6 +90,7 @@ $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]; + $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') ?? ''; $this->uid = hash('sha256', $this->timestamp.$this->model.$this->apiLevel, false); @@ -349,6 +350,15 @@ return $this->version; } + /** + * Get the preversion of the current build (alpha, beta.3, etc) + * @return string the preversion value + */ + public function getPreversion() + { + return $this->preversion; + } + /** * Get the version of the current build * @return string the version value diff --git a/src/Helpers/Builds.php b/src/Helpers/Builds.php index f4cdbe6d41e07db0cdfae5aae21035e480be372a..fc9d7f0ceeb431ad86a8b4a35f5b522eb4aa1041 100644 --- a/src/Helpers/Builds.php +++ b/src/Helpers/Builds.php @@ -100,6 +100,7 @@ 'romtype' => $build->getChannel(), 'datetime' => $build->getTimestamp(), 'version' => $build->getVersion(), + 'pre_version' => $build->getPreversion(), 'display_version' => $build->getDisplayVersion(), 'android_version' => $build->getAndroidVersion(), 'id' => $build->getUid(), @@ -219,4 +220,4 @@ $this->logger->debug('Total execution time of getBuilds in seconds'); } -} \ No newline at end of file +}