Skip to content

Commit b925dab

Browse files
committedJun 5, 2024
initial commit
0 parents  commit b925dab

20 files changed

+3660
-0
lines changed
 

‎.cargo/config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-pc-windows-msvc]
2+
rustflags = ["-Ctarget-feature=+crt-static"]
3+
4+
[target.i686-pc-windows-msvc]
5+
rustflags = ["-Ctarget-feature=+crt-static"]

‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
/build
3+
/bin
4+
.DS_Store

‎.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"reqwest"
4+
]
5+
}

‎Cargo.lock

+3,039
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
name = "tango_bridge_rs"
3+
description = "Tango ADB Desktop Application"
4+
version = "0.1.0"
5+
edition = "2021"
6+
build = "build.rs"
7+
8+
[package.metadata.winresource]
9+
ProductName = "Tango ADB"
10+
OriginalFilename = "tango-bridge.exe"
11+
LegalCopyright = "Copyright © 2024 Tango ADB"
12+
13+
[profile.release]
14+
strip = true
15+
lto = true
16+
17+
[dependencies]
18+
auto-launch = "0.5.0"
19+
open = "5.1.3"
20+
tao = "0.28.0"
21+
tray-icon = { version = "0.14.0", default-features = false, features = [] }
22+
tokio = { version = "1.37.0", features = ["full"] }
23+
warp = { version = "0.3.7", default-features = false, features = ["websocket"] }
24+
futures-util = "0.3.30"
25+
image = { version = "0.25.1", default-features = false, features = ["png"] }
26+
single-instance = "0.3.3"
27+
reqwest = { version = "0.12.4", features = ["stream"] }
28+
29+
[build-dependencies]
30+
winresource = "0.1"
31+
32+
[target."cfg(target_os = \"macos\")".dependencies]
33+
core-foundation = "0.9"

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020-2024 Tango ADB
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Tango Bridge
2+
3+
Tango Bridge is a system-tray application that can start ADB and forward connections to Tango Web App running in a browser.
4+
5+
An ADB executable for each platform is included.
6+
7+
## Build
8+
9+
### Prerequisites
10+
11+
- Rust
12+
13+
### Windows
14+
15+
Visual Studio is required to build the project.
16+
17+
```sh
18+
./build.ps1
19+
```
20+
21+
### macOS
22+
23+
1. Open `build.sh`
24+
2. Change `sdk_version` to the version of MacOS SDK installed on your system
25+
26+
```sh
27+
./build.sh
28+
```
29+
30+
### Linux
31+
32+
gtk3 and libappindicator3 are required to build the project.
33+
34+
Arch Linux / Manjaro:
35+
36+
```sh
37+
sudo pacman -S gtk3 libappindicator-gtk3
38+
```
39+
40+
Ubuntu / Debian:
41+
42+
```sh
43+
sudo apt install libgtk-3-dev libappindicator3-dev
44+
```
45+
46+
```sh
47+
cargo build --release
48+
```

‎adb/linux/adb

7.52 MB
Binary file not shown.

‎adb/win/AdbWinApi.dll

106 KB
Binary file not shown.

‎adb/win/AdbWinUsbApi.dll

71.8 KB
Binary file not shown.

‎adb/win/adb.exe

5.59 MB
Binary file not shown.

‎build.ps1

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rustup target add x86_64-pc-windows-msvc
2+
cargo build --target x86_64-pc-windows-msvc --release
3+
mkdir -Force bin\x86-64
4+
copy target\x86_64-pc-windows-msvc\release\tango_bridge_rs.exe bin\x86-64\tango-bridge.exe
5+
6+
rustup target add i686-pc-windows-msvc
7+
cargo build --target i686-pc-windows-msvc --release
8+
mkdir -Force bin\ia-32
9+
copy target\i686-pc-windows-msvc\release\tango_bridge_rs.exe bin\ia-32\tango-bridge.exe

‎build.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use winresource;
2+
3+
fn main() {
4+
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
5+
let mut res = winresource::WindowsResource::new();
6+
res.set_icon("tango.ico");
7+
res.compile().unwrap();
8+
}
9+
}

‎build.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# https://github.com/walles/riff/blob/master/release.sh
2+
3+
rm -rf bin/mac
4+
5+
archs="x86_64 aarch64"
6+
sdk_version="macosx12.3"
7+
for arch in $archs; do
8+
target="$arch-apple-darwin"
9+
rustup target add $target
10+
SDKROOT=$(xcrun -sdk $sdk_version --show-sdk-path) \
11+
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk $sdk_version --show-sdk-platform-version) \
12+
cargo build --target $target --release
13+
cp -r tango-bridge.app target/$target/release
14+
cp target/$target/release/tango_bridge_rs target/$target/release/tango-bridge.app/Contents/MacOS/tango-bridge
15+
mkdir -p bin/mac/$arch
16+
rm -f bin/mac/$arch/tango-bridge.zip
17+
pushd target/$target/release
18+
zip -r ../../../bin/mac/$arch/tango-bridge.zip tango-bridge.app
19+
popd
20+
done
21+
22+
mv bin/mac/x86_64 bin/mac/x86-64
23+
24+
arch="universal"
25+
mkdir -p target/$arch/release
26+
cp -r tango-bridge.app target/$arch/release
27+
lipo -create \
28+
-output target/$arch/release/tango-bridge.app/Contents/MacOS/tango-bridge \
29+
target/x86_64-apple-darwin/release/tango_bridge_rs \
30+
target/aarch64-apple-darwin/release/tango_bridge_rs
31+
mkdir -p bin/mac/$arch
32+
rm -f bin/mac/$arch/tango-bridge.zip
33+
pushd target/$arch/release
34+
zip -r ../../../bin/mac/$arch/tango-bridge.zip tango-bridge.app
35+
popd

‎src/main.rs

+418
Large diffs are not rendered by default.

‎tango-bridge.app/Contents/Info.plist

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDisplayName</key>
6+
<string>Tango ADB</string>
7+
<key>CFBundleExecutable</key>
8+
<string>tango-bridge</string>
9+
<key>CFBundleIconFile</key>
10+
<string>tango.icns</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>dev.tangoapp.desktop</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>Tango</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>0.1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>0.1.0</string>
23+
<key>LSApplicationCategoryType</key>
24+
<string>public.app-category.developer-tools</string>
25+
<key>LSMinimumSystemVersion</key>
26+
<string>10.13</string>
27+
<key>LSRequiresCarbon</key>
28+
<true />
29+
<key>NSHighResolutionCapable</key>
30+
<true />
31+
<key>NSHumanReadableCopyright</key>
32+
<string>Copyright (C) 2024 Tango ADB. All rights reserved</string>
33+
</dict>
34+
</plist>

‎tango-bridge.app/Contents/MacOS/adb

13 MB
Binary file not shown.
112 KB
Binary file not shown.

‎tango.ico

118 KB
Binary file not shown.

‎tango.png

10.9 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.