Skip to content

Commit

Permalink
Remove osp_detect()
Browse files Browse the repository at this point in the history
This doesn't seem to work at all,
makes the driver fail to install instead of helping it to work.
  • Loading branch information
programminghoch10 committed Oct 17, 2022
1 parent 5103be7 commit 1b03ff9
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions magiskmodule/common/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,11 @@ killall audioserver

ui_print " "
ui_print " Patching existing audio_effects files..."
osp_detect() {
case "$1" in
*.conf)
SPACES=$(sed -n "/^output_session_processing {/,/^}/ {/^ *music {/p}" $1 | sed -r "s/( *).*/\1/")
EFFECTS=$(sed -n "/^output_session_processing {/,/^}/ {/^$SPACES\music {/,/^$SPACES}/p}" $1 | grep -E "^$SPACES +[A-Za-z]+" | sed -r "s/( *.*) .*/\1/g")
for EFFECT in ${EFFECTS}; do
SPACES=$(sed -n "/^effects {/,/^}/ {/^ *$EFFECT {/p}" $1 | sed -r "s/( *).*/\1/")
[ "$EFFECT" != "atmos" ] && sed -i "/^effects {/,/^}/ {/^$SPACES$EFFECT {/,/^$SPACES}/ s/^/#/g}" $1
done
;;
*.xml)
EFFECTS=$(sed -n "/^ *<postprocess>$/,/^ *<\/postprocess>$/ {/^ *<stream type=\"music\">$/,/^ *<\/stream>$/ {/<stream type=\"music\">/d; /<\/stream>/d; s/<apply effect=\"//g; s/\"\/>//g; p}}" $1)
for EFFECT in ${EFFECTS}; do
[ "$EFFECT" != "atmos" ] && sed -ri "s/^( *)<apply effect=\"$EFFECT\"\/>/\1<\!--<apply effect=\"$EFFECT\"\/>-->/" $1
done
;;
esac
}
AUDIO_EFFECTS_FILES="$(find /system /vendor -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml")"
for ORIGINAL_FILE in $AUDIO_EFFECTS_FILES; do
ui_print " Patching $ORIGINAL_FILE"
FILE="$MODPATH$(echo "$ORIGINAL_FILE" | sed "s|^/vendor|/system/vendor|g")"
cp_ch "$ORIGDIR$ORIGINAL_FILE" "$FILE"
osp_detect "$FILE"
case "$FILE" in
*.conf)
sed -i "/v4a_standard_fx {/,/}/d" "$FILE"
Expand Down

0 comments on commit 1b03ff9

Please sign in to comment.