master
ELF 5 years ago
parent 65866d7fa1
commit a8bc52df33

3
.gitignore vendored

@ -6,4 +6,5 @@ Application/Common/Conf/pay_config.php
Application/Sdk/OrderNo/
.idea/
Uploads/
.vscode
.vscode
vendor/

81
1

@ -1,81 +0,0 @@
111111101001100000110010111001110100011110010111101110111111100110101000001111111
100000101101110101010010000011011000001010010110100011101011011000000111101000001
101110101001101100000101011111100000101011111111110000000000000110001010101011101
101110100011011110100101111010001110000000101111111111101000000001101010101011101
101110100110010010000110111110101101000101101101111110100100000010010000001011101
100000101010001101110100100010110100010011011110100010101110000001001001001000001
111111101010101010101010101010101010101010101010101010101010101010101010101111111
000000001010000100100001100011110100101001001010100010101001000110001111000000000
001110101001010000010001111110001111111111110111111111101010101100000011011100111
111101000000010101101110111000000001100010111011111010001100110110001110111001111
100011100101100001101001100011001000001000101100000011000110100100000100000111010
010001010010110101000011010011110101011111101110111110011010000110111100000100011
110111100001111111000001101111011010111101100100100011000100111111101010110100111
000101011000011000111111110101001110011101001000011100110101010100010000001001110
101001101000011110011110101010110011000111001100100000001111011011010010111010000
000011011101001000010001000000000111010110000101000100001011000001111110101001000
101001100011101011011011000111000010010110000110101110001001111111010111000101000
110001001110001100100101111100001001010100111000000000011110000100011110001111101
000011101001100111111010011101111110111001100100000001000000001110000011111100010
111011011100000110000101011110000011000100000010011100111110000010101100111101110
100110110010000011111010101000000100000100100100110001100110111111100111000000110
001110011011111100101011001001101001100001101000000100110111000100111100110010010
100010110010000111000111111001111001111111101000111111001010001111001100100000110
111111000101011011000011101011101100100101000010110000101000001001110101000001001
011111111010111101010101111111101000011101100010111110100111110101001001111111100
101110001011110010101001100010010010101000100100100010000111001100111100100010011
001010101011110001010100101011001010101011011110101010010010011110000110101010110
110010001001111100111101100010111001010111001000100010111110100011000010100011110
000111111001010110010010111111010110001101111110111111000101111101000110111110111
001101001101001110101000000100000110011011110110010110000111001011100100110100001
000000111011101000000111101111000110010000010011010010001100111010000110000101110
001100000100010010000011001011011100101000100101101110101111000001110011110111101
100011111000110101000000010001110010001100111010111111100100011101000101000001110
011101000011111110110111010110111010001110111001001000101111100000010100110000010
000011111111110000100101111101110111100010000000010000001010111011111010000101110
011000011100110111111000010100000111001010001110011110001100000110100011110111111
101001101000001100000000011100001101110100011111011010101011101100101011111000110
111011000101000101111111011111101010110001111010100000000001000010100101100111100
011000110010111000011001111011011101100000000101100011011011101110000010111110010
011000010111101110011010101011101111100111100011100110101101000110001011100101101
010111110010110010110010100001011110001110101000100001101010001101101110011001010
110011001100001110110001011011100101101100110111001110010101100111011101101010110
101001110011011001111010010010111001100101011000001011111110111100001011001101110
010011001010011111110011001000111000001101100000100111001110000110001110110100101
000011101111000011101110111100000010001100011001000111100010000111101110010001001
000110011111111110100101110011011011000111101011101000110010101111100100111100011
100111110101101101010100110000111100000110111001001110000100101111010110001100000
100111010001000000111101010011101100111100100101010101100101001000001101110001110
100011111000010111101001111110011011100001111000111111010110000110001100111111001
110110001101000000101100100010010000101111011110100011111100100000000111100010011
100110101100111100000010101011011010010101110111101010001010011111010110101010100
011110001100011000001010100010110101010001011110100011111010010101111011100011110
100111111010111111001010111110100101010111001000111110010010100000001100111111010
111000010110001000110101010101110000111011000001101000110100000010001100000000001
001100110110001111100010010001010001110100011110001001101110111111111010101000110
001000010101011010101100101001010001001011100111000011111111000010001100011001101
101000111110011010110101111001000101000001100100100111110110110000001110100110001
001001011101111100011110000001100001001100101011100101010101101000000100011000000
001101100110101000101110000111011010101001000010001000000110001101010010000100011
000111011100101110100111000110110110110000101110010011001001001110011011001000100
101100110001001100101100010110000100111100111001100000100000000100000010100111000
110111001110111100111010100001011101001011100010010100111100001100111001011001111
011010111000101001110100101100011111001010001111011010000111100000000111110101011
000100011101001011101000101111111101011110011000010111111001011010011100010100101
111000111101110101110001000100101110000011011010110111000110011111001100110111010
000010010110000010111011011001100111111000010100101000101100001010100100010000100
011001101101110111111101001011001111110010001101101100110010111010011001100100110
000110010101100111000001101011000011111100101001101011001110000101101111011001100
100110110001011010001000010110110101001001111010001110110000010111101100100100010
100010010110111111010101111110011000010001001000110100111100001100100110111010110
011100101111111010000111110011101011010101111010000000111010000100001101111111010
010001010011001111011111111111000101101111110000011011110111101010101101001011101
011100100011110000101010111110101111000001001101111110000010011111000000111111010
000000001001100101111100100011110101101011110001100011101100110110001010100010101
111111100101011111011000101010100001111011101001101010001110111111001010101010010
100000100011101011011100100010011111100011001111100010110011001001000110100011000
101110101011111001001001111111110111011011000101111110000100011110010010111110001
101110101000001010000011111011000011001001101111101000101111000110000100111001100
101110101101010111111101000000011001110010001011000001001000001011100100100001000
100000100110110011111111101011001101100110101010011011011110000111000111010111100
111111100111010110110100111000000100011101111011110011001111101100101011100001010

@ -52,9 +52,7 @@ class SourceEvent extends Controller
$game = M('game', 'tab_')->where(['id' => $data['game_id']])->find();
$gameSourceService = new GameSourceService();
$result = $gameSourceService->sourcePack($data, $game);
var_dump($result);
if (!$result['status']) {
var_dump($result);die();
$this->error('添加失败' , U('GameSource/lists', ['type' => $data['type']]));
}
$data['plist_url'] = $result['data']['plistUrl'];
@ -64,10 +62,8 @@ class SourceEvent extends Controller
if (M('game_source', 'tab_')->add($data)) {
//原包打包
$this->update_game_size($data);
var_dump('success');die();
$this->success('添加成功', U('GameSource/lists', ['type' => $data['type']]));
} else {
var_dump('error');die();
$this->error('添加失败', U('GameSource/lists', ['type' => $data['type']]));
}
}

@ -49,7 +49,7 @@ class GameSourceService {
{
$gameSourceUrl = $this->getGameSourceUrl($gameSource);
$appPath = $this->getIpaAppPath($this->getGameSourceUrl($gameSource));
return $appPath . '/' . Base62::encode(json_encode($packData));
return $appPath . '/TXChannel/' . Base62::encode(json_encode($packData));
}
public function getGameSourceUrl($gameSource)
@ -58,7 +58,7 @@ class GameSourceService {
return '';
}
$path = '';
if($gameSource['file_type'] == 1){
if($gameSource['file_type'] == 1) {
$path = './Uploads/SourcePack/';
}else{
$path = './Uploads/Ios/original/';

@ -2,6 +2,7 @@
namespace Base\Tool;
use \ZipArchive;
use CFPropertyList\CFPropertyList;
/**
* 用于读取plist文件信息
@ -9,9 +10,11 @@ use \ZipArchive;
*/
class PlistParser
{
const IS_SELF_PARSER = false;
const PREG_INFO_PLIST = "/^Payload.*?\.app\/Info.plist$/";
private $xml;
private $plist;
public function openFromIpa($ipaFile, $preg)
{
@ -28,13 +31,18 @@ class PlistParser
$content = $zip->getFromIndex($index);
$zip->close();
if ($content){
$xml = new \DOMDocument();
$xml->loadXML($content);
$this->xml = $xml;
if (self::IS_SELF_PARSER) {
$xml = new \DOMDocument();
$xml->loadXML($content);
$this->xml = $xml;
} else {
$plist = new CFPropertyList();
$plist->parseBinary($content);
$this->plist = $plist;
}
return true;
}
}
die();
return false;
}
@ -48,9 +56,13 @@ class PlistParser
public function getResult()
{
$plistTag = $this->xml->getElementsByTagName('plist');
$dict = $plistTag->item(0)->childNodes->item(1);
return $this->parseDictNode($dict);
if (self::IS_SELF_PARSER) {
$plistTag = $this->xml->getElementsByTagName('plist');
$dict = $plistTag->item(0)->childNodes->item(1);
return $this->parseDictNode($dict);
} else {
return $this->plist->toArray();
}
}
public function parseDictNode($parentNode)

@ -13,6 +13,8 @@
// ThinkPHP公共入口文件
//----------------------------------
require 'vendor/autoload.php';
// 记录开始运行时间
$GLOBALS['_beginTime'] = microtime(TRUE);
// 记录内存初始使用

@ -0,0 +1,5 @@
{
"require": {
"rodneyrehm/plist": "^2.0"
}
}

62
composer.lock generated

@ -0,0 +1,62 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e64bb985b0f808db7d5076e5d7204d7d",
"packages": [
{
"name": "rodneyrehm/plist",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/rodneyrehm/CFPropertyList.git",
"reference": "2ea0483806c989eb0518a767fa29a111bb29cb67"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rodneyrehm/CFPropertyList/zipball/2ea0483806c989eb0518a767fa29a111bb29cb67",
"reference": "2ea0483806c989eb0518a767fa29a111bb29cb67",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"type": "library",
"autoload": {
"psr-0": {
"CFPropertyList": "classes/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christian Kruse",
"email": "cjk@wwwtech.de"
},
{
"name": "Rodney Rehm",
"email": "mail+github@rodneyrehm.de"
}
],
"description": "Library for reading and writing Apple's CFPropertyList (plist) files in XML as well as binary format.",
"homepage": "https://github.com/rodneyrehm/CFPropertyList",
"keywords": [
"plist"
],
"time": "2015-01-28T23:18:19+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
Loading…
Cancel
Save