To create a procedure for enabling USB networking the "hard way", one can do the following:
prepare a file containing the commands, and place it somewhere like /sdcard/my_usbnetworking
The contents can be:
Code:
setprop sys.usb.config rndis
sleep 1
ifconfig rndis0 192.168.22.2
netcfg
Which mean: set the connection; wait a bit; set its address; show the results.
As root (through `su`), that above script can be placed in the system with the following commands, to be issued from a console:
Code:
mount -o rw,remount /system
cat /sdcard/my_usbnetworking > /system/bin/my_usbnetworking
chmod 755 /system/bin/my_usbnetworking
chown root.shell /system/bin/my_usbnetworking
mount -o ro,remount /system
Which mean: allow me to write in the system partition; copy that script above among the commands; make it executable; assign it to the correct owners; return protecting the system partition.
For those who suspect: issuing bad commands can be a way to brick your device.
Then, from a terminal, you can issue your new command `my_usbnetworking` to set the connection and assign an address to the device.
This is what I used up to now - all considered, the application published above is probably more comfortable.
Disclaimer: no responsibility whatsoever may hit any molecule one mile away from these typing fingers, etc.