Skip to content

Commit 031d7d5

Browse files
authoredMar 11, 2024··
feat: add disableSanityCheckPackage to asar to allow custom electron fork asar integrity implementations (#8123)
1 parent 00f46e6 commit 031d7d5

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed
 

‎.changeset/dirty-rats-happen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": minor
3+
---
4+
5+
feat: add disableSanityCheckPackage to allow encrypted asars

‎docs/configuration/configuration.md

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ Env file `electron-builder.env` in the current dir ([example](https://github.com
187187
<li>
188188
<p><code id="Configuration-removePackageKeywords">removePackageKeywords</code> = <code>true</code> Boolean - Whether to remove <code>keywords</code> field from <code>package.json</code> files.</p>
189189
</li>
190+
<li>
191+
<p><code id="Configuration-disableSanityCheckPackage">disableSanityCheckPackage</code> = <code>false</code> Boolean - Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)</p>
192+
</li>
190193
</ul>
191194

192195
<!-- end of generated block -->

‎packages/app-builder-lib/scheme.json

+5
Original file line numberDiff line numberDiff line change
@@ -7152,6 +7152,11 @@
71527152
}
71537153
]
71547154
},
7155+
"disableSanityCheckPackage": {
7156+
"default": false,
7157+
"description": "Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)",
7158+
"type": "boolean"
7159+
},
71557160
"dmg": {
71567161
"anyOf": [
71577162
{

‎packages/app-builder-lib/src/configuration.ts

+6
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ export interface Configuration extends PlatformSpecificBuildOptions {
279279
* @default true
280280
*/
281281
readonly removePackageKeywords?: boolean
282+
283+
/**
284+
* Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)
285+
* @default false
286+
*/
287+
readonly disableSanityCheckPackage?: boolean
282288
}
283289

284290
interface PackContext {

‎packages/app-builder-lib/src/platformPackager.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
316316
}
317317

318318
const isAsar = asarOptions != null
319-
await this.sanityCheckPackage(appOutDir, isAsar, framework)
319+
if (!this.config.disableSanityCheckPackage) {
320+
await this.sanityCheckPackage(appOutDir, isAsar, framework)
321+
}
320322
if (sign) {
321323
await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)
322324
}

0 commit comments

Comments
 (0)
Please sign in to comment.