Skip to content

Commit a1f69d9

Browse files
Remove setenforce 0 requirement
We needed setenforce 0 previously, because SELinux Enforcing prevents access to the folder /data/adb/... for the package manager. Though the folder /data/local is completely accessible to the package manager, so we just copy the file over and install it from there.
1 parent ac13d5b commit a1f69d9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ It contains many useability enhancements and all the major fixes needed to run `
1616
This installer installs the ViPER driver seamlessly during module installation, there is no need to have the app install the driver.
1717
* **`MagiskPolicy` included** \
1818
The necessary `SELinux` rules for running on modern Android ROMs are included, there is no need for [`Audio Compatibility Patch`](https://github.com/Magisk-Modules-Repo/acp) anymore.
19+
* **Enforce the law** \
20+
This installer does not require switching `SELinux` to `permissive` temporarily for installing the APK, which mostly helps with devices where `permissive` has disabled in the kernel.
1921
* **Old folder gone legacy** \
2022
The old folder `ViPER4Android` in your personal files has been redundant for long time already, as all files have been moved to the new scoped storage location anyways.
21-
This installer does depend on the old folder anymore, you can safely delete it and not have it clutter your files anymore.
23+
This installer doesn't depend on the old folder anymore, you can safely delete it and not have it clutter your files anymore.
2224
* **ViperFX, not AudioFX!** \
2325
Who needs [`LineageOS AudioFX`](https://github.com/LineageOS/android_packages_apps_AudioFX) anyways when you have `ViPER4Android` installed.
24-
This installer automatically disables [`LineageOS AudioFX`](https://github.com/LineageOS/android_packages_apps_AudioFX) during install and also reenables in during uninstall.
26+
This installer automatically disables [`LineageOS AudioFX`](https://github.com/LineageOS/android_packages_apps_AudioFX) during install and also reenables it during uninstall.
2527
* **To AML or not to AML** \
2628
[`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.
2729
* **Automatic VDC import** \
@@ -48,12 +50,12 @@ It contains many useability enhancements and all the major fixes needed to run `
4850

4951
This mod is targeted at `LineageOS 19` / `Android 12`. \
5052
Any ROM similar or newer than `LineageOS 17` / `Android 10` should work. \
51-
With anything below that, you can still try it, but I can't guarantee anything there.
53+
With anything else you can still try it, but I can't guarantee anything there.
5254

5355
## Bugs and support
5456

5557
I am not a ViPER dev, nor am I capable of fixing your broken install or ROM.
56-
If you have trouble to install ViPER4Android this way please do hesitate to ask me.
58+
If you have trouble to install ViPER4Android this way, please **do hesitate** to ask me.
5759
Try to install it the normal way and if that doesn't work either,
5860
ask in the
5961
[ViPER4Android Telegram group](https://t.me/ViPER4AndroidFX)

magiskmodule/common/install.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
[ "`getenforce`" == "Enforcing" ] && ENFORCE=true || ENFORCE=false
32
NEWFOL="/storage/emulated/0/Android/data/com.pittvandewitt.viperfx/files"
43

54
# Uninstall v4a app if installed
@@ -108,9 +107,14 @@ ui_print " "
108107
ui_print "- Installing ViPER4AndroidFX $(grep_prop version $MODPATH/module.prop)..."
109108
ui_print " After this completes, reboot your device."
110109
ui_print " "
111-
$ENFORCE && setenforce 0
112-
(pm install $MODPATH/v4afx.apk >/dev/null 2>&1) || abort "Failed to install V4AFX!"
113-
$ENFORCE && setenforce 1
110+
APK_INSTALL_FOLDER="/data/local"
111+
(
112+
cp -f "$MODPATH/v4afx.apk" "$APK_INSTALL_FOLDER/v4afx.apk" || exit 1
113+
pm install $APK_INSTALL_FOLDER/v4afx.apk >/dev/null 2>&1
114+
RET=$?
115+
rm "$APK_INSTALL_FOLDER/v4afx.apk"
116+
exit $RET
117+
) || abort "Failed to install V4AFX!"
114118
pm disable $VIPERFXPACKAGE >/dev/null 2>&1
115119

116120
ui_print " "

0 commit comments

Comments
 (0)