|
|
<?php
|
|
|
namespace Org\Ipa365SDK;
|
|
|
|
|
|
use Think\Exception;
|
|
|
use Qiniu\json_decode;
|
|
|
|
|
|
/**
|
|
|
* Ipa365
|
|
|
* @author zgc
|
|
|
* 2019/9/19 15:00
|
|
|
*/
|
|
|
class Ipa365 {
|
|
|
private $token = "";
|
|
|
public function __construct($token="") {
|
|
|
$this->token = $token;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 获得签包任务完成后的下载地址
|
|
|
* status int 任务进度 0还未生成下载地址 1已经生成下载地址
|
|
|
filename string xxx.ipa
|
|
|
*/
|
|
|
public function down($data) {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/Api/Down";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获得签包任务进度
|
|
|
*/
|
|
|
public function process() {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/Api/Process";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 授予udid下载权限并获得签包任务id
|
|
|
* 调用此接口获得任务id后,需要先调用一下 Down 接口,触发签包任务开始,后调用process查看任务进度,最终调用 Down 获得ipa下载地址
|
|
|
*/
|
|
|
public function request() {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/Api/Request";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取授予应用的信息
|
|
|
*/
|
|
|
public function getinfo() {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/Api/GetInfo";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取 授予udid下载权限并获取下载地址
|
|
|
*/
|
|
|
public function udidRequest($data) {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/OpenApi/UdidRequest";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询授权码列表
|
|
|
*/
|
|
|
public function ticketList($data) {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/OpenApi/TicketList";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询单个授权码状态
|
|
|
*/
|
|
|
public function getCodeStatus() {
|
|
|
$apiurl = "https://app.ipa365.com/Kirin/OpenApi/GetInfo";
|
|
|
$r = curl_post($apiurl, $data);
|
|
|
return json_decode($r, true);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|