Android USB反向网络共享:如何欺骗应用程序

时间:2022-08-07 16:10:51

USB reverse tethering = Cellphone gets network connection from PC via USB.

USB反向网络共享=手机通过USB从PC获得网络连接。

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:

我知道如何进行USB反向网络共享除了一个问题:许多Android应用程序将在执行任何有用的工作之前使用以下代码检查网络连接:

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.

问题是,当使用USB反向网络共享时,上面的代码将报告没有网络连接。但是,有一个网络连接(这是USB反向网络共享本身),ping,wget和所有不执行此愚蠢检查的程序运行良好。

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.

BTW。我使用Cyanogenmod 7.也欢迎任何特定于此MOD的解决方案。

3 个解决方案

#1


3  

This is probably what you're looking for
http://blog.mathieu.carbou.me/post/60454997009/reverse-usb-tethering-with-android-22

这可能就是你要找的http://blog.mathieu.carbou.me/post/60454997009/reverse-usb-tethering-with-android-22

There is also this project:
http://www.codeproject.com/kb/android/usbportforwarding.aspx

还有这个项目:http://www.codeproject.com/kb/android/usbportforwarding.aspx

And also an app on the Android market (paid, with free trial):
https://market.android.com/details?id=com.littlelan.ReverseTether.Trial

还有Android市场上的应用程序(付费,免费试用):https://market.android.com/details?id = com.littlelan.ReverseTether.Trial

#2


1  

If you are doing this much hacking I am assuming that you will probably have your device rooted. If so program a shell interface to send commands to the device shell with JNI and receive STDOUT. Use this interface to run a netcfg command that can be parsed into an array - this will give you all the details the API hides. It also allows you to override Androids device settings using the ipconfig command.

如果你正在做这么多的黑客行为我假设你可能会让你的设备生根。如果是这样,编写一个shell接口,用JNI向设备shell发送命令并接收STDOUT。使用此接口运行可以解析为数组的netcfg命令 - 这将为您提供API隐藏的所有详细信息。它还允许您使用ipconfig命令覆盖Androids设备设置。

As far as using this to send and receive from your device - in my experience - you will have to probably compile a device specif module that can be loaded into the kernel at run time. Or just download the kernel from the manufacturer and compile the module into the kernel and then flash the phone with the new custom kernel.

至于使用它来发送和接收你的设备 - 根据我的经验 - 你可能必须编译一个可以在运行时加载到内核的设备指定模块。或者只是从制造商处下载内核并将模块编译到内核中,然后使用新的自定义内核刷新手机。

Hope this helps.

希望这可以帮助。

#3


1  

To do this , you have to download ReverseTethering_3.19.zip file (Google it to find the link.) Extract to your desired location.

为此,您必须下载ReverseTethering_3.19.zip文件(Google才能找到该链接。)提取到您想要的位置。

Prerequisite: -

先决条件: -

  1. only rooted phones work.
  2. 只有root电话才有效。
  3. USB debugging should be enabled.
  4. 应启用USB调试。

Now connect your rooted android mobile to PC through USB cable.Wait for PC to recognize your mobile. Now open the extracted zip file and open AndroidTool.exe with admin rights.

现在通过USB线将您的root用户手机连接到PC。等待PC识别你的手机。现在打开解压缩的zip文件并使用管理员权限打开AndroidTool.exe。

Now click connect in the android tool.

现在点击android工具中的connect。

Now it tries to connect and installs USB tunneling apk on your device.It also asks for super user rights . Grant it.

现在它尝试在您的设备上连接并安装USB隧道apk。它还要求超级用户权限。授予它。

Finally after successfully establishing the connection, you will see. https://drive.google.com/file/d/0B11p07T8VxhNNUdIM3gtTFR4N3M/view?usp=sharing (Sorry, I cant upload image.)

最后,在成功建立连接后,您将看到。 https://drive.google.com/file/d/0B11p07T8VxhNNUdIM3gtTFR4N3M/view?usp=sharing(抱歉,我无法上传图片。)

Now you get the internet on your mobile and usb tunneling app is installed.But you can access only HTTP connections(i.e;) works only in chrome. Play store apps may not work.

现在你在手机上安装了互联网,并安装了usb隧道应用程序。但是你只能访问HTTP连接(即;)只能在chrome中使用。 Play商店应用可能无法使用。

So you have to fool apps and make it believe that either is mobile is connected to WiFi or mobile data . Only then apps work.

所以你必须欺骗应用程序并让它相信移动设备连接到WiFi或移动数据。只有这样才能运行。

So you have to go to Tools menu in Android tool. https://drive.google.com/file/d/0B11p07T8VxhNRXR3aTVUZUl1dVk/view?usp=sharing

因此,您必须转到Android工具中的“工具”菜单。 https://drive.google.com/file/d/0B11p07T8VxhNRXR3aTVUZUl1dVk/view?usp=sharing

Now install hack(optional).It installs Xposed framework and installs hack connectivity apk. Just follow the instructions , it is easy. Hack connectivity makes the apps believe that mobile is connected to WiFi or mobile data depending on which type of hack u did after installing Hack connectivity. Finally after hacking ,it asks for reboot. After reboot , you can enjoy internet using USB reverse tethering on all apps.

现在安装hack(可选)。它安装Xposed框架并安装hack connectivity apk。只需按照说明操作即可。黑客连接使应用程序相信移动设备连接到WiFi或移动数据,具体取决于安装Hack连接后您执行的黑客操作类型。最后,在黑客入侵后,它要求重新启动。重启后,您可以在所有应用程序上使用USB反向网络共享来享受互联网。

#1


3  

This is probably what you're looking for
http://blog.mathieu.carbou.me/post/60454997009/reverse-usb-tethering-with-android-22

这可能就是你要找的http://blog.mathieu.carbou.me/post/60454997009/reverse-usb-tethering-with-android-22

There is also this project:
http://www.codeproject.com/kb/android/usbportforwarding.aspx

还有这个项目:http://www.codeproject.com/kb/android/usbportforwarding.aspx

And also an app on the Android market (paid, with free trial):
https://market.android.com/details?id=com.littlelan.ReverseTether.Trial

还有Android市场上的应用程序(付费,免费试用):https://market.android.com/details?id = com.littlelan.ReverseTether.Trial

#2


1  

If you are doing this much hacking I am assuming that you will probably have your device rooted. If so program a shell interface to send commands to the device shell with JNI and receive STDOUT. Use this interface to run a netcfg command that can be parsed into an array - this will give you all the details the API hides. It also allows you to override Androids device settings using the ipconfig command.

如果你正在做这么多的黑客行为我假设你可能会让你的设备生根。如果是这样,编写一个shell接口,用JNI向设备shell发送命令并接收STDOUT。使用此接口运行可以解析为数组的netcfg命令 - 这将为您提供API隐藏的所有详细信息。它还允许您使用ipconfig命令覆盖Androids设备设置。

As far as using this to send and receive from your device - in my experience - you will have to probably compile a device specif module that can be loaded into the kernel at run time. Or just download the kernel from the manufacturer and compile the module into the kernel and then flash the phone with the new custom kernel.

至于使用它来发送和接收你的设备 - 根据我的经验 - 你可能必须编译一个可以在运行时加载到内核的设备指定模块。或者只是从制造商处下载内核并将模块编译到内核中,然后使用新的自定义内核刷新手机。

Hope this helps.

希望这可以帮助。

#3


1  

To do this , you have to download ReverseTethering_3.19.zip file (Google it to find the link.) Extract to your desired location.

为此,您必须下载ReverseTethering_3.19.zip文件(Google才能找到该链接。)提取到您想要的位置。

Prerequisite: -

先决条件: -

  1. only rooted phones work.
  2. 只有root电话才有效。
  3. USB debugging should be enabled.
  4. 应启用USB调试。

Now connect your rooted android mobile to PC through USB cable.Wait for PC to recognize your mobile. Now open the extracted zip file and open AndroidTool.exe with admin rights.

现在通过USB线将您的root用户手机连接到PC。等待PC识别你的手机。现在打开解压缩的zip文件并使用管理员权限打开AndroidTool.exe。

Now click connect in the android tool.

现在点击android工具中的connect。

Now it tries to connect and installs USB tunneling apk on your device.It also asks for super user rights . Grant it.

现在它尝试在您的设备上连接并安装USB隧道apk。它还要求超级用户权限。授予它。

Finally after successfully establishing the connection, you will see. https://drive.google.com/file/d/0B11p07T8VxhNNUdIM3gtTFR4N3M/view?usp=sharing (Sorry, I cant upload image.)

最后,在成功建立连接后,您将看到。 https://drive.google.com/file/d/0B11p07T8VxhNNUdIM3gtTFR4N3M/view?usp=sharing(抱歉,我无法上传图片。)

Now you get the internet on your mobile and usb tunneling app is installed.But you can access only HTTP connections(i.e;) works only in chrome. Play store apps may not work.

现在你在手机上安装了互联网,并安装了usb隧道应用程序。但是你只能访问HTTP连接(即;)只能在chrome中使用。 Play商店应用可能无法使用。

So you have to fool apps and make it believe that either is mobile is connected to WiFi or mobile data . Only then apps work.

所以你必须欺骗应用程序并让它相信移动设备连接到WiFi或移动数据。只有这样才能运行。

So you have to go to Tools menu in Android tool. https://drive.google.com/file/d/0B11p07T8VxhNRXR3aTVUZUl1dVk/view?usp=sharing

因此,您必须转到Android工具中的“工具”菜单。 https://drive.google.com/file/d/0B11p07T8VxhNRXR3aTVUZUl1dVk/view?usp=sharing

Now install hack(optional).It installs Xposed framework and installs hack connectivity apk. Just follow the instructions , it is easy. Hack connectivity makes the apps believe that mobile is connected to WiFi or mobile data depending on which type of hack u did after installing Hack connectivity. Finally after hacking ,it asks for reboot. After reboot , you can enjoy internet using USB reverse tethering on all apps.

现在安装hack(可选)。它安装Xposed框架并安装hack connectivity apk。只需按照说明操作即可。黑客连接使应用程序相信移动设备连接到WiFi或移动数据,具体取决于安装Hack连接后您执行的黑客操作类型。最后,在黑客入侵后,它要求重新启动。重启后,您可以在所有应用程序上使用USB反向网络共享来享受互联网。