Search code examples
androidapache-commons-net

apache commons net with reverse tethering


I am trying to write android app which sends photos to FTP server. I use Appache-commons-net library to do so. When device uses Wi-Fi everything is fine, photos are uploaded to FTP server. But my customer wants this app to be able to do the same when Wi-Fi in app is turned off and device gets net from personal computer(Windows) connected to the device via USB cable. I was able to connect device using "gnirehtet":

https://medium.com/genymobile/gnirehtet-reverse-tethering-android-2afacdbdaec7

When I use gnirehtet my app uploads only firsth photo to FTP server and hangs on getting reply code at the end of "_storeFile" function in FTPClient class of AppacheCommonsNet. When I use WiFi everything is ok, the problem is only when I use reverse tethering. I checked other reverse thetering solutions and I met the same problem.

Does anybody knows why it happens? Or what I have to do to make it work?


Solution

  • I have contacted with gnirehtet library author, he made a fix yesterday. Everything now workas as should, all files are copied via USB connection using ApacheCommonsNet library.

    Fix is aviable on dev branch: https://github.com/Genymobile/gnirehtet/tree/dev