2024-05-28 00:30:50 +07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2024-06-29 22:08:40 +07:00
|
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
2024-05-28 00:30:50 +07:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the MIT License.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
SO_FILE="/var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-platform.so.1.0"
|
|
|
|
|
|
|
|
if [ "${1}" = "-r" ]; then
|
|
|
|
if [ -f "${SO_FILE}.bak" ]; then
|
|
|
|
mv -f "${SO_FILE}.bak" "${SO_FILE}"
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "${SO_FILE}" ]; then
|
|
|
|
echo "SynologyPhotos not install"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "${SO_FILE}.bak" ]; then
|
|
|
|
echo "Backup ${SO_FILE}"
|
|
|
|
cp -vfp "${SO_FILE}" "${SO_FILE}.bak"
|
|
|
|
fi
|
|
|
|
echo "Patching ${SO_FILE}"
|
|
|
|
# support face and concept
|
|
|
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3"
|
|
|
|
# force to support concept
|
|
|
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3"
|
|
|
|
# force no Gpu
|
|
|
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3"
|