PHP Classes

File: examples/ApkResource.php

Recommend this page to a friend!
  Classes of Tufan Baris YILDIRIM   Apk Parser   examples/ApkResource.php   Download  
File: examples/ApkResource.php
Role: Example script
Content type: text/plain
Description: resource parsing
Class: Apk Parser
Extract Application Package files in APK format
Author: By
Last change: License (c)
Date: 9 years ago
Size: 622 bytes
 

Contents

Class file image Download
<?php

/**
 * This file is part of the Apk Parser package.
 *
 * (c) Tufan Baris Yildirim <tufanbarisyildirim@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

include 'autoload.php';
$apk = new \ApkParser\Parser('EBHS.apk');
$resourceId = $apk->getManifest()->getApplication()->getIcon();
$resources = $apk->getResources($resourceId);

header('Content-type: text/html');
foreach (
$resources as $resource) {
    echo
'<img src="data:image/png;base64,', base64_encode(stream_get_contents($apk->getStream($resource))), '" />';
}