Open-source alternative of Discord desktop's app.asar
Go to file
Ducko 9412a4f07d [Readme] Add Linux disable write protection notice to install guide 2021-12-11 10:47:17 +00:00
.github/workflows [CI] Try another different way of making releases 2021-12-11 10:23:24 +00:00
polyfills [Polyfills] Rewrite 2021-12-11 00:45:56 +00:00
src [Bootstrap] Add multi-instance handling 2021-12-11 10:37:43 +00:00
.gitignore [Gitignore] More specific package-lock.json ignore 2021-12-10 19:54:50 +00:00
LICENSE Initial commit 2021-12-09 11:14:14 +00:00
README.md [Readme] Add Linux disable write protection notice to install guide 2021-12-11 10:47:17 +00:00
changelog.md [Changelog] Add v0.2 hotfix notes 2021-12-10 20:53:53 +00:00
injectPolyfills.js [Polyfills] Rewrite 2021-12-11 00:45:56 +00:00
test.sh [Polyfills] Rewrite 2021-12-11 00:45:56 +00:00

README.md

OpenAsar

Open-source alternative of Discord desktop's app.asar OpenAsar is currently made of ~80% own code, with the rest being from Discord as it hasn't been rewritten yet or because of compatibility reasons.

Goals

  • Hotpluggable - just swap the asar file, nothing else needed
  • Lightweight - currently improving startup times ~2x (up to ~4x with experimental config)
  • No Tracking - no crash reporting or error tracking (in normal Discord)
  • Minimal - current size is only ~150kb (compared to original ~9mb)
  • Patch Platform - provide a platform for future patching

Implementation

Below is a list in order of priority, marked as complete when finished:

  • Bootstrapping
  • Splash screen
  • Error handling
  • A bunch of specific minor fixes / features
    • Handle hardware acceleration
    • Add Discord-specific Electron flags?
  • Asar auto-updating
  • Multi-instance handling
  • Auto start
  • First run
  • Self-write some small parts of internals
  • Patch updater to survive host updates
  • Self-write updater code (currently mostly copied)
  • Compatibility / replication of original Discord splash?

Custom Patches

Custom patches are another main goal of OpenAsar, patching enhancements where otherwise impossible to do so with traditional mods. Our current ideas for patches to do:

  • Rewrite portions of Discord's code to not rely on external dependencies, increasing speed and decreasing size
  • Skipping checking for updates on startup
  • Linux host app updating

Install Guide

OpenAsar is heavily disrecommened due to it being in early development.

  1. Download latest release (nightly recommended)
  2. Backup your original app.asar (rename to app.asar.backup / etc)
  3. Install OpenAsar app.asar into the original path

If using Linux it is highly recommended to disable write protection (needing root to overwrite files) for your Discord install if you have it enabled. It is not much of a security defecit as Windows has no write protection as well. This enables updating the asar and potentially host updating further on.

Config

You can configure OpenAsar via settings.json (found in your Discord app data / user data), under a openasar object. Keep in mind most options are defaults for good reason, they may temporarily brick your client until you revert your changes. The avaliable options are:

  • quickstart (bool, default false) - whether to use Quickstart (experimental)
  • skipStartupUpdateChecks (bool, default false) - skips startup update checking (Linux-only)
  • autoupdate (bool, default true) - whether to autoupdate OpenAsar after Discord startup
  • multiInstance (bool, default false) - whether to enable multi-instance

An example of a settings.json with OpenAsar config:

{
  "BACKGROUND_COLOR": "#202225",
  "IS_MAXIMIZED": false,
  "IS_MINIMIZED": false,
  "WINDOW_BOUNDS": {
    "x": 801,
    "y": 22,
    "width": 797,
    "height": 876
  },
  "MINIMIZE_TO_TRAY": false,
  "OPEN_ON_STARTUP": false,
  "openasar": {
    "quickstart": true
  }
}