converting cydia app icons to retina
#1
Posted 11 December 2010 - 02:05 AM
#!/bin/bash
#iRetiner
#Adapt your icons to retina display
#created by ardu,v1b, dxs
# ^^
# See this, HackMyiPhone?
# That's the only line I didn't code.
# You just change everything to Italian and think is alright to slap it in your repo, putting /your own site in the header/?
# I didn't put "dxs" in the title display because I don't really care if credit is attributed to me or not.
# But it just pisses me off when you claim credit for something I wrote.
# If it wasn't your intention to steal credit, then I take back the hostility but my message remains.
# At least clarify it by putting "coded by dxs, translated to Italian by HackMyiPhone", not just "iRetiner (0.3by HackMyiPhone)"
cleanup() {
if [ "$tmpfile" ] && [ -f "$tmpfile" ]; then
rm -rf "$tmpfile"
fi
cd "$ORIG_DIR"
}
cleanup_quit() {
cleanup
exit
}
printLine() {
local cols="$(tput cols)"
local i
if [ "$cols" ]; then
for ((i=0; i<$cols; i++)); do
printf "="
done
printf "\n"
fi
}
prompt() { #Usage: prompt (message text)
local answer=""
while [ ! $answer ]; do
read -t 0 dummy #Clears stdin before reading menu selection
read -n 1 -p "$1" answer; echo
answer="$(echo "$answer" | tr [:lower:] [:upper:])"
if [ $answer == "Y" ]; then
return 1
elif [ $answer == "N" ]; then
return 0
else
echo "Invalid response"
answer=""
fi
done
}
#Constants
ICONCACHE_DIR="/var/mobile/Library/Caches/com.apple.IconsCache"
ORIG_DIR="$(pwd)"
ret=0
SANDBOX_ROOTS="/var/stash/Applications.xxxxxx"
SCRIPT_NAME="iRetiner"
SCRIPT_VERSION="0.3"
trap cleanup_quit EXIT
#Used in the console UI
menuOptions=("Exit" "Adapt icons to retina display" "Revert to original icons" "Remove botched icons from $SCRIPT_NAME v0.1" "Display help screen")
clear
echo "$SCRIPT_NAME ($SCRIPT_VERSION)"
printLine
if [ ! -f "/usr/bin/plutil" ]; then
echo "Missing dependency com.ericasadun.utilities"
echo "You can fix this by installing \"Erica Utilities\" from Cydia"
exit 1
fi
for ((i=1; i<${#menuOptions[@]}; i++)); do
echo " $i] ${menuOptions[$i]}"
done
echo -e " 0] ${menuOptions[0]}\n"
i=${#menuOptions[@]}
while [ 1 ]; do
read -t 0 dummy #Clears stdin before reading menu selection
read -p "Select an option: " -n ${#i} menuSelection; echo
menuSelection="$(echo "$menuSelection" | tr -d [:alpha:] | tr -d [:blank:] | tr -d [:cntrl:] | tr -d [:punct:])"
if [ "$menuSelection" ] && [ "${menuOptions[$menuSelection]}" ]; then
break
else
echo "Invalid selection"
fi
done
if [ $menuSelection == 0 ]; then
exit 0
elif [ $menuSelection == 4 ]; then
clear
echo -e "$SCRIPT_NAME ($SCRIPT_VERSION)"
echo -e "A utility for managing AppStore retina icons"
printLine
echo -e "This script can currently do:"
echo -e " > Adapt AppStore apps' to retina display"
echo -e " > Revert adapted icons back to originals"
echo -e " > Remove botched icons from $SCRIPT_NAME v0.1"
echo -e " > Bake you a cake*"
echo -e " Note: \"*\" == blatant lie"
echo
echo "Note to HackMyiPhone from dxs (coder of iRetiner):
#!/bin/bash
#iRetiner
#Adapt your icons to retina display
#created by ardu,v1b, dxs
^^
See this, HackMyiPhone?
That's the only line I didn't code.
You just change everything to Italian and think is alright to slap it in your repo, putting /your OWN NAME in the header/?
I didn't put "dxs" in the title display because I don't really care if credit is attributed to me or not.
But it just pisses me off when you claim credit for something I wrote.
If it wasn't your intention to claim credit, then I take back the hostility but my message remains.
At least clarify it by putting \"coded by dxs, translated to Italian by HackMyiPhone\", not just \"iRetiner (0.3by HackMyiPhone)\""
cleanup
exit 2
else
echo
echo "Operation: ${menuOptions[$menuSelection]}"
prompt "Confirm action [y/n]: "; ret=$?
if [ $ret == 0 ]; then
echo "Aborted"
exit
fi
echo
ls -x -1 "$SANDBOX_ROOTS" | while read sandbox; do
cd "$SANDBOX_ROOTS/$sandbox"
baseapp="$(ls -d *.app)"
echo -en "Processing $baseapp\r"
artwork="$SANDBOX_ROOTS/$sandbox/iTunesArtwork"
info="$SANDBOX_ROOTS/$sandbox/$baseapp/Info.plist"
icon="$SANDBOX_ROOTS/$sandbox/$baseapp/$(plutil -key CFBundleIconFile "$info" 2>/dev/null)"
#Finding the icon
if [ ! -f "$icon" ]; then
for icon in "Icon.png" "icon.png" "Icon.PNG" "icon.PNG" "ICON.png" "ICON.PNG"; do
icon="$SANDBOX_ROOTS/$sandbox/$baseapp/$icon"
if [ -f "$icon" ]; then
break
fi
done
fi
if [ ! -f "$icon" ]; then
echo "Could not find icon file in $baseapp"
continue
fi
case $menuSelection in
1 ) #Adapt to retina display
if [ ! -f "$icon.orig" ]; then
echo -en "Backup up old icon in $baseapp\r"
mv "$icon" "$icon.orig"
fi
echo -en "Adapting iTunesArtwork to retina display\r"
cp "$artwork" "$icon"
touch -r "$artwork" "$icon"
if [ -f "$icon" ]; then
echo "Successfully adapted icon to retina display in $baseapp"
else
echo "Failed to adapt icon to retina display $baseapp"
fi;;
2 ) #Revert to original icons
if [ ! -f "$icon.orig" ]; then
echo "Could not find backup icon in $baseapp"
else
rm -rf "$icon"
mv "$icon.orig" "$icon"
echo "Reverted $baseapp to original icon"
fi;;
3 ) #Hashing and deleting the old botched attempts from v0.1
retina="$SANDBOX_ROOTS/$sandbox/$baseapp/icon@2x.png"
if [ ! -f "$retina" ]; then
echo "Improperly adapted icon not found in $baseapp"
continue
fi
sumArtwork="$(sha1sum -b "$artwork" | cut --delim=" " -f 1)"
sumRetina="$(sha1sum -b "$retina" | cut --delim=" " -f 1 2>/dev/null)"
if [ "$sumArtwork" == "$sumRetina" ]; then
rm -rf "$retina"
echo "Removed improperly adapted icon in $baseapp"
continue
else
echo "Improperly adapted icon not found in $baseapp"
continue
fi;;
esac
done
echo "Clearing the icon cache"
#Create temporary file and make sure it doesn't already exist
if [ -f "$ICONCACHE_DIR/__system_version_info__" ]; then
while [ 1 ]; do
tmpfile="/tmp/iRetiner-$RANDOM$RANDOM$RANDOM"
if [ ! -e "$tmpfile" ]; then
break
fi
done
mv "$ICONCACHE_DIR/__system_version_info__" "$tmpfile"
fi
rm -rf "$ICONCACHE_DIR"/*
if [ "$tmpfile" ] && [ -f "$tmpfile" ]; then
mv "$tmpfile" "$ICONCACHE_DIR/__system_version_info__"
fi
echo -e "\nDone!"
#Respring
prompt "Respring now [y/n]: "; ret=$?
case $ret in
1 ) echo "Performing respring"
cleanup
killall SpringBoard;;
0 ) echo "A respring/reboot should be performed later";;
esac
fi
#2
Posted 11 December 2010 - 03:20 AM
On that note, I have a couple Cydia apps that I've made retina icons for. Perhaps if you make a request I can help you out.
Edited by r0bop0lo, 11 December 2010 - 03:34 AM.
#3
Posted 11 December 2010 - 03:55 PM
#4
Posted 11 December 2010 - 07:46 PM
How's this:of the stuff i have so far i only need mywi:D
They should go under /Applications/MyWi.app as icon@2x.png and Icon_Small@2x.png respectively.
Edited by r0bop0lo, 11 December 2010 - 07:47 PM.
#5
Posted 11 December 2010 - 08:27 PM
#6
Posted 12 December 2010 - 10:51 AM
and yes thats perfect thanks:D
Edited by adhd4lyfe, 12 December 2010 - 10:51 AM.
#7
Posted 03 January 2011 - 01:17 PM
#8
Posted 03 January 2011 - 05:19 PM
Are you referring to iFile? The latest version has a retina icon by default.Anyway some can make please make a retina icon for Ifilefinder?
#9
Posted 05 January 2011 - 01:18 PM
Probably not, I've heard of an app with that name about 3 months ago.Are you referring to iFile? The latest version has a retina icon by default.
#10
Posted 05 January 2011 - 03:52 PM
#11
Posted 20 January 2011 - 01:13 PM
#12
Posted 20 January 2011 - 05:06 PM
You may. I'll have you know I hate spiders with a passion though...May i request default Torrentula and iDemonoid retina icons please?
Torrentula:
Place them in /Applications/Torrentula.app as icon.png (Replace the original) and Icon-Small.png respectively
iDemonoid:
Place them in /Applications/iDemonoid.app as Icon@2x.png (Replace the original) and Icon-Small.png respectively
#13
Posted 21 January 2011 - 10:22 PM
#14
Posted 22 January 2011 - 03:39 AM
Place them in /Applications/iShare.app as Icon@2x.png and Icon-Small.png respectively
Edited by r0bop0lo, 22 January 2011 - 03:39 AM.
#15
Posted 22 January 2011 - 07:29 AM
Edited by mg1572, 22 January 2011 - 07:31 AM.
#16
Posted 22 January 2011 - 11:24 AM
Edited by worldsdream, 22 January 2011 - 12:40 PM.
#17
Posted 06 February 2011 - 03:25 PM
#18
Posted 09 February 2011 - 12:38 AM
Place them in /Applications/uTorrent.app as Morrent_uTorrent_App_Icon.png (Replace the original) and Icon-Small.png respectively
#19
Posted 09 February 2011 - 01:01 AM
#20
Posted 09 May 2011 - 07:42 PM
if anyone sees this
could you please retinize ntpdate and aptbackup icons
cheers











Sign In
Create Account
Back to top










