Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel 5.10 strange behaviour (Pixel 6a) #43

Open
iodn opened this issue Jan 15, 2023 · 15 comments
Open

Kernel 5.10 strange behaviour (Pixel 6a) #43

iodn opened this issue Jan 15, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@iodn
Copy link

iodn commented Jan 15, 2023

I have been using usb-gadget tool for a while on my Xiaomi 11 Lite (Kernel 4.14) and no problem.
But I recently purchased a Pixel 6a (kernel 5.10), /dev/hidg0 and /dev/hidg1 are present and enabled.

The strange thing is that when I execute a command on /dev/hidg0
e.g.

echo h i | ./hid-gadget /dev/hidg0 keyboard

The output is reflected on the mobile phone itself instead of the device that should be connected (PC or another device ..).

For /dev/hidg1 the output is "Success" but nothing happen, seems my PC does not recognize my phone as an HID device, unlike my other Xiaomi phone running under kernel 4.14

Do you have any idea why it behaves this way?

Logs

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/MouseKeyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in `ls -1 ./functions/`; do echo FUNCTIONS=$f; done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/MouseKeyboard/
CONFIG_PATH=/config/usb_gadget/MouseKeyboard//configs/c.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============
GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.adb
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
manufacturer=Google
product=Pixel 6a
serialnumber=2A466JWGX11679
=============

ROOT (stderr) - 
ROOT - Execute command: echo KERNEL_VERSION=`(uname -r |cut -d '-' -f1 )` && (gunzip -c /proc/config.gz | grep -i configfs | sed 's/# //; s/ is not set/=NOT_SET/')

ROOT (stdout) - KERNEL_VERSION=5.10.161
CONFIG_PCI_ENDPOINT_CONFIGFS=NOT_SET
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=NOT_SET
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=NOT_SET
CONFIG_USB_CONFIGFS_RNDIS=NOT_SET
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=NOT_SET
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_F_UAC1=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=NOT_SET
CONFIG_IIO_CONFIGFS=NOT_SET
CONFIG_CONFIGFS_FS=y

ROOT (stderr) - 
@iodn iodn changed the title Kernel 5.10 strange behaviour Kernel 5.10 strange behaviour (Pixel 6a) Jan 15, 2023
@tejado
Copy link
Owner

tejado commented Jan 16, 2023

Hi,

I don't have any phone with kernel 5.1 (yet), so I can't test it. I might try this on a Pi. I don't have any clue - sorry.
What is the value of getprop sys.usb.controller ?
What ROM are you using? Stock? And which release exactly? Then I can check if there is something new in the kernel.

Tjado

@iodn
Copy link
Author

iodn commented Jan 16, 2023

Okok I see, no problem.

What is the value of getprop sys.usb.controller ?

bluejay:/ # getprop sys.usb.controller
dummy_udc.0

What ROM are you using? Stock? And which release exactly? Then I can check if there is something new in the kernel.

Well I started with the official Google rom from this month (Jan. 2023, https://support.google.com/pixelphone/thread/195623748/google-pixel-update-january-2023?hl=en)

Then I realized that usb-gadget tool didn't work, so I installed a custom rom (GrapheneOS) (https://grapheneos.org/releases#bluejay-stable) thinking that I might have better luck but the result was the same.

I've also thought about downgrading the kernel to try, but I'm still not sure how to do this on Android and I need to do more research.

@tejado
Copy link
Owner

tejado commented Jan 16, 2023

What is the value of getprop sys.usb.controller ?

bluejay:/ # getprop sys.usb.controller
dummy_udc.0

This is a dummy USB controller and not the actual one. I guess this is the issue.
Can you look whats inside the directory /sys/class/udc and as well activate ADB and see what value the default USB gadget has, e.g. by executing the command 'cat /config/usb_gadget/*/UDC' ?

@iodn
Copy link
Author

iodn commented Jan 16, 2023

bluejay:/ # ls /sys/class/udc/
11110000.dwc3  dummy_udc.0
bluejay:/ # cat /sys/class/udc/dummy_udc.0/uevent
USB_UDC_NAME=dummy_udc
bluejay:/ # cat /config/usb_gadget/*/UDC
11110000.dwc3

@tejado
Copy link
Owner

tejado commented Jan 16, 2023

bluejay:/ # ls /sys/class/udc/
11110000.dwc3  dummy_udc.0
bluejay:/ # cat /sys/class/udc/dummy_udc.0/uevent
USB_UDC_NAME=dummy_udc
bluejay:/ # cat /config/usb_gadget/*/UDC
11110000.dwc3

Great, then use USB Gadget tool as usual. But if you want to activate the respective gadget, e.g. MouseKeyboard, please test the following:


echo "" > /config/usb_gadget/*/UDC
echo 11110000.dwc3 > /config/usb_gadget/MouseKeyboard/UDC

So I guess I need to adjust the controller detection in USB Gadget tool.

@tejado tejado added the bug Something isn't working label Jan 16, 2023
@iodn
Copy link
Author

iodn commented Jan 16, 2023

Hmm, every time I try to overwrite the /config/usb_gadget/MouseKeyboard/UDC file it comes back to the initial value dummy_udc.0

bluejay:/ # vim /config/usb_gadget/MouseKeyboard/UDC                                                                  
bluejay:/ # cat /config/usb_gadget/MouseKeyboard/UDC                                                                  
dummy_udc.0
bluejay:/ # echo 11110000.dwc3 > /config/usb_gadget/MouseKeyboard/UDC                                                 
1|bluejay:/ # cat /config/usb_gadget/MouseKeyboard/UDC                                                                
dummy_udc.0

@tejado
Copy link
Owner

tejado commented Jan 16, 2023

What about the other gadget, the default one? Does it still has 11110000.dwc3 in it? Can you also paste the kernel log (dmesg) if you are writing to UDC? Thanks.
Please paste these logs on pastebin - not directly here as it will otherwise too much text.

@iodn
Copy link
Author

iodn commented Jan 16, 2023

What about the other gadget, the default one? Does it still has 11110000.dwc3 in it?

bluejay:/ # echo 11110000.dwc3 > /config/usb_gadget/MouseKeyboard/UDC                                                 
1|bluejay:/ # cat /config/usb_gadget/MouseKeyboard/UDC                                                                
dummy_udc.0
bluejay:/ # cat /config/usb_gadget/g1/UDC                                                                             
11110000.dwc3

The file was too big for Pastebin (You have exceeded the maximum size of 512 kilobytes per Paste.), I uploaded it on controlc.com

https://controlc.com/cafc4b44

bluejay:/ # echo 11110000.dwc3 > /config/usb_gadget/MouseKeyboard/UDC
1|bluejay:/ # dmesg > dmesg.txt

@tejado
Copy link
Owner

tejado commented Jan 16, 2023

Thank you - can't see anything in the log which relates to this.
I will need to investigate - unfortunately, I don't have any device which this kernel.

If you can find out why this is happeing, it would be great.

@iodn
Copy link
Author

iodn commented Jan 17, 2023

Update, when I setprop ro.boot.usbcontroller and sys.usb.controller it seems to work and could overwrite the /config/usb_gadget/MouseKeyboard/UDC file but my computer still doesn't recognize the mobile phone as HID device and nothing happen when I try to execute some commands.

bluejay:/ # cat /config/usb_gadget/MouseKeyboard/UDC
dummy_udc.0
bluejay:/ # setprop ro.boot.usbcontroller 11110000.dwc3
bluejay:/ # setprop sys.usb.controller 11110000.dwc3
bluejay:/ # ##Re-enable MouseKeyboard gadget from the app
bluejay:/ # cat /config/usb_gadget/MouseKeyboard/UDC
11110000.dwc3

Screenshot_20230117-144519(2)

Another strange fact, if I load hid.keyboard directly from the gadget path by default /config/usb_gadget/g1/ it works halfway. For some reasons my windows machine still doesn't recognize the mobile phone as HID device but when I plugged it into my Linux box the HID payload I coded kind of work but all the characters are in uppercase and the special characters like slash / are replaced by interrogation marks ?.

@tejado
Copy link
Owner

tejado commented Jan 17, 2023

Okay, interessting. Thanks a lot for the information. I will hopefully get a device with such a Kernel in the next days, so I can look more into that.

Under Windows, do you get the same error in the Device Manager as the following issue? #42

If you are using hid-gadget tool, I can't help you there as I'm not using it. Try Authorizer.

@iodn
Copy link
Author

iodn commented Jan 17, 2023

Okay, interesting. Thanks a lot for the information. I will hopefully get a device with such a Kernel in the next days, so I can look more into that.

Oh so cool, that's good to hear then!

Under Windows, do you get the same error in the Device Manager as the following issue? #42

No, there is no error message, the phone is just not recognized at all by the computer when /usb_gadget/MouseKeyboard is enable.

If you are using hid-gadget tool, I can't help you there as I'm not using it. Try Authorizer.

Yes, I know but my test script works perfectly on two other phones, so it should also work in theory with the Pixel 6. But thanks for the info, I'll try Authorizer.

@SF73
Copy link

SF73 commented May 8, 2023

Hey, any news concerning this issue?
So far, it seems possible to edit the default gadget (g1) but not create one from scratch.

@tejado
Copy link
Owner

tejado commented May 15, 2023

Unfortunately not. I thought I'm going for the Pixel 7a instead of 6a. So will get it in the next days and then have a look into that issue.

@MikeDev101
Copy link

MikeDev101 commented Aug 21, 2023

Having a similar issue on the Pixel 6 (oriole). I edited the props as mentioned in #43 (comment) but I couldn't get any devices to detect USB HID mode.

EvolutionX 7.9.7 (Pinakbet) for Oriole

Kernel: 5.10.157-g58200e03a403-dirty #1 Wed Jun 21 04:29:47 EDT 2023

ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: echo "" > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: echo "" > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=dummy_udc.0
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: echo "" > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: echo "" > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
ROOT - Execute command: echo KERNEL_VERSION=`(uname -r |cut -d '-' -f1 )` && (gunzip -c /proc/config.gz | grep -i configfs | sed 's/# //; s/ is not set/=NOT_SET/')

ROOT (stdout) - KERNEL_VERSION=5.10.157
CONFIG_PCI_ENDPOINT_CONFIGFS=NOT_SET
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=NOT_SET
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=NOT_SET
CONFIG_USB_CONFIGFS_RNDIS=m
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=NOT_SET
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_DM=m
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_F_UAC1=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=NOT_SET
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=NOT_SET
CONFIG_USB_CONFIGFS_F_ETR_MIU=m
CONFIG_IIO_CONFIGFS=NOT_SET
CONFIG_CONFIGFS_FS=y

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/keyboard//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 
GadgetShellApi - Gadget Path is valid
ROOT - Execute command: find /config/usb_gadget/  -name UDC -type f -exec sh -c 'echo "" >  "$@"' _ {} \;

ROOT - Execute command: getprop sys.usb.controller > /config/usb_gadget/g1//UDC

ROOT (stdout) - 
ROOT (stderr) - 
ROOT - Execute command: for dir in /config/usb_gadget/*/; do echo GADGET_PATH=$dir; cd $dir/configs/; echo CONFIG_PATH="$dir/configs/`ls -1 | head -1`/"; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} \;; for f in ./functions/*/; do echo FUNCTIONS=$(basename $f); done; cd ./strings/0x409/; for vars in *; do echo ${vars}=$(cat $vars); done; echo "============="; done; 

ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
CONFIG_PATH=/config/usb_gadget/g1//configs/b.1/
UDC=11110000.dwc3
FUNCTIONS_ACTIVE=ffs.mtp
FUNCTIONS=accessory.gs2
FUNCTIONS=acm.gs6
FUNCTIONS=acm.uwb0
FUNCTIONS=audio_source.gs3
FUNCTIONS=dm.gs7
FUNCTIONS=etr_miu.gs11
FUNCTIONS=ffs.adb
FUNCTIONS=ffs.mtp
FUNCTIONS=ffs.ptp
FUNCTIONS=midi.gs5
FUNCTIONS=ncm.gs9
FUNCTIONS=rndis.gs4
manufacturer=Google
product=Pixel 6
serialnumber=1C181FDF6001BX
=============
GADGET_PATH=/config/usb_gadget/keyboard/
CONFIG_PATH=/config/usb_gadget/keyboard//configs/c.1/
UDC=
FUNCTIONS_ACTIVE=hid.mouse
FUNCTIONS_ACTIVE=hid.keyboard
FUNCTIONS=hid.keyboard
FUNCTIONS=hid.mouse
manufacturer=tejado
product=Android USB Gadget
serialnumber=42
=============

ROOT (stderr) - 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants