[Galaxy S II Android Development] hawkerpaul:
How can I tell if something I'm about to flash is going to replace an app, or morph it?

Following on from this post

I realise this post will be like teaching many of you to suck eggs, so I apologise to you beforehand for waffling, but I thought I would put this down for those of you on here who may be a little uncertain about whether something that you are flashing is a complete apk or a theme morph.

Firstly you will need to download 7Zip in order to examine the zip file you are about to flash.

If you prefer to open it on your handset then you would need to download an app that can open .zip files.

ES File Explorer can do this with its built-in zip viewer. Script Manager and Ghost Commander can also do this.

Inside the zip, look in /system and /preload/symlink

Inside these locations will be the files that will get replaced

These folders may exist in the zip, but could be empty as far as actual files are concerned, perhaps just containing sub-folders.

If there are no actual files in here, then these folders are simply overlooked as far as the installation is concerned.

If your zip has a folder called either vrtheme or XMORPH then inside this folder will be any apk's that will be theme-morphed

Inside here will have the usual folder structure to apps (eg. system/app, preload/symlink etc) but the apk files will take the form of a folder

Inside the "apk's" folder are the specific files that are to be morphed

Again, if you drill down the directory structure within vrtheme/XMORPH you may find that only folders are contained.

All this would mean is no apks are being morphed.

If there is no vrtheme/XMORPH folder then no morphing is taking place at all.

I developed my own morphing script that holds morphed files into an XFormAPK folder. this performs the update a little more slickly compared to current methods, but as it ultimately does nothing over and beyond the current methods, then I dont see much point publishing it.

How is this morphing done?

For every "apk" folder in the vrtheme/XMORPH folder, the install script will take the current version of the apk file being morphed, and will apply all the specific changes (eg. icons, animations etc) contained in the vrtheme/XMORPH folder into the existing apk by re-zipping the changes back into the apk,

Once the morphed changes have been rezipped, the apk is re-zipaligned.

This morphed apk then gets copied back to its original location, and voila, you now have an updated, morphed apk.

Morphing apks is hugely beneficial in comparison to complete apk replacement.

For example, you may have your own preferred wifi icons, so if a morph is made for the icons of your choice, then this can just be applied to your current SystemUI.apk regardless of which version of the firmware you are on, so would basically be good to use for life (or at least until the underlying naming conventions in the apks get changed). If these preferred icons are contained in a complete SystemUI.apk, then this would be specific to the firmware version it originated from. This then becomes a lottery as to whether or not this would work, and even if it does work, then it is not something I would ever recommend as your handset would be running on a mixture of firmware as far as the affected apk's go.

Thanks for reading.