Results 1 to 8 of 8

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Icon harvesting Script: Get all of your icons in one place!

  1. #1
    Post Icon harvesting Script: Get all of your icons in one place!
    sorry had no idea where else to put this

    untested on 4.0 and buggy (i had to restore, but dont worry i fixed that bug lol)

    by buggy i mean it doesnt get ALL of the icons. i am 90% sure it gets all the icons in var/mobile/Applications though.

    please please if you try this give feedback

    instruction:
    1. make a new extensionless file and paste the code below into it
    2. copy it to ur ipod /usr/bin/
    3. change the permissions to read write execute preferably with iFile if not use the command below
    Code:
    chmod 777 /usr/bin/filename
    4. in terminal type the name of the file. for me it was "icostash" terminal for 4.0

    -note: if u get a weird error thats like bash^C is messed up or something with that open up the document with iFile on ur idevice click edit then after the first or third line press backspace to go up a line then enter again if you want. i believe this removes a weird newline character or something *** like that.

    Code:
    #!/bin/bash
    # icon stasher for themers
    # written by Josh aka Phanatic
    
    function exo {
    exit 0
    }
    
    if [ "$(id -u)" != "0" ]; then
       echo "This script must be run as root"
       exit 1
    fi
    
    
    if [ ! -e "/usr/bin/zip" ]; then
    if [ ! -e "/usr/bin/plutil" ]; then
      echo "Please install zip"
      echo "Please install erica utilities"
      exo
    else
      echo "Please install zip"
      exo
    fi
    fi
    if [ ! -e "/usr/bin/plutil" ]; then
    if [ ! -e "/usr/bin/zip" ]; then
      echo "Please install zip"
      echo "Please install erica utilities"
      exo
    else
      echo "Please install erica utilities"
      exo
    fi
    fi
    
    cd /var/mobile
    
    if [ ! -e "/var/mobile/icostash" ]; then
      mkdir icostash
      chown mobile icostash
      chmod 777 icostash
      chgrp mobile icostash
    else
      echo "removing previous icostash"
      rm -rf icostash
      rm -rf icostash.zip
      mkdir icostash
      chown mobile icostash
      chmod 777 icostash
      chgrp mobile icostash
    fi
    
    cd /var/mobile/Applications
    
    echo "processing.."
    
    for dname in $(ls);
    
    do 
    
    	iname="$(plutil -CFBundleIconFile /var/mobile/Applications/$dname/*.app/Info.plist 2>/dev/null)"
    	bname="$(plutil -CFBundleName /var/mobile/Applications/$dname/*app/Info.plist 2>/dev/null)"
    	wname="$(plutil -CFBundleDisplayName /var/mobile/Applications/$dname/*app/Info.plist 2>/dev/null)"
    	
    	if [ -z "$iname" ]; then
    		
    		find /var/mobile/Applications/"$dname" -name "icon.png" -type f -exec cp {} /var/mobile/icostash \; 2>/dev/null
    		find /var/mobile/Applications/"$dname" -name "Icon.png" -type f -exec cp {} /var/mobile/icostash \; 2>/dev/null
    	
    		chown mobile /var/mobile/icostash/*png 2>/dev/null
    		chmod 777 /var/mobile/icostash/*png 2>/dev/null
    		chgrp mobile /var/mobile/icostash/*png 2>/dev/null
    	
    		if [ -z "$wname" ]; then
    			if [ -z "$bname" ]; then
    				altname=/var/mobile/Applications/"$dname"/*.app
    				naltname="${altname##*/}"
    				nnaltname="${naltname%\.*}"
    				mv /var/mobile/icostash/Icon.png "$nnaltname" 2>/dev/null
    				mv /var/mobile/icostash/icon.png "$nnaltname" 2>/dev/null
    			else
    				mv /var/mobile/icostash/Icon.png /var/mobile/icostash/"$bname" 2>/dev/null
    				mv /var/mobile/icostash/icon.png /var/mobile/icostash/"$bname" 2>/dev/null
    			fi
    		else
    			mv /var/mobile/icostash/Icon.png /var/mobile/icostash/"$wname" 2>/dev/null	
    			mv /var/mobile/icostash/icon.png /var/mobile/icostash/"$wname" 2>/dev/null
    		fi
    	
    		if [ -e "/var/mobile/icostash/*png" ]; then
    		echo "Error"
    		fi
    		
    	
    	else
    
    	
    
    
    		cp /var/mobile/Applications/$dname/*.app/"$iname" /var/mobile/icostash 2>/dev/null
    
    	
    		chown mobile /var/mobile/icostash/*png 2>/dev/null
    		chmod 777 /var/mobile/icostash/*png 2>/dev/null
    		chgrp mobile /var/mobile/icostash/*png 2>/dev/null
    	
    		if [ -z "$wname" ]; then
    			if [ -z "$bname" ]; then
    				altname=/var/mobile/Applications/"$dname"/*.app
    				naltname="${altname##*/}"
    				nnaltname="${naltname%\.*}"
    				mv /var/mobile/icostash/"$iname" "$nnaltname" 2>/dev/null
    			else
    				mv /var/mobile/icostash/"$iname" /var/mobile/icostash/"$bname" 2>/dev/null
    			fi
    		else
    				mv /var/mobile/icostash/"$iname" /var/mobile/icostash/"$wname" 2>/dev/null
    		fi
    
    	
    	
    
    	
    		if [ -e "/var/mobile/icostash/*png" ]; then
    		echo "Error"
    		fi
    	
    
    	
    	fi
    
    done
    
    cd /Applications
    
    for ename in $(ls);
    
    do 
    
    	iname=
    	bname=
    	wname=
    
    	iname="$(plutil -CFBundleIconFile /Applications/$ename/Info.plist 2>/dev/null)"
    	bname="$(plutil -CFBundleName /Applications/$ename/Info.plist 2>/dev/null)"
    	wname="$(plutil -CFBundleDisplayName /Applications/$ename/Info.plist 2>/dev/null)"
    
    	if [ -z "$iname" ]; then
    	
    		find -H /Applications/"$ename" -name "icon.png" -type f -exec cp -f {} /var/mobile/icostash \; 2>/dev/null
    		find -H /Applications/"$ename" -name "Icon.png" -type f -exec cp -f {} /var/mobile/icostash \; 2>/dev/null
    		
    		chown mobile /var/mobile/icostash/*png 2>/dev/null
    		chmod 777 /var/mobile/icostash/*png 2>/dev/null
    		chgrp mobile /var/mobile/icostash/*png 2>/dev/null
    		
    		if [ -z "$wname" ]; then
    			if [ -z "$bname" ]; then
    				altname=/Applications/"$ename"
    				naltname="${altname##*/}"
    				nnaltname="${naltname%\.*}"
    				mv /var/mobile/icostash/Icon.png "$nnaltname" 2>/dev/null
    				mv /var/mobile/icostash/icon.png "$nnaltname" 2>/dev/null
    			else
    				mv /var/mobile/icostash/Icon.png /var/mobile/icostash/"$bname" 2>/dev/null
    				mv /var/mobile/icostash/icon.png /var/mobile/icostash/"$bname" 2>/dev/null
    			fi
    		else
    			mv /var/mobile/icostash/Icon.png /var/mobile/icostash/"$wname" 2>/dev/null	
    			mv /var/mobile/icostash/icon.png /var/mobile/icostash/"$wname" 2>/dev/null
    		fi
    		
    		if [ -e "/var/mobile/icostash/*png" ]; then
    		echo "Error"
    		fi
    		
    		
    	else
    
    	
    		cp /Applications/$ename/"$iname" /var/mobile/icostash 2>/dev/null
    	
    	
    		chown mobile /var/mobile/icostash/*png 2>/dev/null
    		chmod 777 /var/mobile/icostash/*png 2>/dev/null
    		chgrp mobile /var/mobile/icostash/*png 2>/dev/null
    	
    	
    	
    		if [ -z "$wname" ]; then
    			if [ -z "$bname" ]; then
    				altname=/Applications/"$ename"
    				naltname="${altname##*/}"
    				nnaltname="${naltname%\.*}"
    				mv /var/mobile/icostash/"$iname" "$nnaltname" 2>/dev/null
    			else
    				mv /var/mobile/icostash/"$iname" /var/mobile/icostash/"$bname" 2>/dev/null
    			fi
    		else
    				mv /var/mobile/icostash/"$iname" /var/mobile/icostash/"$wname" 2>/dev/null
    		fi
    		
    		if [ -e "/var/mobile/icostash/*png" ]; then
    		echo "Error"
    		fi
    	fi
    done
    
    cd /var/mobile
    cd /var/mobile/icostash
    
    find /var/mobile/icostash -type f -exec mv '{}' '{}'.png \; 2>/dev/null
    
    cd ..
    echo "zipping.."
    zip -r icostash.zip icostash 1>/dev/null
    echo "done"
    
    echo "icons are in var/mobile/icostash"
    echo "also zipped as icostash.zip in var/mobile"
    
    echo ""
    echo "thank you for using my script.. support me"
    echo "by joining ipod-hacking.com"
    echo ""
    
    exo
    Attached Thumbnails Attached Thumbnails -icon.png  
    Last edited by PhanaticD; 2010-08-24 at 03:49 AM.

  2. The Following User Says Thank You to PhanaticD For This Useful Post:

    DeCoy (2010-08-25)

  3. #2
    Master Theme Creator (aka Bluemetal) Blue's Avatar
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    7,146
    Thanks
    3,488
    Thanked 14,284 Times in 3,850 Posts

    Can you explain what's this for ?

  4. #3
    Hmm yea I should have thought of that.

    Purpose: this bash script goes through your applications and finds the icons for each and copies them to one folder while renaming them to what they would be in winterboard. It also makes a zip so you can ssh it easily too.

  5. #4
    Quite clever actually

  6. The Following User Says Thank You to ss4adib For This Useful Post:

    PhanaticD (2010-08-24)

  7. #5
    Green Apple
    Join Date
    Jul 2009
    Location
    England uk
    Posts
    55
    Thanks
    10
    Thanked 10 Times in 6 Posts

    There is an app called icon harvester and it themes all icons and it is 4.0/4.0.1 ready and has no glitches thanks any way I will keep to the paid app
    dopydoo

  8. #6
    hey dopy just because it has the same name does not mean it does the same thing.........

    I would not have spent hours creating something that already exists

    this is primarily for those who create themes, not use them

  9. #7
    Green Apple
    Join Date
    Jul 2009
    Location
    England uk
    Posts
    55
    Thanks
    10
    Thanked 10 Times in 6 Posts

    Ah sorry buddy
    dopydoo

  10. #8

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •