mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Compare commits
79 commits
6f7ce60f29
...
64b0f6eeba
Author | SHA1 | Date | |
---|---|---|---|
|
64b0f6eeba | ||
|
f8c4e139fc | ||
|
12df5e6b09 | ||
|
ae926c6548 | ||
|
0df9689bd1 | ||
|
e7ae65bfbb | ||
|
f7a1d23f70 | ||
|
67f2bfeebd | ||
|
df571930cf | ||
|
c76cf4f6cf | ||
|
d2dcb69d38 | ||
|
5b9e1c13c0 | ||
|
6df4446369 | ||
|
57c40ffa4f | ||
|
3f7cade6f2 | ||
|
e72293285b | ||
|
f4167736a0 | ||
|
d21c95008c | ||
|
247eda7c59 | ||
|
2f77ec2f56 | ||
|
3da0191a73 | ||
|
22013310d9 | ||
|
f05508d440 | ||
|
96e6faa8bd | ||
|
1107db1545 | ||
|
bf4f0e4a5b | ||
|
acac9eba66 | ||
|
f61106aa0b | ||
|
630447905c | ||
|
07a6c12255 | ||
|
dfc6995064 | ||
|
847cb9c2c8 | ||
|
0aa6e1399c | ||
|
1d84e24825 | ||
|
fdabb6b4de | ||
|
27c95da82f | ||
|
ec065a05c7 | ||
|
427eb51aa5 | ||
|
adece2efc9 | ||
|
253ff66cc3 | ||
|
21435ca167 | ||
|
e4b54dda05 | ||
|
dccf461fc3 | ||
|
70e8a95a50 | ||
|
493c35d269 | ||
|
024e37e5d0 | ||
|
cdf8ed4ba7 | ||
|
9145f8f233 | ||
|
1307123fd8 | ||
|
51beca4d2f | ||
|
5e10467bf7 | ||
|
9985c8cabe | ||
|
0d7a68c713 | ||
|
3461a997df | ||
|
2b6544bb2c | ||
|
8c29a67854 | ||
|
70949d8414 | ||
|
ae44bad4b1 | ||
|
8532a7742e | ||
|
2faf59b43e | ||
|
df83567d99 | ||
|
d405b89fa9 | ||
|
a348117cb2 | ||
|
7fe38ad307 | ||
|
22f8ea1123 | ||
|
8cdd7e15b7 | ||
|
0c7b7af2b3 | ||
|
f03642e51e | ||
|
45d8b89c9e | ||
|
6232c01006 | ||
|
8d3b5f523a | ||
|
41306d6cde | ||
|
9608851fa2 | ||
|
38edef38ee | ||
|
7dab560a99 | ||
|
3b35a9f888 | ||
|
d5012e79a1 | ||
|
522ffa9ea0 | ||
|
f887513e09 |
22 changed files with 3805 additions and 9712 deletions
66
.github/workflows/build.yml
vendored
66
.github/workflows/build.yml
vendored
|
@ -1,39 +1,37 @@
|
|||
name: Build
|
||||
on: [push, pull_request]
|
||||
name: Build/release
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build_on_linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 14
|
||||
- name: install dependencies
|
||||
run: npm install
|
||||
- name: build
|
||||
run: npm run make
|
||||
release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
build_on_mac:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 14
|
||||
- name: install dependencies
|
||||
run: npm install
|
||||
- name: build
|
||||
run: npm run make
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
|
||||
build_on_win:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 14
|
||||
- name: install dependencies
|
||||
run: npm install
|
||||
- name: build
|
||||
run: npm run make
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Build/release Electron app
|
||||
uses: samuelmeuli/action-electron-builder@v1
|
||||
with:
|
||||
# GitHub token, automatically provided to the action
|
||||
# (No need to define this secret in the repo settings)
|
||||
github_token: ${{ secrets.github_token }}
|
||||
# skip npm run build as there's no script like that
|
||||
skip_build: true
|
||||
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
||||
# release the app after building
|
||||
release: ${{ startsWith(github.ref, 'refs/tags/v') }} #disabled for now as it caused problems (nvm)
|
||||
- name: Archive production builds
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: dist folder
|
||||
path: dist/**
|
||||
|
|
185
LICENSE
185
LICENSE
|
@ -1,21 +1,172 @@
|
|||
MIT License
|
||||
Open Software License ("OSL") v. 3.0
|
||||
|
||||
Copyright (c) 2021 smartfridge
|
||||
This Open Software License (the "License") applies to any original work of
|
||||
authorship (the "Original Work") whose owner (the "Licensor") has placed the
|
||||
following licensing notice adjacent to the copyright notice for the Original
|
||||
Work:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Licensed under the Open Software License version 3.0
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
|
||||
non-exclusive, sublicensable license, for the duration of the copyright, to do
|
||||
the following:
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
a) to reproduce the Original Work in copies, either alone or as part of a
|
||||
collective work;
|
||||
|
||||
b) to translate, adapt, alter, transform, modify, or arrange the Original
|
||||
Work, thereby creating derivative works ("Derivative Works") based upon the
|
||||
Original Work;
|
||||
|
||||
c) to distribute or communicate copies of the Original Work and Derivative
|
||||
Works to the public, with the proviso that copies of Original Work or
|
||||
Derivative Works that You distribute or communicate shall be licensed under
|
||||
this Open Software License;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
|
||||
non-exclusive, sublicensable license, under patent claims owned or controlled
|
||||
by the Licensor that are embodied in the Original Work as furnished by the
|
||||
Licensor, for the duration of the patents, to make, use, sell, offer for sale,
|
||||
have made, and import the Original Work and Derivative Works.
|
||||
|
||||
3) Grant of Source Code License. The term "Source Code" means the preferred
|
||||
form of the Original Work for making modifications to it and all available
|
||||
documentation describing how to modify the Original Work. Licensor agrees to
|
||||
provide a machine-readable copy of the Source Code of the Original Work along
|
||||
with each copy of the Original Work that Licensor distributes. Licensor
|
||||
reserves the right to satisfy this obligation by placing a machine-readable
|
||||
copy of the Source Code in an information repository reasonably calculated to
|
||||
permit inexpensive and convenient access by You for as long as Licensor
|
||||
continues to distribute the Original Work.
|
||||
|
||||
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
|
||||
of any contributors to the Original Work, nor any of their trademarks or
|
||||
service marks, may be used to endorse or promote products derived from this
|
||||
Original Work without express prior permission of the Licensor. Except as
|
||||
expressly stated herein, nothing in this License grants any license to
|
||||
Licensor's trademarks, copyrights, patents, trade secrets or any other
|
||||
intellectual property. No patent license is granted to make, use, sell, offer
|
||||
for sale, have made, or import embodiments of any patent claims other than the
|
||||
licensed claims defined in Section 2. No license is granted to the trademarks
|
||||
of Licensor even if such marks are included in the Original Work. Nothing in
|
||||
this License shall be interpreted to prohibit Licensor from licensing under
|
||||
terms different from this License any Original Work that Licensor otherwise
|
||||
would have a right to license.
|
||||
|
||||
5) External Deployment. The term "External Deployment" means the use,
|
||||
distribution, or communication of the Original Work or Derivative Works in any
|
||||
way such that the Original Work or Derivative Works may be used by anyone
|
||||
other than You, whether those works are distributed or communicated to those
|
||||
persons or made available as an application intended for use over a network.
|
||||
As an express condition for the grants of license hereunder, You must treat
|
||||
any External Deployment by You of the Original Work or a Derivative Work as a
|
||||
distribution under section 1(c).
|
||||
|
||||
6) Attribution Rights. You must retain, in the Source Code of any Derivative
|
||||
Works that You create, all copyright, patent, or trademark notices from the
|
||||
Source Code of the Original Work, as well as any notices of licensing and any
|
||||
descriptive text identified therein as an "Attribution Notice." You must cause
|
||||
the Source Code for any Derivative Works that You create to carry a prominent
|
||||
Attribution Notice reasonably calculated to inform recipients that You have
|
||||
modified the Original Work.
|
||||
|
||||
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
|
||||
the copyright in and to the Original Work and the patent rights granted herein
|
||||
by Licensor are owned by the Licensor or are sublicensed to You under the
|
||||
terms of this License with the permission of the contributor(s) of those
|
||||
copyrights and patent rights. Except as expressly stated in the immediately
|
||||
preceding sentence, the Original Work is provided under this License on an "AS
|
||||
IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
|
||||
limitation, the warranties of non-infringement, merchantability or fitness for
|
||||
a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
|
||||
IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
|
||||
License. No license to the Original Work is granted by this License except
|
||||
under this disclaimer.
|
||||
|
||||
8) Limitation of Liability. Under no circumstances and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise, shall the
|
||||
Licensor be liable to anyone for any indirect, special, incidental, or
|
||||
consequential damages of any character arising as a result of this License or
|
||||
the use of the Original Work including, without limitation, damages for loss
|
||||
of goodwill, work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses. This limitation of liability shall not
|
||||
apply to the extent applicable law prohibits such limitation.
|
||||
|
||||
9) Acceptance and Termination. If, at any time, You expressly assented to this
|
||||
License, that assent indicates your clear and irrevocable acceptance of this
|
||||
License and all of its terms and conditions. If You distribute or communicate
|
||||
copies of the Original Work or a Derivative Work, You must make a reasonable
|
||||
effort under the circumstances to obtain the express assent of recipients to
|
||||
the terms of this License. This License conditions your rights to undertake
|
||||
the activities listed in Section 1, including your right to create Derivative
|
||||
Works based upon the Original Work, and doing so without honoring these terms
|
||||
and conditions is prohibited by copyright law and international treaty.
|
||||
Nothing in this License is intended to affect copyright exceptions and
|
||||
limitations (including "fair use" or "fair dealing"). This License shall
|
||||
terminate immediately and You may no longer exercise any of the rights granted
|
||||
to You by this License upon your failure to honor the conditions in Section
|
||||
1(c).
|
||||
|
||||
10) Termination for Patent Action. This License shall terminate automatically
|
||||
and You may no longer exercise any of the rights granted to You by this
|
||||
License as of the date You commence an action, including a cross-claim or
|
||||
counterclaim, against Licensor or any licensee alleging that the Original Work
|
||||
infringes a patent. This termination provision shall not apply for an action
|
||||
alleging patent infringement by combinations of the Original Work with other
|
||||
software or hardware.
|
||||
|
||||
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
|
||||
License may be brought only in the courts of a jurisdiction wherein the
|
||||
Licensor resides or in which Licensor conducts its primary business, and under
|
||||
the laws of that jurisdiction excluding its conflict-of-law provisions. The
|
||||
application of the United Nations Convention on Contracts for the
|
||||
International Sale of Goods is expressly excluded. Any use of the Original
|
||||
Work outside the scope of this License or after its termination shall be
|
||||
subject to the requirements and penalties of copyright or patent law in the
|
||||
appropriate jurisdiction. This section shall survive the termination of this
|
||||
License.
|
||||
|
||||
12) Attorneys' Fees. In any action to enforce the terms of this License or
|
||||
seeking damages relating thereto, the prevailing party shall be entitled to
|
||||
recover its costs and expenses, including, without limitation, reasonable
|
||||
attorneys' fees and costs incurred in connection with such action, including
|
||||
any appeal of such action. This section shall survive the termination of this
|
||||
License.
|
||||
|
||||
13) Miscellaneous. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent necessary
|
||||
to make it enforceable.
|
||||
|
||||
14) Definition of "You" in This License. "You" throughout this License,
|
||||
whether in upper or lower case, means an individual or a legal entity
|
||||
exercising rights under, and complying with all of the terms of, this License.
|
||||
For legal entities, "You" includes any entity that controls, is controlled by,
|
||||
or is under common control with you. For purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the direction or
|
||||
management of such entity, whether by contract or otherwise, or (ii) ownership
|
||||
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||
ownership of such entity.
|
||||
|
||||
15) Right to Use. You may use the Original Work in all ways not otherwise
|
||||
restricted or conditioned by this License or by law, and Licensor promises not
|
||||
to interfere with or be responsible for such uses by You.
|
||||
|
||||
16) Modification of This License. This License is Copyright © 2005 Lawrence
|
||||
Rosen. Permission is granted to copy, distribute, or communicate this License
|
||||
without modification. Nothing in this License permits You to modify this
|
||||
License as applied to the Original Work or to Derivative Works. However, You
|
||||
may modify the text of this License and copy, distribute or communicate your
|
||||
modified version (the "Modified License") and apply it to other original works
|
||||
of authorship subject to the following conditions: (i) You may not indicate in
|
||||
any way that your Modified License is the "Open Software License" or "OSL" and
|
||||
you may not use those names in the name of your Modified License; (ii) You
|
||||
must replace the notice specified in the first paragraph above with the notice
|
||||
"Licensed under <insert your license name here>" or with a notice of your own
|
||||
that is not confusingly similar to the notice in this License; and (iii) You
|
||||
may not claim that your original works are open source software unless your
|
||||
Modified License has been approved by Open Source Initiative (OSI) and You
|
||||
comply with its license review and certification process.
|
||||
|
|
|
@ -25,7 +25,7 @@ Alternative (npm, nodejs required):
|
|||
# Credits
|
||||
[ArmCord UI Elements and few features](https://github.com/kckarnige)
|
||||
[GooseMod](https://github.com/GooseMod/GooseMod)
|
||||
[GooseMod-Chrome](https://github.com/AAGaming00/GooseMod-chrome)
|
||||
[GooseMod Extension](https://github.com/GooseMod/extension)
|
||||
[update.rocks](https://www.update.rocks)
|
||||
[electron-discord-webapp](https://github.com/SpacingBat3/electron-discord-webapp)
|
||||
[custom-electron-titlebar](https://github.com/AlexTorresSk/custom-electron-titlebar)
|
||||
|
|
4
build.sh
Normal file → Executable file
4
build.sh
Normal file → Executable file
|
@ -1,2 +1,2 @@
|
|||
npm i
|
||||
npm run make
|
||||
npm run package
|
||||
./dist/linux-unpacked/armcord
|
||||
|
|
BIN
build/icon.ico
Normal file
BIN
build/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
BIN
build/icon.png
Normal file
BIN
build/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 423 KiB |
|
@ -1,10 +0,0 @@
|
|||
chrome.webRequest.onHeadersReceived.addListener((h) => {
|
||||
h.responseHeaders.forEach((e, i) => {
|
||||
if (e.name.toLowerCase() === 'content-security-policy') {
|
||||
e.value = ''
|
||||
}
|
||||
})
|
||||
return {responseHeaders: h.responseHeaders}
|
||||
}, {urls: ["*://*.discord.com/*"]},
|
||||
['blocking', 'responseHeaders']
|
||||
)
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 AAGaming00
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,5 +0,0 @@
|
|||
const scr = document.createElement('script');
|
||||
|
||||
scr.src = 'https://goosemod-api.netlify.app/untethered/untetheredInject.js';
|
||||
|
||||
document.head.appendChild(scr);
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"name": "GooseMod",
|
||||
"version": "1.0",
|
||||
"description": "Loads GooseMod, a discord client modification",
|
||||
"background": {
|
||||
"scripts": [
|
||||
"CSP.js"
|
||||
]
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["*://*.discord.com/*"],
|
||||
"js": ["gm.js"]
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"webRequest",
|
||||
"webRequestBlocking",
|
||||
"*://*.discord.com/*"
|
||||
],
|
||||
"manifest_version": 2
|
||||
}
|
21
index.html
21
index.html
|
@ -3,8 +3,22 @@
|
|||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="refresh" content="5; URL=https://discord.com/app" />
|
||||
<title>ArmCord</title>
|
||||
<script>
|
||||
window.onload = setTimeout(function() {
|
||||
if (document.getElementById("ac-channel").innerHTML == "stable") {
|
||||
window.location.href = "https://discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "canary") {
|
||||
window.location.href = "https://canary.discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "ptb") {
|
||||
window.location.href = "https://ptb.discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "foss") {
|
||||
window.location.href = "https://dev.fosscord.com/app";
|
||||
} else {
|
||||
window.location.href = "https://discord.com/app";
|
||||
};
|
||||
}, 3000);
|
||||
</script>
|
||||
<style>
|
||||
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
|
||||
|
||||
|
@ -71,6 +85,10 @@
|
|||
color: #fff;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
#ac-channel {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
|
||||
|
@ -84,6 +102,7 @@
|
|||
</video>
|
||||
<p>Loading...</p>
|
||||
<h1></h1>
|
||||
<p id="ac-channel"></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
|
20
main.js
20
main.js
|
@ -4,7 +4,11 @@ const path = require("path");
|
|||
const contextMenu = require("electron-context-menu");
|
||||
const os = require("os");
|
||||
require("v8-compile-cache");
|
||||
require("./utils/updater");
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {
|
||||
var frame = true
|
||||
} else {
|
||||
var frame = false
|
||||
}
|
||||
|
||||
if (os.type() == 'Linux'){
|
||||
var iconformat = __dirname + "/discord.png"
|
||||
|
@ -31,7 +35,7 @@ function createWindow() {
|
|||
height: 600,
|
||||
icon: iconformat,
|
||||
title: "ArmCord",
|
||||
frame: false,
|
||||
frame: frame,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
enableRemoteModule: true,
|
||||
|
@ -41,7 +45,7 @@ function createWindow() {
|
|||
|
||||
var appIcon = new Tray(iconformat);
|
||||
mainWindow.webContents.userAgent =
|
||||
"Mozilla/5.0 (X12; FreeBSD x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
|
||||
"Mozilla/5.0 (X12; Linux x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
|
||||
mainWindow.loadFile("index.html");
|
||||
mainWindow.focus();
|
||||
mainWindow.webContents.on("new-window", function (e, url) {
|
||||
|
@ -73,6 +77,9 @@ function createWindow() {
|
|||
},
|
||||
},
|
||||
]);
|
||||
appIcon.on("click", () => {
|
||||
mainWindow.show()
|
||||
});
|
||||
|
||||
appIcon.setContextMenu(contextMenu);
|
||||
|
||||
|
@ -87,7 +94,7 @@ function createWindow() {
|
|||
try {
|
||||
appIcon();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
//console.error(error);
|
||||
// expected output: TypeError: appIcon is not a function
|
||||
}
|
||||
});
|
||||
|
@ -98,9 +105,8 @@ function createWindow() {
|
|||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
session.defaultSession.loadExtension(
|
||||
`${require("electron").app.getAppPath()}/goosemod/`
|
||||
);
|
||||
//require("./utils/csp.js");
|
||||
require("./utils/plugin.js");
|
||||
session
|
||||
.fromPartition("some-partition")
|
||||
.setPermissionRequestHandler((webContents, permission, callback) => {
|
||||
|
|
161
manager.css
Normal file
161
manager.css
Normal file
|
@ -0,0 +1,161 @@
|
|||
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
|
||||
|
||||
:root {
|
||||
background-color: #2f3136;
|
||||
user-select: none;
|
||||
--header-secondary: #b9bbbe;
|
||||
--header-primary: #fff;
|
||||
--background-tertiary: #202225;
|
||||
}
|
||||
|
||||
body {
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 0;
|
||||
text-align: center;
|
||||
transform: translateY(-105%);
|
||||
}
|
||||
|
||||
.logo:before {
|
||||
content: "ARM";
|
||||
color: #7289da;
|
||||
font-weight: normal;
|
||||
font-family: Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
font-family: Discordinated;
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
.disabled {
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
font-family: Helvetica, sans-serif;
|
||||
}
|
||||
.container {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
color: #fff;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
button.back-btn {
|
||||
position: absolute;
|
||||
background-color: #7289da;
|
||||
font-family: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: #ffffff;
|
||||
padding: 4px;
|
||||
border-radius: 5px;
|
||||
width: 105px;
|
||||
height: 25px;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button.back-btn:hover {
|
||||
background-color: #687dc6;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.back-btn:active {
|
||||
background-color: #5c6fb1;
|
||||
}
|
||||
|
||||
button#open-themes-btn {
|
||||
position: absolute;
|
||||
background-color: #7289da;
|
||||
font-family: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: #ffffff;
|
||||
padding: 4px;
|
||||
border-radius: 5px;
|
||||
width: 105px;
|
||||
height: 25px;
|
||||
margin-top: 5px;
|
||||
margin-right: 5px;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button#open-themes-btn:hover {
|
||||
background-color: #687dc6;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button#open-themes-btn:active {
|
||||
background-color: #5c6fb1;
|
||||
}
|
||||
|
||||
#tm-list {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
#tm-disabled {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
#tm-list-item {
|
||||
background: #23272a;
|
||||
font-family: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif;
|
||||
width: 100%;
|
||||
border-radius: 5px;
|
||||
padding: 10px 10px 18px;
|
||||
width: 420px;
|
||||
max-width: 820px;
|
||||
}
|
||||
|
||||
#theme-name {
|
||||
color: #7289da;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#theme-author {
|
||||
color: #99aab5;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#theme-description {
|
||||
color: #b9bbbe;
|
||||
font-size: 15px;
|
||||
position: relative;
|
||||
top: 8px;
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
#ac-channel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0.4em;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #202225;
|
||||
border-radius: 25px;
|
||||
}
|
18
manager.html
Normal file
18
manager.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>ArmCord Manager</title>
|
||||
<link rel="stylesheet" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<button class="back-btn">Back to Discord</button>
|
||||
<button id="open-themes-btn">Themes Folder</button>
|
||||
<p class="logo">Cord Manager</p>
|
||||
<div id="tm-list"></div>
|
||||
<p class="disabled">Disabled Themes:</p>
|
||||
<div id="tm-disabled"></div>
|
||||
<p id="ac-channel"></p>
|
||||
</body>
|
||||
</html>
|
12614
package-lock.json
generated
12614
package-lock.json
generated
File diff suppressed because it is too large
Load diff
88
package.json
88
package.json
|
@ -1,33 +1,29 @@
|
|||
{
|
||||
"name": "armcord",
|
||||
"name": "ArmCord",
|
||||
"version": "2.5.0",
|
||||
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron-forge start",
|
||||
"dist": "electron-builder",
|
||||
"start": "electron .",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"package": "electron-forge package",
|
||||
"publish": "electron-forge publish",
|
||||
"make": "electron-forge make"
|
||||
"package": "electron-builder --dir",
|
||||
"make": "electron-builder",
|
||||
"linux-build": "electron-builder --linux deb tar.gz rpm AppImage",
|
||||
"windows-build": "electron-builder --windows nsis portable zip appx"
|
||||
},
|
||||
"author": "smartfrigde",
|
||||
"license": "MIT",
|
||||
"author": "smartfrigde <smartfridge1337@protonmail.com>",
|
||||
"license": "OSL-3.0",
|
||||
"dependencies": {
|
||||
"custom-electron-titlebar": "3.2.7",
|
||||
"electron-context-menu": "^3.0.0",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"electron-store": "^8.0.0",
|
||||
"unzipper": "^0.10.1",
|
||||
"v8-compile-cache": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^6.0.0-beta.54",
|
||||
"@electron-forge/maker-deb": "^6.0.0-beta.55",
|
||||
"@electron-forge/maker-rpm": "^6.0.0-beta.55",
|
||||
"@electron-forge/maker-squirrel": "^6.0.0-beta.55",
|
||||
"@electron-forge/maker-zip": "^6.0.0-beta.55",
|
||||
"@electron-forge/publisher-github": "*",
|
||||
"electron": "latest"
|
||||
"electron": "latest",
|
||||
"electron-builder": "^22.11.7"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -38,47 +34,25 @@
|
|||
"discord",
|
||||
"electron"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/smartfrigde/armcord/issues"
|
||||
},
|
||||
"homepage": "https://github.com/smartfrigde/armcord#readme",
|
||||
"config": {
|
||||
"forge": {
|
||||
"packagerConfig": {},
|
||||
"makers": [
|
||||
{
|
||||
"name": "@electron-forge/maker-squirrel",
|
||||
"config": {
|
||||
"name": "armcord"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-zip",
|
||||
"platforms": [
|
||||
"darwin",
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-deb",
|
||||
"config": {}
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-rpm",
|
||||
"config": {}
|
||||
}
|
||||
],
|
||||
"publishers": [
|
||||
{
|
||||
"name": "@electron-forge/publisher-github",
|
||||
"config": {
|
||||
"repository": {
|
||||
"owner": "erikhofer",
|
||||
"name": "electron-publish-example"
|
||||
}
|
||||
}
|
||||
}
|
||||
"build": {
|
||||
"appId": "com.smartfridge.armcord",
|
||||
"productName": "ArmCord",
|
||||
"mac": {
|
||||
"category": "Network"
|
||||
},
|
||||
"linux": {
|
||||
"maintainer": "smartfridge1337@protonmail.com",
|
||||
"target": [
|
||||
"deb",
|
||||
"tar.gz",
|
||||
"rpm",
|
||||
"AppImage"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/smartfrigde/armcord/issues",
|
||||
"email": "smartfridge1337@protonmail.com"
|
||||
},
|
||||
"homepage": "https://github.com/smartfrigde/armcord#readme"
|
||||
}
|
||||
|
|
24
preload.js
24
preload.js
|
@ -1,15 +1,16 @@
|
|||
const { remote } = require("electron");
|
||||
const currentWindow = remote.getCurrentWindow();
|
||||
const customTitlebar = require("custom-electron-titlebar");
|
||||
const electronLocalshortcut = require("electron-localshortcut");
|
||||
const { remote } = require("electron");
|
||||
const ArmCord = require("./utils/ArmCord.js");
|
||||
|
||||
require("./utils/theme.js");
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {console.log("Using native titlebar")} else {
|
||||
new customTitlebar.Titlebar({
|
||||
backgroundColor: customTitlebar.Color.fromHex("#202225"),
|
||||
menu: false,
|
||||
});
|
||||
});}
|
||||
|
||||
const currentWindow = remote.getCurrentWindow();
|
||||
electronLocalshortcut.register(currentWindow, "F5", () => {
|
||||
location.reload();
|
||||
});
|
||||
|
@ -20,7 +21,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
require("shell").openExternal("https://support.discord.com/");
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F2", () => {
|
||||
window.location.href = "https://discord.com/invite/F25bc4RYDt";
|
||||
window.location.href = "/invite/F25bc4RYDt";
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F4", () => {
|
||||
currentWindow.loadFile("./manager.html");
|
||||
});
|
||||
require("./utils/capturer.js");
|
||||
|
||||
|
@ -30,6 +34,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
--window-buttons: var(--header-secondary);
|
||||
--cord-color: var(--header-primary);
|
||||
--armcord-color: #7289da;
|
||||
--titlebar-color: var(--background-tertiary);
|
||||
}
|
||||
.base-3dtUhz, .sidebar-2K8pFh {
|
||||
display: -webkit-box;
|
||||
|
@ -61,15 +66,18 @@ div.menubar[role="menubar"] {
|
|||
.window-title {
|
||||
font-size: 0px !important;
|
||||
margin-left: initial !important;
|
||||
transform: translate(10px, 2px) !important;
|
||||
transform: translate(10px, 2px);
|
||||
}
|
||||
.titlebar {
|
||||
background: var(--background-tertiary) !important;
|
||||
background: var(--titlebar-color) !important;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
.titlebar .window-controls-container .window-icon {
|
||||
background: var(--window-buttons) !important;
|
||||
}
|
||||
.notice-3bPHh-.colorDefault-22HBa0 {
|
||||
display: none;
|
||||
}
|
||||
`);
|
||||
|
||||
ArmCord.addStyle(
|
||||
|
@ -85,4 +93,6 @@ div.menubar[role="menubar"] {
|
|||
text-transform: none;
|
||||
}`
|
||||
);
|
||||
|
||||
document.getElementById("ac-channel").innerHTML = ArmCord.Channel;
|
||||
});
|
||||
|
|
55
renderer.js
55
renderer.js
|
@ -1,55 +0,0 @@
|
|||
// This file is required by the index.html file and will
|
||||
// be executed in the renderer process for that window.
|
||||
// All of the Node.js APIs are available in this process.
|
||||
const remote = require('electron').remote;
|
||||
|
||||
const win = remote.getCurrentWindow(); /* Note this is different to the
|
||||
html global `window` variable */
|
||||
|
||||
// When document has loaded, initialise
|
||||
document.onreadystatechange = (event) => {
|
||||
if (document.readyState == "complete") {
|
||||
handleWindowControls();
|
||||
|
||||
document.getElementById('electron-ver').innerHTML = `${process.versions.electron}`
|
||||
}
|
||||
};
|
||||
|
||||
window.onbeforeunload = (event) => {
|
||||
/* If window is reloaded, remove win event listeners
|
||||
(DOM element listeners get auto garbage collected but not
|
||||
Electron win listeners as the win is not dereferenced unless closed) */
|
||||
win.removeAllListeners();
|
||||
}
|
||||
|
||||
function handleWindowControls() {
|
||||
// Make minimise/maximise/restore/close buttons work when they are clicked
|
||||
document.getElementById('min-button').addEventListener("click", event => {
|
||||
win.minimize();
|
||||
});
|
||||
|
||||
document.getElementById('max-button').addEventListener("click", event => {
|
||||
win.maximize();
|
||||
});
|
||||
|
||||
document.getElementById('restore-button').addEventListener("click", event => {
|
||||
win.unmaximize();
|
||||
});
|
||||
|
||||
document.getElementById('close-button').addEventListener("click", event => {
|
||||
win.close();
|
||||
});
|
||||
|
||||
// Toggle maximise/restore buttons when maximisation/unmaximisation occurs
|
||||
toggleMaxRestoreButtons();
|
||||
win.on('maximize', toggleMaxRestoreButtons);
|
||||
win.on('unmaximize', toggleMaxRestoreButtons);
|
||||
|
||||
function toggleMaxRestoreButtons() {
|
||||
if (win.isMaximized()) {
|
||||
document.body.classList.add('maximized');
|
||||
} else {
|
||||
document.body.classList.remove('maximized');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,16 @@
|
|||
exports.Version = require("../package.json").version;
|
||||
|
||||
const fs = require("fs");
|
||||
const electron = require("electron");
|
||||
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
|
||||
const settingsFile= userDataPath + "/settings.json";
|
||||
if (!fs.existsSync(settingsFile)) {
|
||||
fs.writeFile(settingsFile, "{}", (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
console.log("Created settings.json file");
|
||||
}
|
||||
exports.Channel = require(settingsFile).channel;
|
||||
exports.Titlebar = require(settingsFile).titlebar;
|
||||
exports.addStyle = function(styleString) {
|
||||
const style = document.createElement('style');
|
||||
style.textContent = styleString;
|
||||
|
|
67
utils/plugin.js
Normal file
67
utils/plugin.js
Normal file
|
@ -0,0 +1,67 @@
|
|||
const fs = require("fs");
|
||||
const { app, session } = require("electron");
|
||||
const electron = require("electron");
|
||||
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
|
||||
const pluginFolder = userDataPath + "/plugins/";
|
||||
if (!fs.existsSync(pluginFolder)) {
|
||||
fs.mkdirSync(pluginFolder);
|
||||
console.log("Created plugin folder")
|
||||
try {
|
||||
console.log("Attempting to download GooseMod Extension")
|
||||
const https = require("https");
|
||||
|
||||
function download(url, dest, cb) {
|
||||
const file = fs.createWriteStream(dest);
|
||||
const request = https
|
||||
.get(url, function (response) {
|
||||
response.pipe(file);
|
||||
file.on("finish", function () {
|
||||
file.close(cb); // close() is async, call cb after close completes.
|
||||
});
|
||||
})
|
||||
.on("error", function (err) {
|
||||
// Handle errors
|
||||
fs.unlink(dest); // Delete the file async. (But we don't check the result)
|
||||
if (cb) cb(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
// Download latest archive from GitHub to temp folder
|
||||
const dest = userDataPath + "/Cache/GooseMod.zip";
|
||||
const url =
|
||||
"https://codeload.github.com/GooseMod/Extension/zip/refs/heads/main";
|
||||
download(url, dest, function () {
|
||||
console.log("Downloaded, attempting to install.");
|
||||
const unzip = require("unzipper")
|
||||
fs.createReadStream(dest).pipe(unzip.Extract({ path: pluginFolder }));
|
||||
electron.dialog.showMessageBox({
|
||||
title: "ArmCord",
|
||||
type: "warning",
|
||||
message: "ArmCord has installed GooseMod onto your client.",
|
||||
detail:
|
||||
"If you wish to use it restart your ArmCord completely using tray icon. It should appear in next session. GooseMod is reccomended to every user of ArmCord due to various improvements and bugfixes it ships with. You won't be able to load themes or see any of ArmCord specific CSS patches including fixed font logo at the top.",
|
||||
});
|
||||
});
|
||||
}
|
||||
catch (e){
|
||||
console.error(`GooseMod failed to download. Error: ${e}`)
|
||||
}
|
||||
}
|
||||
app.whenReady().then(() => {
|
||||
fs.readdirSync(pluginFolder).forEach((file) => {
|
||||
try {
|
||||
const manifest = fs.readFileSync(
|
||||
`${userDataPath}/plugins/${file}/manifest.json`,
|
||||
"utf8"
|
||||
);
|
||||
var pluginFile = JSON.parse(manifest);
|
||||
session.defaultSession.loadExtension(`${userDataPath}/plugins/${file}`);
|
||||
console.log(
|
||||
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,
|
||||
"color:red"
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
53
utils/theme.js
Normal file
53
utils/theme.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
const fs = require("fs");
|
||||
const {shell} = require('electron');
|
||||
const electron = require("electron");
|
||||
const ArmCord = require("./ArmCord.js");
|
||||
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
|
||||
const themeFolder = userDataPath + "/themes/";
|
||||
if (!fs.existsSync(themeFolder)) {
|
||||
fs.mkdirSync(themeFolder);
|
||||
console.log("Created theme folder");
|
||||
}
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
console.log("Theme Module Loaded"); // I KNOW THIS IS A MESS BUT IT'S WORKING MESS, XOXO
|
||||
fs.readdirSync(themeFolder).forEach((file) => {
|
||||
try {
|
||||
if (file.includes('DISABLED')) {
|
||||
console.log(`Skipping ${file}.`)
|
||||
const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8");
|
||||
var themeFile = JSON.parse(manifest);
|
||||
var html = `<div id="tm-list-item"><div id="theme-name">${themeFile.name}</div><div id="theme-author">By ${themeFile.author}</div><div id="theme-description">${themeFile.description}</div></div><br><br>`;
|
||||
document.getElementById("tm-disabled").innerHTML = html + document.getElementById("tm-disabled").innerHTML;
|
||||
}
|
||||
const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8");
|
||||
var themeFile = JSON.parse(manifest);
|
||||
const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8");
|
||||
if (themeFile.theme.endsWith(".scss")) {
|
||||
console.log(
|
||||
`%cCouldn't load ${themeFile.name} made by ${themeFile.author}. ArmCord doesn't support SCSS files! If you want to have this theme ported, feel free to reach out https://discord.gg/F25bc4RYDt `,
|
||||
"color:red; font-weight: bold; font-size: 50px;color: red;"
|
||||
);
|
||||
}
|
||||
ArmCord.addStyle(theme);
|
||||
var html = `<div id="tm-list-item"><div id="theme-name">${themeFile.name}</div><div id="theme-author">By ${themeFile.author}</div><div id="theme-description">${themeFile.description}</div></div><br><br>`;
|
||||
document.getElementById("tm-list").innerHTML = html + document.getElementById("tm-list").innerHTML;
|
||||
console.log(`%cLoaded ${themeFile.name} made by ${themeFile.author}`, "color:red");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
document.getElementById("open-themes-btn").onclick = function () {shell.openPath(`${userDataPath}/themes`);};
|
||||
document.getElementsByClassName("back-btn")[0].onclick = function () {
|
||||
if (document.getElementById("ac-channel").innerHTML == "stable") {
|
||||
window.location.href = "https://discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "canary") {
|
||||
window.location.href = "https://canary.discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "ptb") {
|
||||
window.location.href = "https://ptb.discord.com/app";
|
||||
} else if (document.getElementById("ac-channel").innerHTML == "foss") {
|
||||
window.location.href = "https://dev.fosscord.com/app";
|
||||
} else {
|
||||
window.location.href = "https://discord.com/app";
|
||||
};
|
||||
};
|
||||
});
|
|
@ -1,66 +0,0 @@
|
|||
const electron = require("electron");
|
||||
const APP_VERSION = require("../package.json").version;
|
||||
|
||||
/* IMPORTANT!
|
||||
This url will need to be modified for yours */
|
||||
// The url that the application is going to query for new release
|
||||
const AUTO_UPDATE_URL =
|
||||
'https://api.update.rocks/update/github.com/smartfrigde/armcord/stable/' + process.platform + '/' + APP_VERSION
|
||||
|
||||
function init() {
|
||||
if (process.platform === "linux") {
|
||||
/* There is no auto update for linux however you can still
|
||||
notify the user that a new update has been released
|
||||
our service will return an answer with the latest version. */
|
||||
console.log("Auto updates not available on linux");
|
||||
} else {
|
||||
initDarwinWin32();
|
||||
}
|
||||
}
|
||||
|
||||
function initDarwinWin32() {
|
||||
electron.autoUpdater.on("error", (err) =>
|
||||
console.error(`Update error: ${err.message}`)
|
||||
);
|
||||
|
||||
electron.autoUpdater.on("checking-for-update", () =>
|
||||
console.log("Checking for update")
|
||||
);
|
||||
|
||||
electron.autoUpdater.on("update-available", () =>
|
||||
console.log("Update available")
|
||||
);
|
||||
|
||||
electron.autoUpdater.on("update-not-available", () =>
|
||||
console.log("No update available")
|
||||
);
|
||||
|
||||
// Ask the user if he wants to update if update is available
|
||||
electron.autoUpdater.on(
|
||||
"update-downloaded",
|
||||
(event, releaseNotes, releaseName) => {
|
||||
dialog.showMessageBox(
|
||||
window,
|
||||
{
|
||||
type: "question",
|
||||
buttons: ["Update", "Cancel"],
|
||||
defaultId: 0,
|
||||
message: `Version ${releaseName} is available, do you want to install it now?`,
|
||||
title: "Update available",
|
||||
},
|
||||
(response) => {
|
||||
if (response === 0) {
|
||||
electron.autoUpdater.quitAndInstall();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
electron.autoUpdater.setFeedURL(AUTO_UPDATE_URL);
|
||||
electron.autoUpdater.checkForUpdates();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init,
|
||||
};
|
Loading…
Reference in a new issue