This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e82315a
commit a6cb7d7
Showing
8 changed files
with
115 additions
and
0 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 @@ | ||
# These builds are automatically generated by GitHub Actions |
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,54 @@ | ||
name: Build and release | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: '2.0.2' # default is 'stable' | ||
- name: Install dependencies | ||
run: nimble install -y | ||
- name: Build the project on Linux | ||
run: nim c -d:release src/bdInject.nim | ||
- name: Build the project on Windows | ||
run: sudo apt install mingw-w64 && nim c --os:Windows -d:mingw -d:release --cpu:amd64 src/bdInject.nim | ||
- id: vars | ||
shell: bash | ||
run: | | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.vars.outputs.sha_short }} | ||
release_name: Release ${{ steps.vars.outputs.sha_short }} | ||
draft: true | ||
prerelease: false | ||
body_path: ./.github/release.md | ||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: /home/runner/work/bdInject/bdInject/src/bdInject | ||
asset_name: bdInjectLinux | ||
asset_content_type: application/octet-stream | ||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: /home/runner/work/bdInject/bdInject/src/bdInject.exe | ||
asset_name: bdInjectWindows.exe | ||
asset_content_type: application/octet-stream | ||
- run: | | ||
curl --request PATCH \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
https://api.github.com/repos/${{ github.repository }}/releases/${{steps.create_release.outputs.id}} \ | ||
-d '{"draft":false}' |
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,3 +1,4 @@ | ||
nimcache/ | ||
nimblecache/ | ||
htmldocs/ | ||
src/bdInject |
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,13 @@ | ||
# Package | ||
|
||
version = "0.1.0" | ||
author = "smartfrigde" | ||
description = "bdCompat installer for ArmCord" | ||
license = "MIT" | ||
srcDir = "src" | ||
bin = @["bdInject"] | ||
|
||
|
||
# Dependencies | ||
|
||
requires "nim >= 2.0.2", "puppy >= 2.1.2", "zippy >= 0.10.12" |
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,5 @@ | ||
amd64.windows.gcc.path = "/usr/bin/" | ||
amd64.windows.gcc.exe = "x86_64-w64-mingw32-gcc" | ||
amd64.windows.gcc.linkerexe = "x86_64-w64-mingw32-gcc" | ||
amd64.windows.gcc.options.linker = "" | ||
#gcc.options.linker = "" |
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,26 @@ | ||
import os | ||
import zippy/ziparchives | ||
import puppy | ||
const jsIndex: string = staticRead"index.js" | ||
const jsonPackage: string = staticRead"package.json" | ||
type | ||
Paths = array[3, string] | ||
# let commonInstallPaths: Paths = ["Jasmine", "Ktisztina", "Kristof"] | ||
when isMainModule: | ||
echo("BDCompat injector") | ||
write(stdout, "Your resources directory -> ") | ||
var input: string = readLine(stdin) | ||
var asar: string = joinPath(input & "/app.asar") | ||
echo(asar) | ||
if fileExists(asar): | ||
echo "Injecting BDCompat..." | ||
moveFile(asar, input & "/app-original.asar") | ||
createDir(input & "/app") | ||
writeFile(input & "/app/index.js", jsIndex) | ||
writeFile(input & "/app/package.json", jsonPackage) | ||
writeFile(input & "/app/kernel.asar", fetch("https://github.com/kernel-mod/electron/releases/download/2023-01-15-07-14-02/kernel.asar")) | ||
writeFile(input & "/app/bdCompat.zip", fetch("https://github.com/ArmCord/bdCompat/archive/refs/heads/main.zip")) | ||
extractAll(input & "/app/bdCompat.zip", input & "/app/packages") | ||
removeFile(input & "/app/bdCompat.zip") | ||
else: | ||
echo "Directory does not exist" |
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,11 @@ | ||
const pkg = require("./package.json"); | ||
const Module = require("module"); | ||
const path = require("path"); | ||
|
||
try { | ||
const kernel = require(path.join(__dirname, "kernel.asar")); | ||
if (kernel?.default) kernel.default({ startOriginal: true }); | ||
} catch(e) { | ||
console.error("Kernel failed to load: ", e.message); | ||
Module._load(path.join(__dirname, "..", "app-original.asar"), null, true); | ||
} |
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,4 @@ | ||
{ | ||
"name": "kernel", | ||
"main": "index.js" | ||
} |