blob: f7d9973722ae6bab3818e3dd8b59cba284a396db [file] [log] [blame]
Patrick Williamsddad1a12017-02-23 20:36:32 -06001#!/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
9manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
10model="$(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)
13serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
14
15echo $serial > /sys/class/android_usb/android0/iSerial
16echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
17echo $model > /sys/class/android_usb/android0/iProduct
18
19echo "0" > /sys/class/android_usb/android0/enable
20echo "18d1" > /sys/class/android_usbid_usb/android0/idVendor
21echo "D002" > /sys/class/android_usb/android0/idProduct
22echo "adb" > /sys/class/android_usb/android0/functions
23echo "1" > /sys/class/android_usb/android0/enable
24
25sleep 4