Great work! Wonder if you're willing to "Patch Krisp binary to ignore signature check" like the other package discord-electron
. I have tested and it works with this package.
Also set electron version to be 24 to make wayland work.
diff --git a/.SRCINFO b/.SRCINFO
index 2fd87aa..04862eb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -6,8 +6,9 @@ pkgbase = discord_arch_electron
arch = any
license = custom
makedepends = asar
- depends = electron
+ depends = electron24
depends = libxss
+ depends = rizin
optdepends = libpulse: Pulseaudio support
optdepends = xdg-utils: Open files
provides = discord
@@ -18,7 +19,7 @@ pkgbase = discord_arch_electron
source = LICENSE.html::https://discord.com/terms
source = OSS-LICENSES.html::https://discord.com/licenses
sha512sums = e3ca9075e4a66c7c4358bdccb748f8f849de24cf3036b85d2c42dd15f8e56125fc42e86e73920751126b0e4fa73596a1d7af1f21ac9903911d6c843637c46813
- sha512sums = d398351b209cd89432d8e9cebe9122f152484236d8ca4dd91e5679d3853fe2f082625d35a9ac3f450f1f08250736bf3a23db9926311e8271730d884b57d12dbc
+ sha512sums = 7824fb20f1065d89a964fe5977212324410711fe472a3b0e64b90e8148f98ed1524bbff709f88d00ef9b532cc81140d4a118c372e735f71c78f4d2baa3f6a7be
sha512sums = SKIP
sha512sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index cc9f614..59771c3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
# Contributor: johnnyapol <arch@johnnyapol.me>
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) <lains@archlinux.org>
_pkgname=discord
-_electron=electron
+_electron=electron24
pkgname=${_pkgname}_arch_electron
pkgver=0.0.32
pkgrel=1
@@ -15,7 +15,7 @@ conflicts=("${_pkgname}")
url='https://discord.com'
license=('custom')
options=(!strip)
-depends=("${_electron}" 'libxss')
+depends=("${_electron}" 'libxss' 'rizin')
makedepends=('asar')
optdepends=('libpulse: Pulseaudio support'
'xdg-utils: Open files')
@@ -24,12 +24,14 @@ source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
'LICENSE.html::https://discord.com/terms'
'OSS-LICENSES.html::https://discord.com/licenses')
sha512sums=('e3ca9075e4a66c7c4358bdccb748f8f849de24cf3036b85d2c42dd15f8e56125fc42e86e73920751126b0e4fa73596a1d7af1f21ac9903911d6c843637c46813'
- 'd398351b209cd89432d8e9cebe9122f152484236d8ca4dd91e5679d3853fe2f082625d35a9ac3f450f1f08250736bf3a23db9926311e8271730d884b57d12dbc'
+ '7824fb20f1065d89a964fe5977212324410711fe472a3b0e64b90e8148f98ed1524bbff709f88d00ef9b532cc81140d4a118c372e735f71c78f4d2baa3f6a7be'
SKIP
SKIP)
+_krisp_b2sum='90c3fbf6aab16638995fe21c49d4b8f93dbec9a9147cc7b1424c591c630aae84c362ee2b1a81507311b31e442e6b2706e6f48e1df8edd7248f5659108bbb3711'
+
prepare() {
- sed -i "s|@PKGNAME@|${_pkgname}|;s|@ELECTRON@|${_electron}|" discord-launcher.sh
+ sed -i "s|@PKGNAME@|${_pkgname}|g;s|@PKGVER@|${pkgver}|g;s|@ELECTRON@|${_electron}|g;s|@KRISPB2@|${_krisp_b2sum}|g" discord-launcher.sh
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" Discord/discord.desktop
# HACKS FOR SYSTEM ELECTRON
diff --git a/discord-launcher.sh b/discord-launcher.sh
index 6e6f47e..121d69c 100755
--- a/discord-launcher.sh
+++ b/discord-launcher.sh
@@ -8,6 +8,18 @@ flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
declare -a flags
+krisp_bin="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node"
+krisp_b2=@KRISPB2@
+
+if hash rizin &> /dev/null; then
+ # Patch Krisp binary to ignore signature check
+ if [[ -f "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then
+ addr=$(rz-find -x '4881ec00010000' "${krisp_bin}" | head -n1)
+ rizin -q -w -c "s $addr + 0x30 ; wao nop" "${krisp_bin}" &> /dev/null
+ fi
+fi
+
+
if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi
Pinned Comments
Zoddo commented on 2022-09-15 17:54 (UTC) (edited on 2023-03-31 17:24 (UTC) by Zoddo)
Starting with 0.0.26-1 (2023-03-31):
Starting with 0.0.20-1 (2022-09-15):
$XDG_CONFIG_HOME/discord-flags.conf
: this works likeelectron-flags.conf
, you can set in this file the command line flags you want to pass to electron when running Discord (there are some useful flags in the wiki, especially if you are experiencing lag in the Discord UI).FAQ
Discord requires an update, but this package isn't yet updated
Check the wiki.
The Discord UI is lagging
Try to add the flags recommended in the wiki in
$XDG_CONFIG_HOME/discord-flags.conf
.Krisp not working
This is an issue that will likely never be fixed for this package. The Krisp module checks if Discord binaries are signed by Discord, which is not the case with this package.
See this comment and this GitHub issue for more details and possibles workarounds.