* fix: when native modules are already universal, don't lipo. adds `node-mac-permissions` fixture from https://github.com/codebytere/node-mac-permissions and resolves 3 `it.todo` test cases
* add test `different app dirs with different macho files (shim and lipo)`
* add additional test
* PR feedback
* gotta close `fd`
* use `stream` to read first 4 bytes. copy native fixture before packing into asar to leverage `unpack: "**/*.node"` properly.
* convert params to object
* rename `createTestApp` to `createStagingAppDir` and add jsdoc to the function
* compiler error from merge conflict
* update snapshots
* update snapshots
* only check x64Content since it's the tmp app
* compile macho binaries at runtime using hellow-world.c for fixtures in lipo tests
* Update jest.setup.ts
Co-authored-by: Erik Moura <erikian@erikian.dev>
* Update jest.setup.ts
Co-authored-by: Erik Moura <erikian@erikian.dev>
* remove unstable properties for specific keys
* force redo
* update snapshots
* stripping only hello-world from snapshot and only hash from macho-specific asar integrity
* optimize logic :)
---------
Co-authored-by: Erik Moura <erikian@erikian.dev>
- When an application uses multiple asars (`webapp.asar`, `anything.asar`, etc.), `EnableEmbeddedAsarIntegrityValidation` fuse breaks the application due to not all asars having integrity generated for them. Fixes: #116
- **Also fixes bug** to correctly test `makeUniversalApp no asar mode should shim two different app folders`, (it was not having an asar integrity generated for the shimmed asar)
Functionality added:
- Moves all asar integrity generation to **after** all app assets have been merged/shimmed/copied. This allows other asars that were provided to also be scanned and have asar integrity generated for them.
- Extracted common Integrity logic to a single file `integrity.ts`
- Adds unit test for multi-asar apps
* purely test suite on steroids
* verify stuff
* more fun verifies
* ok ok ok I'm done
* extend timeout and consolidate to constant for easier usage across tests
* PR feedback :)
Remove warnings by adding transform regex to `ts-jest` and `testMatch`.
* cleanup
* cleanup
* PR feedback & converting `export function` to `export const` in `util.ts`
* Mach-O types are in big endian format
One of my dependencies for some reason has two universal binaries per platform, and they are not exactly the same bytewise. I'm unsure why. But I am certain they are functional.
In any case, this error is erroneously being thrown since it fails the previous byte comparison match.
```ts
throw new Error(`Can't reconcile two non-macho files ${file}`);
```
CAFEBABE and FEEDFACE magics for universal binaries. This will allow packaging to continue if both the arm and x64 packages have universal binaries.
* Update asar-utils.ts
* Update asar-utils.ts
* fix: Don’t lipo binaries that are already a universal file or the same arch #17
Some Mach-O files may have already been fat binaries and will throw an error if lipoed again.
Co-authored-by: Mitch Cohen <mitch@1password.com>
Co-authored-by: Nick McGuire <nick.mcguire@1password.com>
* Add a x64ArchFiles config key to allow allow-listing of files that are only always x64Arch
Co-authored-by: Andrew Beyer <beyer@1password.com>
Co-authored-by: Mitch Cohen <mitch@1password.com>
Co-authored-by: Nick McGuire <nick.mcguire@1password.com>