upgpkg: discord-electron-openasar 0.0.27+810-1

Update to latest OpenAsar commit
Unset not needed variables in launch script
Rewording install file text
This commit is contained in:
Manuel 2023-06-08 21:56:34 +02:00
parent 8689b4a782
commit 7ad0778608
Signed by: SunRed
GPG Key ID: 4085037435E1F07A
4 changed files with 21 additions and 18 deletions

View File

@ -1,7 +1,7 @@
pkgbase = discord-electron-openasar
pkgdesc = Discord packaged with OpenAsar using system provided electron (v22) for increased security and performance
pkgver = 0.0.27+809
pkgrel = 5
pkgver = 0.0.27+810
pkgrel = 1
url = https://discord.com
install = discord-electron-openasar.install
arch = x86_64
@ -21,9 +21,9 @@ pkgbase = discord-electron-openasar
options = !strip
source = https://dl.discordapp.net/apps/linux/0.0.27/discord-0.0.27.tar.gz
source = discord-launcher.sh
source = git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae
source = git+https://github.com/goosemod/openasar.git#commit=cd443572e5df630c446a5956ade19c4fc065aca9
sha512sums = 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f
sha512sums = 1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d
sha512sums = 4bbe010c28926ca898ac33da15ce8373060af44e0583e6956671fa2ee8a2a379a88a6ff9b4f886806fc05117428834852ba2e81a9163381c678c240067b7abd0
sha512sums = SKIP
pkgname = discord-electron-openasar

View File

@ -7,9 +7,9 @@
pkgname=discord-electron-openasar
_pkgname=discord
_electron=22
pkgver=0.0.27+809
pkgver=0.0.27+810
_pkgver=${pkgver%%+*}
pkgrel=5
pkgrel=1
pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electron}) for increased security and performance"
arch=('x86_64')
provides=("${_pkgname}")
@ -27,9 +27,9 @@ optdepends=(
)
source=("https://dl.discordapp.net/apps/linux/${_pkgver}/discord-${_pkgver}.tar.gz"
'discord-launcher.sh'
"git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae")
"git+https://github.com/goosemod/openasar.git#commit=cd443572e5df630c446a5956ade19c4fc065aca9")
sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f'
'1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d'
'4bbe010c28926ca898ac33da15ce8373060af44e0583e6956671fa2ee8a2a379a88a6ff9b4f886806fc05117428834852ba2e81a9163381c678c240067b7abd0'
'SKIP')
_krisp_b2sum='592f55259500afc0d7fd334a10d3c1991fae05db870bf12437edc43cf693988195341f2cb827aba333c0e65fb4cb40dccfcc5d6a84dea4a1645f9563505b6496'

View File

@ -1,27 +1,25 @@
post_upgrade() {
# return if old package version is greater than or equal to 0.0.27-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
cat <<EOF
==> The launch script will now patch Krisp noise suppression support
if 'rizin' is installed. Restart your Discord client after update
to apply the patch
to apply the patch.
EOF
# return if old package version is greater than or equal to 0.0.27+809-2...
(( $(vercmp $2 '0.0.27+809-2') >= 0 )) && return
cat <<EOF
==> You can now add or uncomment additional Electron flags in
'~/.config/discord-flags.conf' (if XDG_CONFIG_HOME is not set)
==> You can now set additional Electron flags in '~/.config/discord-flags.conf'.
EOF
}
post_install() {
cat <<EOF
==> For Krisp noise suppression support consider installing 'rizin'. Restart
your Discord client after installation or update to apply the patch
==> In case of performance problems consider adding or uncommenting Electron
flags in '~/.config/discord-flags.conf' (if XDG_CONFIG_HOME is not set)
your Discord client after installation or update to apply the patch.
==> Additional Electron flags can be set in '~/.config/discord-flags.conf'.
EOF
}

View File

@ -2,14 +2,16 @@
set -euo pipefail
declare -a flags
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"
declare -a flags
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) == @KRISPB2@ ]]; then
if [[ -f "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then
addr=$(rz-find -x '4889dfe8........4889dfe8' "${krisp_bin}" | head -n1)
rizin -q -w -c "s $addr + 0x12 ; wao nop" "${krisp_bin}" &> /dev/null
fi
@ -34,6 +36,9 @@ for line in "${MAPFILE[@]}"; do
fi
done
unset flags_file krisp_bin krisp_b2
exec /usr/bin/electron@ELECTRON@ \
/usr/lib/@PKGNAME@/app.asar \
--ozone-platform-hint=auto \