blob: beca353e671cf69e18188defef5a417d2a50e8db [file] [log] [blame]
Patrick Williamsddad1a12017-02-23 20:36:32 -06001#!/bin/sh
2
Brad Bishop34ae6002019-04-08 15:21:03 -04003[ ! -e /dev/pts ] && mkdir -p /dev/pts
4[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts
5
Patrick Williamsddad1a12017-02-23 20:36:32 -06006# TODO enable the lines below once we have support for getprop
7# retrieve the product info from Android
8# manufacturer=$(getprop ro.product.manufacturer Android)
9# model=$(getprop ro.product.model Android)
10# serial=$(getprop ro.serialno 0123456789ABCDEF)
11
12manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
13model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
14# get the device serial number from /proc/cmdline directly(since we have no getprop on
15# GNU/Linux)
16serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
17
18echo $serial > /sys/class/android_usb/android0/iSerial
19echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
20echo $model > /sys/class/android_usb/android0/iProduct
21
22echo "0" > /sys/class/android_usb/android0/enable
Brad Bishop34ae6002019-04-08 15:21:03 -040023echo "18d1" > /sys/class/android_usb/android0/idVendor
Patrick Williamsddad1a12017-02-23 20:36:32 -060024echo "D002" > /sys/class/android_usb/android0/idProduct
25echo "adb" > /sys/class/android_usb/android0/functions
26echo "1" > /sys/class/android_usb/android0/enable
27
28sleep 4