Skip to content

Commit 7c10ee8

Browse files
Add automatic driver restarting
Every 15s a background script will check if the viper driver is running and start it again if its not. This will greatly enhance user experience on devices where Viper is killed sometimes (eg due to OOM).
1 parent 1b03ff9 commit 7c10ee8

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ It contains many useability enhancements and all the major fixes needed to run `
3434
* **IRS ([tax](https://www.youtube.com/results?search_query=kitboga+irs+scammer)) included** \
3535
[The whole pack of IRS files](https://drive.google.com/file/d/1Bii6ER0cNgHMspVozMIfYfFAu3l16d_-/view?usp=sharing) commonly distributed in the [`ViPER4Android` Telegram group](https://t.me/ViPER4AndroidFX) is included and will be automatically copied to the correct place. You can select an IRS in the convolver option.
3636
* **`Legacy mode` for the win** \
37-
To this day i don't see why one would want to have `Legacy mode` disabled.
37+
To this day I don't see why one would want to have `Legacy mode` disabled.
3838
Yes I know it's because a media app should send it's audio session id, but to be honest: Who cares?
3939
`Legacy mode` just always works reliably and this is why this installer enables it by default.
4040
Does anyone remember the time when this option was called "`Process audio session 0`"?
4141
* **Opt-in instead of Opt-out** \
4242
`ViPER4Android 2.7` comes with `Crashlytics bug report metrics` enabled by default. Personally I don't like to send bug reports, so I always disable it. I think Opt-in is the way to go here.
4343
This is why in this module `Crashlytics` is disabled by default and you may enable if it you wish to.
44+
* **Keep the vibes alive** \
45+
`ViPER4Android` will automatically be restarted if it gets killed. This may be of great convenience on low ram devices, where the OOM-killer is very aggressive, even towards foreground services.
4446

4547
## Install
4648

magiskmodule/service.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
(
1+
#!/bin/bash
2+
3+
waitUntilBootCompleted() {
24
while [ $(getprop sys.boot_completed) -ne 1 ] || [ "$(getprop init.svc.bootanim | tr '[:upper:]' '[:lower:]')" != "stopped" ]; do
35
sleep 1
46
done
7+
}
8+
9+
(
10+
waitUntilBootCompleted
511
sleep 10
612
VIPERFXPACKAGE="com.pittvandewitt.viperfx"
713
[ -n "$(pm list packages -d | grep $VIPERFXPACKAGE)" ] && pm enable $VIPERFXPACKAGE
8-
) &
14+
) &
15+
16+
(
17+
waitUntilBootCompleted
18+
sleep 60
19+
while true; do
20+
ps -A -w -o ARGS=CMD | grep -v grep | grep -q com.pittvandewitt.viperfx || am broadcast -a android.intent.action.BOOT_COMPLETED -p com.pittvandewitt.viperfx
21+
sleep 15
22+
done
23+
) &

0 commit comments

Comments
 (0)