2011-01-06 68 views

回答

14

是的。在「音樂/ iTunes /移動應用程序」文件夾中找到應用程序.ipa文件。在某處製作一個副本並將其重命名爲.zip文件。解壓縮文件。在Payload文件夾中,右鍵單擊.app文件並選擇「Show Package Contents」。您現在可以訪問應用程序的所有資源。

PNG文件將被編碼爲iPhone,並且需要轉換爲可在Mac/PC上查看。這有幾個實用程序。

我用atPeek來自動完成整個過程,但它不是一個免費的應用程序(我認爲這是$ 5):http://www.atpurpose.com/atPeek/

+0

得到它,如果你想PNG文件只是在預覽然後觀察他們沒有必要扭轉優化(或解碼)任何工具的文件。只需複製.ipa文件夾外的任何文件夾中的png文件(用於ex下載文件夾中),您可以在預覽中看到它們。但是,如果您想將PNG用於任何其他目的,則只需使用Xcode中提供的pngcrush工具。 pngcrush反向優化(或解碼)會減小圖像的大小。 – 2013-06-27 06:07:20

+0

試試這個,https://gist.github.com/ManujPorwal/5926753 – Say2Manuj 2013-07-04 11:00:30

6

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

2

在最新的Xcode的路徑是:

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

...所以請確保你在pngcrush中編輯路徑。

此外,(對於菜鳥),如果你得到permission denied它,因爲該文件不是一個可執行的是,做chmod +x [filename]

1
  • 提取的ipa文件的內容(按@ TomSwift的答案)

  • 我寫這個PHP CMD行腳本,將轉換/ uncrush所有圖像的目錄。這是一個cmd行腳本,僅在OSX上進行測試。

參數:

--indir(含有的PNG目錄)

--outdir(目錄,其中轉化的PNG將被放置)

--pngcrushpath [可選](路徑pngcrush,如果沒有指定其將默認爲標準)

實施例使用:

PHP uncrush.php--indir/MyIPAs/MyApp.app/ --outdir /MyIPAs /轉換/

腳本來源:

<?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上的這個答案。

相關問題