├── META-INF └── com │ └── google │ └── android │ ├── updater-script │ └── update-binary ├── module.prop ├── customize.sh ├── README.md ├── service.sh └── LICENSE /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=Shamiko-Whitelist-Switch 2 | name=Shamiko Whitelist Switch 3 | version=1.0 4 | versionCode=1 5 | author=sidex15 6 | description=Enable/Disable Shamiko Whitelist Mode without reboot or going through /data/adb/shamiko. Because we're lazy... -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | 2 | ui_print "*******************************" 3 | ui_print " Shamiko Whitelist Switch " 4 | ui_print " for ya'll lazy folks like me " 5 | ui_print " (sidex15) " 6 | ui_print "*******************************" 7 | 8 | set_perm_recursive $MODPATH 0 0 0755 0755 -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v20.4+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 31 | 32 | install_module 33 | exit 0 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shamiko-Whitelist-Switch 2 | A Magisk module to switch Shamiko from Blacklist mode to Whitelist mode and vice versa using a switch without going to /data/adb/shamiko to create or delete a file. 3 | 4 | ## Why? 5 | Because when going to whitelist mode you cannot give root access to the new app that needs root. To have root access it needs to switch to blacklist mode to grant root access. And it's so much work to switch whitelist to blacklist by adding or deleting "whitelist" file in /data/adb/shamiko. this module makes it easier to switch on or off the whitelist mode. 6 | 7 | ## How to install: 8 | Just like a module would do... 9 | 10 | ## How to use: 11 | it is set to whitelist by default so if you want to switch to blacklist mode to grant root to a new app turn off the module and it will switch back to blacklist mode. Switch it on, and it makes it back to whitelist mode. 12 | No need to reboot. 13 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Check the switch status and create/delete the whitelist file accordingly 4 | MODDIR=${0%/*} 5 | 6 | # Checking if the module switch is enabled 7 | is_module_enable() { 8 | if [[ -e "${MODDIR}/disable" ]] || [[ -e "${MODDIR}/remove" ]]; then 9 | return 1 # Disabled 10 | else 11 | return 0 # Enabled 12 | fi 13 | } 14 | 15 | # Executing the switch 16 | whitelist_switch() { 17 | while true; do 18 | 19 | # Check module enable/disable status 20 | is_module_enable 21 | if [ $? -eq 0 ]; then 22 | # Module is enabled, create whitelist file if it doesn't exist 23 | touch /data/adb/shamiko/whitelist 24 | echo "Whitelist file created." 25 | else 26 | # Module is disabled, delete whitelist file if it exists 27 | rm /data/adb/shamiko/whitelist 28 | echo "Whitelist file deleted." 29 | fi 30 | 31 | sleep 5 # Sleep for 5 seconds before checking again 32 | done 33 | } 34 | 35 | # Start the switch monitoring 36 | whitelist_switch 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 sidex15 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------