Update 9/28: Now contains the SDK 1.6 zipalign binary and routine to align each APK after optimization. This results in slightly larger file sizes but a smaller RAM footprint and faster performance. For more information about zipalign, see http://android-developers.blogspot.com/2009/09/zipalign-easy-optimization.html
Update 9/16: new zip defaults to mx5 zip compression, creates "original" and "optimized" folder for apks.
This is a very simple batch file that makes use of command line 7-zip and a special build of optipng (supporting recursive optimizing) to reduce the size of the PNGs in your APKs. This would reduce the overall memory footprint of your apps, and allow you to fit more on the phone's puny internal memory.
As for how much this helps, here's a test run on the latest JACxHeroSki:
Size of uncompressed folder of data/app_s before optimization: 57.3 MB
Size of uncompressed folder of data/app_s after optimization: 43.1 MB
To use it, simply copy all the APKs you want optimized into the batch files' directory and run "apkopt_all.bat" This will take a while but it's all automated! This will then create two folders, optimized and original.
To make the optimization process faster, reduce the "-o99" parameter in apkopt.bat - however, this will result in larger PNGs so best to leave it at o99 and wait. You can also tweak the compression level of the ZIP itself - I left it at "normal" (-mx5) because higher compression levels have reported problems with some APKs.
Once done, the APKs will not be signed but that should not be an issue if you're bundling the APK with a ROM or pushing it through adb.
Optimization has no negative effects, it just makes the PNGs smaller.
Windows only for now - the variant of optipng that this depends on only has a Windows binary available.
It definitely makes a difference!
This distribution includes 7-zip and a variant of optipng called roptipng. Sources can be found:
http://www.7-zip.org/
http://code.google.com/p/roptipng/
I apologize for my noobish Windows command line knowledge. Many devs (like Cyanogen) already seems to have been doing this long ago! His builds are so optimized you can't optimize them more. Any size difference will be due to different compression methods/levels on the ZIP.
sweet, will you do it so I can test it on jacheroskiv2.1 and 2.2? i have a mac w/ ubuntu. no windows!
Is this even necessary when pretty much every ROM uses app2sd?
And wouldn't zipping the png slow things down because the OS now needs to unzip before running?
dwang said:
Is this even necessary when pretty much every ROM uses app2sd?
And wouldn't zipping the png slow things down because the OS now needs to unzip before running?
Click to expand...
Click to collapse
not everyone needs to have hundreds of apps and therefore no need to run apps2sd.
ccyrowski said:
sweet, will you do it so I can test it on jacheroskiv2.1 and 2.2? i have a mac w/ ubuntu. no windows!
Click to expand...
Click to collapse
I'm in the process of making/uploading a pack of APKs of javheroski 2.1.
dwang said:
Is this even necessary when pretty much every ROM uses app2sd?
And wouldn't zipping the png slow things down because the OS now needs to unzip before running?
Click to expand...
Click to collapse
No, this isn't actually zipping the PNGs themselves - the only purpose 7-zip serves is to unpack and repack the APKs.
coolbho3000 said:
I'm in the process of making/uploading a pack of APKs of javheroski 2.1.
No, this isn't actually zipping the PNGs themselves - the only purpose 7-zip serves is to unpack and repack the APKs.
Click to expand...
Click to collapse
Oh cool... I can see the usefulness of having smaller pngs..
I have a similar script that I used for my build, but i used the regular optipng at -o7 for all files. This should help me cram more stuff on my rom, thanks bunches. I have a question, though, I've yet to test this, but is there any adverse effect from running 9-patched pngs through optipng? They're encoded with extra instructions for stretching and padding. In my build, I only ran regular pngs, but if I were able to run the whole thing... I have to try this but I'm at work... Oh, wait, I'm the boss!, I'll try this later today.
---edit---
Oh, cool, I guess I didn't read right. I was trying to modify the thing so that it would recursively optimize extracted pngs in windows folders, but I read the bats and it actually opens up the zips and does all this itself, great! I should have read the post more closely.
dwang said:
Is this even necessary when pretty much every ROM uses app2sd?
And wouldn't zipping the png slow things down because the OS now needs to unzip before running?
Click to expand...
Click to collapse
my builds run pretty quick... I was doing this manually app by app. Check the new version I release and ask again cuz I only got half through them.
uhm i cant seen to get this to work. download your zip and extracted it to a folder. four files in it. placed all my apks into this same folder. ran the batch file but it just opened up and closed and outputted a 1kb file called "and"
NguyenHuu said:
uhm i cant seen to get this to work. download your zip and extracted it to a folder. four files in it. placed all my apks into this same folder. ran the batch file but it just opened up and closed and outputted a 1kb file called "and"
Click to expand...
Click to collapse
Need to be on your c drive or local.
drieves1 said:
Need to be on your c drive or local.
Click to expand...
Click to collapse
ok got it thanks! it was on my secondary drive not C drive. i tried it on cyanogen's system apps and it went from 14.2MB to 13.7MB, not a huge improvement but an improvement nonetheless. this app has a lot of potential for hero roms that really need those extra MBs haha.
if only the batch file can be edited to automatically create duplicate apk instead of overwriting just in case forget to backup. happens sometimes haha. maybe signing can be added to the batch script as well for market apps that need to be resigned since you cant just push them through like you can with system apps that are apart of the rom, they need to be installed.
dont try this on your framework though >.<. I did and it wouldn't boot, seems compression was too aggressive (something about 2XXXXXX to 1XXXXX something, dont remember what it was, but I think bringing o-49 should probably fix it for framework)
UNCOMPRESS_DATA_MAX (XXXXXXX vs 1048576). Causes errors on APKs that are over compressed. Any idea what setting it could be to keep it under that threshold?
hrmm.... I saw what's going on.... For some reason, the script is also processing resources.arsc. This file has to be left alone or it causes problems. I used the script to optimize all pngs, then i extracted all apks, and then i used the optimized pngs and put them back on the regular apks and it worked perfectly, though the gain is much, much more modest, about ~300KB coming from my previous -o7 optimization, and I guess I can attribute that to the 9 patch pngs I hadn't processed the first time around. Am I wrong that resources.arsc should be left untouched? a 10 MB gain is just what I needed to make all of hero fit in death spl's /system (and light hero on a regular spl).
ok, i see, the problem is the re-compression of the apk. I think it's not using the same zip format, so when dalvik tries to expand it causes a problem. roptipng should still save me A LOT of time though...
I'm not home now but try making the -mx9 parameter for 7-zip in apkopt.bat lower as well.
cool stuff, thanks man!
First, thanks for doing this. I have a suggestion. I think you should create an "original" folder and an "optimized" folder (or whatever names you like). So that you can drop the files into the original folder rather than copying them into the same directory. It would just be cleaner that way. Also, you could keep the orginal files in that folder and put the new ones into the optimized folder so people don't need to back them up. They would have both the original and optimized files when the process is finished.
Uploaded a new one with that. Thanks
Have you investigated into why some apks don't work after being compressed? or am I the only one having problems? Some apps compress at best compression and still work, but other apps have to be compressed less in order to work. I tried compressing the whole batch, and then trying to see which ones failed and then try compressing again with a lower setting, etc etc, but it's hard to do for services and non-launcher apps because you don't notice they don't work until you need them. I've seen other people use these scripts and produce working roms, so it might be something different with my setup (win7 64)
Related
I have a Tilt with wm6 and I am running low on space. I noticed in my windows folder that I have several wma files in there that I did not put in there. They are taking up around 12mb of space but the system will not let me remove them! I have Total Commander and even after changing them to a non-system file, it still won't let me remove them. Do I need them for some odd reason? If not, how can I get rid of them and recover some much desired space?
For example, there is a Gin Blossoms song, a Stylistics song?, Ted Leo Pharmacy song, Communique song, the Oranges, Ray Charles, Frightened something, Assembly of something, and I want to delete the 3G up wave file and video since I have them disabled.
Thanks loads for any help!
you'll need to cook your own rom, or find another rom to install that has all those files removed...
rom files are locked and must be removed before the rom is flashed onto your device.
I was feeling like that was the case. Oh well. Which ROM seems to be the best out there? I have read several posts about Dutty's and how good it is. Anyways, thanks alot for you response.
what i did before was to create a blank file using notepad and then save it as a wma file with the same filename as the ones i wanted to remove. then using Resco Explorer, i copied it over the original file.
i know this will give me more storage space, will it give me more ram too?
no flash ram cant be used as app ram
and for at least most devices not using all the os flash dont even yeld any
storage ram for usage
oldsap said:
what i did before was to create a blank file using notepad and then save it as a wma file with the same filename as the ones i wanted to remove. then using Resco Explorer, i copied it over the original file.
Click to expand...
Click to collapse
Oldsap! I hope you realize that by doing this, you actually accomplished NOTHING. Files in ROM can be "covered" with a different version, but they are still there, taking up the space they already did. You merely supplanted a newer version with a smaller size (maybe "0"), covering the one that was there already.
Test my theory, try deleting the 0-byte file you copied there, and miraculously, the old file will appear again, untouched, and the same size it always was.
Test my theory again ... "cover up" one of the files that's 1MB with a file by the same name, but 0 bytes. Then check your storage space, and you will see that you did not save a single byte.
This is just the way that ROM files work. The only way to get rid of them is to cook them out - period.
-pvs
Doing a bit of this lately specifically on rosie. My res folder is like 36 KB (952.5 total) less than the rosie found in the gutted Rom thread (988.3). However my total apk is 1.2 mb while the gutted is only 1. Sup with that?
Are you sure mine is 1 MB? I double checked and I was only able to get mine down to 1.2MB.
Pic! Http://twitter.com/theresthatguy/status/6906940286
Edit: not talking about yours but the one posted in the attachment of rosiesmall3.zip sorry for confusion. Hope you can still help me.
I got mine down to roughly 930-ish k if i remember correctly and I can pare it down even more I just got tired of changing all of the images around. It takes forever. Also make sure you use the highest compression setting for zip files in 7-zip
obelisk79 said:
I got mine down to roughly 930-ish k if i remember correctly and I can pare it down even more I just got tired of changing all of the images around. It takes forever. Also make sure you use the highest compression setting for zip files in 7-zip
Click to expand...
Click to collapse
what programs are are you using on the pngs and also jpegs? Thanks for the 7-zip tip.
A good app for pngs is optipng. Im on linux and that's what I use. For jpegs I usually change the quality to be pretty low because for the most part it is not noticeable. Also remember to find an app that will remove all of the exif data and so forth on jpgs.
gimp and pngout
I changed the jpgs to white
google the best commandline options for pngout I have them written down at home but I'm 300+ miles away from home right now, and I don't have a laptop.
I've considered trying to convert the jpgs to png and changing the xml files to recognize them, but I have too many projects on my plate already. I imagine it should be doable.
obelisk79 said:
gimp and pngout
I changed the jpgs to white
google the best commandline options for pngout I have them written down at home but I'm 300+ miles away from home right now, and I don't have a laptop.
I've considered trying to convert the jpgs to png and changing the xml files to recognize them, but I have too many projects on my plate already. I imagine it should be doable.
Click to expand...
Click to collapse
one last thing: I'm using ubuntu box with no internet. I downloaded the p7zip and I believe I installed it correctly. Cd into the extracted contents did sudo make install command but having trouble finding documentation on actually creating a zip file. I keep finding how make 7z archives.
use wine and 7-zip for win? I dual boot so I actually do that kind of work in windows. I use linux for most everything else.
I dabble in some programming, taking it in college now, but have little experience with linux and the like, so I don't know where to go from here. I found the files, I think, to modify so that the AOSP lockscreen will work. Found keyguard xml files in \system\framework\framework-res.apk\res\layout. Pretty sure these are the right files, as the images for the sliders is in this apk as well. And I know from a logcat that keyguard is what it's opening for the lockscreen. Only problem is, can't seem to view or edit these xml's in a readable format... tried three different editors. About to reboot into linux and try it there, maybe I'll have better luck. But thought I would ask here where there are people FAR more knowledgeable than I.
danaff37 said:
I dabble in some programming, taking it in college now, but have little experience with linux and the like, so I don't know where to go from here. I found the files, I think, to modify so that the AOSP lockscreen will work. Found keyguard xml files in \system\framework\framework-res.apk\res\layout. Pretty sure these are the right files, as the images for the sliders is in this apk as well. And I know from a logcat that keyguard is what it's opening for the lockscreen. Only problem is, can't seem to view or edit these xml's in a readable format... tried three different editors. About to reboot into linux and try it there, maybe I'll have better luck. But thought I would ask here where there are people FAR more knowledgeable than I.
Click to expand...
Click to collapse
They are in a binary format. I opened them in dreamweaver, and it still wasn't fully readable/able to be edited. you can use this to decode them to readable format, but I have NO CLUE how to get them back.
http://forum.xda-developers.com/showthread.php?t=514412
regaw_leinad said:
They are in a binary format. I opened them in dreamweaver, and it still wasn't fully readable/able to be edited. you can use this to decode them to readable format, but I have NO CLUE how to get them back.
http://forum.xda-developers.com/showthread.php?t=514412
Click to expand...
Click to collapse
Use the AXMLPrinter2.jar to convert the XML files to a Text Readable format. Unfortunately, to modify the files, you need to use a Hex Editor to do any updates. I havn't seen any utilities that will read/write the binary XMLs, just read.
-Daryel
I haven't had the time to look into this yet, but... Since the lock screen works fine in Darch's AOSP build, could it just be a matter of switching out the xmls?
Just an idea.
thematrixkid17 said:
I haven't had the time to look into this yet, but... Since the lock screen works fine in Darch's AOSP build, could it just be a matter of switching out the xmls?
Just an idea.
Click to expand...
Click to collapse
WOW, if that's all it takes, someone should try it lol
I mean, it couldn't be thaat easy, could it?
Doesn't it work on the Eris leak?
let me see what's there under the eris builds
Well I'm headed to class now, and have to study for a big big test tomorrow later, but I might find time, if someone doesn't beat me to it. Now I'm not all that familiar with the framework, but its just a brainstorm. And if the one in the eris leak works, then that xml probably has an even better chance playing well with the sprint build, I assume.
hey... you can view and edit the xml on the phone with root explorer after you extract them. Then just copy to pc to rezip
also, when rezipping an apk, using 7zip, is there a particular setting? compression level, method, etc.
Hi guys!
This is a quick tool I jotted together for myself in the past couple days and found it very useful. So I decided to clean it up and share it. Hope you will like it! Do comment and ask!
APK Batch Rename Tool
* for Windows and Linux for now.
APK Batch Rename Tool recursively crawls input folder and all of its subfolders looking for Android Package files (.apk's). It reads Label and Version info from apk's found and creates a copy for each apk under the output folder but using the Label and Version info acquired.
For example a com.example.hw.apk will make Hello World! 1.21.apk provided that the label inside the package was set to Hello World! and version is 1.21.
The old and the new apk files are 100% the same in terms of content and are unchanged. Only the new copies are given new filenames. Input files are left completely intact.
Why?
Have you ever wondered what are your 1500+ apk files with wierd names nested to different wierd folders on your harddrive? Have you ever wanted to find an app but you were unable to because it had some undescriptive javaish name that made no sense reflected no version and your apps were swept across a hundred junk folders anyway? Then APK Batch Rename is the tool for you! And me!
APK Batch Rename will set a human readable name for all your Android apps, and drop such a copy into a folder. You will finally be able to browse them, sort them alphabetically and be able to pick from versions available.
How?
1. Copy all your apk files (or folders with apk files in them) into the input folder. You may copy folders of any depth. APK Batch Rename Tool will recurse all subfolders of the input folder anyway.
2. Hit or click ApkBatchRename.bat . (For Linux users it's: apkbatchrename, or on a terminal enter: ./apkbatchrename ) Wait until it finishes the job.
3. Find your freshly named files in the output folder.
Simple as that!
Have fun! & Comment!
phsorx
great work, just like reading mp3 tag then rename to "song - artist.mp3"
thanks!
Cool. I use to do it manually. Time saver app.
Thanks.
This is awesome! Thank you very much, situation you described in first post is just like mine, I find your tool very useful!
Folks,
Let me join you crediting phsorx's job, that app is just great!
Thanks and congrats!
Very cool, Works well. Always wanted to do this but was too lazy to try aapt.
I just checked:
aapt said:
badging Print the label and icon for the app declared in APK.
Click to expand...
Click to collapse
Code:
> aapt d badging Talk.apk
[B]package: name='com.google.android.talk' [/B]versionCode='130' [B]versionName[/B]='1.3'
sdkVersion:'8'
targetSdkVersion:'8'
uses-permission: **truncated***
application: [B]label='Talk'[/B] icon='res/drawable-hdpi/ic_launcher_google_talk.png'
uses-feature:'android.hardware.touchscreen'
main
other-activities
search
other-receivers
supports-screens: 'small' 'normal' 'large'
locales: '--_--' 'es' 'es_US'
densities: '160' '240'
I'll definitely use your script but with a small change to show the package name as well as its valuable for when you need to uninstall the package.
i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk
Attached a slightly modified batch file and screenshot
For single file one-off renames (right-click->open with->rename single) you can use the script here.
De jo! Honfitars. Hajra Magyarok!
Customizable naming planned in future version
britoso said:
Very cool, Works well. Always wanted to do this but was too lazy to try appt.
i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk
Click to expand...
Click to collapse
Hi Britoso,
Yeah! That's a neat way to do it too!
Eventually I want to make naming and spacing fully customizable! Including what attributes to pick (name, label, versionName) to constitute the filename, and what separators (_,-,(,),space) should go where.
In the howto.txt I have a little road-map for the project. Will add customizable naming too.
Will keep you guys posted.
EOF
phsorx
Ps: Anyone who has another naming suggestion drop a post! I'd be interested.
great job...bravo..
thanks
Very nice tool, thanks for sharing this .
Using it with britoso's edited script.
Edit: I would appreciate it if a log of the conversion would be saved in a \logs\ subfolder, so I can check which files were not converted properly and see if I have to do those manually.
Handy ! Thanks...
deleted
For one-off renames you can use the below batch file.
1) create the below batch file in the same folder as apkrename.bat (its attached too)
Name: rename-single.bat (change this if you want)
content:
Code:
cd "C:\change_me\ApkRename\"
apkrename.bat %1 %~dp1
Change the path(change_me) as needed.
2)Associate it with apks by right clicking on the apk and choosing "choose default program", browse and select the batch file "rename-single.bat".
Uncheck "make this the default operation"
Screenshot and batch file attached. Enjoy.
update:
-12/8 uploaded a new version that fixed a bug involving long path names with spaces.
Also added a check for success and then delete the original apk. (backup your apks just in case).
Remember to set the path to the ApkRename folder in rename_single.bat once before using it.
Really gd job )
APK Batch Rename Tool for Linux is on the way
luvgirl12345 said:
would like a linux version...
Click to expand...
Click to collapse
Hi luvgirl12345,
The Linux port is on the way & will be posted here soon!
Actually, the Windows release is running on win32 ports of a few common Linux tools. And that's so, because I am lazy. Having Linux's much better support for shell scripting plus the same tool set always at hand, porting is a breeze.
Ciao,
phsorx
Sounds very useful, thank you!
Looks nice for massive apk renaming.
Found a similar tool called APKInfo some month ago which i am using for single apk files for a while now.
But finally something for batch renaming.
Thanks
your the man!, works like a charm. Thanks!
Any plans for making an Android version of this to run on our devices?
Future plans for an on-phone version of the APK Rename Tool
del4 said:
Any plans for making an Android version of this to run on our devices?
Click to expand...
Click to collapse
Yes! Certainly. Its in the plans.
But firstly there are a few things to be fixed on the desktop version first. See road map section of the howto.txt file in the archive. The most burning issue is the so called overwrite issue that I want to be sorted out next. Say you have two copies of the same app (same name, label, versionName) but one of them has a patch against it (because its been modded by a reverser) than one of the copies will overwrite the other (ApkRename 1.10).
Secondly on a mobile device's SD card there is usually less space than on a desktop's hard drive. This implies that APK Renamer will actually have to rename the files in place instead of creating a copy of each in a separate folder. Or at least it will need to figure out the empty space left on the device, and if its not enough to hold the copies, it should offer in-place renaming instead. Not a lot of logic to add but still...
Having all the outstanding questions be figured out on the desktop still, will allow me to implement a more established version for the phone right from start. But hold still its not going to take very long
Bests,
phsorx
Okay, well today, I picked up a new HTC One X. First impressions were pretty good, and I have to say that as of yet, it's looking like it's a pretty good handset.
However; there's one thing about it that really bugs me. SMS messages apparently force you to use these utterly horrific smileys. I was never a fan of the old android icons that occasionally popped up, but these icons are just plain god-awful. Is there any way of disabling them?
(To be honest, I'd much prefer just to have your standard ASCII faces... Not to mention, if you happen to need to send a message that just happens to have the characters in that order, I'd rather not have badly made face icons appearing in the middle of it..)
bump. I can't believe htc require you to install a 3rd-party sms app in order to be able to get rid of emoticons. I'm a 40-yr old man, I don't want to see a crappy cartoon face in my text messages...
thanks for this nice q
3lliot said:
bump. I can't believe htc require you to install a 3rd-party sms app in order to be able to get rid of emoticons. I'm a 40-yr old man, I don't want to see a crappy cartoon face in my text messages...
Click to expand...
Click to collapse
My thoughts exactly... Not to mention, they're so badly designed that I spend more time working out what emotion they're actually supposed to convey, rather than reading the actual message...
Seems slightly out of place, too. The rest of the UI is nice and clean, fairly sleek looking - then you have these ridiculous cartoon faces slapped accross all of your texts..
I'm going to go ahead and bring this thread back from the dead.
Last time I tired to fix this by modifying my framework files and ended up soft-bricking my phone.
There's got to be a better way.
bump?
Untested Solution
EDIT: I looked more into it, and it gets pretty complicated. According to a StackExchange post I found (link in the attached .txt file), you can go through a process to retrieve the source code from the original .apk file BUT it requires the classes.dex file to be intact. That means you have to de-odex the Message+Nonprime.odex file, "re-dex" it into classes.dex, and add it to the Message+Nonprime.apk archive (can simply change the extension to .zip and add the file before continuing the linked steps).
After following all of those steps, I ended up with the source code and readable XML files. Unfortunately, trying to open them in Eclipse does not work, as I'm apparently missing key HTC resources (or I just don't know where the resources files should be pointing). I was hoping for the ability to just change the name across any necessary files, then repackage, but it doesn't seem to work like this.
I've also tried taking the original APK, adding the .dex file (created from the .odex -> files/folders -> dex process) inside, and signing the package (after deleting the META-INF folder containing HTC's signed information). I was hoping that signing the package after renaming it to Message2.0.apk would allow me to install it as a user application (I don't have root or the ability to change the bootloader to overwrite system applications, due to the 4.2.2 update) but the install always fails since "the application is already installed." If I knew how to modify the files within classes.dex properly, I'm sure I could rename the entire package and create a "New" application, but for now I've hit a brick wall. Hopefully if anyone reads this they can build on my failed attempts.
======================================================
======================================================
I stumbled on this (admittedly old) thread, and I don't know if anyone cares, but I've figured out what seems to be key in disabling smiley images from appearing. Below is the information of the phone I'm working with:
Phone Model Number: HTC One X
Android Version: 4.2.2
HTC Sense Version: 5.0
Software number: 5.18.502.1
HTC SDK API level: 5.41
Android uses "SmileyParser" to watch for certain key combinations and replace them with preset images. The theory is that by changing the strings SmilelyParser checks, it won't ever find a match, and they won't be replaced.
I found the Message application under /system/app/Message+Nonprime.apk. HTC's Message application utilizes Android's android.com.mms but has custom functionality/themes (I'm assuming)
Using ADB (Android SDK tool to browse filestructure), I used "adb pull [source] [local]" to copy the .apk and .odex files
I used "smali-#-#-#.jar" and "baksmali-#-#-#.jar" to convert the .odex file
The output of the tool gives a file structure with editable files. I navigated to com/android/mms/util/
In this folder, there are two key files: SmileyParser.smali, and SmileyParserOne.smali. I believe the "One" version may be modified to work with HTC One phones, but I'm not 100% sure (content looks similar)
I opened each file with Notepad++ and found "const string" references with the text version of an emoticon. The code seems to match those with "aput objects" but I don't know 100%
I modified each string (within the quotes) by just adding an 'x' to hopefully thwart the string match. Basically, the phone should wait until x or x is fully matched before replacing the smiley
I'll note again, I did the EXACT same process in both .smali files I mentioned, and I touched ABSOLUTELY NOTHING ELSE. There's no telling what you'll break if those don't compile correctly (which is why I also avoided adding a longer string, in case memory allocation issues cropped up)
I then repackaged the entire output I created into a new .odex file
Now, here's where things get tricky. I don't have a rooted phone, so I can't actually replace the .odex inside of the /system/app folder. I may work on testing on my phone (but I don't get a lot of time and really would not like to brick it), but I'm worried since I'm running a very recently updated Sense version (and there may not be reliable root processes, I have no idea).
If anyone has a rooted HTC One X (check above for the exact software version I have) that would like to try out the modified .odex file (apk is mostly UI/theme, .odex contains the actual programming logic) I am providing the .zip containing the apk and odex files. I've also tried installing the apk+odex with "adb install X/X.apk" but the application has a name buried in the structure (probably everywhere) and I have no idea how to rename it everywhere that's required.
If someone knows how to take a package and re-compile it with a new name, I could potentially re-install "Message 2.0" as a user app without any root privileges required. That's another option I'm looking into (since I'd really rather not root and potentially lose my stored data).
The same problem is still occurring in 2018. I would try your solution, but it's outdated. I'll have to dive in and edit the files myself if a solution isn't found. Although, in that case, I would probably match something further from the x, preferably with 2 bytes because as you said, memory issues might pop up and I'm not sure just how far they went with this.