Compare commits

...

36 commits

Author SHA1 Message Date
dependabot[bot]
7d79b56390
Update prettier requirement from ^2.7.0 to ^2.7.1
Updates the requirements on [prettier](https://github.com/prettier/prettier) to permit the latest version.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.0...2.7.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-14 15:27:57 +00:00
smartfridge
c8e6855a02 Merge remote-tracking branch 'origin/dev' into dev 2022-07-14 17:26:10 +02:00
smartfridge
c933981420 Add fixes for pasting images using keyboard shortcuts 2022-07-14 17:25:59 +02:00
smartfridge
9f9b4deae9
Update issue templates 2022-07-14 17:12:04 +02:00
altinat
05daca16d4
Translated using Weblate (Thai)
Currently translated at 100.0% (29 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-07-13 17:17:00 +02:00
smartfridge
83b4f75e87 Add experimental Hummus support 2022-07-12 16:10:41 +02:00
smartfridge
5b509d948f code cleanup part 2 2022-07-11 21:42:35 +02:00
smartfridge
d8fe49df3f Merge remote-tracking branch 'origin/dev' into dev 2022-07-11 20:20:00 +02:00
smartfridge
0ebaa5627e code cleanup 2022-07-11 20:19:50 +02:00
Anonymous
251f4d55ff
Translated using Weblate (Portuguese (Brazil))
Currently translated at 68.9% (20 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/
2022-07-11 19:17:59 +02:00
Anonymous
a3ac768f25
Translated using Weblate (Russian)
Currently translated at 93.1% (27 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/
2022-07-11 19:17:59 +02:00
Anonymous
efe835be04
Translated using Weblate (Persian)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fa/
2022-07-11 19:17:59 +02:00
Anonymous
e946615770
Translated using Weblate (Thai)
Currently translated at 96.5% (28 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-07-11 19:17:58 +02:00
Anonymous
db9bfbb269
Translated using Weblate (Spanish (Latin America))
Currently translated at 79.3% (23 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/es_419/
2022-07-11 19:17:58 +02:00
Anonymous
56c7b68c47
Translated using Weblate (Indonesian)
Currently translated at 96.5% (28 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/id/
2022-07-11 19:17:58 +02:00
Anonymous
69012c95a0
Translated using Weblate (Polish)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pl/
2022-07-11 19:17:58 +02:00
Anonymous
7afb3962dc
Translated using Weblate (Dutch)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/nl/
2022-07-11 19:17:58 +02:00
Anonymous
b25ff8dec3
Translated using Weblate (Norwegian Bokmål)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/nb_NO/
2022-07-11 19:17:58 +02:00
Anonymous
6e30ffa7bf
Translated using Weblate (Italian)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/it/
2022-07-11 19:17:57 +02:00
Anonymous
40dc67f0a8
Translated using Weblate (French)
Currently translated at 82.7% (24 of 29 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fr/
2022-07-11 19:17:57 +02:00
Rafael V
9c2b00d56f
Translated using Weblate (Portuguese (Brazil))
Currently translated at 71.4% (20 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/
2022-07-11 19:17:53 +02:00
smartfridge
d6cbbcba7d Add mobile mode 2022-07-11 19:17:46 +02:00
Anonymous
1a7af5168d
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (0 of 0 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/
2022-07-10 19:45:26 +02:00
Rafael V
b4f2265efb
Added translation using Weblate (Portuguese (Brazil)) 2022-07-10 19:45:23 +02:00
KayoticCarnige
f272bb822e
Update README.md 2022-07-09 18:46:17 -04:00
The_BadUser
73c9e8ecb7
Translated using Weblate (Russian)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/
2022-07-08 20:20:50 +02:00
smartfrigde
927f498872 Move to armcord.xyz for loading files 2022-07-08 19:40:08 +02:00
KayoticCarnige
774a8bea2b Merge branch 'dev' of https://github.com/ArmCord/ArmCord into dev 2022-07-07 19:54:55 -04:00
KayoticCarnige
1d916df998 Update README.md 2022-07-07 19:53:17 -04:00
KayoticCarnige
161b18a725
Update README.md 2022-07-07 16:36:09 -04:00
KayoticCarnige
46a3f3e17b Update README.md 2022-07-07 15:31:29 -04:00
Anonymous
e59c074230
Translated using Weblate (Russian)
Currently translated at 100.0% (0 of 0 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/
2022-07-07 19:25:07 +02:00
Azhar Pusparadhian
249619419f
Translated using Weblate (Indonesian)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/id/
2022-07-07 19:25:07 +02:00
KayoticCarnige
c4aba0bc1b
Translated using Weblate (English (United States))
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/en_US/
2022-07-07 19:25:07 +02:00
The_BadUser
0d1e174d60
Added translation using Weblate (Russian) 2022-07-07 19:25:04 +02:00
smartfrigde
033e5b7973 Forgot to remove debug thing 2022-07-05 19:02:49 +02:00
41 changed files with 509 additions and 322 deletions

32
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Linux, Windows, macOS]
- Method of installation [e.g. snap, setup exe, aur]
- Version [e.g. 3.0.7]
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

5
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

12
.idea/ArmCord.iml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,21 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="color" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
</profile>
</component>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ArmCord.iml" filepath="$PROJECT_DIR$/.idea/ArmCord.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -1,6 +1,6 @@
<div align="center">
<img src="https://armcord.vercel.app/logo.png" width="520">
<img src="https://armcord.xyz/logo.png" width="520">
<br>ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight.
</div>
@ -8,27 +8,27 @@
- **Standalone client**
ArmCord is built as standalone client, it doesn't rely on original Discord client.
ArmCord is built as a standalone client and doesn't rely on the original Discord client in anyway.
- **Various mods built in**
Explore Cumcord/GooseMod/Flicker plugins and their features!
Enjoy Cumcord, GooseMod, Flicker, and their many features, or have a more vanilla experience, it's your choice!
- **Made for Privacy**
- **Made for Privacy**
ArmCord automatically blocks Discord's trackers.
ArmCord automatically blocks all of Discord's trackers; even without any client mods you can feel safe and secure!
- **Faster than normal Discord app**
- **Much more stable**
ArmCord is using newer Electron than stock Discord app. This usually means increased performance and more stable experience.
ArmCord is using a newer build of Electron than the stock Discord app. This means you can have a much more stable and secure experience, along with slightly better performance.
- **Designed to work anywhere**
- **Cross-platform support!**
ArmCord was initially created in mind to run on Arm64 Linux devices. We soon expanded our support to more platforms. We plan to support every platform that [Electron supports](https://www.electronjs.org/docs/latest/tutorial/support#supported-platforms).
ArmCord was originally created for ARM64 Linux devices, since Discord doesn't support them. We soon decided to support every platform that [Electron supports](https://github.com/electron/electron#platform-support)!
# How to run/install it?
### Recommended:
@ -48,8 +48,10 @@ ArmCord is also available on the Snap store [here](https://snapcraft.io/armcord)
### Pi-Apps
ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps).
[![badge](https://github.com/Botspot/pi-apps/blob/master/icons/badge.png?raw=true)](https://github.com/Botspot/pi-apps)
### Manual:
Alternatively you can run ArmCord from source (npm, nodejs required):
### Compiling:
Alternatively you can run ArmCord from source (NodeJS and npm required):
1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git`
2. Run `npm install` to install dependencies
3. Build with `npm run build`
@ -57,24 +59,29 @@ ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps).
# FAQ
## 1. Will I get banned from using it?
## Will I get banned for using this?
- You are breaking [Discord ToS](https://discord.com/terms#software-in-discord%E2%80%99s-services) by using ArmCord, but no one has been banned from using it or any of the client mods included.
- You are breaking Discord ToS if you decided to use client mods. But no one ever got banned from using ArmCord or any of the client mods included. If you wish to remove mods, check our documentation.
## 2. How does this work?
## Can I use this on anything other than ARM?
- Yes! ArmCord should work normally under Windows, MacOS and Linux as long as it has Electron support.
- We are using official web app and adding some magic powder to make it all work!
## 3. Can I use this on other architectures or operating systems?
## How does this work?
- We are using the official web app and adding some magic powder to make it all work!
## Where can I find the source code?
- The source code is on [GitHub](https://github.com/ArmCord/ArmCord/).
## Where can I translate this?
- Translations are done using our [Weblate page](https://hosted.weblate.org/projects/armcord/armcord/). They're pushed to this [repo](https://github.com/ArmCord/i18n).
- Yes! ArmCord should work normally under Windows, Mac OS and Linux as long as it has NodeJS, npm and Electron support.
## 4. Where can I translate this?
- Translations are done using our [Weblate page](https://hosted.weblate.org/projects/armcord/armcord/). They're pushed to this [repo](https://github.com/ArmCord/i18n).
# Credits
[ArmCord UI Elements and few features](https://github.com/kckarnige)
[ArmCord UI design, branding, and a few features](https://github.com/kckarnige)
[Cumcord](https://github.com/Cumcord/Cumcord)
[GooseMod](https://github.com/GooseMod/GooseMod)
[GooseMod Extension](https://github.com/GooseMod/extension)
[GooseMod](https://github.com/GooseMod/GooseMod)
[GooseMod Extension](https://github.com/GooseMod/extension)
[FlickerMod](https://github.com/FlickerMod)
[electron-discord-webapp](https://github.com/SpacingBat3/electron-discord-webapp)
[custom-electron-titlebar (css only)](https://github.com/AlexTorresSk/custom-electron-titlebar)
(Pre v3.0.6) [custom-electron-titlebar](https://github.com/AlexTorresSk/custom-electron-titlebar)
[electron-builder](https://electron.build)
[OpenAsar](https://github.com/GooseMod/OpenAsar)
# Sponsors

View file

@ -18,6 +18,7 @@
"settings-theme-native": "Native",
"settings-tray": "Minimize to tray",
"settings-patches": "Automatic Patches",
"settings-mobileMode": "Mobile mode",
"settings-channel": "Discord channel:",
"settings-invitewebsocket": "Invite Websocket",
"settings-mod": "Client mod:",
@ -25,6 +26,6 @@
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery",
"settings-none": "None",
"settings-save": "Save settings",
"settings-save": "Save Settings",
"settings-updater": "Check for updates"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode-battery": "Batería",
"settings-none": "Ninguna",
"settings-save": "Guardar ajustes",
"settings-updater": "Buscar una actualización"
"settings-updater": "Buscar una actualización",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode-battery": "ذخیره برای باتری",
"settings-none": "هیچکدام",
"settings-save": "ذخیره تنظیمات",
"settings-updater": "بررسی برای بروزرسانی"
"settings-updater": "بررسی برای بروزرسانی",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode": "Mode performance :",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Batterie",
"settings-none": "Aucun"
"settings-none": "Aucun",
"settings-mobileMode": "Mobile mode"
}

View file

@ -1,30 +1,31 @@
{
"loading_screen_start": "Starting ArmCord…",
"loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.",
"loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.",
"setup_question1": "Select what kind of setup you want to perform:",
"setup_question1_answer1": "Express setup",
"setup_question1_answer2": "Full setup",
"setup_question2": "Choose your Discord channel/instance:",
"setup_offline": "You appear to be offline. Please connect to the Internet and restart the ArmCord setup.",
"setup_question3": "Should ArmCord handle client mods installation?",
"yes": "Yes",
"no": "No",
"next": "Next",
"setup_question4": "Select a client mod you want to install:",
"setup_question4_clientmodnotice": "Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our documentation.",
"settings-theme": "ArmCord Theme:",
"settings-theme-default": "Default",
"settings-theme-native": "Native",
"settings-tray": "Minimize to tray",
"settings-patches": "Automatic Patches",
"settings-channel": "Discord channel:",
"settings-invitewebsocket": "discord.gg support",
"settings-mod": "Client mod:",
"settings-save": "Save settings",
"settings-updater": "Check for updates",
"settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery",
"settings-none": "None"
"loading_screen_start": "memulai ArmCord…",
"loading_screen_offline": "tampaknya anda sedang offline. Silahkan sambungkan ke internet dan coba lagi.",
"loading_screen_update": "versi terbaru ArmCord tersedia. Silahkan perbaharui ke versi terbaru.",
"setup_question1": "pilih jenis pengaturan yang ingin anda tampilkan:",
"setup_question1_answer1": "pengaturan cepat",
"setup_question1_answer2": "pengaturan penuh",
"setup_question2": "pilih saluran Discord anda/instansi:",
"setup_offline": "tampaknya anda sedang offline. silahkan sambungkan ke internet dan muat ulang ArmCord.",
"setup_question3": "bolehkah ArmCord menangani pemasangan mods klien?",
"yes": "iya",
"no": "tidak",
"next": "berikutnya",
"setup_question4": "Pilih mod klien yang ingin anda pasang:",
"setup_question4_clientmodnotice": "kenapa tidak semuanya? memiliki mod klien lebih saat bersamaan bisa menyebabkan masalah. jika anda tetap ingin melakukannya, cek di Discord kami.",
"settings-theme": "Tema ArmCord:",
"settings-theme-default": "Bawaan",
"settings-theme-native": "asli",
"settings-tray": "kecilkan ke tray",
"settings-patches": "Patch otomatis",
"settings-channel": "Saluran Discord:",
"settings-invitewebsocket": "mengajak soket web",
"settings-mod": "klien mod:",
"settings-save": "simpan pengaturan",
"settings-updater": "periksa pembaharuan",
"settings-prfmMode": "mode kinerja:",
"settings-prfmMode-performance": "kinerja",
"settings-prfmMode-battery": "Baterai",
"settings-none": "tidak ada",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery",
"settings-none": "None"
"settings-none": "None",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery",
"settings-none": "None"
"settings-none": "None",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-none": "None",
"settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery"
"settings-prfmMode-battery": "Battery",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-prfmMode": "Tryb wydajności:",
"settings-prfmMode-performance": "Wydajny",
"settings-prfmMode-battery": "Bateria",
"settings-none": "Nic/Brak"
"settings-none": "Nic/Brak",
"settings-mobileMode": "Mobile mode"
}

31
assets/lang/pt-BR.json Normal file
View file

@ -0,0 +1,31 @@
{
"no": "Não",
"loading_screen_start": "Iniciando ArmCord…",
"loading_screen_offline": "Você parece estar offline. Conecte-se à internet e tente novamente.",
"loading_screen_update": "Uma nova versão do ArmCord está disponível. Atualize para a versão mais recente.",
"setup_question1": "Selecione que tipo de instação você quer fazer:",
"setup_question1_answer1": "Instalação rápida",
"setup_question1_answer2": "Instalação completa",
"setup_offline": "Você parece estar offline. Conecte-se à internet e tente novamente.",
"setup_question2": "Escolha o canal/instância do seu Discord",
"setup_question3": "O ArmCord deve suportar a instalação dos mods de cliente?",
"yes": "Sim",
"next": "Próximo",
"setup_question4": "Selecione um mod de cliente que você quer instalar:",
"setup_question4_clientmodnotice": "Por que não todos eles? Tendo vários mods de cliente ao mesmo tempo pode causar problemas, Se você realmente quer fazer isso mesmo assim, veja o nosso Discord.",
"settings-theme": "Tema do ArmCord:",
"settings-theme-default": "Padrão",
"settings-theme-native": "Nativo",
"settings-tray": "Minimizar para a bandeja",
"settings-patches": "Patches automáticos",
"settings-channel": "Tipo de Discord:",
"settings-invitewebsocket": "Invite Websocket",
"settings-mod": "Client mod:",
"settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery",
"settings-none": "None",
"settings-save": "Save Settings",
"settings-updater": "Check for updates",
"settings-mobileMode": "Mobile mode"
}

31
assets/lang/ru-RU.json Normal file
View file

@ -0,0 +1,31 @@
{
"loading_screen_start": "Запуск ArmCord…",
"loading_screen_offline": "Видимо, вы не в сети. Подключитесь к Интернету и повторите попытку.",
"loading_screen_update": "Доступна новая версия ArmCord. Обновите до последней версии.",
"setup_question1": "Выберите, какую настройку хотите выполнить:",
"setup_question1_answer1": "Экспресс-настройка",
"setup_question1_answer2": "Полная настройка",
"setup_offline": "Видимо, вы не в сети. Подключитесь к Интернету и перезапустите ArmCord.",
"setup_question2": "Выберите свой канал/экземпляр Discord:",
"setup_question3": "Должен ли ArmCord заниматься установкой клиентских модов?",
"yes": "Да",
"no": "Нет",
"next": "Далее",
"setup_question4": "Выберите клиентский мод, который хотите установить:",
"setup_question4_clientmodnotice": "Почему не все? Наличие множества клиентских модов одновременно может вызвать проблемы. Если вы действительно хотите это сделать, посетите наш Discord.",
"settings-theme": "Тема ArmCord:",
"settings-theme-default": "По умолчанию",
"settings-theme-native": "Нативная",
"settings-tray": "Свернуть в область уведомлений",
"settings-patches": "Автоматические патчи",
"settings-channel": "Канал Discord:",
"settings-invitewebsocket": "Пригласить Websocket",
"settings-mod": "Клиентский мод:",
"settings-prfmMode": "Режим производительности:",
"settings-prfmMode-performance": "Производительность",
"settings-prfmMode-battery": "Батарея",
"settings-none": "Ничего",
"settings-save": "Сохранить настройки",
"settings-updater": "Проверить наличие обновлений",
"settings-mobileMode": "Mobile mode"
}

View file

@ -26,5 +26,6 @@
"settings-mod": "ไคลแอนต์มอด:",
"settings-none": "ไม่มี",
"settings-save": "บันทึกการตั้งค่า",
"settings-updater": "ตรวจหาการอัปเดต"
"settings-updater": "ตรวจหาการอัปเดต",
"settings-mobileMode": "โหมดมือถือ"
}

View file

@ -8,6 +8,7 @@
"watch": "tsc -w",
"start": "npm run build && electron ./ts-out/main.js",
"package": "npm run build && electron-builder",
"packageQuick": "npm run build && electron-builder --dir",
"format": "prettier --write src/**/*",
"CIbuild": "npm run build && electron-builder --linux zip && electron-builder --windows zip && electron-builder --macos zip",
"postinstall": "husky install"
@ -26,10 +27,10 @@
"@types/node": "^17.0.42",
"@types/ws": "^8.5.3",
"copyfiles": "^2.4.1",
"electron": "^19.0.7",
"electron": "^19.0.8",
"electron-builder": "^23.0.3",
"husky": "^8.0.1",
"prettier": "^2.7.0",
"prettier": "^2.7.1",
"typescript": "^4.7.3"
},
"dependencies": {

View file

@ -0,0 +1,6 @@
[aria-label~="Mute"] {
display: none;
}
[aria-label~="Deafen"] {
display: none;
}

View file

@ -0,0 +1,68 @@
.desktop-capturer-selection {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: rgba(30, 30, 30, 0.75);
color: #ffffff;
z-index: 10000000;
display: flex;
align-items: center;
justify-content: center;
}
.desktop-capturer-selection__scroller {
width: 100%;
max-height: 100vh;
overflow-y: auto;
}
.desktop-capturer-selection__list {
max-width: calc(100% - 100px);
margin: 50px;
padding: 0;
display: flex;
flex-wrap: wrap;
list-style: none;
overflow: hidden;
justify-content: center;
}
.desktop-capturer-selection__item {
display: flex;
margin: 4px;
}
.desktop-capturer-selection__btn {
display: flex;
flex-direction: column;
align-items: stretch;
width: 145px;
margin: 0;
border: 0;
border-radius: 3px;
padding: 4px;
background: #2c2f33;
text-align: left;
}
@media (prefers-reduced-motion: no-preference) {
}
.desktop-capturer-selection__btn:hover,
.desktop-capturer-selection__btn:focus {
background: #7289da;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.45), 0 0 2px rgba(0, 0, 0, 0.25);
color: #fff;
}
.desktop-capturer-selection__thumbnail {
width: 100%;
height: 81px;
object-fit: cover;
}
.desktop-capturer-selection__name {
margin: 6px 0;
white-space: nowrap;
color: white;
text-overflow: ellipsis;
text-align: center;
overflow: hidden;
}
.desktop-capturer-selection__name--cancel {
margin: auto 0;
}

View file

@ -38,7 +38,7 @@ SOFTWARE.*/
font-family: Whitney;
font-weight: 400;
font-style: normal;
src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff");
src: url(https://armcord.xyz/whitney_400.woff) format("woff");
}
html,

View file

@ -16,7 +16,7 @@
font-family: Whitney;
font-weight: 400;
font-style: normal;
src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff");
src: url(https://armcord.xyz/whitney_400.woff) format("woff");
}
html,

View file

@ -31,7 +31,7 @@ SOFTWARE.*/
font-family: Whitney;
font-weight: 400;
font-style: normal;
src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff");
src: url(https://armcord.xyz/whitney_400.woff) format("woff");
}
html,

View file

@ -31,7 +31,7 @@
<option value="stable">Stable</option>
<option value="canary">Canary</option>
<option value="ptb">PTB</option>
<option value="foss">Fosscord</option>
<option value="hummus">Hummus (unofficial)</option>
</select>
</div>
<p class="text-center setup-ask" id="setup_question3">
@ -121,6 +121,7 @@
automaticPatches: false,
mods: "cumcord",
inviteWebsocket: true,
mobileMode: false,
trayIcon: "ac_plug_colored",
performanceMode: "none"
});
@ -148,8 +149,8 @@
windowStyle: "default",
channel: options.channel,
armcordCSP: true,
autoLaunch: true,
minimizeToTray: true,
mobileMode: false,
automaticPatches: false,
performanceMode: "none",
trayIcon: "ac_plug_colored",
@ -165,7 +166,7 @@
armcordCSP: true,
minimizeToTray: true,
automaticPatches: false,
autoLaunch: true,
mobileMode: false,
mods: "none",
performanceMode: "none",
trayIcon: "ac_plug_colored",

View file

@ -18,7 +18,7 @@
<body>
<div class="container">
<video autoplay loop class="logo" id="splashscreen-armcord">
<source src="https://armcord.smartfridge.space/discord_loading.webm" type="video/webm" />
<source src="https://armcord.xyz/discord_loading.webm" type="video/webm" />
</video>
<p id="text-splashscreen"></p>
</div>
@ -38,7 +38,7 @@
if (data.version !== window.armcord.version) {
var elem = document.createElement("img");
elem.classList.add("logo");
elem.src = "https://armcord.smartfridge.space/update.webp";
elem.src = "https://armcord.xyz/update.webp";
document.body.prepend(elem);
document.getElementById("splashscreen-armcord").remove();
text.innerHTML = await armcord.getLang("loading_screen_update");
@ -58,8 +58,8 @@
case "ptb":
window.location.replace("https://ptb.discord.com/app");
break;
case "foss":
window.location.replace("https://dev.fosscord.com/app");
case "hummus":
window.location.replace("https://hummus.sys42.net/");
break;
case undefined:
window.location.replace("https://discord.com/app");

View file

@ -27,7 +27,8 @@ const unstrictCSP = () => {
"https://api.goosemod.com/inject.js",
"https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
"https://raw.githubusercontent.com/Cumcord/Cumcord/master/dist/build.js",
"https://raw.githubusercontent.com/FlickerMod/dist/main/build.js"
"https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
"https://localhost:1234/dist.js"
];
electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, url}, done) => {

View file

@ -50,7 +50,7 @@ export function registerIpc() {
var height= await getWindowState("height") ?? 600;
var isMaximized = await getWindowState("isMaximized") ?? false;
} catch (e) {
console.log("No window state file found. Fallbacking to default values.")
console.log("[Window state manager] No window state file found. Fallbacking to default values.")
mainWindow.setSize(800, 600);
}
if (isMaximized) {
@ -58,7 +58,7 @@ export function registerIpc() {
mainWindow.maximize()
} else {
mainWindow.setSize(width, height);
console.log("Not maximized.")
console.log("[Window state manager] Not maximized.")
}
});
ipcMain.on("restart", (event, arg) => {
@ -83,6 +83,9 @@ export function registerIpc() {
ipcMain.on("titlebar", (event, arg) => {
event.returnValue = customTitlebar;
});
ipcMain.on("mobileMode", async (event, arg) => {
event.returnValue = await getConfig("mobileMode");
});
ipcMain.on("shouldPatch", async (event, arg) => {
event.returnValue = await getConfig("automaticPatches");
});

View file

@ -6,7 +6,6 @@ import "./extensions/mods";
import "./extensions/plugin";
import "./tray";
import {createCustomWindow, createNativeWindow} from "./window";
import "./shortcuts";
export var settings: any;
export var customTitlebar: boolean;
@ -26,22 +25,25 @@ if (process.platform == "linux") {
checkIfConfigExists();
injectElectronFlags();
app.whenReady().then(async () => {
switch (await getConfig("windowStyle")) {
case "default":
createCustomWindow();
customTitlebar = true;
break;
case "native":
createNativeWindow();
break;
case "basic":
createNativeWindow();
break;
default:
createCustomWindow();
customTitlebar = true;
break;
async function init() {
switch (await getConfig("windowStyle")) {
case "default":
createCustomWindow();
customTitlebar = true;
break;
case "native":
createNativeWindow();
break;
case "basic":
createNativeWindow();
break;
default:
createCustomWindow();
customTitlebar = true;
break;
}
}
await init()
session.fromPartition("some-partition").setPermissionRequestHandler((webContents, permission, callback) => {
if (permission === "notifications") {
// Approves the permissions request
@ -54,24 +56,6 @@ app.whenReady().then(async () => {
});
app.on("activate", async function () {
if (BrowserWindow.getAllWindows().length === 0)
switch (await getConfig("windowStyle")) {
case "default":
createCustomWindow();
break;
case "native":
createNativeWindow();
break;
case "discord":
createNativeWindow();
break;
default:
createCustomWindow();
break;
}
console.log("userDataPath = " + app.getPath("userData"));
await init()
});
});
app.on("window-all-closed", function () {
if (process.platform !== "darwin") app.quit();
});

51
src/menu.ts Normal file
View file

@ -0,0 +1,51 @@
import { Menu, app, clipboard, globalShortcut } from "electron";
import {mainWindow} from "./window";
function paste(contents: any) {
const contentTypes = clipboard.availableFormats().toString();
//Workaround: fix pasting the images.
if(contentTypes.includes('image/') && contentTypes.includes('text/html')) {
clipboard.writeImage(clipboard.readImage());
}
contents.paste();
}
export function setMenu() {
globalShortcut.register("CmdOrCtrl+V", function () {
if (mainWindow.isFocused()) {
paste(mainWindow.webContents)
}
})
var template: Electron.MenuItemConstructorOptions[] = [{
label: "ArmCord",
submenu: [
{label: "About ArmCord", role: "about"},//orderFrontStandardAboutPanel
{type: "separator"},
{
label: "Developer tools", accelerator: "CmdOrCtrl+Shift+I", click: function () {
mainWindow.webContents.openDevTools()
}
},
{
label: "Quit", accelerator: "CmdOrCtrl+Q", click: function () {
app.quit();
}
}
]
}, {
label: "Edit",
submenu: [
{label: "Undo", accelerator: "CmdOrCtrl+Z", role: "undo"},
{label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", role: "redo"},
{type: "separator"},
{label: "Cut", accelerator: "CmdOrCtrl+X", role: "cut"},
{label: "Copy", accelerator: "CmdOrCtrl+C", role: "copy"},
{label: "Paste", accelerator: "CmdOrCtrl+V", click: function () {
paste(mainWindow.webContents)
}},
{label: "Select All", accelerator: "CmdOrCtrl+A", role: "selectAll"}
]
}
]
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
}

View file

@ -2,6 +2,8 @@
//original https://github.com/electron/electron/issues/16513#issuecomment-602070250
import {ipcRenderer} from "electron";
import {addStyle, addScript} from "../utils";
import fs from "fs";
import path from "path";
const desktopCapturer = {
getSources: (opts: any) => ipcRenderer.invoke("DESKTOP_CAPTURER_GET_SOURCES", opts)
};
@ -40,79 +42,6 @@ export async function getDisplayMediaSelector() {
</div>`;
}
const screenShareCSS = `
.desktop-capturer-selection {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: rgba(30,30,30,.75);
color: #FFFFFF;
z-index: 10000000;
display: flex;
align-items: center;
justify-content: center;
}
.desktop-capturer-selection__scroller {
width: 100%;
max-height: 100vh;
overflow-y: auto;
}
.desktop-capturer-selection__list {
max-width: calc(100% - 100px);
margin: 50px;
padding: 0;
display: flex;
flex-wrap: wrap;
list-style: none;
overflow: hidden;
justify-content: center;
}
.desktop-capturer-selection__item {
display: flex;
margin: 4px;
}
.desktop-capturer-selection__btn {
display: flex;
flex-direction: column;
align-items: stretch;
width: 145px;
margin: 0;
border: 0;
border-radius: 3px;
padding: 4px;
background: #2C2F33;
text-align: left;
@media (prefers-reduced-motion: no-preference) {
transition: background-color .15s, box-shadow .15s, color .15s;
}
color: #dedede;
}
.desktop-capturer-selection__btn:hover,
.desktop-capturer-selection__btn:focus {
background: #7289DA;
box-shadow: 0 0 4px rgba(0,0,0,0.45), 0 0 2px rgba(0,0,0,0.25);
color: #fff;
}
.desktop-capturer-selection__thumbnail {
width: 100%;
height: 81px;
object-fit: cover;
}
.desktop-capturer-selection__name {
margin: 6px 0;
white-space: nowrap;
color: white;
text-overflow: ellipsis;
text-align: center;
overflow: hidden;
}
.desktop-capturer-selection__name--cancel {
margin: auto 0;
}
`;
const screenShareJS = `
window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve, reject) => {
try {
@ -155,6 +84,7 @@ window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve
document.addEventListener("DOMContentLoaded", function () {
addScript(screenShareJS);
addStyle(screenShareCSS);
const screenshareCss = path.join(__dirname, "../", "/content/css/screenshare.css");
addStyle(fs.readFileSync(screenshareCss, "utf8"));
console.log("Capturer injected.");
});

15
src/preload/mobile.ts Normal file
View file

@ -0,0 +1,15 @@
import {ipcRenderer} from "electron";
import {addStyle} from "../utils";
import * as fs from "fs";
import * as path from "path";
export function injectMobileStuff() {
document.addEventListener("DOMContentLoaded", function (event) {
const mobileCSS = path.join(__dirname, "../", "/content/css/mobile.css");
addStyle(fs.readFileSync(mobileCSS, "utf8"));
// TO-DO: clicking on the logo, or additional button triggers ESC button to move around the UI quicker
// var logo = document.getElementById("window-title");
// logo!.addEventListener("click", () => {
//
// });
});
}

View file

@ -6,6 +6,7 @@ import * as path from "path";
import {injectTitlebar} from "./titlebar";
import {sleep, addStyle, injectJS, addScript} from "../utils";
import {ipcRenderer} from "electron";
import {injectMobileStuff} from "./mobile";
var version = ipcRenderer.sendSync("get-app-version", "app-version");
async function updateLang() {
if (window.location.href.indexOf("setup.html") > -1) {
@ -27,7 +28,7 @@ const clientMods = {
flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js"
};
console.log("ArmCord");
console.log("ArmCord " + version);
ipcRenderer.on("themeLoader", (event, message) => {
addStyle(message);
});
@ -37,6 +38,9 @@ if (window.location.href.indexOf("splash.html") > -1) {
if (ipcRenderer.sendSync("titlebar")) {
injectTitlebar();
}
if (ipcRenderer.sendSync("mobileMode")) {
injectMobileStuff();
}
sleep(5000).then(async () => {
const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
addStyle(fs.readFileSync(cssPath, "utf8"));

View file

@ -5,6 +5,11 @@ import * as path from "path";
import os from "os";
export function injectTitlebar() {
document.addEventListener("DOMContentLoaded", function (event) {
if (window.armcord.channel == "hummus") {
window.alert(
"ArmCord Titlebar doesn't currently work well in Hummus, please change ArmCord style to native for better experience."
);
}
var elem = document.createElement("div");
elem.innerHTML = `<nav class="titlebar">
<div class="window-title" id="window-title"></div>
@ -26,7 +31,7 @@ export function injectTitlebar() {
addStyle(fs.readFileSync(titlebarcssPath, "utf8"));
addStyle(fs.readFileSync(wordmarkcssPath, "utf8"));
document.body.setAttribute("customTitlebar", "");
document.body.setAttribute("armcord-platform", "win32");
document.body.setAttribute("armcord-platform", os.platform());
var minimize = document.getElementById("minimize");
var maximize = document.getElementById("maximize");

View file

@ -40,12 +40,18 @@
<input class="tgl tgl-light left" id="websocket" type="checkbox" />
<label class="tgl-btn left" for="websocket"></label>
</div>
<br />
<div class="switch">
<label class="header" id="settings-mobileMode">Mobile mode</label>
<input class="tgl tgl-light left" id="mobile" type="checkbox" />
<label class="tgl-btn left" for="mobile"></label>
</div>
<div class="switch">
<select name="channel" id="channel" class="left">
<option value="stable">Stable</option>
<option value="canary">Canary</option>
<option value="ptb">PTB</option>
<option value="foss">Fosscord</option>
<option value="hummus">Hummus (unofficial)</option>
</select>
<p class="header" id="settings-channel">Discord channel:</p>
</div>
@ -89,6 +95,7 @@
);
document.getElementById("settings-patches").innerHTML = await settings.getLang("settings-patches");
document.getElementById("settings-tray").innerHTML = await settings.getLang("settings-tray");
document.getElementById("settings-mobileMode").innerHTML = await settings.getLang("settings-mobileMode");
document.getElementById("settings-theme").innerHTML = await settings.getLang("settings-theme");
//select stuff
document.getElementById("mod").options[3].text = await settings.getLang("settings-none");
@ -107,6 +114,7 @@
document.getElementById("csp").checked = await settings.get("armcordCSP");
document.getElementById("tray").checked = await settings.get("minimizeToTray");
document.getElementById("websocket").checked = await settings.get("inviteWebsocket");
document.getElementById("mobile").checked = await settings.get("mobileMode");
document.getElementById("patches").value = await settings.get("automaticPatches");
document.getElementById("mod").value = await settings.get("mods");
document.getElementById("channel").value = await settings.get("channel");
@ -123,6 +131,7 @@
minimizeToTray: document.getElementById("tray").checked,
automaticPatches: document.getElementById("patches").checked,
mods: document.getElementById("mod").value,
mobileMode: document.getElementById("mobile").checked,
inviteWebsocket: document.getElementById("websocket").checked,
performanceMode: document.getElementById("prfmMode").value,
trayIcon: document.getElementById("trayIcon").value,

View file

@ -1,23 +0,0 @@
import {app} from "electron";
import {mainWindow} from "./window";
//https://github.com/electron/electron/issues/1334#issuecomment-716080005
// TO-DO add more
app.on("web-contents-created", (webContentsCreatedEvent, webContents) => {
webContents.on("before-input-event", (beforeInputEvent, input) => {
// console.log('Main console::', input)
const {code, alt, control, shift, meta} = input;
// Shortcut: toggle devTools
if (shift && control && !alt && !meta && code === "KeyI") {
mainWindow.webContents.toggleDevTools();
}
// Shortcut: window reload
if (shift && control && !alt && !meta && code === "KeyR") {
mainWindow.reload();
}
// Shortcut: app reload
if (alt && control && !shift && !meta && code === "KeyR") {
app.relaunch();
app.exit();
}
});
});

View file

@ -1,5 +1,5 @@
import * as fs from "fs";
import { app, Menu, Tray } from "electron";
import { app, Menu, Tray, nativeImage} from "electron";
import { mainWindow } from "./window";
import { getConfig, getConfigLocation, setWindowState } from "./utils";
import * as path from "path";
@ -7,10 +7,13 @@ import { createSettingsWindow } from "./settings/main";
let tray: any = null;
app.whenReady().then(async () => {
let finishedSetup = (await getConfig("doneSetup"));
var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored";
let trayPath = nativeImage.createFromPath(path.join(__dirname, "../", `/assets/${trayIcon}.png`));
if(process.platform === "darwin" && trayPath.getSize().height > 22)
trayPath = trayIcon.resize({height: 22});
if ((await getConfig("windowStyle")) == "basic") {
var clientName = (await getConfig("clientName")) ?? "ArmCord";
var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored";
tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`));
tray = new Tray(trayPath);
const contextMenu = function () {
if (finishedSetup == false) {
return Menu.buildFromTemplate([
@ -57,8 +60,7 @@ app.whenReady().then(async () => {
tray.setContextMenu(contextMenu);
} else {
var clientName = (await getConfig("clientName")) ?? "ArmCord";
var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored";
tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`));
tray = new Tray(trayPath);
if (finishedSetup == false) {
const contextMenu = Menu.buildFromTemplate([
{

View file

@ -2,9 +2,8 @@ import * as fs from "fs";
import { app, dialog } from "electron";
import path from "path";
export var firstRun: boolean;
export var isSetup: boolean;
export var contentPath: string;
//utillity functions that are used all over the codebase or just too obscure to be put in the file used in
//utility functions that are used all over the codebase or just too obscure to be put in the file used in
export function addStyle(styleString: string) {
const style = document.createElement("style");
style.textContent = styleString;
@ -43,6 +42,7 @@ export function setup() {
mods: "cumcord",
performanceMode: "none",
inviteWebsocket: true,
mobileMode: false,
trayIcon: "ac_plug_colored",
doneSetup: false
};
@ -104,9 +104,7 @@ export async function injectElectronFlags() {
}
}
export async function setLang(language: string) {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const langConfigFile = storagePath + "lang.json";
const langConfigFile = path.join(app.getPath("userData"), "/storage/") + "lang.json";
if (!fs.existsSync(langConfigFile)) {
fs.writeFileSync(langConfigFile, "{}", "utf-8");
}
@ -140,7 +138,15 @@ export async function getLang(object: string) {
}
let rawdata = fs.readFileSync(langPath, "utf-8");
let parsed = JSON.parse(rawdata);
return parsed[object];
if (parsed[object] == undefined) {
console.log(object + " is undefined in " + language)
langPath = path.join(__dirname, "../", "/assets/lang/en-US.json");
rawdata = fs.readFileSync(langPath, "utf-8");
parsed = JSON.parse(rawdata);
return parsed[object]
} else {
return parsed[object];
}
}
//ArmCord Window State manager
@ -165,9 +171,8 @@ export async function getWindowState(object: string) {
const settingsFile = storagePath + "window.json";
let rawdata = fs.readFileSync(settingsFile, "utf-8");
let returndata = JSON.parse(rawdata);
console.log(object + ": " + returndata[object]);
console.log("[Window state manager] " + object + ": " + returndata[object]);
return returndata[object];
}
//ArmCord Settings/Storage manager
@ -178,65 +183,36 @@ export interface Settings {
minimizeToTray: boolean;
automaticPatches: boolean;
mods: string;
mobileMode: boolean,
performanceMode: string;
inviteWebsocket: boolean;
trayIcon: string;
doneSetup: boolean;
}
export async function getConfig(object: string) {
try {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const settingsFile = storagePath + "settings.json";
let rawdata = fs.readFileSync(settingsFile, "utf-8");
let returndata = JSON.parse(rawdata);
console.log(object + ": " + returndata[object]);
return returndata[object];
} catch (e) {
console.log("Config probably doesn't exist yet. Returning setup value.");
firstRun = true;
return "setup";
}
export function getConfigLocation() {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
return storagePath + "settings.json";
}
export async function getConfigLocation() {
try {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
return storagePath + "settings.json";
} catch (e) {
console.log("Config probably doesn't exist yet. Returning setup value.");
firstRun = true;
return "setup";
}
export async function getConfig(object: string) {
let rawdata = fs.readFileSync(getConfigLocation(), "utf-8");
let returndata = JSON.parse(rawdata);
console.log("[Config manager] " + object + ": " + returndata[object]);
return returndata[object];
}
export async function setConfig(object: string, toSet: any) {
try {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const settingsFile = storagePath + "settings.json";
let rawdata = fs.readFileSync(settingsFile, "utf-8");
let parsed = JSON.parse(rawdata);
parsed[object] = toSet;
let toSave = JSON.stringify(parsed);
fs.writeFileSync(settingsFile, toSave, "utf-8");
} catch (e) {
console.log("Config probably doesn't exist yet. Returning setup value.");
firstRun = true;
return "setup";
}
let rawdata = fs.readFileSync(getConfigLocation(), "utf-8");
let parsed = JSON.parse(rawdata);
parsed[object] = toSet;
let toSave = JSON.stringify(parsed);
fs.writeFileSync(getConfigLocation(), toSave, "utf-8");
}
export async function setConfigBulk(object: Settings) {
try {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const settingsFile = storagePath + "settings.json";
let toSave = JSON.stringify(object);
fs.writeFileSync(settingsFile, toSave, "utf-8");
} catch (e) {
console.log("Config probably doesn't exist yet. Returning setup value.");
firstRun = true;
return "setup";
}
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const settingsFile = storagePath + "settings.json";
let toSave = JSON.stringify(object);
fs.writeFileSync(settingsFile, toSave, "utf-8");
}
export async function checkIfConfigExists() {
const userDataPath = app.getPath("userData");
@ -250,26 +226,14 @@ export async function checkIfConfigExists() {
}
console.log("First run of the ArmCord. Starting setup.");
setup();
isSetup = true;
contentPath = path.join(__dirname, "/content/setup.html");
if (!contentPath.includes("ts-out")) {
contentPath = path.join(__dirname, "/ts-out/content/setup.html");
}
firstRun = true;
} else {
if ((await getConfig("doneSetup")) == false) {
console.log("First run of the ArmCord. Starting setup.");
setup();
isSetup = true;
contentPath = path.join(__dirname, "/content/setup.html");
if (!contentPath.includes("ts-out")) {
contentPath = path.join(__dirname, "/ts-out/content/setup.html");
}
firstRun = true;
} else {
console.log("ArmCord has been run before. Skipping setup.");
contentPath = path.join(__dirname, "/content/splash.html");
if (!contentPath.includes("ts-out")) {
contentPath = path.join(__dirname, "/ts-out/content/splash.html");
}
}
}
}

View file

@ -4,8 +4,9 @@
// I'm sorry for this mess but I'm not sure how to fix it.
import { BrowserWindow, shell, app, dialog } from "electron";
import path from "path";
import { checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang, setWindowState } from "./utils";
import { checkIfConfigIsBroken, firstRun, getConfig, contentPath, setConfig, setLang, setWindowState } from "./utils";
import { registerIpc } from "./ipc";
import { setMenu } from "./menu";
import * as fs from "fs";
import startServer from "./socket";
import contextMenu from "electron-context-menu";
@ -25,12 +26,16 @@ async function doAfterDefiningTheWindow() {
var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
checkIfConfigIsBroken();
registerIpc();
// A little sloppy but it works :p
if (osType == 'Windows_NT') {
osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")";
if (await getConfig("mobileMode")) {
mainWindow.webContents.userAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.149 Mobile Safari/537.36"
} else {
// A little sloppy but it works :p
if (osType == 'Windows_NT') {
osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")";
}
mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work
}
mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) {
shell.openExternal(url);
@ -90,7 +95,7 @@ async function doAfterDefiningTheWindow() {
}
});
});
setMenu()
mainWindow.on("close", async (e) => {
let [width, height] = mainWindow.getSize()
setWindowState({
@ -114,36 +119,14 @@ async function doAfterDefiningTheWindow() {
})
console.log(contentPath);
if ((await getConfig("inviteWebsocket")) == true) {
startServer();
await startServer();
}
try {
mainWindow.loadFile(contentPath);
if (isSetup) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
}
} catch (e) {
console.log(
"Major error detected while starting up. User is most likely on Windows platform. Fallback to alternative startup."
);
console.log(process.platform);
if (process.platform === "win32") {
if (firstRun) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
mainWindow.loadURL(`file://${__dirname}/content/setup.html`);
} else {
mainWindow.loadURL(`file://${__dirname}/content/splash.html`);
}
} else {
if (firstRun) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
mainWindow.loadURL(`file://${__dirname}/ts-out/content/setup.html`);
} else {
mainWindow.loadURL(`file://${__dirname}/ts-out/content/splash.html`);
}
}
if (firstRun) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
await mainWindow.loadFile(path.join(__dirname, "/content/setup.html"));
} else {
await mainWindow.loadFile(path.join(__dirname, "/content/splash.html"));
}
}
export function createCustomWindow() {