-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from sleeyax/2.0
- Loading branch information
Showing
42 changed files
with
38,360 additions
and
622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
patreon: sleeyax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
test: | ||
name: Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 16 | ||
- 14 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.idea/ | ||
node_modules/ | ||
build/ | ||
mytests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# examples | ||
This directory contains some examples to demonstrate how asarmor can be used in production. | ||
|
||
Make sure you've built asarmor (run `npm run build` at project root) before you try them out! | ||
|
||
- [Node.js](node) | ||
- [Electron.js](electron) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.DS_Store | ||
dist/ | ||
node_modules/ | ||
thumbs.db | ||
.idea/ | ||
extracted/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Electron.js example | ||
This project is based on the [electron-webpack-quick-start](https://github.com/electron-userland/electron-webpack-quick-start) boilerplate. | ||
|
||
## Installation | ||
Install dependencies: | ||
|
||
`$ npm i` | ||
|
||
## Usage | ||
Run the following command to build this project: | ||
``` | ||
# create unpacked build with electron-builder | ||
$ npm run dist:dir | ||
``` | ||
|
||
An [afterPack](https://www.electron.build/configuration/configuration.html#afterpack) hook that applies asarmor patches is already included in the build step. | ||
|
||
To verify that the electron app still runs fine, go to `dist/<os>-unpacked/` and run the `asarmor-electron-example` executable. For example on Windows the path to the executable should be `dist/win-unpacked/asarmor-electron-example.exe`. | ||
|
||
Finally, try to run `asar extract dist/<os>-unpacked/resources/app.asar extracted` and notice that it won't work :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const asarmor = require('../../build/src'); | ||
const { join } = require("path"); | ||
|
||
exports.default = async ({ appOutDir, packager }) => { | ||
try { | ||
const asarPath = join(packager.getResourcesDir(appOutDir), 'app.asar'); | ||
console.log(`applying asarmor patches to ${asarPath}`); | ||
const archive = await asarmor.open(asarPath); | ||
archive.patch(); // apply default patches | ||
await archive.write(asarPath); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
}; |
Oops, something went wrong.