upgpkg: discord-electron-openasar 0.0.39+824-2: update electron

* Update Electron version to 28
* Update launch script to require config variable set in order to patch Krisp binary
This commit is contained in:
Manuel 2024-01-04 15:07:27 +01:00
parent 27a74ff543
commit 8f38894da0
Signed by: Manuel
GPG key ID: 4085037435E1F07A
4 changed files with 24 additions and 18 deletions

View file

@ -1,7 +1,7 @@
pkgbase = discord-electron-openasar pkgbase = discord-electron-openasar
pkgdesc = Discord packaged with OpenAsar using system provided electron (v24) for increased security and performance pkgdesc = Discord packaged with OpenAsar using system provided electron (v28) for increased security and performance
pkgver = 0.0.39+824 pkgver = 0.0.39+824
pkgrel = 1 pkgrel = 2
url = https://discord.com url = https://discord.com
install = discord-electron-openasar.install install = discord-electron-openasar.install
arch = x86_64 arch = x86_64
@ -11,7 +11,7 @@ pkgbase = discord-electron-openasar
makedepends = nodejs makedepends = nodejs
makedepends = curl makedepends = curl
makedepends = python-html2text makedepends = python-html2text
depends = electron24 depends = electron28
depends = libxss depends = libxss
depends = unzip depends = unzip
optdepends = libpulse: Pulseaudio support optdepends = libpulse: Pulseaudio support
@ -25,7 +25,7 @@ pkgbase = discord-electron-openasar
source = discord-launcher.sh source = discord-launcher.sh
source = git+https://github.com/goosemod/openasar.git#commit=9f68f8dcb61a5c0c469930aab504dd03aa05f060 source = git+https://github.com/goosemod/openasar.git#commit=9f68f8dcb61a5c0c469930aab504dd03aa05f060
sha512sums = 9f18aea5d82f5db4efa9db9babbc440b24e47dc80df18df5cc58d99d677f1c0863df21ed96d69896785f8fbe0dc0ff1f7317398b8f39606289da79f5a38074f1 sha512sums = 9f18aea5d82f5db4efa9db9babbc440b24e47dc80df18df5cc58d99d677f1c0863df21ed96d69896785f8fbe0dc0ff1f7317398b8f39606289da79f5a38074f1
sha512sums = 723250b70c7f5367701675c6581e9eac2143263910c4ffc35957a6ab858492c5febe89ea0d46fce19ac1416c23d9ca3953e48b9db5aa174b4a401fb6efa5daf5 sha512sums = e68467468e9ebfe7aae873442998bda03212598a87d9af1b9ac976fdbafc81eb376e7770dccca6eb943d579f39717a0473fa4f0a46a0c3e436460688827a2dc7
sha512sums = SKIP sha512sums = SKIP
pkgname = discord-electron-openasar pkgname = discord-electron-openasar

View file

@ -8,8 +8,8 @@ pkgname=discord-electron-openasar
_pkgname=discord _pkgname=discord
pkgver=0.0.39+824 pkgver=0.0.39+824
_pkgver=${pkgver%%+*} _pkgver=${pkgver%%+*}
pkgrel=1 pkgrel=2
_electronver=24 _electronver=28
_electronname="electron${_electronver}" _electronname="electron${_electronver}"
pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electronver}) for increased security and performance" pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electronver}) for increased security and performance"
arch=('x86_64') arch=('x86_64')
@ -31,7 +31,7 @@ source=("https://dl.discordapp.net/apps/linux/${_pkgver}/${_pkgname}-${_pkgver}.
'discord-launcher.sh' 'discord-launcher.sh'
"git+https://github.com/goosemod/openasar.git#commit=9f68f8dcb61a5c0c469930aab504dd03aa05f060") "git+https://github.com/goosemod/openasar.git#commit=9f68f8dcb61a5c0c469930aab504dd03aa05f060")
sha512sums=('9f18aea5d82f5db4efa9db9babbc440b24e47dc80df18df5cc58d99d677f1c0863df21ed96d69896785f8fbe0dc0ff1f7317398b8f39606289da79f5a38074f1' sha512sums=('9f18aea5d82f5db4efa9db9babbc440b24e47dc80df18df5cc58d99d677f1c0863df21ed96d69896785f8fbe0dc0ff1f7317398b8f39606289da79f5a38074f1'
'723250b70c7f5367701675c6581e9eac2143263910c4ffc35957a6ab858492c5febe89ea0d46fce19ac1416c23d9ca3953e48b9db5aa174b4a401fb6efa5daf5' 'e68467468e9ebfe7aae873442998bda03212598a87d9af1b9ac976fdbafc81eb376e7770dccca6eb943d579f39717a0473fa4f0a46a0c3e436460688827a2dc7'
'SKIP') 'SKIP')
_krisp_b2sum='310e3d5ad2311ceace91d20004a677c1a1e49fa1cd5c0458ee5bdb31c01c49df68cac625e66dadcaddf90c67568cde22c2cec3c0b6bca8385225141a8d8d53c1' _krisp_b2sum='310e3d5ad2311ceace91d20004a677c1a1e49fa1cd5c0458ee5bdb31c01c49df68cac625e66dadcaddf90c67568cde22c2cec3c0b6bca8385225141a8d8d53c1'

View file

@ -1,4 +1,12 @@
post_upgrade() { post_upgrade() {
# return if old package version is greater than or equal to 0.0.39+824-2...
(( $(vercmp $2 '0.0.39+824-2') >= 0 )) && return
cat <<EOF
==> In order to patch Krisp noise suppression support set 'PATCH_KRISP=true'
in '~/.config/discord.conf' in addition to having 'rizin' installed.
EOF
# return if old package version is greater than or equal to 0.0.27+809-5... # return if old package version is greater than or equal to 0.0.27+809-5...
(( $(vercmp $2 '0.0.27+809-5') >= 0 )) && return (( $(vercmp $2 '0.0.27+809-5') >= 0 )) && return
@ -18,8 +26,9 @@ EOF
post_install() { post_install() {
cat <<EOF cat <<EOF
==> For Krisp noise suppression support consider installing 'rizin'. Restart ==> For Krisp noise suppression support consider installing 'rizin' and
your Discord client after installation or update to apply the patch. setting 'PATCH_KRISP=true' in '~/.config/discord.conf'. Restart your
Discord client afterwards to apply the patch.
==> Additional Electron flags can be set in '~/.config/discord-flags.conf'. ==> Additional Electron flags can be set in '~/.config/discord-flags.conf'.
EOF EOF
} }

View file

@ -5,29 +5,26 @@ set -euo pipefail
declare -a flags declare -a flags
[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" ]] && source "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf"
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf" flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf"
krisp_bin="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node" krisp_bin="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node"
krisp_b2=@KRISPB2@ krisp_b2=@KRISPB2@
if hash rizin &> /dev/null; then if hash rizin &> /dev/null && [[ "${PATCH_KRISP}" == true ]]; then
# Patch Krisp binary to ignore signature check # Patch Krisp binary to ignore signature check
if [[ -f "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then if [[ -w "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then
addr=$(rz-find -x '4881ec00010000' "${krisp_bin}" | head -n1) addr=$(rz-find -x '4881ec00010000' "${krisp_bin}" | head -n1)
rizin -q -w -c "s $addr + 0x30 ; wao nop" "${krisp_bin}" &> /dev/null rizin -q -w -c "s $addr + 0x30 ; wao nop" "${krisp_bin}" &> /dev/null
fi fi
fi fi
if [[ -f "${flags_file}" ]]; then if [[ -w "${flags_file}" ]]; then
# Replacing because old flag does not work
if grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then if grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}" sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
fi fi
mapfile -t < "${flags_file}" mapfile -t < "${flags_file}"
else
cat > "${flags_file}" <<EOF
#--ignore-gpu-blocklist
#--enable-gpu-rasterization
#--enable-zero-copy
EOF
fi fi
for line in "${MAPFILE[@]}"; do for line in "${MAPFILE[@]}"; do