【问题标题】:ipad - extract images from application?ipad - 从应用程序中提取图像?
【发布时间】:2011-01-06 03:12:25
【问题描述】:

有没有办法从我下载的应用程序中提取图像?

我可以在 Android 上执行此操作,但 iPad?

【问题讨论】:

    标签: ipad extract


    【解决方案1】:

    在最新的 xcode 中,路径是:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush

    ...所以请务必在 pngcrush 中编辑路径。

    另外,(对于新手),如果你得到permission denied 是因为该文件还不是可执行文件,请执行chmod +x [filename]

    【讨论】:

      【解决方案2】:

      是的。在“音乐/iTunes/移动应用程序”文件夹中找到应用程序 .ipa 文件。在某处制作副本并将其重命名为 .zip 文件。解压缩文件。在 Payload 文件夹中,右键单击 .app 文件并选择“显示包内容”。您现在可以访问该应用的所有资源。

      PNG 文件将针对 iPhone 进行编码,并且需要进行转换才能在您的 Mac/PC 上查看。为此有几个实用程序。

      我使用 atPeek 自动化整个过程,但它不是免费的应用程序(我认为是 5 美元):http://www.atpurpose.com/atPeek/

      【讨论】:

      • 如果您想要 png 文件只是为了在预览中查看它们,则无需通过任何工具反向优化(或解码)文件。只需将 png 文件复制到 .ipa 文件夹之外的任何文件夹中(例如在 Downloads 文件夹中),您就可以在预览中看到它们。但是,如果您想将 PNG 用于任何其他目的,那么只需使用 Xcode 本身提供的 pngcrush 工具。 pngcrush 的反向优化(或解码)将减小图像的大小。
      • 如果你想访问应用程序的资产目录,你需要一些东西来查看它的编码版本——assets.car。 this mac application worked for me
      【解决方案3】:

      从 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/

      【讨论】:

        【解决方案4】:

        嗯,Cédric Luthi 有一个很棒的 github 项目可以做到这一点:

        https://github.com/0xced/UIKit-Artwork-Extractor

        它可以浏览和提取iOS内部图稿以及iTunes中任何ipa文件的图稿。

        【讨论】:

          【解决方案5】:
          • 提取 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 上链接回这个答案。

          【讨论】:

          • 这正是我想要的!在此之前,我在使用 ruby​​ 脚本时遇到了麻烦。现在这个脚本就像一个魅力:)
          【解决方案6】:

          这里有一篇文章如何在shell脚本中使用pngcrush,循环和转换所有图像创建:

          希望这会有所帮助。

          【讨论】:

            【解决方案7】:

            我发现从 iPad/iPhone 应用程序中提取图像的最佳工具是 iFunBox 获取它在http://www.i-funbox.com/

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2011-12-29
              • 2016-09-14
              • 1970-01-01
              • 1970-01-01
              • 2011-12-29
              • 2012-07-19
              • 2015-07-11
              • 2011-09-28
              相关资源
              最近更新 更多