yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] viper2097:
Hi Guys!

I own a Desire Z and want to switch to the carrier bob here in Austria.

Bob is operating a virtual network provided by A1.

So when i inserted the bob Sim, my DZ always thought that it is roaming and i had to enable data roaming which is quite annoying. I searched the whole Internet for a Solution and the only one I found, was to edit the spn-conf.xml.

This Solution may work, but not for Sense Roms. HTC (and also others) is maybe ignoring this file...

So i searched and searched and then, I found this thread:

http://android.modaco.com/topic/342267-universal-mvno-patch/page__p__1739302#entry1739302

When I understand it correct, it just enables national roaming, roaming abroad should still work like before.

In the lower section, it is described what you need to do, i hope it is ok when I repeat it here with more details:

1. Download baksmali-1.2.8.jar (just type it in google)

2. Download smali-1.2.8.jar (just type it in google)

3. Get the Framework.jar from your rom

4. Open the Framework.jar with a programm like winrar

5. Extract the file "classes.dex"

6. Put this file, smali and baksmali into a folder you like

7. Open a CMD Window, navigate to the folder where the files are stored

8. Type "java –jar baksmali-1.2.8.jar –o out classes.dex"

9. After a couple of time you will get a promt again and a Folder called "out" should be created

10. Open the file out\com\android\internal\telephony\gsm\GSMServieStateTracker.smali with a text editor of your choice (I prefer notepad++)

11. Now the complicated part:

Search for the following lines

if-eqz v0, :cond_49

if-nez v1, :cond_4f

if-nez v2, :cond_4f

:cond_49

move v8, V12

and replace the two lines

if-nez v1, :cond_4f

if-nez v2, :cond_4f

with

goto :cond_4f

12. Save the file and go back to the cmd window

13. Type: "java –Xmx512M –jar smali-1.2.8.jar out\ -o newclasses.dex"

14. Rename the the file "classes.dex" to "oldclasses.dex" and the new file "newclasses.dex" to "classes.dex"

15. Open the framework.jar with a programm like winrar, delte the classes.dex inside the archive and repalce it with the new created classes.dex

16. Put the file on your phone and replace the existing framework.jar in the path system\framework with the new created.

17. Set the Permissions to 644

18. Reboot your Phone

Now you should be able to use your MVNO without any roaming problem.

I think this works on all Android Versions and Roms, but please, make a Nandroid Backup before changing anything to the System! I'm not responsible for any damage to your device!

I modded a framework.jar for my HTC Desire Z with Virtuous 2.0.0, i attached it to the post, feel free to use it if you have the same phone with the same rom.

I havent found this method anywhere else here on xda, if so, sorry, please delete my thread then.

best regards, Christian
[Android Software/Hacking General [Developers Only]] viper2097:
No one intressted in this?
[Android Software/Hacking General [Developers Only]] Amir.Adel:
i'm :) :) :D
[Android Software/Hacking General [Developers Only]] viper2097:
So you have also the roaming problem with a mvno?

Did you tried my posted solution and did it solved your problem?

(because of that, please don't mind capitalization)
[Android Software/Hacking General [Developers Only]] jjm34:
FYI, CM7 has an option for that ("national data roaming").

Before CM7 I was running Sony Ericsson's stock ROM with Bob as well, and it also seemed to ignore spn-conf.xml. Good to know it's possible to patch non-CM7 builds too.
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

Yes, I know that, but I really don't like CM7 ;)

But as far as i know, The Icon for the Signal Strength still shows the little R, right?

With that Mod, this R is also gone, you will not see anymore that you are roaming inside your home country...
[Android Software/Hacking General [Developers Only]] jjm34:
It's probably implemented the same way. CM7 also doesn't show the "R", and the roaming status in "about phone" says "not roaming".

Also, CM7 displays the actual network operator's name by default ("A1" instead of "bob"). Supposedly it's configurable to either have it display the SPN ("bob") or the PLMN name ("A1"), but SPN doesn't seem to work as it just ends up with an empty string. ;)
[Android Software/Hacking General [Developers Only]] viper2097:
Oh, i did not know that CM7 also does not show the R...

But what I'm intressted in, is how CM7 display A1 instead of bob. This would be nice if this could also be implemented in any other rom...
[Android Software/Hacking General [Developers Only]] jjm34:
From a quick look at the source it's implemented in each of the UI components that display the operator name (such as lock screen and status bar) to display a different name if customized, i.e. changing the preference doesn't change the operator name reported by the underlying GSM layer. This way it can be implemented without changing any of the GSM system components.

I believe the GSM layer should (according to GSM specifications) report the SPN if present (which is stored on the SIM card) instead of the PLMN name, but for whatever reason CM7 doesn't seem to be able to read the SPN at all in my case and therefore displays "A1".
[Android Software/Hacking General [Developers Only]] viper2097:
So do you see a way to hack/ modify any other rom to display the real carrier and not the mvno?
[Android Software/Hacking General [Developers Only]] jjm34:
Well I've taken another look at it, and I've tried a quick patch.

This may be different (or may not work at all) depending on the ROM. CM7, for example, doesn't contain any of these lines.

Disclaimer: I don't know anything about Dalvik assembly specifically, and I'm not responsible if this patch blows up your phone. However, it worked on a Sony Ericsson device with stock ROM I have tested it on.

Similar to your original post you have to disassemble framework.jar/classes.dex, and the file you have to edit is com/android/internal/telephony/gsm/SIMRecords.smali:

It may contain the following line:

sput v0, Lcom/android/internal/telephony/gsm/SIMRecords;->PNN_OPL_ENABLED:I

Above that is the following, which sets this flag to enabled (1):

const/4 v0, [color=red]0x1[/color]

I changed this value from 0x1 to 0x0, and the SE ROM then displayed the actual network operator's name instead of the MVNO's.

Of course, reassemble classes.dex, repack framework.jar, and put it on the phone.
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

Thank you very much for your efforts!

I tried this now, but my SIMRecords.smali doesn't contain the line

sput v0, Lcom/android/internal/telephony/gsm/SIMRecords;->PNN_OPL_ENABLED:I

Maybe you can find in my classes.dex the lines which have to be changed? Here i uploaded my classes.dex from the Virtuous Rom with Sense I'm actually using: http://www.2shared.com/file/DlUDO2-P/classes.html
[Android Software/Hacking General [Developers Only]] jjm34:
I've looked at the disassembly from your classes.dex, and there are some things that may work.

There's a "getDisplayRule" method in SIMRecords, which I had tried on my SE ROM before, and it worked for a short time (before the name was updated with the SPN from some other method).

This method returns either the constant value SPN_RULE_SHOW_PLMN if there is no SPN, and SPN_RULE_SHOW_SPN if there is. Changing

if-nez v2, :cond_14

to

goto :cond_14

(line 3867 in my disassembly) will let it return SPN_RULE_SHOW_PLMN every time.

The other thing that may work is modifiying "getSpnFsm", which tries to read the SPN records from the SIM card in the first place (Java source for this method can be found by Googling, which makes it easier to read).

Inserting "return-void" as the first instruction should make it ignore any attempts to read the SPN from the SIM.

.method private getSpnFsm(ZLandroid/os/AsyncResult;)V
.registers 11
.parameter "start"
.parameter "ar"

.prologue
return-void

Edit: Also, there's setSpnFromConfig, which tries to load SPN names from etc/spn-conf.xml... which could possibly just as well be edited instead of patching the files ;)

So if that file exists it might still be used to read an SPN, but removing the file or inserting a "return-void" in that method should skip it.
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

I'm at work now, but when I get home, I will try these two methods.

I also found some references to the spn-conf.xml, but at first I tried to change this file to get the roaming away, but sense seems to ignore this file...

Thank you very much for your efforts, I will give you a feedback if that worked!
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

I just tried your second method, when reassemble the classes.dex file, i get the following error message:

out\.......\SIMRecords.smali[1804,11] mismatched input "void" expecting REGISTER

So what should i do now?

EDIT: I also tried now your first method. did not effected anything...
[Android Software/Hacking General [Developers Only]] jjm34:
Did you put it as "return void"? I just tried it with that and get the same error. ;)

"return-void" (with a dash) is the correct form, and I don't get any errors when reassembling.
[Android Software/Hacking General [Developers Only]] viper2097:
I'm so a stupid idiot....

This was it...

BUT: My Z is still displaying "bob", so it looks like it was not succesfull ;)

But still thank you very much for your efforts!
[Android Software/Hacking General [Developers Only]] jjm34:
Hm, sorry it didn't work. I don't have an HTC device so unfortunately I can't try out the changes myself.

If you want to look into which component might be setting the network name you could try watching the logcat output (also the radio log) while disabling flight mode, that's when the phone registers on the network. There might be log entries relating to where the network name gets set.
[Android Software/Hacking General [Developers Only]] viper2097:
Thank you very much for your efforts!

I'm not really familiar with logcat, so i think i will not be able to do that or to filter the intresting things...

But when I have time I will try it...
[Android Software/Hacking General [Developers Only]] viper2097:
I'm not really a coder, hacker or what else, but I'm good in using google ;)

Maybe this one helps?:

http://xdaforums.com/showpost.php?p=8735731&postcount=106
[Android Software/Hacking General [Developers Only]] jjm34:
Yeah, that way could work. However, it says in that post that the carrier string is hardcoded in the XML, so then it would always display whatever is in there, and not change to the actual carrier name if you're roaming on a foreign network.

Also, the layout XML files have to be compatible with the app that uses them. If that XML is for a different version of Sense that what you're using, it most likely won't work.

(I know, those files aren't XML, but XML is the original format and they are compressed when the APK is packaged.)

I might be able to borrow a friend's Desire S at some point and get a logcat output. However, that's a SIM-locked device, and I still couldn't try an MVNO SIM. :p
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

Yes i know that it then would be hardcoded, and that would be a thing that i don't like.

But maybe it helps to trace what needs to be changed?

I'm using my Desire Z with Virtuous Sense 2.0.0 what is overall a optimized stock rom. My DZ is Simlock Free and at the moment I'm still on tele.ring because i need to wait for the confirmation Code from bob.

Yesterday, before going to bed, i downloaded the app "CatLog" and tried to log what happens when I'm activating the flight mode and deactivating it.

I attached the logfile, I only deletet the part where I enter my PIN.

I never did this before and I hope this is something that could help you?

I have a 8 year old tele.ring SIM Card, so one strange thing is, that my telephone shows me always T-Mobile, and not telering. My GF have a newer SIM Card an hers shows Tele.ring. So I could also do that log again with a bob and a newer SIM Card if that would help.

One strange thing beside: Telering is for me roaming the same way like bob is doing it. But with my SIM Card and with my GF's SIM Card we never had the roaming problem before. This first appeared when using a bob SIM Card. Ok, this problem is, thank god, now solved, but somehow, I think that's something weired...
[Android Software/Hacking General [Developers Only]] viper2097:
Hi!

I made now also a log with my bob Sim inserted, its attached to the post. Only removed the lines where I enter my PIN.

Maybe it helps?
[Android Software/Hacking General [Developers Only]] viper2097:
I just searched a little bit more, could maybe these lines be intresting?

out\com\android\internal\telephony\gsm

SIMCard.smali

invoke-virtual {v0}, Lcom/android/internal/telephony/gsm/SIMRecords;->getServiceProviderName()Ljava/lang/String;

out\com\android\internal\telephony\Telephony

Telephonyproperties.smali

.field public static final PROPERTY_ICC_OPERATOR_ALPHA:Ljava/lang/String; = "gsm.sim.operator.alpha"
[Android Software/Hacking General [Developers Only]] McGiverGim:
Hi Viper2097, I'm very interested in your method, for a LG Optimus 2x.

I've decompiled the framework.jar but in the GsmServiceStateTracker.smali I cannot find the lines you say, or anything similar inside the isRoamingBetweenOperators() method.

I attached the file here to see if you can help me ;-)

Regards and thank you very much!
[Android Software/Hacking General [Developers Only]] viper2097:
HI McGiverGim!

I'm not a developer or a coder, I'm just good in using google, so I'm sorry, I will not be able to help you, but here are also some other good guys reading, so maybe another one can help you.

There is only one thing I can see at first in line:

In my guide I'm talking about the file named "GSMServieTracker.smali" which you can find under "out\android\internal\telephony\gsm\" after you have got the classes.dex out of the framework.jar and "baksamli"'ed the classes.dex

You are talking about "GsmServiceStateTracker.smali" after decompiling framework.jar. So you are sure that you have the right file and did it exactly following my guide?

Maybe you can also tell us which custom rom you are running or which version of the stock rom? Or provide us your framework.jar file?
[Android Software/Hacking General [Developers Only]] McGiverGim:
Hi! I think your guide has a mistake. I've opened the patch file from modaco and it appears:

diff -ur out.orig/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali out/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali

So I suppose the correct file is mine ;-)

Your file doesn't appear in my framework.jar

I use LG Optimus 2x with v20o rom (ginger 2.3.4).

Regards!
[Android Software/Hacking General [Developers Only]] viper2097:
Hi McGiverGim!

I'm now at my Desktop and I double checked that and need to say sorry. Of course you are right, the file is named "GSMServiceStateTracker.smali". I will correct this immediately in the guide.

I took a quick look at your file, but as you said, i cannot find it...

But the funny thing is... in my file, I also can't find it anymore...

I don't know why, but I will investigate this later today and hope that I will find a solution....
[Android Software/Hacking General [Developers Only]] McGiverGim:
I think that my file is not "standard", because is a lot bigger than others.

If you could find a solution here I'm, I will look into it too...
[Android Software/Hacking General [Developers Only]] viper2097:
Just took a better look at it now, I don't know why your file does not contain this, overall it look complete difficult to my one. With a little more time I found for sure the lines to change in my one again ;)

But I've seen that you also postet this to the forum where I have it from, so maybe someone who really knows what to do can help. I will be very intressted in the result...

Sorry that I was not able to help and that it doesn't work for you:(
[Android Software/Hacking General [Developers Only]] leaskovski:
Hi guys,

I've stumbled across this thread from a bug on Googles bug tracker. Not sure if I'm seeing the same thing, however I will try to explain what it is that I am seeing...

Basically my provider is Virgin Uk who is an MVNO. They use TMobiles network. TMobile has an agreement with Orange so that we can use their network when the TMob/Virgin signal is not good. Once I am on the orange network, the network name changes to 'Virgin from the normal 'virgin. Note, in the notification pull down tray, when I am on my home network, it shows as 'no service.

Whilst I am on the virgin network and thus actually the TMob network, I can use data without any changes to the roaming settings. If I swap over onto the orange network, Android tells me that I am roaming and thus I have lost data. At this stage I have to change the roaming settings to enable data.

Can the above posts help out?
[Android Software/Hacking General [Developers Only]] derx666:
thanks

just expressing a lot of thanks to viper2097. :good:

I was about to give up on the whole roaming thing until i stumbled upon this post. pfew... You saved me quite some headaches!
[Android Software/Hacking General [Developers Only]] St4hli:
Hey Guys, I'm trying to do this with my Nexus 4 on Stock Android.

But I can't find any classes.dex file in my framework.jar. Is this because Stock Android is not "deodexed"?

Would be nice if someone could help me a little bit with this :S
[Android Software/Hacking General [Developers Only]] caspase:
If you're using a rooted rom, simply calling

# setprop gsm.sim.operator.alpha <your operator>

fixes the problem until the next reboot. Note that you can't put this in defaults.prop,

as it is updated after unlocking the SIM... I haven't gotten around to writing an app

that automates this step, but it certainly wouldn't be rocket science - for now, I'm

happy typing this one-liner every time I reboot ;)
[Android Software/Hacking General [Developers Only]] AM-I-ROOT?:
MVNO Problem Wiko Darkside

I got the GsmServiceStateTracker.smali of my Wiko Darkside extractet but I'm kind of stuck at this point because (of course) the coding is completely different.

In the appendix you can find the .smali file I extracted from a custom ROM for my Darkside... Would be great if somebody could have a look and check it for the reason why MVNO is not working.
[Atrix 4G Q&A, Help & Troubleshooting] DannyBiker:
So I guess this has been asked but I really need details on it cause it's a real throwback for CM7/9 to me...

So I understand that MotoBlur and CM7 "read" the storage differently, pointing internal/sd to different folders in the system folders.

Now I must say, although CM's way seems more logical, for now, I find MotoBlur more practical. I understand that there is a "Internal Storage only" option the CM7 settings but still, I'm having a lot of bugs with many apps.

Ex :

- With Titanium Backup, I HAVE to move my backup my "Titanium BackUp" folder on the SD Card. If I point the internal storage within the settings as the standard folder, the m***f*** will wipe the current folder of its content. Wasn't so happy when that I happen ("m***f***" explained !); thank god for online backups.

- Many apps that can't change the folders' direction won't be able to read any data from the current folder in the internal storage. I'll HAVE to move them.

- Many bugs in many apps such as PlayerPro. I always leave my Music on my SD. In Motorblur, I'll select only the "Music" folder from my SD and only the music from there will be shown. If I do the same in CM7 with the same set up, I'll keep seeing the music from ALL my sd card, not only my Music folder. Also, playback will stop on several tracks, saying that it can't be found anymore...

So is there a way to switch from CM to MotoBlur and vice versa without copying everything, breaking stuffs, etc. ?

Because honestly, it prevents me to really test CM7. I don't want to debate about which storage method, CM7 or MotoBLur, is the best, although I would only say that CM method is buggy and therefore, less pertinent, asking for way too many fixes...

I just want to know if there is any way to switch quickly with no bugs. If not, I'll stick with MotoBlur until CM9 is daily driver material...

Thanks !
[Atrix 4G Q&A, Help & Troubleshooting] turl1:
Did you ever read the FAQ? :confused:

https://code.google.com/p/atrix-dev-team/wiki/FAQ#SD_Card
[Atrix 4G Q&A, Help & Troubleshooting] live4nyy:
Have you tried switching to "internal storage" in the CM settings

right after

flashing the ROM and

before

installing any apps? Then reboot immediately? Maybe also select the "Install Location" option to use internal for when you do download TiBu.
[Atrix 4G Q&A, Help & Troubleshooting] slojko:
no because its hard to find what you are looking for.
[Atrix 4G Q&A, Help & Troubleshooting] DannyBiker:
I read it but you sir apparently didn't read my post !

live4nyy : Yup, it's the first thing I do. Activate that option then reboot.

Don't get me wrong : it is working. After the reboot, when I install Titanium Backup, the info on the app's main screen show the correct setup. It's just that it is buggy as hell with so many apps (see the op) it becomes a pain to use it.

I think the only way to make it work would be to start scratch : no titanium backup restore, no previous data, etc. But I'm a switcher and I sure won't start ALL over again every time I want to switch back to MotoBlur.

So my question would be : what do other frequent "switchers" between CM7/Blur do to avoid the many bugs ?
[Atrix 4G Q&A, Help & Troubleshooting] live4nyy:
I'm also wondering about the other part of my suggestion. Do you select "Internal" as your default app location? Where are the apps that have issues (including TiBu) being installed when you restore them?
[Atrix 4G Q&A, Help & Troubleshooting] DannyBiker:
I choose "Use Internal Location" but I don't select anything more...
[Atrix 4G Q&A, Help & Troubleshooting] live4nyy:
Well, my theory is, depending on where TiBu defaults to (eg. sd-card) when you install it might cause an issue when trying to access it's own files that are on the internal storage. So, depending on where TiBu is being installed might be the cause of the problem?? :confused:

This is just a total stab in the dark, btw.
[T-Mobile Samsung Galaxy S II SGH-T989] absdotan:
Well, I am quite confused as I read and searched this forum, but could not come with a exact answer. What is the best way to transfer my sms messages from my T-mobile Vibrant (Froyo 2.2.1) to T989 (Stock rooted KL1 rom).

Many Thanks
[T-Mobile Samsung Galaxy S II SGH-T989] Laazyboy:
Download SMS back up and restore app for your vibrant, back all your SMS. Then find the files on your phones directory (should be .XML) and put it on your comp. Download the same app on your gs2 and move the file to your gs2 and restore.
[T-Mobile Samsung Galaxy S II SGH-T989] AllGamer:
GO SMS also includes a backup/restore feature that is extremely easy to use
[T-Mobile Samsung Galaxy S II SGH-T989] xile6:
lways use mybackup pro
[Galaxy S I9000 Q&A, Help & Troubleshooting] Blacknoise:
Hi everyone,

I'm planning on flashing a (almost, it has root and is deodexed) stock JVT firmware over my current Darky's 10.2.2 install. In just wondering if I should use pit and repartition in Odin... I have searched the forum, but haven't been able to find a definitive answer.

Thanks
[Galaxy S I9000 Q&A, Help & Troubleshooting] TIGER 123:
dude check out http://www.youtube.com/watch?v=pKS6...xt=C32278e9UDOEgsToPDskJ4EFoZFY9s7oqRXMVWVvjL