Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dc206df authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch '728-handle-pre-release-tags' into 'master'

Handle pre-release tag

See merge request !36
parents 1f770f47 e7be7692
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -71,12 +71,12 @@
                      LINEAGE => [SIGNED] (ex. signed)
                )
            */
            preg_match_all('/(cm|lineage|eelo|e)-([0-9\.]+)-\D?-?([\d_]+)?-([\w+]+)-([A-Za-z0-9]+)?-?([\w+]+)?/', $fileName, $tokens);
            preg_match_all('/(e)-([0-9\.]+)-?((alpha|beta|rc)(\.\d)?)?-\D-?([\d_]+)?-([\w+]+)-([A-Za-z0-9]+)?-?([\w+]+)?/', $fileName, $tokens);
            $this->filePath = (substr($physicalPath, -1) === '/') ? $physicalPath . $fileName : $physicalPath . '/' . $fileName;
            $tokens = $this->formatTokens($tokens);

            $this->migrationFilePath = $physicalPath . '/migration_paths.json';
            $this->channel = $this->_getChannel(str_replace(range(0, 9), '', $tokens[4]), $tokens[1], $tokens[2]);
            $this->channel = $this->_getChannel(str_replace(range(0, 9), '', $tokens[7]), $tokens[1], $tokens[2]);
            $this->filename = $fileName;

            // Try to load the build.prop from two possible paths:
@@ -88,7 +88,7 @@
            $this->timestamp = intval($this->getBuildPropValue('ro.build.date.utc') ?? filemtime($this->filePath));
            $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[6] : $tokens[5]);
            $this->model = $this->getBuildPropValue('ro.lineage.device') ?? $this->getBuildPropValue('ro.cm.device') ?? ($tokens[1] == 'cm' ? $tokens[9] : $tokens[8]);
            $this->version = $tokens[2];
            $this->displayVersion = $this->getBuildPropValue('ro.cm.display.version') ?? $this->getBuildPropValue('ro.lineage.display.version') ?? '';
            $this->androidVersion = $this->getBuildPropValue('ro.build.version.release') ?? '';