/**
* 打包渠道包-仅适用于安卓
* @param $file
* @param $dest_file
* @param $cid
* @return bool
*/
public static function package_channel_apk($file, $dest_file, $cid)
{
if (empty($file) || empty($dest_file) || empty($cid)) {
throw new \Exception('缺少参数');
}
//复制包
copy($file, $dest_file);
chmod($dest_file, 0777);
//插入文件
$obj = new \ZipArchive();
$res = false;
if($obj->open($dest_file, \ZipArchive::CREATE)){
$res = $obj->addFromString("META-INF/channel", $cid);
}
$obj->close();
return $res;
}
```
其中file 为原始包
dest_file为打包成功之后的包
cid 为渠道ID
