Tuesday, November 13, 2007

Google's Android: My two cents

I love it. At least from a developers point of view. Now the real question is, can they get the devices with the right form factors to really complete with the big boys, MS, Symbian, and now Apple.

With HTC behind them, there is no reason why they can't. So why does a tech skeptic like me like this FOB (Fresh off the boat) platform so much. Well here's why

  • SDK for OS X, Linux & Windows (Take note Apple!)
  • It uses Java as the language of choice.
  • Each app runs in VM, they borrowed an idea from palm os(kinda)
  • They provided a C Api
  • XML GUI layouts, nice and open
  • The Platform is wide open
If you wanna look at this from a web 2.0 mashup point of view, its like the following

Microsoft's level developer support + Googles Open-ness + Apples inovation

Alternatively Lets compare it to it's rivals

Symbian - 'Modern' widely supported Language (Java vs C++).
Microsoft - It doesn't look like it was retrofitted to be used in a phone
Palm - Multiple device makers, means better form factors + it's a brand new os
Apple - It's not a Objective-C only world, and locked down like a [insert word of choice]
Others - It's got traction, and the developer community behind it, we all love google.

I'm getting to work on developing some apps for this platform. As i said it's got my support, it's solid under the hood, and i look forward to queuing for my first device. 

BTW i hate the iphone if anyone is wondering.


Quote of the Day
Red Light District

Some are more hungry than others...

Tuesday, November 06, 2007

Quick and Dirty Leopard Dock Image replacement script

This one is for all the dock hackers out there. I'm gonna try and roll this into a application during my lectures today ^_^

Cut and paste the script into a text editor of your choice, and save it as "dockSwitcher.sh"

To use this save your new dock images on the desktop and then run the script. Beware i haven't tested as i A. Use the non-glass dock, and B. didn't have time. So use with caution.


#!/bin/bash
## Quick and dirty Dock Image Replacement script
## Jonathan Dalrymple
## November 6, 2007

##Root Checking
## Thanks to
## http://blog.mecworks.com/articles/2006/02/23/bash-scripting-tip-running-a-script-as-root/
CMDLN_ARGS="$@" # Command line arguments for this script
export CMDLN_ARGS

# Run this script as root if not already.
chk_root () {

if [ ! $( id -u ) -eq 0 ]; then
echo "Please enter root's password."
exec su -c "${0} ${CMDLN_ARGS}" # Call this prog as root
exit ${?} # sice we're 'execing' above, we wont reach this exit
# unless something goes wrong.
fi

}

# Check if user is root
chk_root

##Back up dock
cp /System/Library/CoreServices/Dock.app ~/Dock.backup.app

##Remove the old files
rm /System/Library/CoreServices/Dock.app/Contents/Resources/scurve-l.png

rm /System/Library/CoreServices/Dock.app/Contents/Resources/scurve-m.png

rm /System/Library/CoreServices/Dock.app/Contents/Resources/scurve-sm.png

rm /System/Library/CoreServices/Dock.app/Contents/Resources/scurve-xl.png

##Put in the new files
mv ~/Desktop/scurve-l.png /System/Library/CoreServices/Dock.app/Contents/Resources/

mv ~/Desktop/scurve-m.png /System/Library/CoreServices/Dock.app/Contents/Resources/

mv ~/Desktop/scurve-sm.png /System/Library/CoreServices/Dock.app/Contents/Resources/

mv ~/Desktop/scurve-xl.png /System/Library/CoreServices/Dock.app/Contents/Resources/

##Remove dock images from desktop
rm ~/Desktop/scurve-l.png

rm ~/Desktop/scurve-m.png

rm ~/Desktop/scurve-sm.png

rm ~/Desktop/scurve-xl.png

##
killall Dock


Monday, November 05, 2007

Leopard Hacking : Front Row

Thanks to my coffee, i can't seem to sleep. So to pass the time i decided to do some more work on a new brain wave i just had this evening.

It centers around front row. Well actually it had nothing to do with front row, however building on top of front row makes more sense, than starting out from scratch.

Now as you may or may not know, like most of the cool gui stuff on osx front row is a closed environment. Which means it's hacking time. Something i always wanted to play with is a decompiler. Now i'm no Dmitry Grinberg, so assembly doesn't wash with me. Instead i found this little gem.

After a a brief compile it gave me this wonderful output



struct _NSZone;

/*
* File: Movies
* Arch: Intel 80x86 (i386)
*/

@protocol BRMenuListItemProvider
- (long)itemCount;
- (float)heightForRow:(long)fp8;
- (BOOL)rowSelectable:(long)fp8;
- (id)titleForRow:(long)fp8;
- (id)itemForRow:(long)fp8;
@end

@protocol NSObject
- (BOOL)isEqual:(id)fp8;
- (unsigned int)hash;
- (Class)superclass;
- (Class)class;
- (id)self;
- (struct _NSZone *)zone;
- (id)performSelector:(SEL)fp8;
- (id)performSelector:(SEL)fp8 withObject:(id)fp12;
- (id)performSelector:(SEL)fp8 withObject:(id)fp12 withObject:(id)fp16;
- (BOOL)isProxy;
- (BOOL)isKindOfClass:(Class)fp8;
- (BOOL)isMemberOfClass:(Class)fp8;
- (BOOL)conformsToProtocol:(id)fp8;
- (BOOL)respondsToSelector:(SEL)fp8;
- (id)retain;
- (oneway void)release;
- (id)autorelease;
- (unsigned int)retainCount;
- (id)description;
@end

@interface RUIMoviesAppliance : BRAppliance
{
}

+ (id)moduleKey;
- (id)init;
- (void)dealloc;
- (id)moduleIconName;
- (float)moduleIconReflectionOffset;
- (id)moduleName;
- (id)moduleKey;
- (id)applianceController;

@end

@interface RUIMoviesApplianceController : BRMediaMenuController
{
NSArray *_headerRows;
NSMutableArray *_titlesWithUnplayedContent;
RUIMovieFolderCollection *_movieFolderCollection;
BRMovieTrailersProvider *_trailersProvider;
unsigned int _hasLocalMovies:1;
unsigned int _movieTrailersPreviewRequested:1;
unsigned int _movieTrailersSelected:1;
BRDataStore *_dataStore;
Class _msClass;
}

- (id)init;
- (void)dealloc;
- (id)musicStoreBaseType;
- (BOOL)menuDisplaysLeftIcon;
- (void)networkStatusChanged:(id)fp8;
- (BOOL)isVolatile;
- (id)loadModelData;
- (void)refreshControllerForModelUpdate;
- (BOOL)shouldRefreshForUpdateToObject:(id)fp8;
- (long)defaultIndex;
- (void)itemSelected:(long)fp8;
- (void)wasExhumedByPoppingController:(id)fp8;
- (void)wasPushed;
- (void)willBePopped;
- (void)wasPopped;
- (id)previewControlForItem:(long)fp8;
- (BOOL)brEventAction:(id)fp8;

@end

@interface RUIMoviesApplianceController (AsyncNotifications)
- (void)_movieTrailersLoaded:(id)fp8;
- (void)_swapNewController:(id)fp8;
@end

@interface RUIMoviesApplianceController (DataSourceAccess)
- (id)_movieTrailers:(id *)fp8;
@end

@interface RUIMoviesApplianceController (MediaParadeBuilders)
- (id)_moviesFolderParade;
- (id)_movieTrailersParade;
- (id)_stingrayMediaPreview;
@end

@interface RUIMoviesApplianceController (MovieLoading)
- (void)_cacheUnplayedTitles;
- (BOOL)_hasUnplayedMovies;
@end

@interface RUIMoviesApplianceController (MovieSelection)
- (id)_movieSelectedAtIndex:(long)fp8;
@end

@interface RUIMoviesApplianceController (MenuBuilding)
- (id)_buildMovieTrailersMenu;
- (id)_movieTrailersController:(id)fp8;
- (id)_buildMyMoviesMenu;
- (id)_stingrayFrontPageController;
- (id)_headerRows;
@end

@interface RUIMoviesApplianceController (DataProviders)
- (id)itemForRow:(long)fp8;
- (long)itemCount;
- (id)titleForRow:(long)fp8;
- (float)heightForRow:(long)fp8;
- (BOOL)rowSelectable:(long)fp8;
@end

@interface RUISDMovieTrailersController : RUIMovieTrailersController
{
}

- (id)initWithTrailers:(id)fp8;
- (id)previewControlForItem:(long)fp8;
- (id)titleForRow:(long)fp8;
- (long)defaultIndex;
- (id)itemForRow:(long)fp8;
- (long)itemCount;
- (void)itemSelected:(long)fp8;

@end

@interface RUIMovieTrailersController : BRMediaMenuController
{
NSArray *_trailers;
}

- (id)initWithTrailers:(id)fp8;
- (void)dealloc;
- (BOOL)isNetworkDependent;
- (void)itemSelected:(long)fp8;
- (long)itemCount;
- (id)itemForRow:(long)fp8;
- (id)titleForRow:(long)fp8;
- (float)heightForRow:(long)fp8;
- (BOOL)rowSelectable:(long)fp8;
- (id)previewControlForItem:(long)fp8;

@end

@interface RUISDMovieTrailersController (Private)
- (id)_HDMovieTrailers:(id *)fp8;
@end

@interface RUIMovieTrailersController (Private)
- (id)_movieTrailersTitle;
@end

@interface RUIMovieDirectoryController : BRMediaMenuController
{
RUIMovieFolderCollection *_collection;
NSString *_path;
}

- (id)initWithMovieFolderCollection:(id)fp8;
- (void)dealloc;
- (id)moviesForParade;
- (void)itemSelected:(long)fp8;
- (id)previewControlForItem:(long)fp8;
- (id)mediaPreviewMissingMediaType;
- (BOOL)mediaPreviewShouldShowMetadata;
- (BOOL)mediaPreviewShouldShowMetadataImmediately;
- (long)itemCount;
- (id)itemForRow:(long)fp8;
- (id)titleForRow:(long)fp8;
- (float)heightForRow:(long)fp8;
- (BOOL)rowSelectable:(long)fp8;

@end

@interface RUIMovieFolderAsset : BRBaseMediaAsset
{
NSString *_displayName;
NSURL *_mediaURL;
NSString *_folderPath;
BRImage *_posterImage;
BOOL _requestedImage;
}

+ (id)assetForName:(id)fp8 folderPath:(id)fp12 andMediaURL:(id)fp16;
- (void)dealloc;
- (void)setDisplayName:(id)fp8;
- (void)setMediaURL:(id)fp8;
- (void)setMovieFolderPath:(id)fp8;
- (id)assetID;
- (id)title;
- (id)mediaURL;
- (BOOL)hasCoverArt;
- (id)coverArt;
- (id)dateAcquired;
- (id)mediaType;

@end

@interface RUIMovieFolderAsset (ArtLoading)
- (void)_loadImage:(id)fp8;
- (void)_imageLoaded:(id)fp8;
@end

@interface RUIMovieFolderCollection : BRBaseMediaCollection
{
RUIMovieFolderCollection *_parent;
NSString *_displayName;
NSString *_folderPath;
NSArray *_childCollections;
NSArray *_childAssets;
}

+ (id)collectionForName:(id)fp8 folderPath:(id)fp12 andParent:(id)fp16;
- (void)dealloc;
- (void)setParent:(id)fp8;
- (void)setDisplayName:(id)fp8;
- (void)setMovieFolderPath:(id)fp8;
- (id)childCollections;
- (id)parentCollection;
- (id)collectionType;
- (id)collectionID;
- (int)count;
- (id)mediaAssets;
- (id)title;
- (id)titleForSorting;
- (BOOL)hasCoverArt;
- (id)coverArt;
- (BOOL)isLocal;

@end

@interface RUIMovieFolderCollection (Private)
- (void)_generateCollectionChildren;
@end

@interface BRMediaCollectionType (FolderCollectionExtension)
+ (id)folderCollection;
@end

What you see here is the headers/interface & protocol files for all the different classes located within Front rows movies appliance.

If you want to see your own front row app, it's located @ /system/library/coreservices/front row.app

Now i had heard that some good folks over at Awkward TV forums have hacked appliances for the Apple TV which is basically what the new front row on leopard is, however these don't seem to work 'out of the box', and apparently Apple updated this version before the roll out.

Coupled with all the above, i have reason to believe that the new appliances are digitally signed by [chinese] ni cai, Apple.

By reasoning for this, is a did a hex dump (using 0xED) of the appliance executables, and found the following string(s) @ 135535

"Apple Certification Authority1301U*Apple Code Signing Certification Authority"

Now just after typing the above sentence, it dawned on me that this might be for the transactions with the ITMS, for movie trailers, however i checked the settings appliance and found the same thing.

Also i tried deleting the various applications from a running front row, and it handles them gracefully, and also doesn't mind having new ones dropped in. I tried droping in the rss apple tv plugin, however it didn't like it very much.

I'm a programmer, not a hacker so this is about the limit of my skill, especially if it envolves digitally signed apps. I can barely deal with the symbian signed apps, never mind about these ones. If got some ideas or feel like getting dirty and dodging some DMCA takedown notices let me know.

UPDATE

i found this URL above the previous string, http://www.apple.com/appleca/

turns out that the certificate may be freely available, which might make life a tad bit easier.

PS. to any one wanting to warn me for breaking the law, i'm not a US resident ^_^