Example #1
0
 $r_width = $file1['width'] = isset($img['width']) ? $img['width'] : 0;
 $r_height = $file1['height'] = isset($img['height']) ? $img['height'] : 0;
 $r_oname = $file1['oname'] = substr($f['name'], 0, strrpos($f['name'], '.'));
 switch ($f['extension']) {
     case 'zip':
     case 'rar':
         $resource_type = 3;
         break;
     case 'flv':
         $resource_type = 2;
         break;
     case 'apk':
         $resource_type = 4;
         //插入APK提取资源参数
         $p = new ApkParser();
         $res = $p->open(dirname(__FILE__) . '/../' . $resource_url);
         $xml = $p->getXML();
         echo $xml;
         preg_match('~android:versionName="(.*?)"~', $xml, $matches);
         $version = '';
         if (count($matches) > 1) {
             $version = $matches[1];
         }
         preg_match('~android:minSdkVersion="(.*?)"~', $xml, $matches);
         $minsys = '';
         if (count($matches) > 1) {
             $minsys = get_android($matches[1]);
         }
         preg_match('~package="(.*?)"~', $xml, $matches);
         $packname = '';
         if (count($matches) > 1) {
Example #2
0
<?php

include __DIR__ . "/IpaParser.php";
include __DIR__ . "/ApkParser.php";
#apk解析
$main = new ApkParser();
$main->open('blabla.apk');
echo $main->getPackage();
echo $main->getVersionName();
echo $main->getVersionCode();
echo $main->getAppName();
#ipa解析
$main = new IpaParser();
echo $main->parse('blabla.ipa');
echo $main->getPackage();
echo $main->getVersion();
echo $main->getAppName();
var_dump($main->getPlist());