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

Switch from rusb to nusb #176

Closed
wgreenberg opened this issue Mar 19, 2025 · 5 comments
Closed

Switch from rusb to nusb #176

wgreenberg opened this issue Mar 19, 2025 · 5 comments
Assignees

Comments

@wgreenberg
Copy link
Collaborator

Per a tip from @m0veax, we might consider updating the serial script to use https://crates.io/crates/nusb instead of rusb since nusb is pure rust and doesn't depend on libusb.

@oopsbagel
Copy link
Contributor

I've started working on this.

@oopsbagel
Copy link
Contributor

oopsbagel commented Mar 20, 2025

It turns out this was very straightforward and I'm almost done. However, sending the equivalent of handle.write_control(0x40, 0xa0, 0, 0) caused the device to reboot but didn't seemingly change it out of "command" mode (I can still send AT+SYSCMD, for example, and the product ID didn't change back to 0xf626). I'm not familiar enough with USB/Android/Orbic/etc to know if there's something else I need to do on the device to get it back to its "out of the box" state.

@wgreenberg
Copy link
Collaborator Author

wgreenberg commented Mar 20, 2025

if you already have rootshell on the device, i've been using this to revert command mode:

adb shell '/bin/rootshell -c "echo 3 > /usrdata/mode.cfg"'
adb shell '/bin/rootshell -c reboot'

and then wait for it to reboot

@mujo-hash
Copy link

... sending the equivalent of handle.write_control(0x40, 0xa0, 0, 0) caused the device to reboot but didn't seemingly change it out of "command" mode (I can still send AT+SYSCMD, for example, and the product ID didn't change back to 0xf626). I'm not familiar enough with USB/Android/Orbic/etc to know if there's something else I need to do on the device to get it back to its "out of the box" state.

Sorry if I'm just adding noise, but I don't think that command is supposed to change it out of "command" mode.

When I repeat the ./install-linux.sh I see "Device already in command mode. Doing nothing...", implying the current behavior does not change it back to its "out of the box" state, right?

@oopsbagel
Copy link
Contributor

Correct, I was just blindly and very quickly using the hammer I had in front of me to see if sending 0xa0 or another message (like 0x00, etc) would change the user mode, rather than doing any real research. :) I wasn't expecting much, but it seemed worth the 60 seconds I spent on it.

@cooperq cooperq closed this as completed Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants