devicely 2.2.3 → 2.2.4

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.
@@ -0,0 +1,20 @@
1
+ const fs = require('fs');
2
+ const crypto = require('crypto');
3
+
4
+ const ENCRYPTION_KEY = process.env.DEVICELY_SCRIPT_KEY || 'devicely-secure-key-2024-v1';
5
+
6
+ function decryptScript(encryptedFilePath) {
7
+ const encryptedData = fs.readFileSync(encryptedFilePath, 'utf8');
8
+ const [ivHex, encryptedText] = encryptedData.split(':');
9
+
10
+ const iv = Buffer.from(ivHex, 'hex');
11
+ const key = crypto.scryptSync(ENCRYPTION_KEY, 'salt', 32);
12
+
13
+ const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
14
+ let decrypted = decipher.update(encryptedText, 'hex', 'utf8');
15
+ decrypted += decipher.final('utf8');
16
+
17
+ return decrypted;
18
+ }
19
+
20
+ module.exports = { decryptScript };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devicely",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Devicely - One Command, All Devices. AI Powered Mobile Automation for iOS and Android",
5
5
  "main": "lib/index.js",
6
6
  "bin": {