Skip to content

Commit 06b3f4d

Browse files
disable notifications
currently only for sdk>=31
1 parent f5b9bb4 commit 06b3f4d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ It contains many useability enhancements and all the major fixes needed to run `
5757
Measures have been put in place to ensure `ViPER4Android` doesn't get killed by the OOM-killer.
5858
Though should `ViPER4Android` stop working anyways, will automatically be restarted.
5959
This may be of great convenience on low ram devices, where the OOM-killer is very aggressive, even towards foreground services.
60+
* **I know you're doing fine** \
61+
The notifications of `ViPER4Android` have been permanently disabled.
62+
There is no need for this permanent cluttering of the notifications list.
63+
([more](#where-is-the-notification))
6064

6165
## Install
6266

@@ -85,6 +89,13 @@ or the
8589
[ViPER4Android XDA Thread](https://forum.xda-developers.com/android/apps-games/app-viper4android-fx-2-6-0-0-t3774651)
8690
instead.
8791

92+
### Where is the notification?
93+
The notification has been disabled on purpose,
94+
as I don't see the necessity of it.
95+
I know the App-Info toggle to enable notifications does not work.
96+
If you really need it, run this command:
97+
`pm set-distracting-restriction com.pittvandewitt.viperfx`
98+
8899
## Thanks
89100

90101
If you want to invest into a great dev,

magiskmodule/customize.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ VIPERFXSHAREDPREFS="$VIPERFXPREFS"/shared_prefs
100100
cp -f "$MODPATH"/viperfx_preferences.xml "$VIPERFXSHAREDPREFS"/"${VIPERFXPACKAGE}_preferences.xml"
101101
chown -R $VIPERFXPREFSOWNER:$VIPERFXPREFSOWNER "$VIPERFXPREFS"
102102
chown -R $VIPERFXPREFSOWNER "$FOLDER"
103+
# this permanently hides the notifications without the possiblity of reenabling them
104+
[ $API -ge 31 ] && pm set-distracting-restriction --flag hide-notifications $VIPERFXPACKAGE
105+
[ $API -ge 33 ] && {
106+
# this will tell android that the user made the final decision to not receive notifications
107+
pm revoke $VIPERFXPACKAGE android.permission.POST_NOTIFICATIONS
108+
pm set-permission-flags $VIPERFXPACKAGE android.permission.POST_NOTIFICATIONS user-fixed
109+
}
103110

104111
IFS=$'\n'
105112
for packagedata in $(sed -e 's/^\s*#.*$//' -e '/^$/d' < "$MODPATH"/stockeqpackages.csv); do

0 commit comments

Comments
 (0)