[TOOL] Resource id remapper - Dev only - UPDATED 02/13/2011 - Vibrant Android Development

resource id re-mapper 0.5b
Introduction:
By far the most tedious part of porting and app or mod from one phone to another, or from
one firmware version to another is remapping the resource id's and can take hours, and you
still miss a few and then spend more time looking at a log cat trying to find it.
So I wrote a resource re-mapper tool, it works by feeding it the public.xml from the source ROM
and the public.xml for the target ROM and a smali file or a directory and the tool will search for
resource id's in the smali files look up the resource name in the source public.xml then look
up the name in the target public.xml to get the new resource id and then change the id's in the
smali file.
Limitations:
1. compilers will shorten resource id's like 0x1040000 -> const/high16 0x104 there is no
way to be sure that is a resource id with out looking at the code, what the tool does in
this case is check to see if the id's resolve to the same resource name on both ROM's
and if not advises you to verify that it is indeed a resource id.
Use:
Code:
java -jar remapid.jar [source.xml] [target.xml] [directory] or [file.smali]
UPDATED 02/13/2011
fix for multiple comments on the same line
UPDATED 02/08/2011
fix for a problem that would almost certainly never occur
UPDATED 02/08/2011
added support for resource arrays.
added resource name comment next to resource id, example:
Code:
0x1070015 #config_virtualKeyVibePattern
useful for code modification
added processed file tagging useful if a file gets broken bad enough
you have to restart with a fresh one, you can rerun the tool without
breaking the already processed files.
.

Holy crap this is amazing. You do such awesome work! Thank you so much for making this tedious chore more convenient (AS USUAL)!

THANK YOU!!!!! Lol, this fixes the part I hate and have the most issues with
Sent from my SGH-T959

Wow, this should really cut out some serious time. Can't wait to see where the development of this goes! Great work as always!!

Thanks, to test I built the froyo-plus-aosp branch from source and got
all the AOSP apps except Browser.apk and LatinIME.apk on KB1 without
a single force-close it was unbelievable

Wow, awesome............ thanks !!!!!

Great job supervb

Awesome! Eventually I will get it to work for me too! Will keep messing with it and see if I can figure out what is wrong with my folder structure that causes it to act like it is going to work but doesn't.

jellette said:
Awesome! Eventually I will get it to work for me too! Will keep messing with it and see if I can figure out what is wrong with my folder structure that causes it to act like it is going to work but doesn't.
Click to expand...
Click to collapse
I added some more informative output so when no changes are need to the
smali code there isn't that natural WTF? it didn't do anything feeling.

Great work dude!

untermensch said:
I added some more informative output so when no changes are need to the
smali code there isn't that natural WTF? it didn't do anything feeling.
Click to expand...
Click to collapse
Thanks! And double thanks for the messages!

UPDATED 02/08/2010
added resource name comment next to resource id, example:
Code:
0x1070015 #config_virtualKeyVibePattern
useful for code modification
added processed file tagging useful if a file gets broken bad enough
you have to restart with a fresh one, you can rerun the tool without
breaking the already processed files.

Awesome work, a big fan of your work.
Sent from my Galaxy S using XDA App

untermensch said:
Thanks, to test I built the froyo-plus-aosp branch from source and got
all the AOSP apps except Browser.apk and LatinIME.apk on KB1 without
a single force-close it was unbelievable
Click to expand...
Click to collapse
Niiicceeee...
I'm going to have to try this out.
Thanks always Untermensch!!!

untermensch said:
UPDATED 02/08/2010
added resource name comment next to resource id, example:
Code:
0x1070015 #config_virtualKeyVibePattern
useful for code modification
added processed file tagging useful if a file gets broken bad enough
you have to restart with a fresh one, you can rerun the tool without
breaking the already processed files.
Click to expand...
Click to collapse
I didn't see this, I barely saw this, was this updated in the OP, Untermensch?
If so, disregard my post.
Thanks! Again!

ndwgs said:
I didn't see this, I barely saw this, was this updated in the OP, Untermensch?
If so, disregard my post.
Thanks! Again!
Click to expand...
Click to collapse
yes the OP has been updated, that example line is added to the smali code, it is really
really useful to have an idea of what images/strings are being used by the code.

minor update to fix an unlikely issue with resource arrays.

I posted a similar jar file in the captivate forums two days ago. The only difference is that mine is just an amateur attempt of an app full of bugs still
http://forum.xda-developers.com/showthread.php?t=946328
Any chance you will share the code?

aleadam said:
I posted a similar jar file in the captivate forums two days ago. The only difference is that mine is just an amateur attempt of an app full of bugs still
http://forum.xda-developers.com/showthread.php?t=946328
Any chance you will share the code?
Click to expand...
Click to collapse
the source is included in the jar but if it wasn't then you could always use this
http://java.decompiler.free.fr/
my rough code looked like that but I was using a regular expression to find the res id's

how do you use this?

Related

Help with Phone.apk mod please

I want to edit the background of the dialer from black to white, but I cannot seem to find where it is, I've went through the source and can't find it. Can anyone help with this mod?
Thanks
Ima make a judgement call on this one and say if you can't find it, most likely you shouldn't be messing around with it
stefan.buddle said:
Ima make a judgement call on this one and say if you can't find it, most likely you shouldn't be messing around with it
Click to expand...
Click to collapse
If you do not recognize the name, perhaps you should not make such assumptions.
Let me see if I can find the file name, give me a few.
Edit: As far as I can tell, there is no image file for the background. From the small bit of android programming I have attempted, I do seem to recall the default background color being black. I think you probably need to edit an xml file, but I could be completely wrong. I could not read the xml files with my phone, so I could not narrow it down at all. If you agree this is the way to go, and need to know how to decrypt xml send me a pm.
I know it is not an image, I've edited all the images. I have done an abundant amount of themes. I posted the question because I have spent a long time looking though the source. It is not an xml in the drawable, it is in the source somewhere. After looking though the source though, I am starting to think it is something at a higher level than the phone.apk of contacts.apk and maye be something from the system itself, since all the apps have a black background as the default.
Since I think it does default to black, have you thought about including a new background file into drawable, and writing it into the xml somewhere.
cloverdale said:
Since I think it does default to black, have you thought about including a new background file into drawable, and writing it into the xml somewhere.
Click to expand...
Click to collapse
Haven't thought that far but that may be the best solution. There are a few white themes, and it could be a nice addition to them, or even to those without. I'll look into it more when I have some more time, unless there are some people that have time to help on this project
I need help please. I have the latest source from Cyanogen. I am trying to add something to the dialpad.xml but without even doing anything yet, when I start a new project from the code, I get a lot of errors, most I can just delete files and be ok with but I get
Description Resource Path Location Type
ERROR No resource identifier found for attribute 'contentDescription' in package 'android' dialpad.xml /DialtactsActivity/res/layout-finger line 126 Android AAPT Problem
Click to expand...
Click to collapse
Its from the part of the code android:contentDescription="@string/description_image_button_pound"
I have spent days trying to figure out what the issue is.
Can anyone help?

Weather Widget from 2.0 BackPorted

I searched the forum to see if someone had done this and couldn't find it. I back ported the weather widget from 2.0 in case anyone is interested (works fine on donuts). This is the beginning of my development work. Hope this helps!
Please just take the .zip file and rename it to .apk
copy to your sdcard and install with any file explorer or
connect your device to your pc with development enabled
type "adb install MotAccuWeatherWidget.apk"
Red
G1 with latest Cyan
Thank you to this site and all the developers for their inspiration and hard work.
This has been around for a while...
Good work, though. Kudos and thanks for the effort.
Oh, sorry. I guess I'll probably get flamed by like 30 ppl now. lol. I guess I will try my hand at the Dock applications, unless that has been done too?
Red
redd12345 said:
Oh, sorry. I guess I'll probably get flamed by like 30 ppl now. lol. I guess I will try my hand at the Dock applications, unless that has been done too?
Red
Click to expand...
Click to collapse
If anyone flames you, they're stupid. You did good work, even if it was in vain. Car Dock has been ported to Donut, though I don't think the little nightstand Dock from Droid is running on anything prior to 2.0... Not sure, though, as it doesn't interest me all that much.
thanks for the encouragement. is there a list of things that show what needs to be back ported or which ones have already been? I want to contribute.
Red.
redd12345 said:
thanks for the encouragement. is there a list of things that show what needs to be back ported or which ones have already been? I want to contribute.
Click to expand...
Click to collapse
Not to my knowledge. It might not be a bad idea for one of the leading devs to start a thread here on things we want from new phones to run on our phones, and check them off as they are accomplished. 75% of the list would be from the Nexus One, at the moment. You really want to help? See what you can do to get Launcher2 from the Nexus working on Dream... Just changing the build.prop doesn't work, so we'll have to fix errors one by one. Hope you're better at coding than I.
There is also more info in the Dream app section, where these apps are usually released...good work, keep it up!
Hi, there's a version that does not work with 1.6 (only 2.X). Which version is?
BR.
I'm not sure. I pulled this weather widget from Eugene373's AOSP Rom port and hex edited the AndroidManifest.xml to make the MinSDK 3 instead of 5. I can't tell you much more than that. I hope this helps you.
Red.
Give this widget a shot and see if it's the one you are looking for. At least one person might make use of it. haha
Red
yukkio said:
Hi, there's a version that does not work with 1.6 (only 2.X). Which version is?
BR.
Click to expand...
Click to collapse
So, does anyone know if this will work on 1.6? Cyanogen MOD ROM?
It will work on any 1.6 rom. I am running Cyanogen's 11.1 (most recent.) This widget typically works on most people's "custom roms" as long as the 1.6 base is the same, it's just that there is a MinSDK value that prohibits users on a lower SDK from using the application. I dropped that value to 3, so I think that it should also work on hero roms (1.5 cupcake base) if someone likes the graphics on this widget better than the weather app that is included. Hope this helps.
Red.
Ps. I am going to be trying my hand at creating themes instead. My only experience with programming was C++, Pascal, and Visual Basic and that was close to 8 years ago! lol. I'm a little outdated as far as Java goes.
I'm really looking forward to using Stericson's Metamorph. It is such a great effort for theme development.
i sure could use it im new to xda im non root for now, but i would like to make a few nice add ons to my mt3g till i get the guts to root. is thr some good stuff here for a non root like me
Awesome job. I appreciate the work.
Odd question though, what do you do in the process of back porting? I'd love to learn..
Nice Widget, thanks. I was using weathereye before. I like this one better.
Thanks. In the case of this widget, it was ok to backport it because it doesn't call on any other functions that are proprietary to a specific rom (ie. Happenings widget from Blur calls tons of other functions in the home.Blur). There are a few places online when you look up backporting (I'll try to remember to post the links for people.)
You want to start by unziping the aplication you want to backport. Just rename it to a .zip file.
When you look in the file, you will see AndroidManifest.xml. This file has been compiled out as a binary file so you can't read it like a normal .xml file. You want to then download AxmlPrinter2.jar and run that to change the AndroidManifest.xml to AndroidManifest.txt by typing "Java -jar AmxlPrinter2.jar AndroidManifest.xml > AndroidManifest.txt"
The hard part is to find the byte offset in the AndroidManifest where it says the MinSDK value is. The MinSDK value needs to drop from 6 or 7 down to "2" so that you can use the widget on Cupcake or higher. There is a program online and I will post the link when I get home that you use with Eclipse to find the byte offset and then you have to use a Hex editor to change the value in the original .xml file.
Once you use the hex editor and save your changes, you zip up all the files and use the apkbuilder.exe that is in the sdk tools directory by typing "apkbuilder application_name.apk -z application_name.zip"
that will make an apk from a zip file and then you right-click and resign the apk file. From there, you just copy it to your sd card and you know the rest.
It is a pretty dirty and painful approach to porting an app. That is why I am more interested in working on themes. You can just unzip the apk's you want to use and edit the /res directory and then rebuild the app and sign it. Photoshop works great for it.
I'm planning on making a theme/rom that uses hero (1.5) for a base, but slimming it down and using widgets that are smaller like the one that I ported and changing a lot of the graphics for the clocks and such.
I hope this helps for anyone interested in developing.
Red.
Wisefire said:
Awesome job. I appreciate the work.
Odd question though, what do you do in the process of back porting? I'd love to learn..
Click to expand...
Click to collapse

[Q] Metamorph & XML

Can Metamorph replace compiled XML files like it does graphics without causing problems?
Initially MetaMorph was designed for themers but it was discovered through use that we could also use it for applying customer dex files, resource files, images, and xml files. Pretty much anything inside of the apk and jar can be replaced with MetaMorph, which makes it very versatile and useful, in addition to this we can now copy files to places on the phone or sdcard, and we can implement the use of scripts now!
Click to expand...
Click to collapse
from,
http://forum.xda-developers.com/showthread.php?t=591329
so your answer is yes. perhaps read a little more next time...
mattyyey said:
from,
http://forum.xda-developers.com/showthread.php?t=591329
so your answer is yes. perhaps read a little more next time...
Click to expand...
Click to collapse
Yes. I know and realized my mistake. I normally do search, but look at the time of the post. Was a long day and my brain was not functioning. Not an excuse for not searching, but the reason behind my moment of stupidity
But now that the answer has been found, please let us forget this thread and let it die.

[APP] Purple Cherry formally WJ7 (Wario's Jewels 7) Gameboy Emulator

Hey Everyone. We are doing a complete redesign of WJ7 we will be changing the name to Purple Cherry also. Stay tuned for more updates.
Hey everyone. I am excited to announce that today is the day that WJ7 is released to the public! After months and months of testing we have finally finished it!
You can download the XAP here! http://wj7.fr.cr/
Here is a list of all the games that work atm
http://www.mediafire.com/?6q3851dubkkw7yr
Here is a free public domain game to get you started
http://80.118.144.61/wordpress/wj7/GameList/GameList.xml
If you need help I can assist you in the comments below
Enjoy everyone
Great news..
I'm gonna test as soon as i get home
Hmm i hope i can somehow be able to install this on my mango beta lg e900 without going back to pre nodo... Thank you for the great work!
Do you have any plans for a snes emulator too?
Will check this out. Thanks!
Working fine here, hope you will be able to fix sound too =)
On my Trophy, I do notice a significant speed improvement when I select the "Faster screen" option. What does this do differently? Is there any downside to using this option?
Very Nice.
But maybe you could add a description how to add Games, as it took me a while to figure out what to do (I guess I'm not the only one)
Error
Hi!
I get this error when trying to add an .xml....
Can't load the game list! The remote server returned an error: NotFound
Could you please do a step by step tutorial on how to do the gamelist... and explain what is the "URI" you need to enter into warios jewels settings?
Thanks for your time!
http://gamelistcreator.codeplex.com/
There is what you have to to to create a GameList.
Afterwards - Upload your "Covers" and "Roms" folders to a webserver, as well as the GameList.xml
Then just enter this URL in the Game Settings. Et voliĆ .
Where is the .xap? I'm getting the .zip, but there is no XAP file inside it.
dbG33K said:
Where is the .xap? I'm getting the .zip, but there is no XAP file inside it.
Click to expand...
Click to collapse
rename it to .xap
DominikZ said:
Very Nice.
But maybe you could add a description how to add Games, as it took me a while to figure out what to do (I guess I'm not the only one)
Click to expand...
Click to collapse
if you look on the site there is a video I made showing how to add games
Badcam3 said:
if you look on the site there is a video I made showing how to add games
Click to expand...
Click to collapse
Right I somehow missed that...
Well, in that case you have to move the button (or add a description) so that everyone can easily find it
EDIT: Do you have a PayPal account - because I'd really like to support your work...
DominikZ said:
There is what you have to to to create a GameList.
Afterwards - Upload your "Covers" and "Roms" folders to a webserver, as well as the GameList.xml
Then just enter this URL in the Game Settings. Et voliĆ .
Click to expand...
Click to collapse
Thanks...tried the Gamelist and added some roms... I have now ready the 3 files you said....
but didnt understand what you really meant when you said of uploading it to a "webserver"....you mean ...megaupload/rapidshare...and that sort of?...
or...is it another thing?
sorry for my poor knowledge on the subject...
new to this world
Thx!
You'll need a real webserver where you can access those files. So Rapidshare, e.g. is not an option.
Just wondering, what does the little Floppy Disc button do on the Individual Game page? It's greyed out for all of my games.
DominikZ said:
Right I somehow missed that...
Well, in that case you have to move the button (or add a description) so that everyone can easily find it
EDIT: Do you have a PayPal account - because I'd really like to support your work...
Click to expand...
Click to collapse
We currently do not but that is a good idea . If we do make one I will be sure to contact you XD
I have an issue with the GameList.xml.
I created it with "GameListCreator", then I redirected "GameList.xml", "Roms" and "Covers" with HFS (HTTP File Server), shut off the Firewall, pointed to the URL of the XML but I obtained the following error :
"Can't load the game List ! The format of the GameList is not valid !
NullReferenceException"
I tried your GameList.xml but I have the same issue.
So I tried to replace "Roms\" by "Roms/" and "Covers\" by "Covers/" in the xml file, unfortunately nothing change
Thanks for your work and help
love the website! amazing silverlight
gonna try the emu soon, much appreciate your work!
keep it up!
Someone needs to post the instructions because i don't know what to do

Creating an Xposed module, modifying google maps, not sure how to continue

I am trying to make a simple Xposed module where the screen that says "You have made it to %s" will be black if you were navigating in night mode. Currently it is bright white, which is quite blinding.
I have successfully created a simple Xposed module to turn the clock red via a very useful tutorial. I have also successfully decompiled google maps, but I am not entirely sure how to continue now. I looked for the string "you have made it to", which I then did find in an xml file, but I can't find it being referenced anywhere. The other strings ("earlier than predicted" and "walk the rest of the way") gave me the same result.
I had assumed it would be relatively easy to find where in the code the arrival screen is rendered, but apparently not. Can anyone here give me any tips on how I can find it?
I'm quite sure it's not easy, because google apps are not open source and I suppose they're taking measures against full decompilation.
Gesendet von meinem Moto G 2014 LTE mit Tapatalk
I have decompiled obfuscated java code before(although not an app), and it wasn't super easy, but looking for strings made it quite doable. I guess it might just be harder for apps?
inasm said:
I have decompiled obfuscated java code before(although not an app), and it wasn't super easy, but looking for strings made it quite doable. I guess it might just be harder for apps?
Click to expand...
Click to collapse
You probably have to locate where the string resource is being used. If you're able to decompile the APK, you should be able to find the resource ID for this string and then search through the code for a reference to it.
Then maybe hook that function to change the TextView color after it's being called.
itandy said:
You probably have to locate where the string resource is being used. If you're able to decompile the APK, you should be able to find the resource ID for this string and then search through the code for a reference to it.
Then maybe hook that function to change the TextView color after it's being called.
Click to expand...
Click to collapse
Thanks for the response! I already tried doing that, and I only found these kind of id's by doing that: 0x7f110460. This is an extremely large number, so I'm assuming it's some kind of memory location, and I have no clue how to continue from here
inasm said:
Thanks for the response! I already tried doing that, and I only found these kind of id's by doing that: 0x7f110460. This is an extremely large number, so I'm assuming it's some kind of memory location, and I have no clue how to continue from here
Click to expand...
Click to collapse
Your ID 0x7f110460 is actually 6C7F3C in hex. Next thing you can do is search this hex number in the decompiled smali or jar file to locate the referencing methods.
itandy said:
Your ID 0x7f110460 is actually 6C7F3C in hex. Next thing you can do is search this hex number in the decompiled smali or jar file to locate the referencing methods.
Click to expand...
Click to collapse
Thanks for your help, but the id 0x7f110460 is already in hex (I think you have missed the f in there). I tried searching for it, but it turns up nothing.
inasm said:
Thanks for your help, but the id 0x7f110460 is already in hex (I think you have missed the f in there). I tried searching for it, but it turns up nothing.
Click to expand...
Click to collapse
Oh yes like you said I misread the number. Anyway you need to translate the hex back to decimal. Then search again.
Wrong post
itandy said:
Oh yes like you said I misread the number. Anyway you need to translate the hex back to decimal. Then search again.
Click to expand...
Click to collapse
I had already tried that, and found nothing .
Thanks a lot for your help though, but google just updated its app to include this! Maybe it's because of the feature request I made, or maybe it's just a coincidence, but I'm super happy!

Categories

Resources