Jump to content

Advertisement

--


Donate

Skrill

Stripe

BitPay



Photo

converting cydia app icons to retina


  • Please log in to reply
19 replies to this topic

#1
adhd4lyfe

adhd4lyfe

    Advanced Member

  • +Contributor
  • PipPipPip
  • 31 posts
can anyone please help me mod this iretiner script to make the cydia apps into retina? i modded one line to look inside the folder with those icons but above that line i made is one that looks for caches and then there are lines to look in app store.. so is this even possible without looking into the app store and the cache? heres the script.

#!/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
  • 0

x-bot

x-bot

    x-bot

  • Ad-Bot
  • Ad post

--



#2
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts
iRetiner needs a source image to create a retina icon. In the case of AppStore applications that source is the iTunesArtwork, but Cydia applications don't have anything like that. It also requires the icon to have the default AppStore overlay, which rounds the normally square source image. The only way to really get a retina Cydia app icon is to wait for the dev to make one, make one yourself using a photo editing software, or request one from the community.

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.

  • 0

Posted Image


#3
adhd4lyfe

adhd4lyfe

    Advanced Member

  • +Contributor
  • PipPipPip
  • 31 posts
of the stuff i have so far i only need mywi:D
  • 0

#4
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts

of the stuff i have so far i only need mywi:D

How's this:
Posted ImagePosted Image

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.

  • 1

Posted Image


#5
Zamda

Zamda

    Donator

  • +Contributor
  • PipPipPipPipPipPipPip
  • 122 posts
Yeah, that script grabs the itunesartwork files and uses them instead. Cydia apps don't have those.
  • 0

#6
adhd4lyfe

adhd4lyfe

    Advanced Member

  • +Contributor
  • PipPipPip
  • 31 posts
well they should:D i think it would be hella nice UI if it looked like the app store. all the catigories, updates tab, best apps.. featured.. it would be cool:D

and yes thats perfect thanks:D

Edited by adhd4lyfe, 12 December 2010 - 10:51 AM.

  • 0

#7
dabba

dabba

    Whats an iPhone

  • Members
  • Pip
  • 8 posts
Anyway some can make please make a retina icon for Ifilefinder?
  • 0

#8
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts

Anyway some can make please make a retina icon for Ifilefinder?

Are you referring to iFile? The latest version has a retina icon by default.
  • 0

Posted Image


#9
Ryccardo

Ryccardo

    Whats an iPhone

  • +Contributor
  • PipPipPipPipPipPipPip
  • 285 posts

Are you referring to iFile? The latest version has a retina icon by default.

Probably not, I've heard of an app with that name about 3 months ago.
  • 0

#10
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts
iFileFinder:

Posted Image Posted Image

SSH them to /Applications/iFileFinder.app and rename them icon@2x.png and Icon-Small.png respectively.

Edited by r0bop0lo, 05 January 2011 - 03:52 PM.

  • 0

Posted Image


#11
mg1572

mg1572

    Whats an iPhone

  • Members
  • PipPipPipPipPipPipPip
  • 233 posts
May i request default Torrentula and iDemonoid retina icons please?
  • 0

#12
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts

May i request default Torrentula and iDemonoid retina icons please?

You may. I'll have you know I hate spiders with a passion though...

Torrentula:

Posted Image Posted Image

Place them in /Applications/Torrentula.app as icon.png (Replace the original) and Icon-Small.png respectively

iDemonoid:

Posted Image Posted Image

Place them in /Applications/iDemonoid.app as Icon@2x.png (Replace the original) and Icon-Small.png respectively
  • 1

Posted Image


#13
mg1572

mg1572

    Whats an iPhone

  • Members
  • PipPipPipPipPipPipPip
  • 233 posts
dude, youre the man. i dont want to seem too greedy, but......."ishare" please. :)
  • 0

#14
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts
iShare:
Posted Image Posted Image

Place them in /Applications/iShare.app as Icon@2x.png and Icon-Small.png respectively

Edited by r0bop0lo, 22 January 2011 - 03:39 AM.

  • 1

Posted Image


#15
mg1572

mg1572

    Whats an iPhone

  • Members
  • PipPipPipPipPipPipPip
  • 233 posts
Dude, thank you so much! You've completed my collection! :)

Edited by mg1572, 22 January 2011 - 07:31 AM.

  • 0

#16
worldsdream

worldsdream

    Senior Member

  • +Contributor
  • PipPipPipPipPipPipPip
  • 258 posts
the most cydia apps are getting retina icons

Edited by worldsdream, 22 January 2011 - 12:40 PM.

  • 0

#17
mg1572

mg1572

    Whats an iPhone

  • Members
  • PipPipPipPipPipPipPip
  • 233 posts
Hey r0bop0lo, can you retinaize uTorrent, please?
  • 0

#18
r0bop0lo

r0bop0lo

    I Bite

  • +Contributor
  • PipPipPipPipPipPipPipPipPipPip
  • 2501 posts
uTorrent:
Posted Image Posted Image


Place them in /Applications/uTorrent.app as Morrent_uTorrent_App_Icon.png (Replace the original) and Icon-Small.png respectively
  • 1

Posted Image


#19
mg1572

mg1572

    Whats an iPhone

  • Members
  • PipPipPipPipPipPipPip
  • 233 posts
these icons look great. thanks again. :)
  • 0

#20
dsluga113

dsluga113

    Whats an iPhone

  • Members
  • Pip
  • 9 posts
hi,
if anyone sees this
could you please retinize ntpdate and aptbackup icons

cheers :thumbsup:
  • 0




IPB skins by Skinbox
-->