Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # TODO enable the lines below once we have support for getprop |
| 4 | # retrieve the product info from Android |
| 5 | # manufacturer=$(getprop ro.product.manufacturer Android) |
| 6 | # model=$(getprop ro.product.model Android) |
| 7 | # serial=$(getprop ro.serialno 0123456789ABCDEF) |
| 8 | |
| 9 | manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)" |
| 10 | model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)" |
| 11 | # get the device serial number from /proc/cmdline directly(since we have no getprop on |
| 12 | # GNU/Linux) |
| 13 | serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')" |
| 14 | |
| 15 | echo $serial > /sys/class/android_usb/android0/iSerial |
| 16 | echo $manufacturer > /sys/class/android_usb/android0/iManufacturer |
| 17 | echo $model > /sys/class/android_usb/android0/iProduct |
| 18 | |
| 19 | echo "0" > /sys/class/android_usb/android0/enable |
| 20 | echo "18d1" > /sys/class/android_usbid_usb/android0/idVendor |
| 21 | echo "D002" > /sys/class/android_usb/android0/idProduct |
| 22 | echo "adb" > /sys/class/android_usb/android0/functions |
| 23 | echo "1" > /sys/class/android_usb/android0/enable |
| 24 | |
| 25 | sleep 4 |