Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Forced to sync to the local repo
  • Loading branch information
yzyhk904 committed Apr 3, 2023
1 parent 89056ae commit 133237c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if "$IS64BIT"; then
"kona" )
replaceSystemProps_Kona
;;
"sdm845" )
"sdm845" | "bengal" | "kalama" )
replaceSystemProps_SDM845
;;
"sdm660" )
Expand Down
36 changes: 24 additions & 12 deletions post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
#!/system/bin/sh

# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script
# and module is placed.
# This will make sure your module will still work
# if Magisk change its mount point in the future
MODDIR=${0%/*}
# ALWAYS use $MODDIR if you need to know where this script and module is placed.
# This will make sure your module will still work if Magisk change its mount point in the future
MODDIR=${0%/*}

# This script will be executed in post-fs-data mode

if [ \( -e "${MODDIR%/*/*}/modules/usb-samplerate-unlocker" -a ! -e "${MODDIR%/*/*}/modules/usb-samplerate-unlocker/disable" \) \
-o -e "${MODDIR%/*/*}/modules_update/usb-samplerate-unlocker" ]; then
# If usb-samplerate-unlock exists, do nothing because it will do the same thing in itself.
if [ ! -e "$MODDIR/skip_mount" ]; then
touch "$MODDIR/skip_mount" 1>"/dev/null" 2>&1
fi

# If usb-samplerate-unlock exists, save related libraries elsewhere because the unlocker will do the same thing in itself.
for d in "lib" "lib64"; do
for lname in "libalsautils.so" "libalsautilsv2.so"; do
if [ -r "${MODDIR}/system/vendor/${d}/${lname}" ]; then
mkdir -p "${MODDIR}/save/vendor/${d}"
mv "${MODDIR}/system/vendor/${d}/${lname}" "${MODDIR}/save/vendor/${d}/${lname}"
fi
done
done

else
if [ -e "$MODDIR/skip_mount" ]; then
rm -f "$MODDIR/skip_mount" 1>"/dev/null" 2>&1
fi

# If usb-samplerate-unlock doesn't exist, restore related libraries from their saved folders.
for d in "lib" "lib64"; do
for lname in "libalsautils.so" "libalsautilsv2.so"; do
if [ -r "${MODDIR}/save/vendor/${d}/${lname}" -a -e "${MODDIR}/system/vendor/${d}" ]; then
mv "${MODDIR}/save/vendor/${d}/${lname}" "${MODDIR}/system/vendor/${d}/${lname}"
chmod 644 "${MODDIR}/system/vendor/${d}/${lname}"
fi
done
done

fi

0 comments on commit 133237c

Please sign in to comment.