|
|
|
@ -97,6 +97,23 @@ class SourceEvent extends Controller
|
|
|
|
|
}
|
|
|
|
|
$data['source_version'] = $game_source['source_version'] + 1;
|
|
|
|
|
|
|
|
|
|
$version = '';
|
|
|
|
|
$packageName = '';
|
|
|
|
|
if ($data['file_type'] == 1) {
|
|
|
|
|
$parser = new ApkParser();
|
|
|
|
|
$parser->open($data['file_url']);
|
|
|
|
|
$version = $parser->getVersionName();
|
|
|
|
|
$packageName = $parser->getPackage();
|
|
|
|
|
} elseif($data['file_type'] == 2) {
|
|
|
|
|
$parser = new PlistParser();
|
|
|
|
|
$parser->openFromIpa($data['file_url'], PlistParser::PREG_INFO_PLIST);
|
|
|
|
|
$result = $parser->getResult();
|
|
|
|
|
$version = $result['CFBundleShortVersionString'];
|
|
|
|
|
$packageName = $result['CFBundleIdentifier'];
|
|
|
|
|
}
|
|
|
|
|
$data['version'] = $version;
|
|
|
|
|
$data['bao_name'] = $packageName;
|
|
|
|
|
|
|
|
|
|
$game = M('game', 'tab_')->where(['id' => $data['game_id']])->find();
|
|
|
|
|
$gameSourceService = new GameSourceService();
|
|
|
|
|
$result = $gameSourceService->sourcePack($data, $game);
|
|
|
|
|