Google Maps Nav guidance, force language. Help needed - Android Software/Hacking General [Developers Only]

Hey guys,
like many people I just hate localizations of software, so I've set my phone to english. However I'd like the Google Maps Navigation instructions to be in my native language German, mainly because German street names spoken by an english voice are just gibberish sounds.
So I tried modding the Maps.apk to force the locale, either for the whole app or just for TTS.
I found this in com.google.android.apps.maps.apk\smali\y.2\ae.smali
Code:
invoke-virtual {v0}, Landroid/speech/tts/TextToSpeech;->getLanguage()Ljava/util/Locale;
move-result-object v0
It seems to be the only reference to any TTS loading in the whole app, so I tried overriding it using
Code:
sget-object v0,Landroid/speech/tts/TextToSpeech;->deu-DEU:Ljava/util/Locale;
where I tried not just "deu-deu" but also "de", "de_de", "de-de", "deu". But they all caused the app to FC as soon as I started the navigation activity.
I also tried adding code like
Code:
sget-object v1,Ljava/util/Locale;->de:Ljava/lang/String;
to occurances of getLanguage() and getCountry() but to the same results.
Maybe someone with some Android programming experience has an idea what needs to be changed where to force a certain voice? Would be great to make this happen.

Related

[Q] [REQ] record from FM radio.

There are regular programs that I listen to that I would really love to be able to record from the FM radio on my EVO.....is it possible? Is there anything? Can something be made?
It would be awsome....thanks for the help!
I've been looking for something like this myself. So far nothing exists AFAIK. Some suggestions in the past were to try using one of the many voice/call recording apps available but any that I try kill the radio output when recording starts. I'm actually learning how to develop for Android now and that is one of the things on my list of apps to try and develop, but hopefully someone has already beat me to the punch.
yea I've been looking for something for a long time......got the same responses like u......but would totally awsome if you get to make it.....
There its no published api for the radio. I wanted to do something exactly like this, but gave up since HTC does not publish any mechanism to interact with the fm radio.
-frank
Sent from my PC36100 using XDA App
check out chillirec
chillirec is for recording internet radio... we're looking for something to record FM radio... big difference, but thanks for the suggestion...
i want one, add me, my old nokia ngage use to do it.
Definitely. This would be a very handy app to have. My old Creative Zen Sleek Photo mp3 player could do this.
Many times many places (although, not often enough even at that) this has been asked for. Many of us would be grateful!
This simply has to be possible. It's a shame it's apparently not an appealing enough project to interest some developers that understand these things.
Amigaben, perhaps you did not read my post. The mechanisms just don't exist from htc. Unlike most apps, the tools and system calls don't exist in java which is what the main supplication is written in. It is not a question of lack of interest, I would love to do this as a developer and have explored this pretty extensively, it just isn't feasible without a release of code from HTC.
To do this would likely require low level c coding at least and might require keys or some other special code we don't have.
-frank
Sent from my PC36100 using XDA App
kaediil, I didn't mean to be rude in my post. I realize that what you said is true, that the mechanisms don't exist from HTC, or if they do they're not documented. It just seems like the type of thing that can get worked around or implemented the hard way when it's something truly interesting for enough developers/hackers. I just figured FM recording wasn't interesting to enough of the right people in the right situations to make that happen yet, realizing that if it is possible to do without HTC's help it would probably require a lot of effort.
Anyway, I meant no slight. Though I might have intended a prod to those looking for a challenge.
If there are any coders/hackers out there who have any interest in working on this, I have looked at the FmRadio.apk file from my EVO.
I have gotten as far as confirming from this code that the FMRadio is actually a part of the Broadcom Bluetooth chip, which I think is the BCM4329. Reference this code from the file BroadcomFMTuner.java:
iget-object v1, p0, Lcom/htc/fm/BroadcomFMTuner;->mFmReceiver:Lcom/broadcom/bt/service/fm/FmReceiver;
Note the reference to the bt (bluetooth) service. Just after that line is:
const-string v2, "!!!! @@@@@@@ ##### setRdsOn() - successfully!!"
Also in this file the lines:
com/broadcom/bt/service/fm/FmReceiver;->turnOnRadio()
The java code modifies a few files located in:
/data/data/com.htc.fm/
There is a file called fm in there that shows what channel the radio is tuned to, if the channel is a favorite and what name you gave that channel.
Once the radio is turned on a new file is created there called audio_fm which describes the audio path or where the app should be sending the audio.
There is a mime type described in the file: application/fm and a data or URI prefix of: htcfm://
Apparently to play the app uses the MediaPlayer with that URI, and shuts down all other players, hence why you can't record when playing the FmStream.
In the code I see a line like this:
"mime_type = \'application/fm\' and _data = \'htcfm://"
then a few lines later:
const-string v0, "internal"
invoke-static {v0}, Landroid/provider/MediaStore$Audio$Media;->getContentUri(Ljava/lang/StringLandroid/net/Uri;
Anyway, all of these things point to needing com.broadcom.bt.service.fm.FmReceiver, which I am assuming is in some other apk or file on the system, but I have not looked for/found it yet.
-frank
I want to record from FM!!!

[Q] Replace GetDeviceID() with a hard coded String (???)

This is the line of code I'm working with. I need to change this line by hard coding the device id for testing purposes.
invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;
Could anyone please step in in the right direction.
If you need the code leading up to this or even following this line, let me know and I can post more.
Thanks,
Chad

SG DEV Chat

Okay, so we've made changes to CommonUtils.smali, I'm not sure how you did it.
But there are also calls to MAKE/MODEL in MediaPlayerWrapper.smali and HDMIReceiver.
The former checks for Samsung models, the latter checks for HTC models.
You can see them as:
Code:
sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;
That should be the last of the device specific tests ...
Next step ... root:
Having a read through Gingerbreads DRM framework for clues, but I'm convinced the likely culprit will be in DrmAgentService.smali.
Final step ... ICS:
There are version checks for ICS all over the place, which can be amended ... But BSB really need to add ICS support, as I don't particularly fancy adding it on their behalf.
PS: Currently by Dev environment is refusing to recompile any source, so I'm a little bit hampered as to how much I can debug atm.
As far as I can work out, the calls to make and model in those files are superfluous. It's where they're checking for the kernel or such that's confusing me...
No worries ...
Interestingly ... They seemed to have left a lot of TEST code in ... I'm wondering what would happen if we set it to run as a test version.
Anyway ... VGDRM.smali seem to be the likely place to start to look for the root issue ... Going through it now to see what else it calls.
Error code called VGDRM_STATUS_DEVICE_IS_ROOTED, just can't work out where it's being called...
I believe what happens is that the when the DRM session initiates it posts a load of info like deviceName, username etc and it invariably responds with 0x7f060021 which corresponds with that the device is rooted.
Interestingly ... In SOAPconstants you can set the device to whatever you want, have a gander at HARDCODED_DEVICE_TYPE.
Finding a lot of interesting stuff ... Still no closer to where they're hiding that root check ...
Discovered how they plan to force upgrades ... if you look in Flags.smali there's a URL that pulls a config file from their site. In there, they can force people to upgrade to a specific version.
At the bottom of CommonUtils.smali, you forgot to override getManufacturerName ...
Squiggle said:
At the bottom of CommonUtils.smali, you forgot to override getManufacturerName ...
Click to expand...
Click to collapse
Doesn't seem to affect anything - people with SE phones running stock have had it working.
Sony Ericsson phones? Really?!
Hrm.
This is also confusing in terms of whether they're checking the kernel version, I guess they're not...
I was wondering if they were matching things up with the UserAgent, but there's nothing in there that would state if you're rooted or not.
I can only presume that extra code is downloaded from them that performs a Kernel check ... as I'm buggered if I can see anything in the code that does it.
Threads on BSB forums seem to indicate that Jailbroken iOS devices now experience the same issues ...
Can it help?
I extracted this code from a famous .apk:
.method public isRooting_check()Z
.locals 1
iget-boolean v0, p0, Lit/sky/go/model/Config;->rooting_check:Z
return v0
.end method
If I put
const/4 v1, 0x0
return v1
to fool it it doesn't work.
Is possible that this apk could have more controls regarding the presence of root? thank you

[Q] Smali Compile Error - Classes.dex

Disclaimer: Perhaps this should be in Development, but I'm below the 10 post threshhold
I'm new to XDA forums posting, have no programming experience(ie:copy/paste script), but have been lurking for some time now reading as much as I can without asking for help, scouring the forums so I can achieve my whims and hopefully help others in the long run when I have more experience. I've succeeded in setting up adb/SDK, decompiling/recompiling apk's, editing 9patch, flashing, signing etc..
My post is in regards to my efforts to change the width of the drawable line used to connect the pattern dots on a security pattern lock screen.
I found these instructions from another site from someone asking the same question, The answer given was:
In com\android\internal\widget\LockPatternView.smali of framework.jar (make sure you decompile with backsmali),
find something that looks like:
Code:
iput v2, p0, Lcom/android/internal/widget/LockPatternView;->mDiameterFactor:F
Above it, you should find something like:
Code:
const/high16 v0, 0x3f00
Change 0x3f00 (or whatever it is) to 0x3dcccccd
Click to expand...
Click to collapse
I Decompiled classes.dex from framework.jar on two roms. Reaper 3.0 (default) and classes.dex from the latest CM9 (which has the thinner drawable line) to try and compare them. Attached are 2 screen shots from within notepad++ One from the Reaper LockPatternView.smali which I modified and tried to recompile. And the other from CM9's LockPatternView.smali left untouched. I tried to draw a comparison.
After editing LockPatternView.smali I saved the file, but am getting recompile errors with either autosmali or by command line.
Code:
C:\AutoSmali_1.0-2>java -Xmx512M -jar smali-1.3.2.jar out/ new-classes.dex
out\com\android\internal\widget\LockPatternView.smali[0,0] 1036831949 cannot fit
into a short
out\com\android\internal\widget\LockPatternView.smali[251,4] mismatched tree nod
e: I_STATEMENT_FORMAT22c_FIELD expecting I_CATCHES
out\com\android\internal\widget\LockPatternView.smali[261,4] mismatched tree nod
e: I_STATEMENT_FORMAT35c_METHOD expecting <UP>
I was wondering if anyone has any experience with this, or has experienced the same error. I have been able to change all the png's and customize the appearance to my hearts content, i only lack the ability to edit that 'connecting line'
I'm just a beginner who's good with Photoshop, but If i can work this out I figure I'll write a tutorial with everything combined.
twiice
Almost a year later comes someone with the exact same issue. The only difference is that I'm a Samsung Y DUOS user.
So, anyways, I was able to compile the file again with no errors.
I've changed this:
Code:
const/high16 v2, 0x3f00
Into this:
Code:
const v2, 0x3dcccccd
If I left it like this:
Code:
const/high16 v2, 0x3dcccccd
I got compile errors.
Nevertheless, I don't think that this is the right way to do this. I was able to flash the new framework.jar onto my phone and it booted ok without errors. The only thing is that I've noticed that the phone gain some LAG while moving around the UI. The LAG is not always present, but it happens with a lot more frequency than before.
So, my question is, what the hell does const/high16 means? Why do I have a compile error if I leave it like that, and why does it get recompiled ok if we remove the /high16?
Can anyone help me?
It most likely means high 16 bits of 32-bit variable.
You're using 32-bit value.
Obviously you can't stick 32-bit value into 16 bits, that's why you're getting compilation errors.
The lag has most likely nothing to do with this, and has to do with the tool version you used for recompilation and/or lack of zipaligning and/or something else caused by the change you did.

Decompiling APKs question regarding .smali syntax such as .line

I'm comparing two APK's after decompiling them.
The code is very much identical apart from when I decompile one there are many lines such as
.line
.prologue
Is there anyway to cut this out as it would help very much when comparing?
Yeah.
Don't include debugging information.
For baksmali just pass the b argument. You'll see it in the binaries documentation.
zeroprobe said:
I'm comparing two APK's after decompiling them.
The code is very much identical apart from when I decompile one there are many lines such as
.line
.prologue
Is there anyway to cut this out as it would help very much when comparing?
Click to expand...
Click to collapse
Search for xda user mudhi then check his signature and goto the "A way to optimize app and framework files" thread in his sig.
It strips out the debugging code like .line .prologue etc and gives more readable code
Or, you could simply enter -b like I said before.
No need to install new software this is easy.
Thanks guys, much appreciated.

Categories

Resources