Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,4 @@ jobs:
- name: Build
run: yarn build
- name: Test
env:
ELECTRON_INTEGRITY_DIGEST_TEST_MAJOR_VERSION: '41'
ELECTRON_INTEGRITY_DIGEST_TEST_RELEASE_CHANNEL: 'auto'
run: yarn test
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ $ asar --help
extract|e <archive> <dest>
extract archive

integrity-digest|id <command> <app>
manage integrity digest in app binary (macOS only)


Options:

Expand All @@ -57,7 +54,6 @@ $ asar --help

#### Excluding multiple resources from being packed


Given:

```text
Expand Down Expand Up @@ -90,30 +86,6 @@ Exclude: a, b, d, f, h
asar pack app app.asar --unpack-dir "{**/x1,**/x2,z4/w1}"
```

#### Integrity digest

The integrity digest is a macOS-specific feature that further hardens apps which utilize [ASAR Integrity](https://www.electronjs.org/docs/latest/tutorial/asar-integrity) from tampering by storing a hash of the integrity info within the code of the app itself. If you modify this hash, you ***must*** re-sign your app afterwards. By default, this feature is off.

To enable the integrity digest, run:
```bash
asar integrity-digest on /path/to/YourApp.app
```

To disable the integrity digest, run:
```bash
asar integrity-digest off /path/to/YourApp.app
```

To see the status of the integrity digest, run:
```bash
asar integrity-digest status /path/to/YourApp.app
```

To verify the status of the integrity digest, run:
```bash
asar integrity-digest verify /path/to/YourApp.app
```

## Programmatic usage

For full API usage, see the [API documentation](https://packages.electronjs.org/asar).
Expand Down
26 changes: 0 additions & 26 deletions bin/asar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import packageJSON from '../package.json' with { type: 'json' };
import { createPackageWithOptions, listPackage, extractFile, extractAll } from '../lib/asar.js';
import { enableIntegrityDigestForApp, disableIntegrityDigestForApp, verifyIntegrityDigestForApp, printStoredIntegrityDigestForApp } from '../lib/integrity-digest.js';
import { program } from 'commander';
import fs from 'node:fs';
import path from 'node:path';
Expand Down Expand Up @@ -72,31 +71,6 @@ program.command('extract <archive> <dest>')
extractAll(archive, dest)
})

program.command('integrity-digest <command> <app>')
.alias('id')
.description('manage integrity digest in app binary (macOS only)')
.action(async function (command, app) {
// No platform guard just in case users want to run this on other platforms
const allowedCommands = ['on', 'off', 'status', 'verify']
switch (command) {
case 'on':
await enableIntegrityDigestForApp(app)
break
case 'off':
await disableIntegrityDigestForApp(app)
break
case 'status':
await printStoredIntegrityDigestForApp(app)
break
case 'verify':
await verifyIntegrityDigestForApp(app)
break
default:
console.log('Unknown integrity digest command: %s. Allowed commands are: %s', command, allowedCommands.join(', '))
process.exit(1)
}
})

program.command('*', { hidden: true})
.action(function (_cmd, args) {
console.log('asar: \'%s\' is not an asar command. See \'asar --help\'.', args[0])
Expand Down
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,15 @@
"dependencies": {
"commander": "^13.1.0",
"glob": "^13.0.2",
"minimatch": "^10.0.1",
"plist": "^3.1.0"
"minimatch": "^10.0.1"
},
"devDependencies": {
"@electron/fuses": "^2.1.0",
"@electron/get": "^4.0.2",
"@tsconfig/node22": "^22.0.1",
"@types/node": "^22.12.0",
"@types/plist": "^3.0.5",
"@types/semver": "^7.7.1",
"electron": "^35.7.5",
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"prettier": "^3.8.1",
"semver": "^7.7.4",
"tsx": "^4.21.0",
"typedoc": "~0.25.13",
"typescript": "^5.5.4",
Expand Down
10 changes: 0 additions & 10 deletions src/asar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,3 @@ export function extractAll(archivePath: string, dest: string) {
}

export { uncacheAll, uncacheFilesystem as uncache, FileRecord, DirectoryRecord } from './disk.js';
export {
calculateIntegrityDigestForApp,
getStoredIntegrityDigestForApp,
setStoredIntegrityDigestForApp,
InvalidAppPathError,
InvalidAsarIntegrityError,
MissingIntegrityDigestError,
MultipleDifferentIntegrityDigestsError,
UnknownIntegrityDigestVersionError,
} from './integrity-digest.js';
Loading