Skip to content

Commit 560106c

Browse files
install viper driver during module install
this installs the viper driver at module install time, removing the need to install the driver using the viper app. The viper binaries have been extracted from the viper apk. The patching audio_effects.conf script has been copied from the ViPER4AndroidFX-Legacy Module: https://github.com/Magisk-Modules-Repo/ViPER4AndroidFX-Legacy/blob/9241c9801e33505a1cc63b60c7e7f281c97dfc15/common/unity_install.sh#L249 The patching process hasn't changed since then, there is no reason not to continue patching this way.
1 parent 4658deb commit 560106c

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

magiskmodule/common/install.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,35 @@ cp -f $MODPATH/v4afx.apk $FOL/v4afx.apk
240240
umount -l $(mount | awk '{print $3}' | grep 'libv4a_fx.so')
241241
killall audioserver
242242

243+
244+
ui_print " "
245+
ui_print "- Patching audio_effects.xml"
246+
mkdir -p $MODPATH/system/vendor/etc
247+
AUDIO_EFFECTS_FILE=$MODPATH/system/vendor/etc/audio_effects.xml
248+
cp -f /vendor/etc/audio_effects.xml $AUDIO_EFFECTS_FILE
249+
sed -i "/v4a_standard_fx/d" $AUDIO_EFFECTS_FILE
250+
sed -i "/v4a_fx/d" $AUDIO_EFFECTS_FILE
251+
sed -i "/<libraries>/ a\ <library name=\"v4a_fx\" path=\"libv4a_fx.so\"\/>" $AUDIO_EFFECTS_FILE
252+
sed -i "/<effects>/ a\ <effect name=\"v4a_standard_fx\" library=\"v4a_fx\" uuid=\"41d3c987-e6cf-11e3-a88a-11aba5d5c51b\"\/>" $AUDIO_EFFECTS_FILE
253+
254+
# here is how to strace v4a app:
255+
# run adb root
256+
# run in adb shell
257+
# while [ -z "$(pidof com.pittvandewitt.viperfx)" ]; do true; done && (strace -f -p $(pidof com.pittvandewitt.viperfx) 2>&1| grep -i "open")
258+
ui_print " "
243259
ui_print "- Installing ViPER4AndroidFX $(grep_prop version $MODPATH/module.prop)..."
260+
ui_print " After this completes,"
261+
#ui_print " open V4A app and follow the prompts"
262+
ui_print " you MUST REBOOT before opening the app"
263+
#ui_print " reboot your device."
264+
ui_print " "
244265
$ENFORCE && setenforce 0
245266
(pm install $MODPATH/v4afx.apk >/dev/null 2>&1) || abort "Failed to install V4AFX!"
246267
$ENFORCE && setenforce 1
247268

248269
# Install temporary service script
249270
install_script -l $MODPATH/common/service.sh
250271

251-
ui_print " After this completes,"
252-
ui_print " open V4A app and follow the prompts"
253-
ui_print " "
254-
sleep 5
255272

256273
REMS=$(find $NVBASE/modules/*/system $MODULEROOT/*/system -type f -name "ViPER4AndroidFX.apk" 2>/dev/null)
257274
if [ "$REMS" ]; then
9.97 KB
Binary file not shown.
770 KB
Binary file not shown.

0 commit comments

Comments
 (0)