Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 1486c11

Browse files
committed
Prevent module install script from permanently disabling hidden APIs.
1 parent 2a03093 commit 1486c11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/src/main/assets/module_installer_compat.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ grep_get_prop() {
4242
}
4343
fi
4444

45+
# prevent old modules from disabling hidden_apis, please use LSPosed library instead.
46+
# See: https://github.com/LSPosed/AndroidHiddenApiBypass
47+
settings() {
48+
if [ "$1" == "put" ] && [ "$2" == "global" ] && ([ "$3" == "hidden_api_policy" ] || \
49+
[ "$3" == "hidden_api_policy_p_apps" ] || [ "$3" == "hidden_api_policy_pre_p_apps" ]); then
50+
true
51+
else
52+
"$(which settings)" "$@"
53+
fi
54+
}
55+
4556
if [ $MAGISK_VER_CODE -ge 20400 ]; then
4657
# New Magisk have complete installation logic within util_functions.sh
4758
install_module

0 commit comments

Comments
 (0)