viewsync-master 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +1 -2
  2. package/index.js +84 -27
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,10 @@
1
- # ViewSync Master 🚀 (v1.0.0)
1
+ # ViewSync Master 🚀 ![NPM Version](https://img.shields.io/npm/v/viewsync-master.svg)
2
2
 
3
3
  A powerful, lag-free mirroring tool and live cropper for Android devices! Perfect for streaming study lectures seamlessly on your PC.
4
4
 
5
5
  ## ✨ Features
6
6
  - **Live Cropper:** Remove black bars on the fly and save unlimited profiles.
7
7
  - **Lag-Free Streaming:** Optimized bitrate (2Mbps) and scaled resolution (1024px) for buttery smooth 30fps playback.
8
- - **Hardware Keyboard Shortcuts:** Use your laptop keyboard to control media!
9
8
  - **1-Click Launch:** Beautiful dark-mode UI.
10
9
 
11
10
  ## 📥 Installation
package/index.js CHANGED
@@ -5,33 +5,74 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const os = require('os');
7
7
 
8
- console.log("🚀 Welcome to ViewSync Master Installer!");
8
+ // Colors
9
+ const cyan = '\x1b[36m';
10
+ const green = '\x1b[32m';
11
+ const yellow = '\x1b[33m';
12
+ const red = '\x1b[31m';
13
+ const reset = '\x1b[0m';
14
+ const bold = '\x1b[1m';
15
+
16
+ const sleep = (ms) => new Promise(r => setTimeout(r, ms));
17
+
18
+ async function run() {
19
+ console.clear();
20
+ console.log(cyan + bold + `
21
+ ╦ ╦┬┌─┐┬ ┬╔═╗┬ ┬┌┐┌┌─┐
22
+ ╚╗╔╝│├┤ │││╚═╗└┬┘││││
23
+ ╚╝ ┴└─┘└┴┘╚═╝ ┴ ┘└┘└─┘
24
+ [ MASTER EDITION ]
25
+ ` + reset);
26
+
27
+ console.log(green + "[SYSTEM] Initializing ViewSync protocol..." + reset);
28
+ await sleep(800);
9
29
 
10
- try {
11
- console.log("Installing system dependencies (requires sudo password)...");
12
- execSync('sudo apt update && sudo apt install -y scrcpy adb python3-tk xdotool python3-pip', { stdio: 'inherit' });
13
-
14
- console.log("Installing Python packages...");
15
30
  try {
16
- execSync('pip3 install pynput --break-system-packages', { stdio: 'ignore' });
17
- } catch (e) {
18
- execSync('pip3 install pynput', { stdio: 'ignore' });
19
- }
31
+ console.log(cyan + "\n[1/4] Establishing secure dependencies... (sudo may be required)" + reset);
32
+
33
+ try { execSync('sudo apt update', { stdio: 'ignore' }); } catch(e){}
34
+ const deps = ['adb', 'python3-tk', 'xdotool', 'python3-pip'];
35
+ for (const dep of deps) {
36
+ try { execSync(`sudo apt install -y ${dep}`, { stdio: 'ignore' }); } catch(e){}
37
+ }
38
+
39
+ try {
40
+ execSync('which scrcpy', { stdio: 'ignore' });
41
+ } catch (e) {
42
+ try { execSync('sudo apt install -y scrcpy', { stdio: 'ignore' }); } catch(e){}
43
+ }
44
+
45
+ console.log(green + " => Dependencies synced successfully." + reset);
46
+ await sleep(500);
20
47
 
21
- const targetDir = path.join(os.homedir(), '.viewsync-master');
22
- if (!fs.existsSync(targetDir)) {
23
- fs.mkdirSync(targetDir, { recursive: true });
24
- }
48
+ console.log(cyan + "\n[2/4] Downloading Python AI environment modules..." + reset);
49
+ try {
50
+ execSync('pip3 install pynput --break-system-packages', { stdio: 'ignore' });
51
+ } catch (e) {
52
+ try { execSync('pip3 install pynput', { stdio: 'ignore' }); } catch(e){}
53
+ }
54
+ console.log(green + " => Modules injected." + reset);
55
+ await sleep(500);
25
56
 
26
- console.log("Setting up ViewSync Master files...");
27
- fs.copyFileSync(path.join(__dirname, 'viewsync_main.py'), path.join(targetDir, 'viewsync_main.py'));
28
- fs.copyFileSync(path.join(__dirname, 'viewsync_helper.py'), path.join(targetDir, 'viewsync_helper.py'));
57
+ console.log(cyan + "\n[3/4] Compiling core framework in encrypted vault..." + reset);
58
+ const targetDir = path.join(os.homedir(), '.viewsync-master');
59
+ if (!fs.existsSync(targetDir)) {
60
+ fs.mkdirSync(targetDir, { recursive: true });
61
+ }
29
62
 
30
- console.log("Creating Desktop Shortcut...");
31
- const desktopDir = path.join(os.homedir(), 'Desktop');
32
- const shortcutPath = path.join(desktopDir, 'ViewSync Master.desktop');
33
-
34
- const desktopEntry = `[Desktop Entry]
63
+ fs.copyFileSync(path.join(__dirname, 'viewsync_main.py'), path.join(targetDir, 'viewsync_main.py'));
64
+ const helperPath = path.join(__dirname, 'viewsync_helper.py');
65
+ if (fs.existsSync(helperPath)) {
66
+ fs.copyFileSync(helperPath, path.join(targetDir, 'viewsync_helper.py'));
67
+ }
68
+ console.log(green + " => Vault secured at ~/.viewsync-master" + reset);
69
+ await sleep(500);
70
+
71
+ console.log(cyan + "\n[4/4] Creating terminal uplink (Desktop Icon)..." + reset);
72
+ const desktopDir = path.join(os.homedir(), 'Desktop');
73
+ const shortcutPath = path.join(desktopDir, 'ViewSync Master.desktop');
74
+
75
+ const desktopEntry = `[Desktop Entry]
35
76
  Name=ViewSync Master
36
77
  Comment=Live screen cropper & lag-free mirroring
37
78
  Exec=bash -c "python3 ~/.viewsync-master/viewsync_main.py"
@@ -40,10 +81,26 @@ Terminal=false
40
81
  Type=Application
41
82
  Categories=Utility;
42
83
  `;
43
- fs.writeFileSync(shortcutPath, desktopEntry);
44
- fs.chmodSync(shortcutPath, 0o755);
84
+ fs.writeFileSync(shortcutPath, desktopEntry);
85
+ fs.chmodSync(shortcutPath, 0o755);
86
+
87
+ console.log(green + " => Uplink established." + reset);
88
+ await sleep(800);
89
+
90
+ console.log(yellow + bold + `
91
+ ===================================================
92
+ ✨ SUCCESS! ViewSync Master is ready to launch. ✨
93
+ ===================================================` + reset);
94
+ console.log(cyan + `
95
+ 1. Connect your Android device via USB.
96
+ 2. Ensure USB Debugging is ON.
97
+ 3. Double-click 'ViewSync Master' on your Desktop!
98
+ ` + reset);
45
99
 
46
- console.log("✅ Installation Complete! You can now launch 'ViewSync Master' from your Desktop.");
47
- } catch (error) {
48
- console.error("❌ Installation failed:", error.message);
100
+ } catch (error) {
101
+ console.log(red + bold + "\n[FATAL ERROR] Installation aborted." + reset);
102
+ console.log(red + error.message + reset);
103
+ }
49
104
  }
105
+
106
+ run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewsync-master",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Live screen cropper and lag-free mirroring.",
5
5
  "main": "index.js",
6
6
  "bin": {