[Magisk] oreo27:
Edit 1 - /system/priv-app/CleanMaster is apparently hidden.

Edit 2 - Looks like /system removal through this method is working okay. How can I do the same for /data? This doesn't seem to be working?

This is driving me a little insane. I've tried following the guide here to create my own module. I'm just testing it out by trying to remove some folders. I've followed the instructions to a t but I can't figure out what's going on.

1. Edited the config.sh like so:

##########################################################################################
#
# Magisk
# by topjohnwu
#
# This is a template zip for developers
#
##########################################################################################
##########################################################################################
#
# Instructions:
#
# 1. Place your files into system folder
# 2. Fill in all sections in this file
# 3. For advanced features, add commands into the script files under common:
# post-fs.sh, post-fs-data.sh, service.sh
# 4. Change the "module.prop" under common with the info of your module
#
##########################################################################################
##########################################################################################
#
# Limitations:
# 1. Can not place any new items under /system root!! e.g. /system/newfile, /system/newdir
# Magisk will delete these items at boot.
#
##########################################################################################

##########################################################################################
# Defines
##########################################################################################

# NOTE: This part has to be adjusted to fit your own needs

# This will be the folder name under /magisk or /cache/magisk
# This should also be the same as the id in your module.prop to prevent confusion
MODID=MIUI8Debloat

# Set to true if you need automount
# Most mods would like it to be enabled
AUTOMOUNT=true

# Set to true if you need post-fs-data script
POSTFSDATA=false

# Set to true if you need late_start service script
LATESTARTSERVICE=false

##########################################################################################
# Installation Message
##########################################################################################

# Set what you want to show when installing your mod

print_modname() {
ui_print "***********************************"
ui_print " MIUI 8 DeBloater by oreo27 "
ui_print "***********************************"
}

##########################################################################################
# Replace list
##########################################################################################

# List all directories you want to directly replace in the system
# By default Magisk will merge your files with the original system
# Directories listed here however, will be directly mounted to the correspond directory in the system

# This is an example
REPLACE=""

# Construct your own list here
REPLACE="
/system/priv-app/CleanMaster
/data/app/Browser
"

##########################################################################################
# Permissons
##########################################################################################

# NOTE: This part has to be adjusted to fit your own needs

set_permissions() {
# Default permissions, don't remove them
set_perm_recursive $MODPATH 0 0 0755 0644

# Only some special files require specific permission settings
# The default permissions should be good enough for most cases

# Some templates if you have no idea what to do:

# set_perm_recursive <dirname> <owner> <group> <dirpermission> <filepermission> <contexts> (default: u:object_r:system_file:s0)
# set_perm_recursive $MODPATH/system/lib 0 0 0755 0644

# set_perm <filename> <owner> <group> <permission> <contexts> (default: u:object_r:system_file:s0)
# set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0
# set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0
# set_perm $MODPATH/system/lib/libart.so 0 0 0644
}

But the two folders are not empty when browsed to. Perhaps I'm going about this in the wrong way?

In addition, I've attached the entire module which is based off of the latest template. Hoping for a response :)