Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,064 Members 41,632 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
jschmier
Old
(Last edited by jschmier; 17th March 2012 at 04:49 PM.) Reason: note issues w/ ICS
#1  
jschmier's Avatar
Senior Member - OP
Thanks Meter 443
Posts: 265
Join Date: May 2011

 
DONATE TO ME
Default [Live Wallpaper] Asus MyWater Reworked w/ tutorial (no root required)

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, 13033 views)
File Type: apk JollyRoger.apk - [Click for QR Code] (1.17 MB, 7391 views)
File Type: apk RubberDuckie.apk - [Click for QR Code] (2.92 MB, 4362 views)
File Type: apk RubberDuckie_v1.1.apk - [Click for QR Code] (5.24 MB, 9402 views)
File Type: apk Nessie.apk - [Click for QR Code] (2.20 MB, 6292 views)
File Type: apk Honeycomb.apk - [Click for QR Code] (2.56 MB, 5552 views)
File Type: apk Tux.apk - [Click for QR Code] (2.11 MB, 9198 views)
The Following 82 Users Say Thank You to jschmier For This Useful Post: [ Click to Expand ]
 
jschmier
Old
(Last edited by jschmier; 24th June 2011 at 05:50 PM.) Reason: add Step 7 - Zipalign the APK
#2  
jschmier's Avatar
Senior Member - OP
Thanks Meter 443
Posts: 265
Join Date: May 2011

 
DONATE TO ME
Default 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.
The Following 36 Users Say Thank You to jschmier For This Useful Post: [ Click to Expand ]
 
gniouki
Old
(Last edited by gniouki; 8th June 2011 at 10:52 PM.)
#3  
Senior Member
Thanks Meter 8
Posts: 102
Join Date: Apr 2009
Location: Le Chesnay
Amazing, Will try it now !

edit : works perfectly, I will news it on my french website about the transformer
The Following User Says Thank You to gniouki For This Useful Post: [ Click to Expand ]
 
skchan2
Old
#4  
Member
Thanks Meter 2
Posts: 48
Join Date: Apr 2011
awesome job...
 
TKENNEY
Old
#5  
Junior Member
Thanks Meter 2
Posts: 19
Join Date: Jan 2011
Thumbs up Ni$E

Remarkable
 
poussinou69
Old
#6  
Senior Member
Thanks Meter 15
Posts: 255
Join Date: Sep 2008
Location: France
Thanks for your share, it's amazing.
I love the yellow duckie .... (and my wife too ;) )
 
Q.Entity
Old
#7  
Q.Entity's Avatar
Senior Member
Thanks Meter 60
Posts: 578
Join Date: Nov 2010
Location: Dallas
The duck is the best one!

Thanks for documenting the process
 
sharkynolike
Old
#8  
sharkynolike's Avatar
Junior Member
Thanks Meter 1
Posts: 14
Join Date: Jan 2011
Location: SF Bay Area
These are great, thanks so much for your effort here.
 
freeza
Old
#9  
freeza's Avatar
Recognized Developer
Thanks Meter 9486
Posts: 4,246
Join Date: May 2006
Location: Pasadena, CA

 
DONATE TO ME
Fantastic work man.
 
jschmier
Old
#10  
jschmier's Avatar
Senior Member - OP
Thanks Meter 443
Posts: 265
Join Date: 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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes