upgpkg: discord-electron-openasar 0.0.27+809-5

Include rudimentary patch to allow Krisp noise suppression support
This commit is contained in:
Manuel 2023-06-02 21:52:38 +02:00
parent dee0c4a1bb
commit 32e5c20306
Signed by: Manuel
GPG key ID: 4085037435E1F07A
4 changed files with 32 additions and 9 deletions

View file

@ -3,12 +3,22 @@
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
grep -q '\--ignore-gpu-blacklist' "${flags_file}" && \
if grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
fi
mapfile -t < "${flags_file}"
else
cat > "${flags_file}" <<EOF