adb-webui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +131 -0
- package/bin/adb-web.js +101 -0
- package/index.html +1132 -0
- package/package.json +49 -0
- package/server.js +279 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sonys
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# π± adb-web
|
|
4
|
+
|
|
5
|
+
**A beautiful, browser-based ADB APK installer and Android device manager.**
|
|
6
|
+
No Electron. No heavy desktop app. Just Node.js + a browser.
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/adb-web)
|
|
9
|
+
[](https://www.npmjs.com/package/adb-web)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
[](CONTRIBUTING.md)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## β¨ Features
|
|
19
|
+
|
|
20
|
+
- π¦ **Drag & drop APK installer** β drop your `.apk` and install in one click
|
|
21
|
+
- π± **Auto device detection** β lists all connected ADB devices, auto-refreshes
|
|
22
|
+
- π΄ **Live log console** β real-time WebSocket output from ADB
|
|
23
|
+
- ποΈ **Package manager** β list, search, and uninstall installed apps
|
|
24
|
+
- β‘ **Quick actions** β reboot, recovery, bootloader, logcat, kill/start server
|
|
25
|
+
- β
**Confirm prompts** β animated modal before every destructive action
|
|
26
|
+
- βοΈ **Configurable ADB path** β works even if ADB is not in your system PATH
|
|
27
|
+
- π **Dark UI** β premium glassmorphism design, fully responsive
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## π Quick Start
|
|
32
|
+
|
|
33
|
+
### β‘ Run instantly with npx (no install needed)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx adb-web
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### π¦ Install globally
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g adb-web
|
|
43
|
+
adb-web
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### π οΈ Clone & run manually
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/shubhamsoni24/adb-web.git
|
|
50
|
+
cd adb-web
|
|
51
|
+
npm install
|
|
52
|
+
npm start
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then open **http://localhost:3737** in your browser.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## π± Enable USB Debugging on Your Phone
|
|
61
|
+
|
|
62
|
+
1. **Settings** β **About Phone** β tap **Build Number** 7 times
|
|
63
|
+
2. **Settings** β **Developer Options** β enable **USB Debugging**
|
|
64
|
+
3. Connect phone via USB cable
|
|
65
|
+
4. Accept the **"Allow USB Debugging?"** prompt on your phone
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## βοΈ Configure ADB Path
|
|
70
|
+
|
|
71
|
+
If `adb` is not in your system PATH, go to the **βοΈ Settings** tab in the app and set the full path:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
C:\platform-tools\adb.exe # Windows
|
|
75
|
+
/usr/local/bin/adb # macOS/Linux
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## πΌοΈ Screenshot
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## π Project Structure
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
adb-web/
|
|
90
|
+
βββ server.js # Express + WebSocket backend, ADB integration
|
|
91
|
+
βββ index.html # Full frontend (vanilla HTML/CSS/JS)
|
|
92
|
+
βββ package.json
|
|
93
|
+
βββ .gitignore
|
|
94
|
+
βββ LICENSE
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## π Security Notes
|
|
100
|
+
|
|
101
|
+
- ADB shell commands are **whitelisted** β only safe read-only commands are allowed via the UI
|
|
102
|
+
- Uploaded APKs are stored **locally only** on your machine
|
|
103
|
+
- The server binds to `localhost` only by default β not exposed to the network
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## π€ Contributing
|
|
108
|
+
|
|
109
|
+
Contributions, issues and feature requests are welcome!
|
|
110
|
+
|
|
111
|
+
1. Fork the repo
|
|
112
|
+
2. Create your feature branch: `git checkout -b feature/my-feature`
|
|
113
|
+
3. Commit your changes: `git commit -m 'Add my feature'`
|
|
114
|
+
4. Push to the branch: `git push origin feature/my-feature`
|
|
115
|
+
5. Open a Pull Request
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## π‘ Roadmap
|
|
120
|
+
|
|
121
|
+
- [ ] Batch APK installation (multiple files)
|
|
122
|
+
- [ ] Screenshot & screen recording support
|
|
123
|
+
- [ ] File push/pull from device storage
|
|
124
|
+
- [ ] Wireless ADB (connect over Wi-Fi)
|
|
125
|
+
- [ ] Dark/light theme toggle
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## π License
|
|
130
|
+
|
|
131
|
+
[MIT](LICENSE) Β© 2026 sonys
|
package/bin/adb-web.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const { spawn, exec } = require('child_process');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const net = require('net');
|
|
8
|
+
|
|
9
|
+
// ββ Colours ββββββββββββββββββββββββββββββββββββββββββββββ
|
|
10
|
+
const c = {
|
|
11
|
+
reset: '\x1b[0m',
|
|
12
|
+
bold: '\x1b[1m',
|
|
13
|
+
dim: '\x1b[2m',
|
|
14
|
+
green: '\x1b[32m',
|
|
15
|
+
cyan: '\x1b[36m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
magenta:'\x1b[35m',
|
|
18
|
+
red: '\x1b[31m',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function banner(port) {
|
|
22
|
+
console.log('');
|
|
23
|
+
console.log(`${c.magenta}${c.bold} βββββββββββββββββββββββββββββββββββββββββ${c.reset}`);
|
|
24
|
+
console.log(`${c.magenta}${c.bold} β π± ADB Web β APK Installer β${c.reset}`);
|
|
25
|
+
console.log(`${c.magenta}${c.bold} βββββββββββββββββββββββββββββββββββββββββ${c.reset}`);
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log(` ${c.green}β${c.reset} Server running on ${c.cyan}${c.bold}http://localhost:${port}${c.reset}`);
|
|
28
|
+
console.log(` ${c.green}β${c.reset} Opening browserβ¦`);
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log(` ${c.dim}Press Ctrl+C to stop${c.reset}`);
|
|
31
|
+
console.log('');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ββ Find a free port βββββββββββββββββββββββββββββββββββββ
|
|
35
|
+
function getFreePort(preferred) {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
const srv = net.createServer();
|
|
38
|
+
srv.listen(preferred, () => {
|
|
39
|
+
const { port } = srv.address();
|
|
40
|
+
srv.close(() => resolve(port));
|
|
41
|
+
});
|
|
42
|
+
srv.on('error', () => {
|
|
43
|
+
// preferred taken β let OS pick
|
|
44
|
+
const srv2 = net.createServer();
|
|
45
|
+
srv2.listen(0, () => {
|
|
46
|
+
const { port } = srv2.address();
|
|
47
|
+
srv2.close(() => resolve(port));
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ββ Open browser cross-platform ββββββββββββββββββββββββββ
|
|
54
|
+
function openBrowser(url) {
|
|
55
|
+
const platform = process.platform;
|
|
56
|
+
let cmd;
|
|
57
|
+
if (platform === 'win32') cmd = `start "" "${url}"`;
|
|
58
|
+
else if (platform === 'darwin') cmd = `open "${url}"`;
|
|
59
|
+
else cmd = `xdg-open "${url}"`;
|
|
60
|
+
exec(cmd, (err) => {
|
|
61
|
+
if (err) console.log(` ${c.yellow}β ${c.reset} Could not auto-open browser. Visit: ${c.cyan}${url}${c.reset}`);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ββ Main βββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
66
|
+
async function main() {
|
|
67
|
+
const preferredPort = parseInt(process.env.PORT || '3737', 10);
|
|
68
|
+
const port = await getFreePort(preferredPort);
|
|
69
|
+
|
|
70
|
+
// Pass the port to the server via env
|
|
71
|
+
const serverPath = path.join(__dirname, '..', 'server.js');
|
|
72
|
+
const child = spawn(process.execPath, [serverPath], {
|
|
73
|
+
env: { ...process.env, PORT: String(port) },
|
|
74
|
+
stdio: 'inherit',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
child.on('error', (err) => {
|
|
78
|
+
console.error(`${c.red}Failed to start server:${c.reset}`, err.message);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
child.on('exit', (code) => {
|
|
83
|
+
process.exit(code ?? 0);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Give the server a moment to boot, then open browser
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
const url = `http://localhost:${port}`;
|
|
89
|
+
banner(port);
|
|
90
|
+
openBrowser(url);
|
|
91
|
+
}, 800);
|
|
92
|
+
|
|
93
|
+
// Forward signals
|
|
94
|
+
['SIGINT', 'SIGTERM'].forEach((sig) => {
|
|
95
|
+
process.on(sig, () => {
|
|
96
|
+
child.kill(sig);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
main();
|