homebridge-plejd 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/README.md +7 -2
  2. package/config.schema.json +24 -3
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/model/device.d.ts +8 -0
  6. package/dist/model/device.d.ts.map +1 -0
  7. package/dist/{model.js → model/device.js} +1 -1
  8. package/dist/model/device.js.map +1 -0
  9. package/dist/model/plejdSite.d.ts +479 -0
  10. package/dist/model/plejdSite.d.ts.map +1 -0
  11. package/dist/model/plejdSite.js +107 -0
  12. package/dist/model/plejdSite.js.map +1 -0
  13. package/dist/model/userInputConfig.d.ts +7 -0
  14. package/dist/model/userInputConfig.d.ts.map +1 -0
  15. package/dist/model/userInputConfig.js +3 -0
  16. package/dist/model/userInputConfig.js.map +1 -0
  17. package/dist/plejdApi.d.ts +19 -0
  18. package/dist/plejdApi.d.ts.map +1 -0
  19. package/dist/plejdApi.js +142 -0
  20. package/dist/plejdApi.js.map +1 -0
  21. package/dist/plejdPlatform.d.ts +10 -7
  22. package/dist/plejdPlatform.d.ts.map +1 -1
  23. package/dist/plejdPlatform.js +102 -42
  24. package/dist/plejdPlatform.js.map +1 -1
  25. package/dist/plejdPlatformAccessory.d.ts +2 -2
  26. package/dist/plejdPlatformAccessory.d.ts.map +1 -1
  27. package/dist/plejdPlatformAccessory.js +20 -11
  28. package/dist/plejdPlatformAccessory.js.map +1 -1
  29. package/dist/plejdService.d.ts +6 -2
  30. package/dist/plejdService.d.ts.map +1 -1
  31. package/dist/plejdService.js +56 -33
  32. package/dist/plejdService.js.map +1 -1
  33. package/dist/plejdUtils.d.ts.map +1 -1
  34. package/dist/plejdUtils.js +5 -1
  35. package/dist/plejdUtils.js.map +1 -1
  36. package/dist/settings.d.ts +2 -0
  37. package/dist/settings.d.ts.map +1 -1
  38. package/dist/settings.js +12 -2
  39. package/dist/settings.js.map +1 -1
  40. package/my-site.json +2427 -0
  41. package/package.json +8 -5
  42. package/dist/model.d.ts +0 -13
  43. package/dist/model.d.ts.map +0 -1
  44. package/dist/model.js.map +0 -1
  45. package/docs/Extracting crypto key.md +0 -85
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Plejd",
4
4
  "name": "homebridge-plejd",
5
5
  "author": "Alexander Herlin",
6
- "version": "1.2.5",
6
+ "version": "1.2.7",
7
7
  "description": "HomeKit support for the Plejd BLE platform using Homebridge",
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -29,10 +29,13 @@
29
29
  "plejd"
30
30
  ],
31
31
  "dependencies": {
32
- "@abandonware/noble": "^1.9.2-15"
32
+ "@abandonware/noble": "^1.9.2-15",
33
+ "axios": "^1.3",
34
+ "events": "^3.3",
35
+ "lodash": "^4.17"
33
36
  },
34
37
  "devDependencies": {
35
- "@types/node": "^16.10.9",
38
+ "@types/node": "^18.13",
36
39
  "@types/noble": "^0.0.40",
37
40
  "@typescript-eslint/eslint-plugin": "^5.0.0",
38
41
  "@typescript-eslint/parser": "^5.0.0",
@@ -40,7 +43,7 @@
40
43
  "homebridge": "^1.3.5",
41
44
  "nodemon": "^2.0.13",
42
45
  "rimraf": "^3.0.2",
43
- "ts-node": "^10.3.0",
44
- "typescript": "^4.4.4"
46
+ "ts-node": "^10.9",
47
+ "typescript": "^4.9"
45
48
  }
46
49
  }
package/dist/model.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- export interface Device {
3
- name: string;
4
- model: string;
5
- identifier: number;
6
- isDimmer: boolean;
7
- uuid: string;
8
- }
9
- export interface UserInputConfig {
10
- devices: Device[];
11
- cryptoKey: Buffer;
12
- }
13
- //# sourceMappingURL=model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,MAAM;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB"}
package/dist/model.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":""}
@@ -1,85 +0,0 @@
1
- ## Extract crypto key
2
-
3
- This parts means digging into often encrypted information in a file on your phone. This is done through making a local un-encrypted backup onto you computer no matter operative system, after that you need to somehow get to the information.
4
-
5
- The information is mostly based on [this](https://github.com/klali/ha-plejd) project.
6
-
7
- I've composed a [shell script](./../extractToken.sh) for doing the tasks listed here, feel free to have a look.
8
-
9
- ### Steps for Android on MacOs/Linux:
10
-
11
- Turn on USB debugging and connect the phone to a computer.
12
-
13
- Extract a backup from the phone:
14
- ```bash
15
- $ adb backup com.plejd.plejdapp
16
- ```
17
- Unpack the backup:
18
- ```bash
19
- $ dd if=backup.ab bs=1 skip=24 | zlib-flate -uncompress | tar -xv
20
- ```
21
- Recover the .site file:
22
- ```bash
23
- $ cp apps/com.plejd.plejdapp/f/*/*.site site.json
24
- ```
25
-
26
- ### Steps for iOS:
27
-
28
-
29
- One free alternative is to use [this](https://github.com/richinfante/iphonebackuptools) npm package.
30
-
31
- There's some information on how to use it. This means using the terminal.
32
-
33
- There might be other alternatives out there.
34
-
35
- ### Using NPM & JQ
36
- Connect you iPhone to your computer and make a backup
37
-
38
- Mac: *Steps: finder -> locations -> [phone] -> un-tick 'Encrypt local backup' -> Back up now*
39
-
40
- ```bash
41
- # on mac you need to use sudo.
42
- npm i -g ibackuptool
43
- ```
44
-
45
- Mac: *System preferences -> Security & Privacy -> Privacy -> tick Full disk access for terminal*
46
- ```bash
47
- #!/bin/bash
48
- PREFIX=`npm config get prefix`
49
- NODE_IBACKUP_DIR=$PREFIX/lib/node_modules/ibackuptool
50
-
51
- sudo find $NODE_IBACKUP_DIR/**/*js -exec sudo dos2unix {} \;
52
- ```
53
-
54
- Run the extraction:
55
- ```bash
56
- ibackuptool -l -f json > temp.json
57
- ````
58
- This output can be read using any editor, search for ```.PlejdMesh.CryptoKey```
59
-
60
-
61
- If you'd want to automate it a bit more using jq:
62
-
63
- ```
64
- #!/bin/bash
65
- # ----> Run the ibackup tool and put all information into a raw json variable
66
- RAW=$(ibackuptool -l -f json)
67
-
68
- # ----> Get the fields needed
69
- UUID=$(echo ${RAW} | sed 's/run backups.list //' | jq '.[0].udid' | sed 's/"//g')
70
-
71
- # ----> Extract the actual needed data into a temp dir
72
- mkdir temp
73
- Q=$(sudo ibackuptool -b ${UUID} -r backup.files --extract ./temp --regex-filter '\.(site)$')
74
- mv temp/App/com.plejd.consumer.light/Documents/**/*.site ./temp/site.json
75
-
76
- # ----> List the data and remove the temp dir
77
- cat ./temp/site.json | jq '.PlejdMesh.CryptoKey' | sed 's/-//g' | sed 's/"//g'
78
- cat ./temp/site.json | jq '.PlejdMesh._outputAddresses' | grep -v '\$type' | jq '.[][]'
79
- rm -rf temp
80
- ````
81
-
82
- Mac: *System preferences -> Security & Privacy -> Privacy -> un-tick Full disk access for terminal*
83
-
84
- <br />
85
-