You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
PHTML
45 lines
1.3 KiB
PHTML
5 years ago
|
<?php
|
||
|
namespace Base\Service;
|
||
|
|
||
|
use Base\Model\PromoteModel;
|
||
|
use Base\Model\ApplyModel;
|
||
|
|
||
|
class GameSourceService {
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
public function getChannelConfigFile($gameSource) {
|
||
|
$configUrl = '';
|
||
|
if ($gameSource['sdk_version'] == 1) {
|
||
|
$configUrl = "META-INF/mch.properties";
|
||
|
} else {
|
||
|
$preUrl = '';
|
||
|
$zipGameSource = zip_open($this->getGameSourceUrl($gameSource));
|
||
|
if ($zipGameSource) {
|
||
|
while ($zipEntry = zip_read($zipGameSource)) {
|
||
|
if (preg_match("/^Payload.*?\.app/", zip_entry_name($zipEntry), $matches)) {
|
||
|
$preUrl = $matches[0];
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
zip_close($zipGameSource);
|
||
|
}
|
||
|
$configUrl = $preUrl . '/_CodeSignature/TXChannel';
|
||
|
}
|
||
|
return $configUrl;
|
||
|
}
|
||
|
|
||
|
public function getGameSourceUrl($gameSource){
|
||
|
$path = '';
|
||
|
if($gameSource['file_type'] == '1'){
|
||
|
$path = './Uploads/SourcePack/';
|
||
|
}else{
|
||
|
$path = './Uploads/Ios/original/';
|
||
|
}
|
||
|
$fileUrl = $path . $gameSource['file_name'];
|
||
|
return ROOTTT . ltrim($fileUrl, './');
|
||
|
}
|
||
|
}
|