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

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!

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?

[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.

Change text highlight color in Sense

Hi everyone. Can anyone point me in the right direction to change the text highlight color in Sense? I already tried to change the highlight value in framework-res.apk/res/values/styles.xml but that's not working on Fresh ROM 3.4.0.1. I'm starting to think the hex color code to change is somewhere in com.htc.resources.apk or HTC_IME.apk but I've been searching for a day and have gone through tons of code and nothing's sticking out. I've attached a screenshot that shows what exactly I'm talking about.
Can anyone help please? Thank you!
Would it be in a jar file??
MacaronyMax said:
Would it be in a jar file??
Click to expand...
Click to collapse
Ooooh good hint. I did not think of that. Maybe services.jar? I'll keep looking around.
I'm really starting to believe this particular thing needs to be change in smali code in HTC_IME.apk but I'm still spinnin the wheels on this.
Well, no Sense, but maybe this helps http://forum.xda-developers.com/showthread.php?t=795242
rori~ said:
Well, no Sense, but maybe this helps http://forum.xda-developers.com/showthread.php?t=795242
Click to expand...
Click to collapse
Thanks. Unfortunately, that doesn't apply to Sense I already followed those steps for the CM themes I've asked gIMpSTa to give me a hand on this one. He too thinks it's in smali code as well.
Thanks again.
was this ever solved
found it http://forum.xda-developers.com/showpost.php?p=13831424&postcount=684

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

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?

[Q] Changing value of int within method

@rovo89 or anyone could you please help me with this
Say we have method A
public void A(){
//random stuff
int i = 0;
//more stuff
doing stuff with int i
}
Now how would i change i?
It has never been defined outside the method
Is it possible?
Thanks
That's an exact duplicate of this thread from yesterday: http://forum.xda-developers.com/xposed/field-inner-class-t2788380
--> Not possible.
rovo89 said:
That's an exact duplicate of this thread from yesterday: http://forum.xda-developers.com/xposed/field-inner-class-t2788380
--> Not possible.
Click to expand...
Click to collapse
In the other thread @GermainZ mentions doing it with another process by replicating it
Could this be done for changing the int?
Thans for your help
hamzahrmalik said:
In the other thread @GermainZ mentions doing it with another process by replicating it
Could this be done for changing the int?
Thans for your help
Click to expand...
Click to collapse
To be honest, I don't understand what he meant with that, but it seems to have helped. I see two possibilities here:
1. Replace and reimplement the method completely. There might be cases where this is fine, but usually I wouldn't recommend it. Often, you can't just copy & paste the method, but you have to use a lot of reflection to replicate it. And if the original method changes, your implementation becomes outdated.
2. Find a different way to achieve your goal. Maybe hook a method that sets the initial value of that variable or somehow has an influence on it. Or maybe choose a completely different approach. There is no standard recipe for this.
rovo89 said:
To be honest, I don't understand what he meant with that, but it seems to have helped. I see two possibilities here:
1. Replace and reimplement the method completely. There might be cases where this is fine, but usually I wouldn't recommend it. Often, you can't just copy & paste the method, but you have to use a lot of reflection to replicate it. And if the original method changes, your implementation becomes outdated.
2. Find a different way to achieve your goal. Maybe hook a method that sets the initial value of that variable or somehow has an influence on it. Or maybe choose a completely different approach. There is no standard recipe for this.
Click to expand...
Click to collapse
Ok thanks for your help
Option 2 won't work because the variable is never used outside the method
Option one is possible but hard because my method is very complicated
hamzahrmalik said:
Ok thanks for your help
Option 2 won't work because the variable is never used outside the method
Option one is possible but hard because my method is very complicated
Click to expand...
Click to collapse
Especially for complicated methods, I strongly advise not to rebuild them.
Can you show the full concrete example and what you're trying to achieve? You seem to be focused on "i", but there are often many ways to achieve something.
rovo89 said:
To be honest, I don't understand what he meant with that, but it seems to have helped. I see two possibilities here:
1. Replace and reimplement the method completely. There might be cases where this is fine, but usually I wouldn't recommend it. Often, you can't just copy & paste the method, but you have to use a lot of reflection to replicate it. And if the original method changes, your implementation becomes outdated.
2. Find a different way to achieve your goal. Maybe hook a method that sets the initial value of that variable or somehow has an influence on it. Or maybe choose a completely different approach. There is no standard recipe for this.
Click to expand...
Click to collapse
Right, "replicate the process to get the int" = reimplement part of the method to get the int.
rovo89 said:
Especially for complicated methods, I strongly advise not to rebuild them.
Can you show the full concrete example and what you're trying to achieve? You seem to be focused on "i", but there are often many ways to achieve something.
Click to expand...
Click to collapse
http://grepcode.com/file/repository...oader.java#RecentTasksLoader.getRecentTasks()
trying to change int first, line 232
hamzahrmalik said:
http://grepcode.com/file/repository...oader.java#RecentTasksLoader.getRecentTasks()
trying to change int first, line 232
Click to expand...
Click to collapse
Can't you just add the first task back, or remove the numbers you don't want? Instead of modifying the int directly (which you can't do), modify the result to either add or remove whatever tasks you want…
GermainZ said:
Can't you just add the first task back, or remove the numbers you don't want? Instead of modifying the int directly (which you can't do), modify the result to either add or remove whatever tasks you want…
Click to expand...
Click to collapse
Ok. I was hoping it would be possible to change the int because it would be easier
But thanks for your help

Categories

Resources