【发布时间】:2011-01-06 03:12:25
【问题描述】:
有没有办法从我下载的应用程序中提取图像?
我可以在 Android 上执行此操作,但 iPad?
【问题讨论】:
有没有办法从我下载的应用程序中提取图像?
我可以在 Android 上执行此操作,但 iPad?
【问题讨论】:
在最新的 xcode 中,路径是:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush
...所以请务必在 pngcrush 中编辑路径。
另外,(对于新手),如果你得到permission denied 是因为该文件还不是可执行文件,请执行chmod +x [filename]
【讨论】:
是的。在“音乐/iTunes/移动应用程序”文件夹中找到应用程序 .ipa 文件。在某处制作副本并将其重命名为 .zip 文件。解压缩文件。在 Payload 文件夹中,右键单击 .app 文件并选择“显示包内容”。您现在可以访问该应用的所有资源。
PNG 文件将针对 iPhone 进行编码,并且需要进行转换才能在您的 Mac/PC 上查看。为此有几个实用程序。
我使用 atPeek 自动化整个过程,但它不是免费的应用程序(我认为是 5 美元):http://www.atpurpose.com/atPeek/
【讨论】:
assets.car。 this mac application worked for me
从 iOS SDK 3.2(及更高版本)开始,您可以使用 pngcrush 撤消 iOS PNG 优化。
使用命令:
$ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations "~/Path/To/The/Apps.app/Image.png" "~/Path/To/Place/The/Reverted/Image.png"
有关完整信息,请参阅http://developer.apple.com/library/ios/#qa/qa1681/_index.html。
iOS SDK 可通过以下网址免费下载:http://developer.apple.com/devcenter/ios/index.action
您可以下载pngcrush而无需从以下位置下载iOS SDK:http://pmt.sourceforge.net/pngcrush/
【讨论】:
嗯,Cédric Luthi 有一个很棒的 github 项目可以做到这一点:
https://github.com/0xced/UIKit-Artwork-Extractor
它可以浏览和提取iOS内部图稿以及iTunes中任何ipa文件的图稿。
【讨论】:
提取 ipa 文件的内容(根据@TomSwift 的回答)
我编写了这个 PHP 命令行脚本,它将转换/取消压缩目录中的所有图像。这是一个命令行脚本,仅在 OSX 上测试。
参数:
--indir(包含 PNG 的目录)
--outdir(将放置转换后的 PNG 的目录)
--pngcrushpath [可选](pngcrush的路径,如果没有指定默认为标准)
使用示例:
php uncrush.php --indir /MyIPAs/MyApp.app/ --outdir /MyIPA/已转换/
脚本来源:
<?php
$args = getopt('', array(
'indir:',
'outdir:',
'pngcrushpath::'
));
$inDir = @rtrim($args['indir'], '/');
$outDir = @rtrim($args['outdir'], '/');
$pngCrushPath = isset($args['pngcrushpath']) ? $args['pngcrushpath'] : '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush';
if(!is_dir($inDir)){
error('INPUT DIR IS NOT VALID - DIRECTORY NOT FOUND ' . $inDir);
}
if(!is_dir($outDir) && !mkdir($outDir)){
error('OUTPUT DIR IS NOT VALID - DIRECTORY WAS NOT FOUND AND COULD NOT BE CREATED ' . $outDir);
}
if(!is_file($pngCrushPath)){
error('PNGCRUSH BINARY NOT FOUND');
}
$pngs = glob($inDir . '/*.png');
foreach($pngs as $png){
msg('CONVERTING - ' . $png);
convert($png, $outDir . '/' . basename($png));
}
msg('DONE');
exit;
function error($str){
$f = fopen('php://stderr', 'w');
fwrite($f, $str . "\n");
fclose($f);
exit;
}
function msg($str){
$f = fopen('php://stdout', 'w');
fwrite($f, $str . "\n");
fclose($f);
}
function convert($inPng, $outPng){
global $pngCrushPath;
exec($pngCrushPath . ' -revert-iphone-optimizations -q ' . $inPng . ' ' . $outPng);
}
?>
我今天写了这个脚本供自己使用,希望对其他人有用。随意修改并重新发布到其他地方,但请在 SO 上链接回这个答案。
【讨论】:
【讨论】:
我发现从 iPad/iPhone 应用程序中提取图像的最佳工具是 iFunBox 获取它在http://www.i-funbox.com/
【讨论】: