Skip to content

Commit 08d811f

Browse files
committed
v3.2
1 parent 4bac2e2 commit 08d811f

File tree

5 files changed

+78
-72
lines changed

5 files changed

+78
-72
lines changed

AudioModificationLibrary.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
#libam3daudioenhancement~6723dd80-f0b7-11e0-98a2-0002a5d5c51b
1+
#libam3daudioenhancement.so~6723dd80-f0b7-11e0-98a2-0002a5d5c51b
22
patch_cfgs am3daudioenhancement 6723dd80-f0b7-11e0-98a2-0002a5d5c51b am3daudioenhancement $libfile
3-
#libv4a_fx~41d3c987-e6cf-11e3-a88a-11aba5d5c51b
3+
#libv4a_fx.so~41d3c987-e6cf-11e3-a88a-11aba5d5c51b
44
patch_cfgs v4a_standard_fx 41d3c987-e6cf-11e3-a88a-11aba5d5c51b v4a_fx $libfile
5-
#libv4a_fx_ics~41d3c987-e6cf-11e3-a88a-11aba5d5c51b
5+
#libv4a_fx_ics.so~41d3c987-e6cf-11e3-a88a-11aba5d5c51b
66
patch_cfgs v4a_standard_fx 41d3c987-e6cf-11e3-a88a-11aba5d5c51b v4a_fx $libfile
7-
#libv4a_xhifi_ics~d92c3a90-3e26-11e2-a25f-0800200c9a66
7+
#libv4a_xhifi_ics.so~d92c3a90-3e26-11e2-a25f-0800200c9a66
88
patch_cfgs v4a_standard_xhifi d92c3a90-3e26-11e2-a25f-0800200c9a66 v4a_xhifi $libfile
9-
#libhwdax~9d4921da-8225-4f29-aefa-6e6f69726861
9+
#libhwdax.so~9d4921da-8225-4f29-aefa-6e6f69726861
1010
patch_cfgs -pl dax 9d4921da-8225-4f29-aefa-6e6f69726861 dax_sw 6ab06da4-c516-4611-8166-6168726e6f69 $(dirname $libfile)/libswdax.so dax_hw a0c30891-8246-4aef-b8ad-696f6e726861 $libfile
11-
#libswdax~9d4921da-8225-4f29-aefa-6e6f69726861
11+
#libswdax.so~9d4921da-8225-4f29-aefa-6e6f69726861
1212
patch_cfgs dax 9d4921da-8225-4f29-aefa-6e6f69726861 dax $libfile
13-
#libswdap~9d4921da-8225-4f29-aefa-39537a04bcaa
13+
#libswdap.so~9d4921da-8225-4f29-aefa-39537a04bcaa
1414
patch_cfgs dap 9d4921da-8225-4f29-aefa-39537a04bcaa dap $libfile
15-
#libhwdap~a0c30891-8246-4aef-b8ad-d53e26da0253
15+
#libhwdap.so~a0c30891-8246-4aef-b8ad-d53e26da0253
1616
patch_cfgs -pl dap 9d4921da-8225-4f29-aefa-6e6f69726861 dap_sw 6ab06da4-c516-4611-8166-452799218539 $(dirname $libfile)/libswdap.so dap_hw a0c30891-8246-4aef-b8ad-d53e26da0253 $libfile
17-
#libdseffect~9d4921da-8225-4f29-aefa-39537a04bcaa
17+
#libdseffect.so~9d4921da-8225-4f29-aefa-39537a04bcaa
1818
patch_cfgs dsplus 9d4921da-8225-4f29-aefa-39537a04bcaa ds $libfile
19-
#libswvlldp~3783c334-d3a0-4d13-874f-0032e5fb80e2
19+
#libswvlldp.so~3783c334-d3a0-4d13-874f-0032e5fb80e2
2020
patch_cfgs vlldp 3783c334-d3a0-4d13-874f-0032e5fb80e2 vlldp $libfile
2121
patch_cfgs -ole music atmos 9d4921da-8225-4f29-aefa-aacb40a73593 atmos $(dirname $libfile)/libatmos.so
22-
#libicepower~f1c02420-777f-11e3-981f-0800200c9a66
22+
#libicepower.so~f1c02420-777f-11e3-981f-0800200c9a66
2323
patch_cfgs -l icepower $libfile
2424
patch_cfgs -e icepower_algo f1c02420-777f-11e3-981f-0800200c9a66 icepower
2525
patch_cfgs -e icepower_eq 50dbef80-4ad4-11e3-8f96-0800200c9a66 icepower
2626
patch_cfgs -e icepower_test e5456320-5391-11e3-8f96-0800200c9a66 icepower
2727
patch_cfgs -e icepower_load bf51a790-512b-11e3-8f96-0800200c9a66 icepower
2828
patch_cfgs -e icepower_null 63509430-52aa-11e3-8f96-0800200c9a66 icepower
29-
#libarkamys~17852d50-161e-11e2-892e-0800200c9a66
29+
#libarkamys.so~17852d50-161e-11e2-892e-0800200c9a66
3030
patch_cfgs -ole music Arkamysfx 17852d50-161e-11e2-892e-0800200c9a66 arkamys $libfile
31-
#libdirac~4c6383e0-ff7d-11e0-b6d8-0002a5d5c51b
31+
#libdirac.so~4c6383e0-ff7d-11e0-b6d8-0002a5d5c51b
3232
patch_cfgs dirac 4c6383e0-ff7d-11e0-b6d8-0002a5d5c51b dirac $libfile
3333
patch_cfgs -e dirac_controller b437f4de-da28-449b-9673-667f8b9643fe dirac
3434
patch_cfgs -e dirac_music b437f4de-da28-449b-9673-667f8b964304 dirac
35-
#libdirac~e069d9e0-8329-11df-9168-0002a5d5c51b
35+
#libdirac.so~e069d9e0-8329-11df-9168-0002a5d5c51b
3636
patch_cfgs -ole music dirac e069d9e0-8329-11df-9168-0002a5d5c51b dirac $libfile
37-
#libjamesdsp~f27317f4-c984-4de6-9a90-545759495bf2
37+
#libjamesdsp.so~f27317f4-c984-4de6-9a90-545759495bf2
3838
patch_cfgs jamesdsp f27317f4-c984-4de6-9a90-545759495bf2 jdsp $libfile
39-
#libmaxxeffect-cembedded~ae12da60-99ac-11df-b456-0002a5d5c51b
39+
#libmaxxeffect-cembedded.so~ae12da60-99ac-11df-b456-0002a5d5c51b
4040
patch_cfgs -ole music maxxaudio3 ae12da60-99ac-11df-b456-0002a5d5c51b maxxaudio3 $libfile
41-
#libbassboostMz~850b6319-bf66-4f93-bec0-dc6964367786
41+
#libbassboostMz.so~850b6319-bf66-4f93-bec0-dc6964367786
4242
patch_cfgs bassboostMz 850b6319-bf66-4f93-bec0-dc6964367786 bassboostMz $libfile
4343
patch_cfgs virtualizerMz 0e9779c9-4e8f-494d-b2b1-b4ad4e37c54c virtualizerMz $(dirname $libfile)/libvirtualizerMz.so
4444
patch_cfgs livemusicMz 0bbc89fe-52dc-4c40-8211-cae4da538b50 livemusicMz $(dirname $libfile)/liblivemusicMz.so
4545
patch_cfgs equalizerMz 9626da93-9c71-4bb2-8e23-9fc707fb9703 equalizerMz $(dirname $libfile)/ibequalizerMz.so
46-
#libsonysweffect~50786e95-da76-4557-976b-7981bdf6feb9
46+
#libsonysweffect.so~50786e95-da76-4557-976b-7981bdf6feb9
4747
patch_cfgs -qle mic,camcorder ZNR b8a031e0-6bbf-11e5-b9ef-0002a5d5c51b znrwrapper $(dirname $libfile)/libznrwrapper.so
4848
patch_cfgs -pl sonyeffect af8da7e0-2ca1-11e3-b71d-0002a5d5c51b sonyeffect_sw 50786e95-da76-4557-976b-7981bdf6feb9 $libfile sonyeffect_hw f9ed8ae0-1b9c-11e4-8900-0002a5d5c51b $(dirname $libfile)/libsonypostprocbundle.so
49-
#libatmos~74697567-7261-6564-6864-65726f206678
49+
#libatmos.so~74697567-7261-6564-6864-65726f206678
5050
patch_cfgs dolbyatmos 74697567-7261-6564-6864-65726f206678 dolbyatmos $libfile
5151
osp_detect "alarm notification ring"
52-
#libdtsaudio~146edfc0-7ed2-11e4-80eb-0002a5d5c51b
52+
#libdtsaudio.so~146edfc0-7ed2-11e4-80eb-0002a5d5c51b
5353
patch_cfgs -ole music dtsaudio 146edfc0-7ed2-11e4-80eb-0002a5d5c51b dtsaudio $libfile
5454
#end

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ AudModLib is a compatibility framework that allows the seamless integration of m
33
To uninstall, REMOVE WITH MAGISK MANAGER
44

55
## Change Log
6+
### v3.2 - 03.17.2020
7+
* Restructured script for better efficiency/faster running time - may fix xposed issues
8+
* Fix prop issue where non-aml supported mods were affected
9+
* Favor module .aml.sh scripts over built-ins
10+
611
### v3.1 - 03.14.2020
712
* Enhanced osp_detect - needed for some mods
813
* Added chcon fix for Q - may fix issues some users have with v4a/jdsp

customize.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@ ui_print " "
55
ui_print " Also note that disabled mods will be ignored!"
66
ui_print " "
77

8-
# Set vars in script
9-
amldir=$NVBASE/aml
10-
[ $API -ge 26 ] && libdir="/vendor" || libdir="/system"
11-
sed -i -e "s|moddir=|moddir=$NVBASE/modules|" -e "s|amldir=|amldir=$amldir|" $MODPATH/uninstall.sh
12-
sed -i "s|MODPATH=|MODPATH=$(echo $MODPATH | sed 's/modules_update/modules/')|" $MODPATH/post-fs-data.sh
13-
for i in MAGISKTMP API IS64BIT libdir amldir; do
14-
sed -i "s|$i=|$i=$(eval echo \$$i)|" $MODPATH/post-fs-data.sh
15-
done
16-
17-
# Place fallback script in the event idiot user deletes aml module in file explorer
18-
install -m 0755 $MODPATH/uninstall.sh $SERVICED/aml.sh
19-
sed -i "1a[ -d \"$(echo $MODPATH | sed 's/modules_update/modules/')\" ] && exit 0" $SERVICED/aml.sh
20-
echo 'rm -f $0' >> $SERVICED/aml.sh
21-
228
# Escape each backslash and space since shell will expand it during echo
239
sed -i -e 's/\\/\\\\/g' -e 's/\ /\\ /g' $MODPATH/AudioModificationLibrary.sh
2410
# Separate AML into individual files for each audio mod
@@ -33,3 +19,22 @@ while read line; do
3319
esac
3420
done < $MODPATH/AudioModificationLibrary.sh
3521
rm -f $MODPATH/AudioModificationLibrary.sh
22+
# Generate libs var for faster script running
23+
for i in $MODPATH/.scripts/*; do
24+
libs="$libs-name \"$(basename $i | sed "s/~.*//")\" "
25+
done
26+
libs="$(echo $libs | sed "s/\" /\" -o /g")"
27+
28+
# Set vars in script
29+
amldir=$NVBASE/aml
30+
[ $API -ge 26 ] && libdir="/vendor" || libdir="/system"
31+
sed -i -e "s|moddir=|moddir=$NVBASE/modules|" -e "s|amldir=|amldir=$amldir|" $MODPATH/uninstall.sh
32+
sed -i -e "s|<libs>|$libs|" -e "s|MODPATH=|MODPATH=$(echo $MODPATH | sed 's/modules_update/modules/')|" $MODPATH/post-fs-data.sh
33+
for i in MAGISKTMP API IS64BIT libdir amldir; do
34+
sed -i "s|$i=|$i=$(eval echo \$$i)|" $MODPATH/post-fs-data.sh
35+
done
36+
37+
# Place fallback script in the event idiot user deletes aml module in file explorer
38+
cp -f $MODPATH/uninstall.sh $SERVICED/aml.sh && chmod 0755 $SERVICED/aml.sh
39+
sed -i "1a[ -d \"$(echo $MODPATH | sed 's/modules_update/modules/')\" ] && exit 0" $SERVICED/aml.sh
40+
echo 'rm -f $0' >> $SERVICED/aml.sh

module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id=aml
22
name=Audio Modification Library
3-
version=v3.1
4-
versionCode=50
3+
version=v3.2
4+
versionCode=51
55
author=zackptg5, ahrion
66
description=AudModLib is a framework that allows the seamless integration of multiple audio mods in Magisk.
77
support=https://forum.xda-developers.com/apps/magisk/module-audio-modification-library-t3579612

post-fs-data.sh

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -223,48 +223,44 @@ done
223223
osp_detect "music"
224224

225225
# Detect/install audio mods
226-
for mod in $(find $moddir/* -maxdepth 0 -type d); do
226+
for mod in $(find $moddir/* -maxdepth 0 -type d ! -name "aml"); do
227227
modname="$(basename $mod)"
228-
[ "$mod" == "$MODPATH" -o -f "$mod/disable" ] && continue
229-
builtin=false
230-
for audmod in $MODPATH/.scripts/*; do
231-
lib=$(echo "$(basename $audmod)" | sed -r "s|(.*)~.*.sh|\1|")
232-
# Favor vendor libs if oreo+
233-
libfile="$(find $mod/system/vendor/lib/soundfx $mod/**/lib/soundfx -type f -name $lib.so 2>/dev/null | head -n1)"
234-
[ -f "$libfile" ] || continue
235-
uuid=$(echo "$(basename $audmod)" | sed -r "s|.*~(.*).sh|\1|")
236-
hexuuid="$(echo $uuid | sed -r -e "s/^(..)(..)(..)(..)-(..)(..)-(..)(..)-/\4\3\2\1\6\5\8\7-/" -e "s/-(..)(..)-(............)$/\2\1\3/")"
237-
xxd -p $libfile | tr -d '\n' | grep -q "$hexuuid"
238-
[ $? -eq 0 ] || continue
239-
builtin=true
240-
[ "$(grep -x "$modname" $amldir/modlist)" ] || echo "$modname" >> $amldir/modlist
241-
files=$(find $mod/system -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml" -o -name "*audio_*policy*.conf" -o -name "*audio_*policy*.xml" -o -name "*mixer_paths*.xml" -o -name "*mixer_gains*.xml" -o -name "*audio_device*.xml" -o -name "*sapa_feature*.xml" -o -name "*audio_platform_info*.xml" -o -name "*audio_configs*.xml" -o -name "*audio_device*.xml")
242-
for file in $files; do
243-
cp_mv -m $file $amldir/$modname/$(echo "$file" | sed "s|$mod/||")
228+
[ -f "$mod/disable" ] && continue
229+
# Move files
230+
files="$(find $mod/system -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml" -o -name "*audio_*policy*.conf" -o -name "*audio_*policy*.xml" -o -name "*mixer_paths*.xml" -o -name "*mixer_gains*.xml" -o -name "*audio_device*.xml" -o -name "*sapa_feature*.xml" -o -name "*audio_platform_info*.xml" -o -name "*audio_configs*.xml" -o -name "*audio_device*.xml")"
231+
[ "$files" ] && echo "$modname" >> $amldir/modlist
232+
for file in $files; do
233+
cp_mv -m $file $amldir/$modname/$(echo "$file" | sed "s|$mod/||")
234+
done
235+
# .aml.sh file should take precedence
236+
if [ -f "$mod/.aml.sh" ]; then
237+
$(grep -x "$modname" $amldir/modlist) || echo "$modname" >> $amldir/modlist
238+
if grep -qE '\$MODPATH/\$NAME|RUNONCE=|COUNT=' $mod/.aml.sh; then
239+
legacy_script
240+
else
241+
(. $mod/.aml.sh) || echo "Error in $modname aml.sh script" >> $MODPATH/errors.txt
242+
fi
243+
else
244+
# Favor vendor libs over system ones, no aml builtins are 64bit only - use 32bit lib dir
245+
libs="$(find $mod/system/vendor/lib/soundfx $mod/system/lib/soundfx -type f <libs>)"
246+
for lib in $libs; do
247+
for audmod in $MODPATH/.scripts/$(basename $lib)~*; do
248+
uuid=$(basename $audmod | sed -r "s/.*~(.*).sh/\1/")
249+
hexuuid="$(echo $uuid | sed -r -e "s/^(..)(..)(..)(..)-(..)(..)-(..)(..)-/\4\3\2\1\6\5\8\7-/" -e "s/-(..)(..)-(............)$/\2\1\3/")"
250+
xxd -p $lib | tr -d '\n' | grep -q "$hexuuid"
251+
[ $? -eq 0 ] || continue
252+
$(grep -xq "$modname" $amldir/modlist) || echo "$modname" >> $amldir/modlist
253+
libfile="$(echo $lib | sed -e "s|$mod||" -e "s|/system/vendor|/vendor|")"
254+
. $audmod
255+
done
244256
done
257+
fi
258+
if $(grep -x "$modname" $amldir/modlist); then
259+
[ -s "$mod/system.prop" ] && { prop_process $mod/system.prop; cp_mv -m $mod/system.prop $amldir/$modname/system.prop; }
245260
# Chcon fix for Android Q+
246261
[ $API -ge 29 ] && chcon -R u:object_r:vendor_file:s0 $mod/system/vendor/lib*/soundfx 2>/dev/null
247-
libfile="$(echo $libfile | sed -e "s|$mod||" -e "s|/system/vendor|/vendor|")"
248-
. $audmod
249-
[ -s "$mod/system.prop" ] && { prop_process $mod/system.prop; cp_mv -m $mod/system.prop $amldir/$modname/system.prop; }
250-
done
251-
if ! $builtin; then
252-
files=$(find $mod/system -type f -name "*audio_effects*.conf" -o -name "*audio_effects*.xml" -o -name "*audio_*policy*.conf" -o -name "*audio_*policy*.xml" -o -name "*mixer_paths*.xml" -o -name "*mixer_gains*.xml" -o -name "*audio_device*.xml" -o -name "*sapa_feature*.xml" -o -name "*audio_platform_info*.xml" -o -name "*audio_configs*.xml" -o -name "*audio_device*.xml")
253-
[ "$files" ] && [ ! "$(grep -x "$modname" $amldir/modlist)" ] && echo "$modname" >> $amldir/modlist
254-
for file in $files; do
255-
cp_mv -m $file $amldir/$modname/$(echo "$file" | sed "s|$mod/||")
256-
done
257-
if [ -f "$mod/.aml.sh" ]; then
258-
if grep -qE '\$MODPATH/\$NAME|RUNONCE=|COUNT=' $mod/.aml.sh; then
259-
legacy_script
260-
else
261-
(. $mod/.aml.sh) || echo "Error in $modname aml.sh script" >> $MODPATH/errors.txt
262-
fi
263-
[ -s "$mod/system.prop" ] && { prop_process $mod/system.prop; cp_mv -m $mod/system.prop $amldir/$modname/system.prop; }
264-
fi
265262
fi
266263
done
267-
[ -s $MODPATH/system.prop ] && { [ "$(tail -1 $MODPATH/system.prop)" ] && echo >> $MODPATH/system.prop; } || rm -f $MODPATH/system.prop
268264

269265
# Set perms and such
270266
set_perm_recursive $MODPATH/system 0 0 0755 0644

0 commit comments

Comments
 (0)