homebridge-plejd 1.2.4 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +17 -4
- package/config.schema.json +24 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/model/device.d.ts +8 -0
- package/dist/model/device.d.ts.map +1 -0
- package/dist/{model.js → model/device.js} +1 -1
- package/dist/model/device.js.map +1 -0
- package/dist/model/plejdSite.d.ts +479 -0
- package/dist/model/plejdSite.d.ts.map +1 -0
- package/dist/model/plejdSite.js +107 -0
- package/dist/model/plejdSite.js.map +1 -0
- package/dist/model/userInputConfig.d.ts +7 -0
- package/dist/model/userInputConfig.d.ts.map +1 -0
- package/dist/model/userInputConfig.js +3 -0
- package/dist/model/userInputConfig.js.map +1 -0
- package/dist/plejdApi.d.ts +19 -0
- package/dist/plejdApi.d.ts.map +1 -0
- package/dist/plejdApi.js +142 -0
- package/dist/plejdApi.js.map +1 -0
- package/dist/plejdPlatform.d.ts +10 -7
- package/dist/plejdPlatform.d.ts.map +1 -1
- package/dist/plejdPlatform.js +102 -29
- package/dist/plejdPlatform.js.map +1 -1
- package/dist/plejdPlatformAccessory.d.ts +2 -2
- package/dist/plejdPlatformAccessory.d.ts.map +1 -1
- package/dist/plejdPlatformAccessory.js +20 -11
- package/dist/plejdPlatformAccessory.js.map +1 -1
- package/dist/plejdService.d.ts +6 -2
- package/dist/plejdService.d.ts.map +1 -1
- package/dist/plejdService.js +57 -37
- package/dist/plejdService.js.map +1 -1
- package/dist/plejdUtils.d.ts.map +1 -1
- package/dist/plejdUtils.js +5 -1
- package/dist/plejdUtils.js.map +1 -1
- package/dist/settings.d.ts +2 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +12 -2
- package/dist/settings.js.map +1 -1
- package/my-site.json +2427 -0
- package/package.json +8 -5
- package/dist/model.d.ts +0 -13
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js.map +0 -1
- package/docs/Extracting crypto key.md +0 -40
- package/extractToken.sh +0 -40
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.
|
6
|
+
"version": "1.2.6",
|
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": "^
|
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.
|
44
|
-
"typescript": "^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
|
package/dist/model.d.ts.map
DELETED
@@ -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,40 +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 on MacOs:
|
27
|
-
|
28
|
-
Connect you iPhone to your computer and make a backup
|
29
|
-
|
30
|
-
*Steps: finder -> locations -> [phone] -> un-tick 'Encrypt local backup' -> Back up now*
|
31
|
-
|
32
|
-
```bash
|
33
|
-
./plejd.sh
|
34
|
-
```
|
35
|
-
|
36
|
-
All the info will be printed in the terminal for you.
|
37
|
-
|
38
|
-
Requirements: ```node``` & ```jq```
|
39
|
-
<br />
|
40
|
-
|
package/extractToken.sh
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
#/bin/bash
|
2
|
-
|
3
|
-
# ----> Check if you're using a mac, if not don't continue
|
4
|
-
UNAME=$(uname)
|
5
|
-
if [ $UNAME != 'Darwin' ]; then
|
6
|
-
echo "For now only works on mac"
|
7
|
-
exit 0
|
8
|
-
fi
|
9
|
-
|
10
|
-
# ----> Look for global NPM modules and set the path to ibackuptool that we'll use for extraction
|
11
|
-
PREFIX=$(npm config get prefix)
|
12
|
-
NODE_IBACKUP_DIR=$PREFIX/lib/node_modules/ibackuptool
|
13
|
-
|
14
|
-
# ----> If the ibackup tool is not installed, let's install it
|
15
|
-
if [ ! -d "$NODE_IBACKUP_DIR" ]; then
|
16
|
-
then
|
17
|
-
sudo npm i -g ibackuptool
|
18
|
-
echo "Installing ibackuptool https://github.com/richinfante/iphonebackuptools"
|
19
|
-
# To make it run on mac we need to fix the line breaks in the files.
|
20
|
-
sudo find $NODE_IBACKUP_DIR/**/*js -exec sudo dos2unix {} \;
|
21
|
-
echo "System preferences -> Security & Privacy -> Privacy -> tick Full disk access for terminal"
|
22
|
-
fi
|
23
|
-
|
24
|
-
# ----> Run the ibackup tool and put all information into a raw json variable
|
25
|
-
RAW=$(ibackuptool -l -f json)
|
26
|
-
|
27
|
-
# ----> Get the fields needed
|
28
|
-
UUID=$(echo ${RAW} | sed 's/run backups.list //' | jq '.[0].udid' | sed 's/"//g')
|
29
|
-
|
30
|
-
# ----> Extract the actual needed data into a temp dir
|
31
|
-
mkdir temp
|
32
|
-
Q=$(sudo ibackuptool -b ${UUID} -r backup.files --extract ./temp --regex-filter '\.(site)$')
|
33
|
-
mv temp/App/com.plejd.consumer.light/Documents/**/*.site ./temp/site.json
|
34
|
-
|
35
|
-
# ----> List the data and remove the temp dir
|
36
|
-
cat ./temp/site.json | jq '.PlejdMesh.CryptoKey' | sed 's/-//g' | sed 's/"//g'
|
37
|
-
cat ./temp/site.json | jq '.PlejdMesh._outputAddresses' | grep -v '\$type' | jq '.[][]'
|
38
|
-
rm -rf temp
|
39
|
-
|
40
|
-
echo "System preferences -> Security & Privacy -> Privacy -> un-tick Full disk access for terminal"
|