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 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
+ [![npm version](https://img.shields.io/npm/v/adb-web.svg)](https://www.npmjs.com/package/adb-web)
9
+ [![npm downloads](https://img.shields.io/npm/dm/adb-web.svg)](https://www.npmjs.com/package/adb-web)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-violet.svg)](LICENSE)
11
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D16-green)](https://nodejs.org)
12
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](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
+ ![ADB Web Dashboard](./screenshot.png)
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();