Post Reply

[Live Wallpaper] Asus MyWater Reworked w/ tutorial (no root required)

8th June 2011, 10:25 PM   |  #1  
jschmier's Avatar
OP Senior Member
Thanks Meter: 443
 
265 posts
Join Date:Joined: May 2011
Donate to Me
As I mentioned in another thread, I was intrigued by Ruvort's modifications to the Asus MyWater live wallpaper over at xoomforums.com and some of the work from similar xda developers threads here and here.

The most common issue with using these modified live wallpapers is that they simply replace the default Asus MyWater live wallpaper, which limits you to having one at a time and causes additional difficulties for Transformer owners since the Asus MyWater live wallpaper is a system application. I have been in contact with Ruvort and plan on working with him to re-release his live wallpapers with the necessary adjustments so that they can all coexist and multiple flavors can be installed at the same time; even on non-rooted tablets.

These reworked MyWater live wallpapers are my initial step into the arena of editing APK files. They can be installed and uninstalled like any other application, however allowing installation of non-Market applications is required. I should note that in order to prove out some edits I made to the smali disassembly files, I adapted Ruvort's excellent work for the beer w/ lime wallpaper and I hijacked his idea for the ducky wallpaper.

Update: On a whim, I decided to check the alignment of the APK files using zipalign. I found that the resources in the wallpapers needed adjustment, so I have corrected the alignment for all the attached wallpapers. If you downloaded and installed any wallpaper from this post prior to June 24th 2011, I recommend replacing with an optimized version.

Update 2: It has been discovered that these live wallpapers have issues when running on ICS. I am aware of the issues and have been working toward a solution (one recent attempt here). While workarounds have been reported, I have not tried any of them myself and prefer to address the problem at its source. Once I am confident that I have things working correctly, I intend on starting a new thread to feature the updated, ICS-friendly designs. Stay tuned...

Beer w/ Lime


Jolly Roger


Rubber Duckie (original v1.0)


Rubber Duckie (updated to v1.1 14th June 2011 - original still available)


Loch Ness Monster (added 12th June 2011)


Honeycomb (added 14th June 2011)


Tux (added 20th June 2011)


Note: There are additional wallpapers attached to subsequent thread posts.
Attached Files
File Type: apk BeerWithLime.apk - [Click for QR Code] (3.57 MB, 13127 views)
File Type: apk JollyRoger.apk - [Click for QR Code] (1.17 MB, 7424 views)
File Type: apk RubberDuckie.apk - [Click for QR Code] (2.92 MB, 4388 views)
File Type: apk RubberDuckie_v1.1.apk - [Click for QR Code] (5.24 MB, 9438 views)
File Type: apk Nessie.apk - [Click for QR Code] (2.20 MB, 6315 views)
File Type: apk Honeycomb.apk - [Click for QR Code] (2.56 MB, 5570 views)
File Type: apk Tux.apk - [Click for QR Code] (2.11 MB, 9225 views)
Last edited by jschmier; 17th March 2012 at 04:49 PM. Reason: note issues w/ ICS
The Following 82 Users Say Thank You to jschmier For This Useful Post: [ View ]
8th June 2011, 10:26 PM   |  #2  
jschmier's Avatar
OP Senior Member
Thanks Meter: 443
 
265 posts
Join Date:Joined: May 2011
Donate to Me
Creating the Reworked MyWater Wallpapers
The following is an overview of the process I followed in creating the live wallpapers found in the first post. These instructions are intended to serve as a guide to those interested in creating their own modifications.

Prerequisites
  • Asus MyWater APK (you can grab a copy here)
  • android-apktool - tool for reengineering Android apk files (here)
  • roptipng - modification to OptiPNG PNG optimizer (here)
  • SignApk.jar - (Google search)
  • zipalign - archive alignment tool (included in Android SDK)

Step 1 - Decoding the APK
Using apktool, decode the APK to retrieve the resources into nearly original form. In this example, the decoded files are placed in a directory called MyWaterDir.
Code:
apktool decode MyWater.apk MyWaterDir
Step 2 - Modifying the package name
The package name is a unique identifier used by Android to manage the installed applications. The easiest package name modification simply involves changing all instances of asus to another unique identifier.

Using your favorite editor (I like gVim), modify the package name found in MyWaterDir/AndroidManifest.xml (com.asus.livewallpaper) and MyWaterDir/res/xml/glwallpaper.xml (com.asus.livewallpaper.gl.MyWaterSettings). There are only 2 instances of the package name in the XML files.

The package name is also embedded in the smali disassembly files (MyWaterDir/smali/com/asus/livewallpaper/gl/*.smali). In all, there are 1791 instances of the package name in the smali files that must be updated. My recommendation is to find an editor that makes it easy to perform a global search and replace.

The package name must also match the folder hierarchy under the smali folder (MyWaterDir/smali/com/asus/livewallpaper/gl/). Change the name of the asus folder to match the new unique identifier selected for the application.

Step 3 - Update the application name and settings text
Using your favorite editor, modify the text found in MyWaterDir/res/values/strings.xml. Rather than worry about translations for my updated text, I chose to remove all but the default by deleting the MyWaterDir/res/values-XX folders (keep values-large).

Step 4 - Update the image resources
The image resources are found in MyWaterDir/res/drawable-mdpi. You can modify these images or use your own. For the purpose of this tutorial there is a requirement that they maintain the original file naming scheme. It is also important to note that if you provide an image with different dimensions, it will be scaled to match the dimensions of the original image. Modifications to the smali disassembly files are required to overcome this limitation.

As an optional step, you can optimize the PNG image resources to reduce their size.
Code:
roptipng -o7 MyWaterDir/res/drawable-mdpi/*.png
Step 5 - Build the APK
Now that the desired modifications have been made, build the APK using apktool.
Code:
apktool build MyWaterDir MyWaterModified_unsigned.apk
Step 6 - Sign the APK
The Android system requires that all installed applications be digitally signed with a certificate whose private key is held by the application's developer. I followed the instructions found here or here for generating my keys and using them to sign the APK. It should also be possible to sign the APK using the approach recommended at developer.android.com.
Code:
java -jar signapk.jar certificate.pem key.pk8 MyWaterModified_unsigned.apk MyWaterModified_signed.apk
Step 7 - Zipalign the APK
Zipalign the APK to optimize the way it is packaged in order to enable the Android operating system to interact with the application more efficiently. The benefit of this step is a reduction in the amount of RAM consumed when running the application.
Code:
zipalign -f -v 4 MyWaterModified_signed.apk MyWaterModified.apk
________________________

The truly adventurous can take a stab at modifying the smali disassembly prior to building the APK. The syntax is a bit difficult to follow at first, but with proper modifications you can adjust the image dimensions, rendering locations, and much more. I found it useful to pull the classes.dex file from the APK, convert it from .dex to .class format using dex2jar, and then browse the reconstructed source using JD-GUI. It is important to remember that the reconstructed source is not a 100% match to the original source code. However, it is useful for comparing against and understanding the corresponding smali source.
________________________

I hope some of you find this information useful. If so, be sure to say thanks via the button below.
Last edited by jschmier; 24th June 2011 at 05:50 PM. Reason: add Step 7 - Zipalign the APK
The Following 36 Users Say Thank You to jschmier For This Useful Post: [ View ]
8th June 2011, 10:42 PM   |  #3  
Senior Member
Flag Le Chesnay
Thanks Meter: 8
 
102 posts
Join Date:Joined: Apr 2009
More
Amazing, Will try it now !

edit : works perfectly, I will news it on my french website about the transformer
Last edited by gniouki; 8th June 2011 at 10:52 PM.
The Following User Says Thank You to gniouki For This Useful Post: [ View ]
9th June 2011, 06:36 AM   |  #4  
Member
Thanks Meter: 2
 
48 posts
Join Date:Joined: Apr 2011
awesome job...
9th June 2011, 12:45 PM   |  #5  
Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Jan 2011
Thumbs up Ni$E
Remarkable
9th June 2011, 02:06 PM   |  #6  
Senior Member
Flag France
Thanks Meter: 15
 
260 posts
Join Date:Joined: Sep 2008
Thanks for your share, it's amazing.
I love the yellow duckie .... (and my wife too ;) )
9th June 2011, 03:52 PM   |  #7  
Q.Entity's Avatar
Senior Member
Flag Dallas
Thanks Meter: 62
 
593 posts
Join Date:Joined: Nov 2010
More
The duck is the best one!

Thanks for documenting the process
10th June 2011, 03:28 AM   |  #8  
sharkynolike's Avatar
Junior Member
SF Bay Area
Thanks Meter: 1
 
14 posts
Join Date:Joined: Jan 2011
More
These are great, thanks so much for your effort here.
10th June 2011, 07:19 AM   |  #9  
freeza's Avatar
Recognized Developer
Flag Pasadena, CA
Thanks Meter: 9,731
 
4,273 posts
Join Date:Joined: May 2006
Donate to Me
More
Fantastic work man.
12th June 2011, 08:44 AM   |  #10  
jschmier's Avatar
OP Senior Member
Thanks Meter: 443
 
265 posts
Join Date:Joined: May 2011
Donate to Me
I appreciate the praise I've received for this work. I took a couple hours this evening to throw together another version containing one of my favorite lake monsters. Nessie is definitely one of the biggest "ice cubes" I've used for these wallpapers.

It might be worth pointing out that in order to render "ice cube" images larger than the original 324 x 226 ice cube, the GLIceItem constructor should be edited to specify the desired dimensions.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes