Compare commits
No commits in common. "32e5c20306c6339146580bbfe550d36fc5553dba" and "ae61795aab245a94e87c415598a250989cffe1d3" have entirely different histories.
32e5c20306
...
ae61795aab
8 changed files with 18 additions and 64 deletions
|
@ -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
|
||||
pkgrel = 4
|
||||
url = https://discord.com
|
||||
install = discord-electron-openasar.install
|
||||
arch = x86_64
|
||||
|
@ -15,7 +15,6 @@ pkgbase = discord-electron-openasar
|
|||
depends = libxss
|
||||
optdepends = libpulse: Pulseaudio support
|
||||
optdepends = xdg-utils: Open files
|
||||
optdepends = rizin: Allow patching Krisp support
|
||||
provides = discord
|
||||
conflicts = discord
|
||||
options = !strip
|
||||
|
@ -23,7 +22,7 @@ pkgbase = discord-electron-openasar
|
|||
source = discord-launcher.sh
|
||||
source = git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae
|
||||
sha512sums = 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f
|
||||
sha512sums = 1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d
|
||||
sha512sums = 6337d1f40c9ac97f180862ed0bcf1ec6fb6d4ecf3cb215369550768a4a3600a9546c43f467855a77e95b0f314348a833de40f4284b5b8924d101b4a456b073f5
|
||||
sha512sums = SKIP
|
||||
|
||||
pkgname = discord-electron-openasar
|
||||
|
|
|
@ -9,7 +9,7 @@ _pkgname=discord
|
|||
_electron=22
|
||||
pkgver=0.0.27+809
|
||||
_pkgver=${pkgver%%+*}
|
||||
pkgrel=5
|
||||
pkgrel=4
|
||||
pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electron}) for increased security and performance"
|
||||
arch=('x86_64')
|
||||
provides=("${_pkgname}")
|
||||
|
@ -23,17 +23,14 @@ makedepends=('git' 'asar' 'nodejs' 'curl' 'python-html2text')
|
|||
optdepends=(
|
||||
'libpulse: Pulseaudio support'
|
||||
'xdg-utils: Open files'
|
||||
'rizin: Allow patching Krisp support'
|
||||
)
|
||||
source=("https://dl.discordapp.net/apps/linux/${_pkgver}/discord-${_pkgver}.tar.gz"
|
||||
'discord-launcher.sh'
|
||||
"git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae")
|
||||
sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f'
|
||||
'1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d'
|
||||
'6337d1f40c9ac97f180862ed0bcf1ec6fb6d4ecf3cb215369550768a4a3600a9546c43f467855a77e95b0f314348a833de40f4284b5b8924d101b4a456b073f5'
|
||||
'SKIP')
|
||||
|
||||
_krisp_b2sum='592f55259500afc0d7fd334a10d3c1991fae05db870bf12437edc43cf693988195341f2cb827aba333c0e65fb4cb40dccfcc5d6a84dea4a1645f9563505b6496'
|
||||
|
||||
# just in case I get the version wrong
|
||||
pkgver() {
|
||||
cd "${srcdir}/openasar"
|
||||
|
@ -41,8 +38,8 @@ pkgver() {
|
|||
}
|
||||
|
||||
prepare() {
|
||||
# prepare launcher script
|
||||
sed -i "s|@PKGNAME@|${_pkgname}|g;s|@PKGVER@|${_pkgver}|g;s|@ELECTRON@|${_electron}|g;s|@KRISPB2@|${_krisp_b2sum}|g" discord-launcher.sh
|
||||
# prepare launcher and install script
|
||||
sed -i "s|@PKGNAME@|${_pkgname}|;s|@ELECTRON@|${_electron}|" discord-launcher.sh
|
||||
|
||||
# fix the .desktop file
|
||||
sed -i "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" Discord/$_pkgname.desktop
|
||||
|
|
|
@ -1,27 +1,18 @@
|
|||
post_upgrade() {
|
||||
# return if old package version is greater than or equal to 0.0.27-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
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
EOF
|
||||
}
|
||||
|
|
|
@ -3,22 +3,12 @@
|
|||
set -euo pipefail
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
addr=$(rz-find -x '4889dfe8........4889dfe8' "${krisp_bin}" | head -n1)
|
||||
rizin -q -w -c "s $addr + 0x12 ; wao nop" "${krisp_bin}" &> /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "${flags_file}" ]]; then
|
||||
if grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then
|
||||
grep -q '\--ignore-gpu-blacklist' "${flags_file}" && \
|
||||
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
|
||||
fi
|
||||
mapfile -t < "${flags_file}"
|
||||
else
|
||||
cat > "${flags_file}" <<EOF
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
pkgbase = discord-electron
|
||||
pkgdesc = Discord using system provided electron (v22) for increased security and performance
|
||||
pkgver = 0.0.27
|
||||
pkgrel = 5
|
||||
pkgrel = 4
|
||||
url = https://discord.com
|
||||
install = discord-electron.install
|
||||
arch = x86_64
|
||||
|
@ -13,13 +13,12 @@ pkgbase = discord-electron
|
|||
depends = libxss
|
||||
optdepends = libpulse: Pulseaudio support
|
||||
optdepends = xdg-utils: Open files
|
||||
optdepends = rizin: Allow patching Krisp support
|
||||
provides = discord
|
||||
conflicts = discord
|
||||
options = !strip
|
||||
source = https://dl.discordapp.net/apps/linux/0.0.27/discord-0.0.27.tar.gz
|
||||
source = discord-launcher.sh
|
||||
sha512sums = 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f
|
||||
sha512sums = 1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d
|
||||
sha512sums = 6337d1f40c9ac97f180862ed0bcf1ec6fb6d4ecf3cb215369550768a4a3600a9546c43f467855a77e95b0f314348a833de40f4284b5b8924d101b4a456b073f5
|
||||
|
||||
pkgname = discord-electron
|
||||
|
|
|
@ -15,7 +15,7 @@ pkgname=discord-electron
|
|||
_pkgname=discord
|
||||
_electron=22
|
||||
pkgver=0.0.27
|
||||
pkgrel=5
|
||||
pkgrel=4
|
||||
pkgdesc="Discord using system provided electron (v${_electron}) for increased security and performance"
|
||||
arch=('x86_64')
|
||||
provides=("${_pkgname}")
|
||||
|
@ -29,18 +29,15 @@ makedepends=('asar' 'curl' 'python-html2text')
|
|||
optdepends=(
|
||||
'libpulse: Pulseaudio support'
|
||||
'xdg-utils: Open files'
|
||||
'rizin: Allow patching Krisp support'
|
||||
)
|
||||
source=("https://dl.discordapp.net/apps/linux/${pkgver}/discord-${pkgver}.tar.gz"
|
||||
'discord-launcher.sh')
|
||||
sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f'
|
||||
'1da218eb240901ed48c392c154d061b02024daeb02ee7d991cdbc97ecba30a6f06af25abb602880872d89dcc63a8cd4d149c12414086b081035938deff8fe26d')
|
||||
|
||||
_krisp_b2sum='592f55259500afc0d7fd334a10d3c1991fae05db870bf12437edc43cf693988195341f2cb827aba333c0e65fb4cb40dccfcc5d6a84dea4a1645f9563505b6496'
|
||||
'6337d1f40c9ac97f180862ed0bcf1ec6fb6d4ecf3cb215369550768a4a3600a9546c43f467855a77e95b0f314348a833de40f4284b5b8924d101b4a456b073f5')
|
||||
|
||||
prepare() {
|
||||
# prepare launcher script
|
||||
sed -i "s|@PKGNAME@|${_pkgname}|g;s|@PKGVER@|${_pkgver}|g;s|@ELECTRON@|${_electron}|g;s|@KRISPB2@|${_krisp_b2sum}|g" discord-launcher.sh
|
||||
# prepare launcher and install script
|
||||
sed -i "s|@PKGNAME@|${_pkgname}|;s|@ELECTRON@|${_electron}|" discord-launcher.sh
|
||||
|
||||
# fix the .desktop file
|
||||
sed -i "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" Discord/$_pkgname.desktop
|
||||
|
|
|
@ -1,27 +1,18 @@
|
|||
post_upgrade() {
|
||||
# return if old package version is greater than or equal to 0.0.27-5...
|
||||
(( $(vercmp $2 '0.0.27-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
|
||||
EOF
|
||||
|
||||
# return if old package version is greater than or equal to 0.0.27-2...
|
||||
(( $(vercmp $2 '0.0.27-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)
|
||||
|
||||
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)
|
||||
|
||||
EOF
|
||||
}
|
||||
|
|
|
@ -3,22 +3,12 @@
|
|||
set -euo pipefail
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
addr=$(rz-find -x '4889dfe8........4889dfe8' "${krisp_bin}" | head -n1)
|
||||
rizin -q -w -c "s $addr + 0x12 ; wao nop" "${krisp_bin}" &> /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "${flags_file}" ]]; then
|
||||
if grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then
|
||||
grep -q '\--ignore-gpu-blacklist' "${flags_file}" && \
|
||||
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
|
||||
fi
|
||||
mapfile -t < "${flags_file}"
|
||||
else
|
||||
cat > "${flags_file}" <<EOF
|
||||
|
|
Loading…
Reference in a new issue