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

Commit 424a2b35 authored by Romain Hunault's avatar Romain Hunault
Browse files

Fix buid.lprop file path

parent d7be01c3
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@
            // Try to load the build.prop from two possible paths:
            // - builds/CURRENT_ZIP_FILE.zip/system/build.prop
            // - builds/CURRENT_ZIP_FILE.zip.prop ( which must exist )
            $this->buildProp = explode( "\n", @file_get_contents('zip://'.$this->filePath.'#system/build.prop') ?? @file_get_contents($filePath.'.prop') );
            $this->buildProp = explode( "\n", @file_get_contents($this->getPropFilePath()));
            // Try to fetch build.prop values. In some cases, we can provide a fallback, in other a null value will be given
            $this->timestamp = intval( $this->getBuildPropValue( 'ro.build.date.utc' ) ?? filemtime($this->filePath) );
            $this->incremental = $this->getBuildPropValue( 'ro.build.version.incremental' ) ?? '';
@@ -258,6 +258,16 @@

    	/* Utility / Internal */

        /**
         * Return the correct prop file path (depending of version)
         * @return boolean
         */
        private function getPropFilePath() {
          return file_exists($this->filePath.'.prop') ?
            $this->filePath.'.prop'
            : 'zip://'.$this->filePath.'#system/build.prop';
        }

        /**
         * Remove trailing dashes
         * @param type $token The string where to do the operation