Skip to content

Commit 0ac2700

Browse files
add IRS detection
Just apply the VDC detection logic to IRS files. * MAGIC * 👀
1 parent 7e086b4 commit 0ac2700

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ It contains many useability enhancements and all the major fixes needed to run `
3939
This installer automatically disables [`LineageOS AudioFX`](https://github.com/LineageOS/android_packages_apps_AudioFX) during install and also reenables it during uninstall.
4040
* **To AML or not to AML** \
4141
[`Audio Modification Library`](https://github.com/Magisk-Modules-Repo/aml) is not included, but is usually not needed either. But you can still combine `ViPER4Android` with other audio mods using [`Audio Modification Library`](https://github.com/Magisk-Modules-Repo/aml) if you want to.
42-
* **Automatic VDC import** \
43-
If you have [bought a VDC file](https://t.me/vdcservice) which now lays in your Download directory, you don't have to copy it over manually.
44-
The installer automatically finds and copies them to the correct place for `ViPER4Android` to find them and you to enjoy the audiophile feeling.
42+
* **Automatic VDC and IRS import** \
43+
If you have [bought a VDC file](https://t.me/vdcservice) or downloaded an IRS file
44+
which now lays in your Download directory,
45+
you don't have to copy it over manually.
46+
The installer automatically finds and copies them to the correct place
47+
for `ViPER4Android` to find them
48+
and for you to enjoy the audiophile feeling.
4549
* **Original DDCs included** \
4650
If you have not yet bought a VDC file, this installer will automatically install all original `ViPER4Android` DDC files for you to enjoy them until you notice you can [buy even better ones](https://t.me/vdcservice).
4751
* **IRS ([tax](https://www.youtube.com/results?search_query=kitboga+irs+scammer)) included** \

magiskmodule/customize.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ VIPERFXPACKAGE="com.pittvandewitt.viperfx"
66
SDCARD="/storage/emulated/0"
77
FOLDER="$SDCARD/Android/data/$VIPERFXPACKAGE/files"
88
VIPERVDCFILE="ViperVDC.tar.gz"
9+
VIPERIRSFILE="ViperIRS.tar.gz"
910

1011
IFS=$'\n'
1112
SEARCH_ROOT="$(magisk --path)/.magisk/mirror"/
@@ -46,14 +47,32 @@ if $CUSTOM_VDC_FOUND; then
4647
done
4748
fi
4849

49-
if [ -z "$(ls "$FOLDER"/Kernel 2>/dev/null)" ]; then
50+
[ ! -f "$MODPATH"/"$VIPERIRSFILE" ] && abort "Missing $VIPERIRSFILE"
51+
mkdir -p "$FOLDER"/Kernel
52+
CUSTOM_IRS_FILES=$(find $SDCARD -name '*.irs' -not -path "$SDCARD/Android/*")
53+
[ -n "$CUSTOM_IRS_FILES" ] && CUSTOM_IRS_FOUND=true || CUSTOM_IRS_FOUND=false
54+
for file in $(tar -tzf "$MODPATH"/"$VIPERIRSFILE") $CUSTOM_IRS_FILES; do
55+
file="$FOLDER"/Kernel/"$file"
56+
[ -f "$file" ] && rm "$file"
57+
done
58+
[ -z "$(ls -A "$FOLDER"/Kernel 2>/dev/null)" ] && IRS_FOLDER_EMPTY=true || IRS_FOLDER_EMPTY=false
59+
if $IRS_FOLDER_EMPTY && ! $CUSTOM_VDC_FOUND; then
5060
ui_print "- Copying Viper IRS files"
5161
mkdir -p "$FOLDER"/Kernel 2>/dev/null
52-
tar -xzf "$MODPATH"/ViperIRS.tar.gz -C "$FOLDER"/Kernel
62+
tar -xzf "$MODPATH"/"$VIPERIRSFILE" -C "$FOLDER"/Kernel
5363
else
54-
ui_print "- Skipping Viper IRS copy, folder is not empty"
64+
ui_print "- Skipping Viper IRS copy"
65+
! $IRS_FOLDER_EMPTY && ui_print " the folder is not empty"
66+
$CUSTOM_IRS_FOUND && ui_print " custom IRS files have been found"
67+
fi
68+
rm "$MODPATH"/"$VIPERIRSFILE"
69+
if $CUSTOM_IRS_FOUND; then
70+
ui_print "- Copying custom IRS files"
71+
for file in $CUSTOM_IRS_FILES; do
72+
ui_print " $file"
73+
cp -f "$file" "$FOLDER"/Kernel
74+
done
5575
fi
56-
rm "$MODPATH"/ViperIRS.zip 2>/dev/null
5776

5877
ui_print "- Patching system audio files"
5978
LIBRARY_NAME="v4a_standard_fx"

0 commit comments

Comments
 (0)