[Galaxy Ace S5830 Themes and Apps] ts_firehawk:
Hello guys!

After a bit of searching, trial and error, I managed to hack the TwWallpaperChooser.apk to add more wallpapers to it, or just change the standard ones. It is very simple and it shouldn't take more than 5 minutes to do.

You'll need:

- a bit of time

- apktool

- signapk

- any image-manipulation program that allows you to resize images (or you can use pixlr:http://pixlr.com/editor/)

- any text editor capable to edit .xml files (I recommend Notepad++:http://notepad-plus-plus.org/)

- obviously, wallpapers!

Lets do it. Start by decompiling TwWallpaperChoser (I've attached it) to any folder you want:

Go to the decompiled folder and navigate to res\drawable-mdpi. Here you'll paste the wallpapers you want to add. Each new wallpaper needs two files: the wallpaper itself and a preview, for the wallpaper select screen:

The wallpaper size needs to be 640x480px and the preview needs to be 107x80px. Both PNG and JPEG works. I didn't tried anything else than this. I'll leave the image work to you. After you've finished, rename the wallpaper file to wallpaper_(the name you want here) and the preview to wallpaper_(the name you want here)_small and move/paste them to the folder you've opened before. Note that the names cannot contain any spaces!

I've added wallpaper_80, wallpaper_beach, wallpaper_clouds and wallpaper_wave.

Now go to res\values folder and open public.xml. It will look something like this:

Copy the last drawable entry, in this case:

<public type="drawable" name="wallpaper_zanzibar" id="0x7f020016" />
<public type="drawable" name="wallpaper_zanzibar_small" id="0x7f020017" />

And paste it right below. It will look like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="drawable" name="APKTOOL_DUMMY_0001" id="0x7f020001" />
<public type="drawable" name="APKTOOL_DUMMY_0006" id="0x7f020006" />
<public type="drawable" name="APKTOOL_DUMMY_0007" id="0x7f020007" />
<public type="drawable" name="APKTOOL_DUMMY_0010" id="0x7f020010" />
<public type="drawable" name="APKTOOL_DUMMY_0011" id="0x7f020011" />
<public type="drawable" name="ic_launcher_wallpaper" id="0x7f020000" />
<public type="drawable" name="wallpaper_16" id="0x7f020002" />
<public type="drawable" name="wallpaper_16_small" id="0x7f020003" />
<public type="drawable" name="wallpaper_17" id="0x7f020004" />
<public type="drawable" name="wallpaper_17_small" id="0x7f020005" />
<public type="drawable" name="wallpaper_default" id="0x7f020008" />
<public type="drawable" name="wallpaper_default_small" id="0x7f020009" />
<public type="drawable" name="wallpaper_desert" id="0x7f02000a" />
<public type="drawable" name="wallpaper_desert_small" id="0x7f02000b" />
<public type="drawable" name="wallpaper_field" id="0x7f02000c" />
<public type="drawable" name="wallpaper_field_small" id="0x7f02000d" />
<public type="drawable" name="wallpaper_grass" id="0x7f02000e" />
<public type="drawable" name="wallpaper_grass_small" id="0x7f02000f" />
<public type="drawable" name="wallpaper_nexuswallpaper1" id="0x7f020012" />
<public type="drawable" name="wallpaper_nexuswallpaper1_small" id="0x7f020013" />
<public type="drawable" name="wallpaper_tree" id="0x7f020014" />
<public type="drawable" name="wallpaper_tree_small" id="0x7f020015" />
<public type="drawable" name="wallpaper_zanzibar" id="0x7f020016" />
<public type="drawable" name="wallpaper_zanzibar_small" id="0x7f020017" />
[B][COLOR="Blue"] <public type="drawable" name="wallpaper_zanzibar" id="0x7f020016" />
<public type="drawable" name="wallpaper_zanzibar_small" id="0x7f020017" />[/COLOR][/B]
<public type="layout" name="wallpaper_chooser" id="0x7f030000" />
<public type="layout" name="wallpaper_item" id="0x7f030001" />
<public type="array" name="extra_wallpapers" id="0x7f040000" />
<public type="array" name="wallpapers" id="0x7f040001" />
<public type="string" name="app_name" id="0x7f050000" />
<public type="string" name="pick_wallpaper" id="0x7f050001" />
<public type="string" name="wallpaper_instructions" id="0x7f050002" />
<public type="id" name="wallpaper" id="0x7f060000" />
<public type="id" name="gallery" id="0x7f060001" />
<public type="id" name="set" id="0x7f060002" />
</resources>

Now, rename the entry you've just added to the name of the wallpaper you've pasted in res\drawable-mdpi. For example:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="drawable" name="APKTOOL_DUMMY_0001" id="0x7f020001" />
<public type="drawable" name="APKTOOL_DUMMY_0006" id="0x7f020006" />
<public type="drawable" name="APKTOOL_DUMMY_0007" id="0x7f020007" />
<public type="drawable" name="APKTOOL_DUMMY_0010" id="0x7f020010" />
<public type="drawable" name="APKTOOL_DUMMY_0011" id="0x7f020011" />
<public type="drawable" name="ic_launcher_wallpaper" id="0x7f020000" />
<public type="drawable" name="wallpaper_16" id="0x7f020002" />
<public type="drawable" name="wallpaper_16_small" id="0x7f020003" />
<public type="drawable" name="wallpaper_17" id="0x7f020004" />
<public type="drawable" name="wallpaper_17_small" id="0x7f020005" />
<public type="drawable" name="wallpaper_default" id="0x7f020008" />
<public type="drawable" name="wallpaper_default_small" id="0x7f020009" />
<public type="drawable" name="wallpaper_desert" id="0x7f02000a" />
<public type="drawable" name="wallpaper_desert_small" id="0x7f02000b" />
<public type="drawable" name="wallpaper_field" id="0x7f02000c" />
<public type="drawable" name="wallpaper_field_small" id="0x7f02000d" />
<public type="drawable" name="wallpaper_grass" id="0x7f02000e" />
<public type="drawable" name="wallpaper_grass_small" id="0x7f02000f" />
<public type="drawable" name="wallpaper_nexuswallpaper1" id="0x7f020012" />
<public type="drawable" name="wallpaper_nexuswallpaper1_small" id="0x7f020013" />
<public type="drawable" name="wallpaper_tree" id="0x7f020014" />
<public type="drawable" name="wallpaper_tree_small" id="0x7f020015" />
<public type="drawable" name="wallpaper_zanzibar" id="0x7f020016" />
<public type="drawable" name="wallpaper_zanzibar_small" id="0x7f020017" />
[B][COLOR="blue"] <public type="drawable" name="[COLOR="Red"]wallpaper_80[/COLOR]" id="0x7f020016" />
<public type="drawable" name="[COLOR="red"]wallpaper_80_small[/COLOR]" id="0x7f020017" />[/COLOR][/B]
<public type="layout" name="wallpaper_chooser" id="0x7f030000" />
<public type="layout" name="wallpaper_item" id="0x7f030001" />
<public type="array" name="extra_wallpapers" id="0x7f040000" />
<public type="array" name="wallpapers" id="0x7f040001" />
<public type="string" name="app_name" id="0x7f050000" />
<public type="string" name="pick_wallpaper" id="0x7f050001" />
<public type="string" name="wallpaper_instructions" id="0x7f050002" />
<public type="id" name="wallpaper" id="0x7f060000" />
<public type="id" name="gallery" id="0x7f060001" />
<public type="id" name="set" id="0x7f060002" />
</resources>

Now, note that the ID is the same for the wallpaper_zanzibar entry and for the wallpaper_80 entry. We need to change this, so I'll increase the last digit, following the hexadecimal order (0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f):

<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="drawable" name="APKTOOL_DUMMY_0001" id="0x7f020001" />
<public type="drawable" name="APKTOOL_DUMMY_0006" id="0x7f020006" />
<public type="drawable" name="APKTOOL_DUMMY_0007" id="0x7f020007" />
<public type="drawable" name="APKTOOL_DUMMY_0010" id="0x7f020010" />
<public type="drawable" name="APKTOOL_DUMMY_0011" id="0x7f020011" />
<public type="drawable" name="ic_launcher_wallpaper" id="0x7f020000" />
<public type="drawable" name="wallpaper_16" id="0x7f020002" />
<public type="drawable" name="wallpaper_16_small" id="0x7f020003" />
<public type="drawable" name="wallpaper_17" id="0x7f020004" />
<public type="drawable" name="wallpaper_17_small" id="0x7f020005" />
<public type="drawable" name="wallpaper_default" id="0x7f020008" />
<public type="drawable" name="wallpaper_default_small" id="0x7f020009" />
<public type="drawable" name="wallpaper_desert" id="0x7f02000a" />
<public type="drawable" name="wallpaper_desert_small" id="0x7f02000b" />
<public type="drawable" name="wallpaper_field" id="0x7f02000c" />
<public type="drawable" name="wallpaper_field_small" id="0x7f02000d" />
<public type="drawable" name="wallpaper_grass" id="0x7f02000e" />
<public type="drawable" name="wallpaper_grass_small" id="0x7f02000f" />
<public type="drawable" name="wallpaper_nexuswallpaper1" id="0x7f020012" />
<public type="drawable" name="wallpaper_nexuswallpaper1_small" id="0x7f020013" />
<public type="drawable" name="wallpaper_tree" id="0x7f020014" />
<public type="drawable" name="wallpaper_tree_small" id="0x7f020015" />
<public type="drawable" name="wallpaper_zanzibar" id="0x7f020016" />
<public type="drawable" name="wallpaper_zanzibar_small" id="0x7f020017" />
[B][COLOR="blue"] <public type="drawable" name="wallpaper_80" id="0x7f02001[COLOR="Red"]8[/COLOR]" />
<public type="drawable" name="wallpaper_80_small" id="0x7f02001[COLOR="red"]9[/COLOR]" />[/COLOR][/B]
<public type="layout" name="wallpaper_chooser" id="0x7f030000" />
<public type="layout" name="wallpaper_item" id="0x7f030001" />
<public type="array" name="extra_wallpapers" id="0x7f040000" />
<public type="array" name="wallpapers" id="0x7f040001" />
<public type="string" name="app_name" id="0x7f050000" />
<public type="string" name="pick_wallpaper" id="0x7f050001" />
<public type="string" name="wallpaper_instructions" id="0x7f050002" />
<public type="id" name="wallpaper" id="0x7f060000" />
<public type="id" name="gallery" id="0x7f060001" />
<public type="id" name="set" id="0x7f060002" />
</resources>

Repeat these steps for every wallpaper you've added, but don't forget to change its ID or the apk won't compile. When your last digit is F (0x7f02001f, in my example), the next one should be 0x7f020020 and then the counting begins. Also, I don't know if there is a limitation to wallpapers to add!

When you finish this part, save and close. Now, navigate to res\values-mdpi folder and open arrays.xml:

We'll need to add the reference for the wallpaper here, so just copy and paste the last line and rename it to the wallpaper name (like I did on the image above). To change the order that wallpapers will appear on the selection screen, just change the order on this file. So, if you want the wallpaper you've added to be the first, move its entry to the top:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="wallpapers">
[COLOR="red"]<item>wallpaper_80</item>[/COLOR]
<item>wallpaper_default</item>
<item>wallpaper_16</item>
<item>wallpaper_17</item>
<item>wallpaper_desert</item>
<item>wallpaper_zanzibar</item>
<item>wallpaper_tree</item>
<item>wallpaper_grass</item>
<item>wallpaper_field</item>
<item>wallpaper_nexuswallpaper1</item>
</string-array>
</resources>

Save and close. Now, recomplie the apk:

If everything went OK, you'll see this. Now, navigate to TwWallpaperChoser\dist and copy the TwWallpaperChoser.apk to the SignAPK folder (I strongly suggest you to place SignAPK in C:\SignAPK).

Open a terminal window, navigate to the SignAPK folder and enter the following command:

java -jar signapk.jar certificate.pem key.pk8 TwWallpaperChooser.apk TwWallpaperChooser-signed.apk

You can copy the entire command and right-click any empty space on terminal and select Paste:

SignApk doesn't output anything when it sign the apk successfully, so when your terminal window goes like this:

You're done! Now upload the TwWallpaperChoser-signed.apk to your phone and install it. Done! Now you have your customized wallpaper chooser. :D

Any questions feel free to ask. Also, thank me if this helped you and forgive me if I did something wrong, this is my first or second tutorial :D