Skip to content

Commit

Permalink
Used new named tokens from parseFilenameFull()
Browse files Browse the repository at this point in the history
  • Loading branch information
toolstack authored and julianxhokaxhiu committed Apr 19, 2022
1 parent da811bc commit dd4ecea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Helpers/BuildGithub.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public function __construct($release, $data=False) {
$tokens = $this->parseFilenameFull($archive['name']);
$this->filePath = $archive['browser_download_url'];
$this->url = $archive['browser_download_url'];
$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['channel'] ), $tokens['type'], $tokens['version'] );
$this->filename = $archive['name'];
$this->timestamp = strtotime( $archive['updated_at'] );
$this->model = $tokens[1] == 'cm' ? $tokens[6] : $tokens[5];
$this->version = $tokens[2];
$this->model = $tokens['model'];
$this->version = $tokens['version'];
$this->size = $archive['size'];
$largestSize = $this->size;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Helpers/BuildLocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public function __construct($fileName, $physicalPath, $data=False) {
$this->buildProp = explode( "\n", $propsFileContent );

// Try to fetch build.prop values. In some cases, we can provide a fallback, in other a null value will be given
$this->channel = $this->_getChannel( $this->getBuildPropValue( 'ro.lineage.releasetype' ) ?? str_replace( range( 0 , 9 ), '', $tokens[4] ), $tokens[1], $tokens[2] );
$this->channel = $this->_getChannel( $this->getBuildPropValue( 'ro.lineage.releasetype' ) ?? str_replace( range( 0 , 9 ), '', $tokens['channel'] ), $tokens['type'], $tokens['version'] );
$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->version = $tokens[2];
$this->model = $this->getBuildPropValue( 'ro.lineage.device' ) ?? $this->getBuildPropValue( 'ro.cm.device' ) ?? $tokens['model'];
$this->version = $tokens['version'];
$this->uid = hash( 'sha256', $this->timestamp.$this->model.$this->apiLevel, false );
$this->size = filesize($this->filePath);

Expand Down

0 comments on commit dd4ecea

Please sign in to comment.