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

wip: integrate adb port forwarding #2451

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a48a16a
Add package
E1int Oct 8, 2024
95f563f
Add device listing
E1int Oct 8, 2024
eb9acaf
Remove unneeded derives
E1int Oct 9, 2024
68099b8
Force installation path
E1int Oct 9, 2024
bb3794f
Replace reqwest with ureq
E1int Oct 10, 2024
b811fca
Improve device parsing
E1int Oct 10, 2024
fe44f5a
Fix link
E1int Oct 10, 2024
73197c8
Refactor
E1int Oct 11, 2024
5bf61e6
Specify device serial number
E1int Oct 11, 2024
0a90ec1
Update lock
E1int Oct 11, 2024
23abc86
Enable alvr_adb workspace
E1int Oct 11, 2024
a5f7c30
Increase download request timeout
E1int Oct 11, 2024
5ae1cae
Add first rough implementation
E1int Oct 11, 2024
1014001
Remove use of generics
E1int Oct 12, 2024
db83ca8
Remove use of `formatcp!`
E1int Oct 12, 2024
e5645c1
Use `exec_fname`
E1int Oct 12, 2024
86746c2
Update lock
E1int Oct 12, 2024
04df281
Move port forwarding logic to adb crate
E1int Oct 13, 2024
59d2967
Skip local devices
E1int Oct 13, 2024
df972b5
Ignore first line of device list
E1int Oct 13, 2024
c40c723
Fix forwarding
E1int Oct 13, 2024
133a76a
Add download progress callback
E1int Oct 13, 2024
d2f6cfe
Use anyhow
E1int Oct 14, 2024
f8c6bf8
Add context to forwarding errors
E1int Oct 14, 2024
863ab09
Move setup logic
E1int Oct 14, 2024
86d5abe
More context
E1int Oct 14, 2024
1f1a92c
Add more ADB functions
E1int Oct 14, 2024
c841d1a
Don't show console
E1int Oct 15, 2024
2c3a99c
Update lock
E1int Oct 15, 2024
1791827
Set read timeout for download
E1int Oct 15, 2024
e644b0c
Install ADB in executables directory
E1int Oct 15, 2024
bdfe213
Use filesystem layout to get paths
E1int Oct 15, 2024
34e9f70
Use correct ports
E1int Oct 17, 2024
6196b38
Add wired toggle
E1int Oct 17, 2024
d414a29
Don't use option
E1int Oct 20, 2024
cb56227
Remove unused imports
E1int Oct 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 63 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 32 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
[workspace]
resolver = "2"
members = ["alvr/*"]

[workspace.package]
version = "21.0.0-dev01"
edition = "2021"
rust-version = "1.77"
authors = ["alvr-org"]
license = "MIT"

[workspace.dependencies]
alvr_audio = { path = "alvr/audio" }
alvr_client_core = { path = "alvr/client_core" }
alvr_common = { path = "alvr/common" }
alvr_events = { path = "alvr/events" }
alvr_filesystem = { path = "alvr/filesystem" }
alvr_gui_common = { path = "alvr/gui_common" }
alvr_packets = { path = "alvr/packets" }
alvr_server_core = { path = "alvr/server_core"}
alvr_server_io = { path = "alvr/server_io" }
alvr_session = { path = "alvr/session" }
alvr_sockets = { path = "alvr/sockets" }

[profile.release]
debug = "limited"
strip = false

[profile.distribution]
inherits = "release"
lto = true
[workspace]
resolver = "2"
members = ["alvr/*"]

[workspace.package]
version = "21.0.0-dev01"
edition = "2021"
rust-version = "1.77"
authors = ["alvr-org"]
license = "MIT"

[workspace.dependencies]
alvr_adb = { path = "alvr/adb" }
alvr_audio = { path = "alvr/audio" }
alvr_client_core = { path = "alvr/client_core" }
alvr_common = { path = "alvr/common" }
alvr_events = { path = "alvr/events" }
alvr_filesystem = { path = "alvr/filesystem" }
alvr_gui_common = { path = "alvr/gui_common" }
alvr_packets = { path = "alvr/packets" }
alvr_server_core = { path = "alvr/server_core"}
alvr_server_io = { path = "alvr/server_io" }
alvr_session = { path = "alvr/session" }
alvr_sockets = { path = "alvr/sockets" }

[profile.release]
debug = "limited"
strip = false

[profile.distribution]
inherits = "release"
lto = true
16 changes: 16 additions & 0 deletions alvr/adb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "alvr_adb"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true

[dependencies]
alvr_common.workspace = true
alvr_filesystem.workspace = true
alvr_server_io.workspace = true

anyhow = "1"
ureq = "2.10"
zip = "2"
33 changes: 33 additions & 0 deletions alvr/adb/src/connection_state.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// https://cs.android.com/android/platform/superproject/main/+/7dbe542b9a93fb3cee6c528e16e2d02a26da7cc0:packages/modules/adb/adb.h;l=104-122
#[derive(Debug)]
pub enum ConnectionState {
Authorizing,
Bootloader,
Connecting,
Detached,
Device,
Host,
NoPermissions, // https://cs.android.com/android/platform/superproject/main/+/main:system/core/diagnose_usb/diagnose_usb.cpp;l=83-90
Offline,
Recovery,
Rescue,
Sideload,
Unauthorized,
}

pub fn parse(value: &str) -> Option<ConnectionState> {
match value {
"authorizing" => Some(ConnectionState::Authorizing),
"bootloader" => Some(ConnectionState::Bootloader),
"connecting" => Some(ConnectionState::Connecting),
"detached" => Some(ConnectionState::Detached),
"device" => Some(ConnectionState::Device),
"host" => Some(ConnectionState::Host),
"offline" => Some(ConnectionState::Offline),
"recovery" => Some(ConnectionState::Recovery),
"rescue" => Some(ConnectionState::Rescue),
"sideload" => Some(ConnectionState::Sideload),
"unauthorized" => Some(ConnectionState::Unauthorized),
_ => None,
}
}
Loading
Loading