Jump to content

Universal MVNO patch


Guest leromarinvit

Recommended Posts

Guest leromarinvit

Those of you using MVNOs (mobile virtual network operators, e.g. budget brands of big networks) probably know that you need to enable data roaming to get the data connection to work (unless specific RIL libs exist like for Saunalahti). This is quite annoying when you travel abroad, because you need to disable it manually to avoid expensive roaming bills.

CyanogenMod has a useful feature called "national roaming", which enables roaming to all providers in one's home country, while disabling it internationally. Unfortunately, such a thing doesn't exist in standard Android builds. Since I'm going to need it next week, I hacked framework.jar to work the same way as CyanogenMod's national roaming. I tested it with a foreign SIM and it does indeed work.

This should be compatible with the following ROMs:

  • Ginger Stir Fry
  • GingerLeak
  • Swedish Spring
  • Japanese Jellyfish
  • FLB Froyo

If you're using a ROM based on any of these, chances are it will work too, since the only relevant file is framework.jar. Trying it doesn't hurt, since it compares the MD5 checksum before changing anything. It also doesn't matter if your phone is Gen1 or Gen2. Porting this to other ROMs is a five minute job, so just ask me and I'll add them.

BIG FAT WARNING: In some countries (USA IIRC, maybe others), some operators let you roam onto their networks even at home. So don't install this unless you know you can safely (and need to, otherwise it's useless) enable roaming at home without incurring any additional costs!

Download here: http://www.multiupload.com/FJX94XCC13

You don't need to download the attachment to this post if you just want to use it.

If you're interested in how it works, I'm patching isRoamingBetweenOperators() in the GsmServiceStateTracker class to rely on the MCC only and ignore the carrier name. I've attached the patch so you can port it yourself using smali/baksmali.

framework_mvno_patch.zip

Link to comment
Share on other sites

Guest sambartle

Awesome work.. Useful in the UK for Orange and T-Mo users as they can share each others network now..

Another great post from leromarinvit after fixing the touch issues.. fancy a crack at the CM7 GPS Reboot issue? :)

Link to comment
Share on other sites

  • 3 months later...

On the previous Android version (v2.3.4) this patch corrected the MVNO issue flawlessly. Recently, ZTE has released Android v2.3.5 for their Blade / San Francisco devices. It performs very nicely I must say. Nevertheless, the MVNO issue has not been corrected. I've tried to install the MVNO Patch v1.0 and it's aborted during the process, I presume that it's incompatible with it. Will you release an updated version capable of dealing with v2.3.5? Thanks a lot !

Link to comment
Share on other sites

Hey! Thank you!!! That was quick! I applied the 'mvno-v3.zip' patch but it returned the following error:

Error: no matching framework found!

Therefore, I tried to install 'framework_mvno_patch.zip' you offered above but it aborted. I'm kinda stuck here.

Am I doing something wrong?

Thanks again!!

Link to comment
Share on other sites

Guest leromarinvit

Hmm, which 2.3.5 ROM are you using, and which add-ons if any? Theoretically it should work on LibraGinger, Moldovan Mile-High Mountain, and this "gen3" mod. But I didn't test the install package, I only checked that the framework patch itself still works on 2.3.5 (tried it with LibraGInger).

The only 2.3.5 ROM it shouldn't work on is the original image.bin version, since it's odexed and I've never messed with that particular beast before.

Link to comment
Share on other sites

Guest unrandomsam

Bull's eye! I'm afraid I'm using an original image.bin version, but I'm not quite sure. Is there an easy way to find that out? Thanks.

Check in /system/framework for odex files.

Link to comment
Share on other sites

Guest leromarinvit

Hi, There is no 'odex' files. All of the files ther are '.jar' files. The closest I could find is the file 'java.obex.jar'.

Regards

Then it doesn't look like you're using the original version. What does the Build Number in Settings -> Phone Info (or something similar) say?

Link to comment
Share on other sites

Model Number: ZTE-BLADE

Android Version: 2.3.5

Base Band Version: P729B01

Kernel Version: 2.6.35.7-perf+zte-kernel@Zdroid-SMT

Compilation Number: ZTE-BLADEV1.0.0B01

I hope this info be useful for you.

Thanks again

Link to comment
Share on other sites

Guest farris12

Can you make this for a MIUI ROM or teach me how to do it? I tried to do it myself, but I don't understand anything of the GsmServiceStateTracker.smali file and how to add my virtual provider.

Link to comment
Share on other sites

  • 1 month later...
Guest betaboxmd

  • Extract framework.jar from your Rom-Zip file, you will get Meta-inf folder, Classes.dex , Preloaded-classes


  • java –jar baksmali-1.2.8.jar –o out classes.dex
    -> new folder out


  • Open file out\android\internal\telephony\gsm\GSMServieTracker.smali with a text editor of your choice

  • 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



  • java –Xmx512M –jar smali-1.2.8.jar out\ -o newclasses.dex

  • rename newclasses.dex to classes.dex and
    replace the original classes.dex in your framework.jar with the new classes.dex

  • replace framwork.jar in your ROM-Zip file

Edited by betaboxmd
Link to comment
Share on other sites

Guest farris12

Sweet!!!!! I'm not roaming anymore!!!! I'm wondering if it switches to roaming when I travel abroad.. but this is good enough for me! Especially for Spotify.. it keeps nagging me that I was roaming.. I don't care ;)

But now it works!! Thanks!!

Link to comment
Share on other sites

  • 1 month later...
Guest farris12

I've made a .bat file to automate some of the command. The only thing you have to do is copy the framework.jar into the right folder, and replace the lines, the rest is done automatically. If there's any interest, I can post it here.

Link to comment
Share on other sites

Guest fortunados

WOuld it be possible to apply this patch to HTC desire with a cooked rom ?

I have looked everywhere about how to solve this problem mith MVNO but there is no way

When you say

Extract framework.jar from your Rom-Zip file

It is from the cooked rom zip file before install ??

It means that after that I have to reinstal the rom or to modify the patch ?

Thx

Link to comment
Share on other sites

Guest farris12

WOuld it be possible to apply this patch to HTC desire with a cooked rom ?

I have looked everywhere about how to solve this problem mith MVNO but there is no way

When you say

Extract framework.jar from your Rom-Zip file

It is from the cooked rom zip file before install ??

It means that after that I have to reinstal the rom or to modify the patch ?

Thx

Just get the framework.jar from the /system/framework folder once you have your ROM installed. It isn't neccessary to do it in advance.

Link to comment
Share on other sites

Guest fortunados

Just get the framework.jar from the /system/framework folder once you have your ROM installed. It isn't neccessary to do it in advance.

Y have taken the framework.jar from the cooked rom I have followed the steps but there is no internal folder inside out/android/.

There is a path \out\com\android\internal\telephony\gsm but then there is no GSMServieTracker.smali. I have founded a GSMServiceStateTRacker.smali but I cannot find the lines of code inside.

Also there is 3 more files in the path GSMServiceStateTRacker$1.smali GSMServiceStateTRacker$2.smali GSMServiceStateTRacker$3.smali but again I cannot find the lines inside.

I am talking about a HTC desire just to clear confusion, so I guess I will hace to stay with my Roaming, It´s a pain because I am living close to the border and sometimes is taking the foreign country network and giving my a nice extra charges on my bill.

Thanks anyway guys.

Link to comment
Share on other sites

Guest tmallafre

Sorry for my ignorance and my English, but what steps I need to do exactly? On my linux box, if I do

$ patch framework.jar frameworkmvno.diff

I get

patching framework jar file.

1 Hunk FAILED at 1,457.

1 out of 1 hunk FAILED--saving rejects to file framework.jar.rej

or with

$ patch classes.dex frameworkmvno.diff

a similar error.

And with

$ java –jar smali-1.2.8.jar –o out classes.dex

I get

Exception in thread main java.lang.NoClassDefFoundError:-jar

Caused by: java.lang.ClassNotFoundException:-jar

at java.net. URLClassLoader1. run (java URLClassLoader.: 217)

at Java.Security. AccessController. doPrivileged (Native Method)

at java.net. URLClassLoader. findClass (java URLClassLoader.: 205)

at java ClassLoader lang.. loadClass (java ClassLoader.: 321)

at sun. misc. LauncherAppClassLoader. loadClass (java Launcher.: 294)

at java ClassLoader lang.. loadClass (java ClassLoader.: 266)

Could not find the main class:-jar. Program will exit.

I have both files, baksmali-1.2.8.jar and smali-1.2.8.jar in the directory, and my Java version:

java version "1.6.0_23"

OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10)

OpenJDK Client VM (build 20.0-b11, mixed mode, sharing)

What should I do exactly?

If that is useful, my original framework .jar (MIUI 2.1.6, Desire S) is here:

http://dl.dropbox.co...6/framework.jar

Thank you very much.

Edited by tmallafre
Link to comment
Share on other sites

Guest farris12

Y have taken the framework.jar from the cooked rom I have followed the steps but there is no internal folder inside out/android/.

There is a path \out\com\android\internal\telephony\gsm but then there is no GSMServieTracker.smali. I have founded a GSMServiceStateTRacker.smali but I cannot find the lines of code inside.

Also there is 3 more files in the path GSMServiceStateTRacker$1.smali GSMServiceStateTRacker$2.smali GSMServiceStateTRacker$3.smali but again I cannot find the lines inside.

I am talking about a HTC desire just to clear confusion, so I guess I will hace to stay with my Roaming, It´s a pain because I am living close to the border and sometimes is taking the foreign country network and giving my a nice extra charges on my bill.

Thanks anyway guys.

Yes, it's true that the guide is a bit wrong. The .smali file is not at the location in the guide, but somewhere else. I will post a correct guide when I'm home.

Sorry for my ignorance and my English, but what steps I need to do exactly? On my linux box, if I do

don't know how you must do it on linux, the guide is for windows.

Edited by farris12
Link to comment
Share on other sites

Guest farris12

Y have taken the framework.jar from the cooked rom I have followed the steps but there is no internal folder inside out/android/.

There is a path \out\com\android\internal\telephony\gsm but then there is no GSMServieTracker.smali. I have founded a GSMServiceStateTRacker.smali but I cannot find the lines of code inside.

Also there is 3 more files in the path GSMServiceStateTRacker$1.smali GSMServiceStateTRacker$2.smali GSMServiceStateTRacker$3.smali but again I cannot find the lines inside.

I am talking about a HTC desire just to clear confusion, so I guess I will hace to stay with my Roaming, It´s a pain because I am living close to the border and sometimes is taking the foreign country network and giving my a nice extra charges on my bill.

Thanks anyway guys.

\out\com\android\internal\telephony\gsm\GsmServiceStateTracker.smali

This should be the correct path. The file is about 154kB, the line code that you need to replace starts at 476 (in my .smali file). Maybe you can check again? :)

Link to comment
Share on other sites

  • 4 weeks later...
Guest malfare

Those of you using MVNOs (mobile virtual network operators, e.g. budget brands of big networks) probably know that you need to enable data roaming to get the data connection to work (unless specific RIL libs exist like for Saunalahti). This is quite annoying when you travel abroad, because you need to disable it manually to avoid expensive roaming bills.

This should be compatible with the following ROMs:

  • Ginger Stir Fry
  • GingerLeak
  • Swedish Spring
  • Japanese Jellyfish
  • FLB Froyo

Porting this to other ROMs is a five minute job, so just ask me and I'll add them.

Is there / will there be one for Mile High Mountain Pie RLS9 ?

Regards

Manfred

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.