Sunday, January 6, 2013

Adding more wallpapers to TwWallpaperChooser.apk

Now that I have explored how to de-compile an APK, we can play with its resources and XML files. The first experiment I did was to remove unwanted wallpapers from the TwWallpaperChooser.apk and add what I want it as default.

so here it goes, the basic procedure remains same, as decompile the apk and then recompile the apk.

First de-compile the apk into a folder with the below commands
apktool TwWallpaperChooser.apk TwWallpaperChooser

You would see a folder created with the files as shown below.






The contents of the folder is as shown below.




The important folder, and file you need to know in this case are /res/drawable-hdpi/ this folder contains all the images and their thumbnails, thumbnails are with _small in the name, and are of size 170x142, and main wallpaper images are of size 960x800. You can add more pictures and their thumbnails with the same size.

The reference to these files are made in the file /res/values-hdpi/arrays.xml, you need to edit this file to add more files and then recompile to generate a TwWallpaperChooseNew.apk.

Once you have your New APK ready, open both the NEW and OLD APK in some zip manager such as 7zip, and copy the resources.arsc from NEW apk to OLD apk, and also copy the images you have added into corresponding folders, and you are ready. The apk can be renamed to .zip file, so that it can be opened in zip manager, and once your copy is done, rename back to .apk file. 

You can now copy this file into /system/app and chmod to 644 and you are ready to use new TwWallpaperChooser.apk with added wallpapers. 

Here is few screen shots from what I have done. 


Hope you would enjoy doing it. Let me know if you have any questions.




No comments:

Post a Comment