add ApkParser - from https://github.com/tufanbarisyildirim/php-apk-parser
This commit is contained in:
22
website/page/code/apk/lib/ApkManifestXmlElement.php
Normal file
22
website/page/code/apk/lib/ApkManifestXmlElement.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
class ApkManifestXmlElement extends SimpleXMLElement
|
||||
{
|
||||
public function getPermissions()
|
||||
{
|
||||
/**
|
||||
* @var ApkManifestXmlElement
|
||||
*/
|
||||
$permsArray = $this->{'uses-permission'};
|
||||
|
||||
$perms = array();
|
||||
foreach($permsArray as $perm)
|
||||
{
|
||||
$permAttr = get_object_vars($perm);
|
||||
$objNotationArray = explode('.',$permAttr['@attributes']['name']);
|
||||
$permName = trim(end($objNotationArray));
|
||||
$perms[$permName] = ApkManifest::$permissions[$permName];
|
||||
}
|
||||
|
||||
return $perms;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user