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

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

Merge branch 'same_version_improvement' into 'master'

Allows for same version upgrades without adding a rule in migration_paths.json

See merge request e/os/LineageOTA!20
parents 3bf76329 5eba0181
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -247,10 +247,13 @@
            $thisMajorVersion = explode(".", $this->androidVersion)[0];
            $compareMajorVersion = explode(".", $compareVersion)[0];
            $isSameVersion = boolval(!strcmp($thisMajorVersion, $compareMajorVersion)); // Check if Android version is same
            $migrationContents = NULL;
            if(file_exists($this->migrationFilePath)) {
                $migrationContents = file_get_contents($this->migrationFilePath);

            if($isSameVersion) {
                return true;
            }
            
            else if(file_exists($this->migrationFilePath)) {
                $migrationContents = file_get_contents($this->migrationFilePath);
                if (!empty($migrationContents)) {
                    $migrations = json_decode($migrationContents, true); // Contains migration rules
    
@@ -258,7 +261,9 @@
                        return in_array(intval($thisMajorVersion), $migrations[$compareMajorVersion]);
                    }
                }
            return $isSameVersion;
            }
           
            return false;
        }
        /**
         * Get a unique id of the current build