Android USB reverse tethering: How to fool the apps USB reverse tethering = Cellphone gets network connection from PC via USB.

I know how to do USB reverse tethering except for one problem: Many Android apps will check network connection using the code below before doing any useful work:

ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = connectivityManager.getActiveNetworkInfo();


The problem is that, when using USB reverse tethering, the above code will report no network connection. However, there IS a network connection (which is the USB reverse tethering itself), and ping, wget and all programs not doing this stupid check work well.

So the question is: How can I hack the system to let this network connection check return success (so that I can fool these apps)?

BTW. I use Cyanogenmod 7. And any solution specific to this MOD is also welcome.
I'd say that there are only Mod specific solutions. Nearly every App that I know uses this Android API, and therefore the code snipped in your questions, for network connectivity checks.

One would need to change the Cyanogen source so that the OS (Android+Cyanogen) is aware of the USB reverse tethering network connectivity and returns the right information to app requesting the current network state. I don't believe that this can be done with some artificial layer between the API and the app that "fools" the app into this. It's more realistic that Cyanogen implements the handling of reverse tethering by imitating an active WiFi connection. You should ask them to address this topic.
Maybe in the future Android has official support for reverse tethering. :)