############################################################################
#
# Copyright (c) 2012 - dsixda (dislam@rocketmail.com)
#
# Android Kitchen is 100% free.  This script file is intended for personal
# and/or educational use only.  It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################


img_dir=$1
img_file=$2

dos_path=`cygpath -wp $img_dir`

echo 
echo "#####################################################################"
echo 
echo " READ INSTRUCTIONS BELOW TO EXTRACT FILES FROM $img_file:"
echo 
echo " 1) Ensure you have installed MagicISO, found under:"
echo "    tools/magiciso_windows/Setup_MagicISO.exe"
echo 
echo " 2) Launch MagicISO, select 'Try It' and use 'File->Open ...' to"
echo "    mount:"
echo "    $dos_path\\$img_file"
echo
echo "    NOTE: To see your file there, type '*.rfs' in the 'File name' box"
echo "    at the bottom of the dialog"
echo

next_num=5

if [ "$img_file" == "cache.rfs" ]
then
  echo " 3) In the top right window, open the 'recovery' folder so that "
  echo "    sec_csc.zip is shown"
  echo
  echo " 4) Right-click on sec_csc.zip, select 'Extract' and choose folder"
  echo "    $dos_path"

elif [ "$img_file" == "csc.rfs" ]
then
  echo " 3) In the top right window, right-click on csc.zip, select"
  echo "    'Extract' and choose folder"
  echo "    $dos_path"

  next_num=4

else
  echo " 3) In the top right window, right-click on the folders and choose "
  echo "    'Select All'"
  echo 
  echo " 4) Right-click again, select 'Extract' and choose folder"
  echo "    $dos_path"
fi

echo
echo " $next_num) Wait for extraction to finish and then close MagicISO"
echo      
echo "#####################################################################"
echo

echo 
echo ">>>> PERFORM THE STEPS ABOVE BEFORE PRESSING ENTER! <<<<"
echo

scripts/press_enter


