Wednesday, September 24, 2008

Android SDK

Really good looking on my Mac



Wednesday, September 17, 2008

Recent apps on your dock for Mac

http://www.tuaw.com/2008/09/16/terminal-tips-add-recent-applications-as-a-stack-on-dock/

Type this in Mac Terminal

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
killall Dock

Monday, September 8, 2008

How do you create an .ipa file?

This is taken from discussion forum and I found it very useful

What you need:
1: An app
2: A patched MobileInstallation file installed on your iPhone or iPod Touch.
3: Lastly, you need to know that when I say "ProgName", substitute the name of the program you're working with
Getting the iTunesArtwork file
The iTunesArtwork file is simply a jpeg image with the extension taken off, and is included in application's install folder on your device for every app downloaded from the app store. This image is what appears in the Applications section of iTunes as the icon for the app, and is definitely nice to have -- if you don't have it, you get a generic, black icon that no one wants to see. If you have the iTunesArtwork file, skip all this and go down to the next red headline! Otherwise, read on:
1: Open iTunes on your computer and find your application in the iTunes Music Store. On the application's page, find the app icon at the top-left corner of the page and right-click it. Now choose "Copy iTunes Store URL". Your clipboard now contains something like this:
Code:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284962368&mt=8

2. run this script (which I created) in mac, eg ./getappicon.sh 284962368
Shell script: getappicon.shSelect all

#!/bin/sh
url=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f22 -d"\""`
appname=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f16 -d"\""`
if [ "$appname" = "0" ] ; then
appname=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f18 -d"\""`
fi
echo ${appname}

url100=${url}
curl ${url100} > ${1}.jpg

url512=`echo ${url100} | perl -pe 's/100/512/g'`
curl ${url512} > ${1}_512.jpg


3: Then you will get two jpg files, 284962368_512.jpg & 284962368.jpg Rename the 512 jpeg to iTunesArtwork. You've just gotten your iTunesArtwork file.

Bundling the .IPA
1: Create a folder on your desktop called "working". Open that, and create another folder inside of it called "Payload". Case-sensitive.
2: Move your iTunesArtwork file into the "working" folder, and your .app into the Payload folder.
3: Mac and Linux users only: Open Terminal and run the following command:
Code:
chmod -R 775 ~/Desktop/working/Payload
4: Go into your ProgName.app folder within Payload (Mac users, right-click ProgName.app and choose Show Package Contents).
5 (For Mac users with Dev Tools installed ONLY): Double-click the Info.plist file. The Property List Editor will open and show a simple table. Click the last row of the table, then press the + button that appears to create a new row at the bottom. In the first new cell enter
Code:
SignerIdentity
and in the second new cell, enter
Code:
Apple iPhone OS Application Signing
Save this file.
5 (For Windows, Linux, and other Macs): Visit the following site: https://brokolice.drsny.net/iphone/plutil/ (You may have to Approve the security certificate -- don't worry, it's safe)
Browse for your Info.plist file, and press the "Convert" button. Save the resulting file to your computer. Windows users, open this file in WordPad. Mac and Linux users can use any text editor.
scroll to the bottom of the file and make a new line just before
Code:
</dict>
And paste the following in that spot:
Code:
<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>
The end of the file should now look like this:
Code:
<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>
</dict>
</plist>
Save the file (Make sure the name is Info.plist -- case sensitive!) and replace the Info.plist in ProgName.app with it.
6: Time to zip it up. Use your favorite method to zip the iTunesArtwork file and Payload folder together in one .zip file. Mac users can select both, right-click, and choose "Compress 2 Items". Windows users can select both, right-click, and choose "Add to Archive" (remember to select ZIP, not RAR if that option is available).
If you unzip the file, you should see this structure:
Code:

iTunesArtwork
+Payload
AppName.app
7: Rename the zip file to ProgName.ipa
8: All done! Congratulations!

Friday, August 22, 2008

iPhone / iPod Firmware Link

http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version?touchUpdate=true

Shell script: Select all

#!/bin/sh
curl -s -L http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version?touchUpdate=true | gunzip | grep appldnld | grep "iP*.*Restore" | awk '{print $1;}' | uniq

Wednesday, August 20, 2008

Installer Script Command

http://www.hackint0sh.org/forum/showpost.php?p=335937&postcount=2

Common Script Commands of Installer
These are old script commands for Installer, I think some of them are still applicable in Installer 4

CopyPath() and RemovePath()
Code: Select all

<array>
<string>CopyPath</string>
<string>YourProg.app/</string>
<string>/Applications/YourProg.app</string>
</array>


and
Code: Select all

<array>
<string>RemovePath</string>
<string>/Applications/YourProg.app</string>
<string>/var/mobile/Library/Preferences/com.yourcompany.YourProg.plist</string>
</array>


Other Common Commands
AbortOperation(string) This will make Installer both abort the install process and displays a message telling the user why
Confirm(string,string,string) Confirm an action.
Exec(terminalCommand) Runs a Terminal command. Useful for things like chmod, chown, etc.
ExecNoError(terminalCommand) Runs a Terminal command.
LinkPath(oldPath, newPath) Links the two paths.
MovePath(oldPath, newPath) Moves files from one location to another
Notice(string) Displays a pop message while Installing
SetStatus(string) Sets the status of the install process. Useful for lengthy installs.

Example
Code: Select all

<array>
<string>Confirm</string>
<string>Changing Permission. Do you wish to continue?</string>
<string>Yes</string>
<string>No</string>
</array>
<array>
<string>SetStatus</string>
<string>Changing Permissions</string>
</array>
<array>
<string>Exec</string>
<string>/bin/chmod -R 755 /var/mobile/Media/MyProgData</string>
</array>
<array>
<string>Exec</string>
<string>/usr/bin/chown -R mobile /var/mobile/Media/MyProgData/.</string>
</array>
<array>
<string>Notice</string>
<string>Installation Completed. Please restart iPhone.</string>
</array>


If / IfNot
If(condition[array], action[array]) Use this to check for specific conditions and have Installer react accordingly. Example
Code: Select all

<array>
<string>IfNot</string>
<array>
<array>
<string>InstalledPackage</string>
<string>com.anothercompany.anotherprog</string>
</array>
</array>
<array>
<array>
<string>AbortOperation</string>
<string>You must install another package first.</string>
</array>
</array>
</array>


Some common things to check with If / IfNot
InstalledPackage(bundleIdentifier) Checks to see whether or not an application is installed.
ExistsPath(path) Checks to see whether a specific file or directory exists
FirmwareVersionIs(arrayOfFirmwaresTocheck) Checks the firmware version