which-electron/README.md

43 lines
1.4 KiB
Markdown
Raw Normal View History

2021-07-16 07:11:12 +00:00
# which-electron ![](https://img.shields.io/badge/Status-WIP-orange)
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
Try to find out which Electron version is bundled inside an application.
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
## Usage
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
```shell
2021-07-16 14:46:29 +00:00
$ npm install which-electron
2021-07-16 14:46:29 +00:00
$ which-electron Google.Play.Music.Desktop.Player.OSX.zip
Version Constraint (Unsupported): <v7.0.0
Fingerprint: v3.1.7-v3.1.8
v3.1.8 is currently not supported
2021-07-16 14:46:29 +00:00
$ which-electron HashTag-win32-x64.zip
Found Version file: v7.1.10
v7.1.10 is currently not supported
2021-07-16 14:46:29 +00:00
Fingerprint: v7.1.10
v7.1.10 is currently not supported
$ which-electron Appium-linux-1.21.0.AppImage
Fingerprint: v7.2.4-v7.3.3
v7.3.3 is currently not supported
2021-07-16 14:46:29 +00:00
$ which-electron Google.Play.Music.Desktop.Player.deb
2021-07-16 07:11:12 +00:00
```
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
## How does it work?
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
We attempt multiple pathways:
2021-07-15 15:26:36 +00:00
2021-07-16 07:11:12 +00:00
1. The presence of a `electron.asar` file denotes an electron version `<v7.0.0`, since later releases dropped that file and embedded it in the binary instead.
2. A `version` text file is sometimes included in the final binary.
3. The `node_modules/electron/package.json` file is sometimes present.
4. A lookup table of [hashes from various electron releases](https://github.com/captn3m0/electron-fingerprints/) is used to guess the version. (WIP)
5. Get the electron version from the electron binary (WIP)
Note that this can be run against untrusted binaries as it does not _try to run the application_.
## License
Licensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details.