View Single Post
Old 05-26-2017, 06:19 PM   #100
mdp
Wizard
mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.mdp ought to be getting tired of karma fortunes by now.
 
Posts: 1,481
Karma: 9010563
Join Date: Jul 2013
Device: none
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.

Last edited by mdp; 05-27-2017 at 02:34 AM.
mdp is offline   Reply With Quote