Skip to content

Allow use of the native Android Debug Bridge#53

Open
DanTheMan827 wants to merge 18 commits into
Lauriethefish:mainfrom
DanTheMan827:adb-websocket
Open

Allow use of the native Android Debug Bridge#53
DanTheMan827 wants to merge 18 commits into
Lauriethefish:mainfrom
DanTheMan827:adb-websocket

Conversation

@DanTheMan827
Copy link
Copy Markdown
Contributor

@DanTheMan827 DanTheMan827 commented Mar 16, 2025

This allows the website to connect to the local adb server through a websocket proxy

https://github.com/dantheman827/mbf-bridge/

@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 13 times, most recently from 7d55d8f to 81de910 Compare March 24, 2025 22:02
@Lauriethefish
Copy link
Copy Markdown
Owner

Is there a reason this PR includes making the agent support any app ID? I'd probably prefer this to be in a different PR, esp. given that the implementation of it here isn't ideal. (i.e. would prefer not to use a command line arg for the agent and would also prefer not having a bunch of different oncelocks for each static path)

@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 4 times, most recently from f33d8a4 to 0d9e605 Compare March 29, 2025 19:35
@DanTheMan827 DanTheMan827 marked this pull request as ready for review March 29, 2025 19:37
@DanTheMan827
Copy link
Copy Markdown
Contributor Author

DanTheMan827 commented Mar 29, 2025

I removed the commit to change the game id of the agent from this branch, but I would like to add it at some point as a dev option at least (I have two BS installs as an example)

@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 2 times, most recently from 43b079c to 400d02c Compare March 29, 2025 22:50
@DanTheMan827 DanTheMan827 changed the title Allow use of an adb bridge Allow use of the native Android Debug Bridge Mar 29, 2025
@DanTheMan827 DanTheMan827 mentioned this pull request Apr 3, 2025
Comment thread mbf-site/src/AdbServerWebSocketConnector.ts Outdated
Comment thread mbf-site/src/AdbServerWebSocketConnector.ts
Comment thread mbf-site/src/Agent.ts Outdated
Comment thread mbf-site/src/App.tsx
Comment thread mbf-site/package.json Outdated
@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 2 times, most recently from 02c2b40 to 706bc87 Compare April 15, 2025 18:14
@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 3 times, most recently from 9d0abda to 45e24da Compare July 24, 2025 15:19
@Lauriethefish
Copy link
Copy Markdown
Owner

Conflicts need resolving again

@DanTheMan827 DanTheMan827 force-pushed the adb-websocket branch 4 times, most recently from c2384c4 to ae4df3c Compare September 3, 2025 22:19
@DanTheMan827
Copy link
Copy Markdown
Contributor Author

I’ve merged the head, and it doesn’t fail to build… but I don’t know if it functions.

This allows the website to connect to the local adb server through a websocket proxy
- Moved "@yume-chan/stream-extra" from devDependencies to dependencies
- Enhanced WebSocket error handling with logging
- Log errors during stream close in WebSocketConnection
- Removed unneccesary AGENT_SHA1 empty check
- Removed DeviceStore and SyncStore, consolidating their functionality into a new context-based approach.
- Introduce DeviceConnector and BridgeManager hooks to manage device connections and bridge interactions.
- Updated ModManager, OptionsMenu, and other components to utilize the new context for device management.
- Refactor operation modals to use a new context-based approach.
- Add a missing key in the ChooseDevice component.
This uses a custom `__mbfBridge` window object injected by a wrapper app to connect to the native adb server running on the device.
@DanTheMan827
Copy link
Copy Markdown
Contributor Author

@Lauriethefish I’ve abstracted the ADB connector logic, and also added support for a global __mbfBridge object that can be implemented by apps (and potentially even browser extensions) to allow for connection to the ADB server on the host machine without needing to create a web socket.

I’ve kept the web socket connector in this branch, but it could just as well be removed. The factory method allows for multiple potential connectors (or just one)

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

Successfully merging this pull request may close these issues.

3 participants