[Magisk] exocetdj:
so been working on the script further and have ironed out all bugs I can conceive, i'm literally at the end of what I can try with this.

i'm stumped, even the coding expert who has kindly put loads of their time in is stumped. for whatever reasons I cannot get that damn cscfeatures.xml over as, although cp_ch appears to work, its not copying from $TMPDIR.

it looks like I have now got the zip to make the necessary amendments to the file however by extracting from the zip to tmpdir

furthermore i'm happy for anyone else to use if it ever works lol!!

just need a bit of input

install code is below

#!/sbin/sh
# CSC Function, keeps these at the top of the file
# $1 is the read/identified CSC ID
# $2 is the desired/test CSC ID, so the one your are testing against
# how to call it:
# copy_cscfeature_xml $csc_id ACR
copy_cscfeature_xml ()
{
if [[ "$1" == "$2" ]]; then
ui_print "Extracting $1 CSC..."
unzip -qjo "$ZIPFILE" common/420/product/omc/$1/conf/cscfeature.xml -d $TMPDIR
ui_print "Installing $1 CSC..."

sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Calendar_SetColorOfDays XXXXXBR
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_EnableCameraDuringCall TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_EnableSmsNotiPopup TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_ShutterSoundMenu TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Common_ConfigSvcProviderForUnknownNumber whitepages,whitepages,whitepages
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Setting_CustNetworkSelMenu4 TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Setting_SupportRealTimeNetworkSpeed TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_ConfigDashboard dual_dashboard
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_ConfigSubFeatures roguepopup,applock,data_compression,badappnoti,autoclean,autorestart,networkpowersaving,storageclean,backgroundapp,trafficmanager,notificationmanager,devicesecurity,applicationpermission,devicesecurity,chinadualpage,UDS2
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_DisableAntiMalware TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_ConfigDefQuickSettingItem Wifi,SoundMode,Bluetooth,RotationLock,Flashlight,AirplaneMode,BatteryMode,PowerShare,MobileData,BikeMode,BlueLightFilter,Hotspot,DailyBoard,PersonalMode,Location,Nfc,Aod,AllShareCast,DeviceVisibility,Dnd,Ebook,Sync,UDS,PowerPlanning,EdgeLighting,WifiCalling,VoLte,Dolby,DesktopMode,KidsHome,Routines,ScreenCapture,NavigationBar
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_SupportRecentAppProtection TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_VoiceCall_ConfigRecording RecordingAllowed
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Knox_SupportKnoxGuard FALSE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Wifi_SupportAdvancedMenu TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Common_ConfigYuva_sprotect|downloadable_sprotect

cp_ch -r $TMPDIR/cscfeature.xml $MODPATH/system/product/omc/$1/conf/cscfeature.xml 0755

fi
}

copy_cscfeature_xml_single ()
{
if [[ "$1" == "$2" ]]; then
ui_print "Extracting $1 CSC..."
unzip -qjo "$ZIPFILE" common/420/product/omc/single/$1/conf/cscfeature.xml -d $TMPDIR
ui_print "Installing $1 CSC..."

sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Calendar_SetColorOfDays XXXXXBR
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_EnableCameraDuringCall TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_EnableSmsNotiPopup TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Camera_ShutterSoundMenu TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Common_ConfigSvcProviderForUnknownNumber whitepages,whitepages,whitepages
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Setting_CustNetworkSelMenu4 TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Setting_SupportRealTimeNetworkSpeed TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_ConfigDashboard dual_dashboard
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_ConfigSubFeatures roguepopup,applock,data_compression,badappnoti,autoclean,autorestart,networkpowersaving,storageclean,backgroundapp,trafficmanager,notificationmanager,devicesecurity,applicationpermission,devicesecurity,chinadualpage,UDS2
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SmartManager_DisableAntiMalware TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_ConfigDefQuickSettingItem Wifi,SoundMode,Bluetooth,RotationLock,Flashlight,AirplaneMode,BatteryMode,PowerShare,MobileData,BikeMode,BlueLightFilter,Hotspot,DailyBoard,PersonalMode,Location,Nfc,Aod,AllShareCast,DeviceVisibility,Dnd,Ebook,Sync,UDS,PowerPlanning,EdgeLighting,WifiCalling,VoLte,Dolby,DesktopMode,KidsHome,Routines,ScreenCapture,NavigationBar
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_SystemUI_SupportRecentAppProtection TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_VoiceCall_ConfigRecording RecordingAllowed
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Knox_SupportKnoxGuard FALSE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Wifi_SupportAdvancedMenu TRUE
sh $MODPATH/common/addon/cscfeature.sh $TMPDIR cscfeature.xml CscFeature_Common_ConfigYuva_sprotect|downloadable_sprotect

cp_ch -r $TMPDIR/cscfeature.xml $MODPATH/system/product/omc/single/$1/conf/cscfeature.xml 0755

fi
}

ui_print " "
ui_print " #####################################################"
ui_print " Welcome to 420rom "
ui_print " This option gives you Debloat customisation. "
ui_print " -----------------------------------------------------"
ui_print " Vol+ = Custom Install "
ui_print " Vol- = Stock Style install "
ui_print " #####################################################"
ui_print " "
ui_print "420rom_installer"
ui_print "Testing Buttons"
ui_print " "
ui_print " Vol+ = Custom Install"
ui_print " Vol- = Stockish Install"
if $VKSEL; then
ui_print "Custom Install selected"
ui_print " ##############################################"
ui_print " ~~ Do you want to add 1120 fonts? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, add SamsungSans.apk "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
cp -rf $MODPATH/common/420/system/app/SamsungSans $MODPATH/system/app
ui_print " Installed fonts"
ui_print" "
sleep 1
fi
ui_print " ##############################################"
ui_print " ~~ Do you want the 420 Bootanimation ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, Swap Bootanimation "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
cp -rf $MODPATH/common/420/system/media $MODPATH/system
ui_print " Swapped Bootanimation"
ui_print" "
sleep 1
fi
ui_print " ##############################################"
ui_print " ~~ Add GoodLock? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, add GoodLock.apk "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
cp -rf $MODPATH/common/420/system/app/SamsungGoodLock $MODPATH/system/app
ui_print " Installed GoodLock"
ui_print" "
sleep 1
fi
ui_print " ##############################################"
ui_print " ~~ SoundAssistant for vol steps settings?~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, add SoundAssistant.apk "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
cp -rf $MODPATH/common/420/system/app/SoundAssistant $MODPATH/system/app
ui_print " Installed SoundAssistant"
ui_print" "
sleep 1
fi
ui_print " ##############################################"
ui_print " ~~ Install Viper4Androidfx? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, add Viper4Androidfx.apk "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
cp -rf $MODPATH/common/420/system/app/Viper4Androidfx $MODPATH/system/app
ui_print " Installed V4a"
ui_print" "
sleep 1
fi
ui_print " ##############################################"
ui_print " ~~ Do you want to remove Chrome? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke chrome "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed chrome"
ui_print" "
sleep 1
REPLACE="$REPLACE /system/app/Chrome"
fi
ui_print " ##############################################"
ui_print " ~~ Do you want to remove Facebook? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke facebook "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Facebook"
ui_print " "
sleep 1
REPLACE="$REPLACE /system/app/Facebook_stub
/system/priv-app/FBServices"
fi
ui_print " ##############################################"
ui_print " ~~ Do you want to remove Netflix? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Netflix n "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Netflix"
ui_print " "
sleep 1
REPLACE="$REPLACE /system/app/Netflix_stub"
fi
ui_print " ##############################################"
ui_print " ~~ Do you want to remove Tips? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Tips "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Netflix"
ui_print " "
sleep 1
REPLACE="$REPLACE /system/priv-app/Tips"
fi
ui_print " ##############################################"
ui_print " ~~ Do you want to remove Bixby? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Bixby "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Bixby"
ui_print " "
sleep 1
REPLACE="$REPLACE	/system/app/BixbyWakeup
/system/priv-app/Bixby
/system/priv-app/BixbyAgentStub
/system/priv-app/BixbyHome
/system/priv-app/BixbyService"
fi
ui_print " ##############################################"
ui_print " ~~ Kill Defunct system update? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke System Update "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed System Update"
ui_print " "
sleep 1
REPLACE="$REPLACE	/system/priv-app/FotaAgent
/system/priv-app/SystemUpdate"
fi
ui_print " ##############################################"
ui_print " ~~ Kill Upday? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Upday "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Upday?"
ui_print " "
sleep 1
REPLACE="$REPLACE	/system/priv-app/Upday"
fi
ui_print " ##############################################"
ui_print " ~~ Kill Kids Home? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Kids Home "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Kids Home"
ui_print " "
sleep 1
REPLACE="$REPLACE	/system/priv-app/KidsHome_Installer"
fi
ui_print " ##############################################"
ui_print " ~~ Kill Onedrive? ~~ "
ui_print " ----------------------------------------------"
ui_print " Vol+ = Yes, nuke Onedrive "
ui_print " Vol- = No, next bong please "
ui_print " ##############################################"
if $VKSEL; then
ui_print " Killed Onedrive"
ui_print " "
sleep 1
REPLACE="$REPLACE	/system/priv-app/OneDrive_Samsung_v3"
fi
ui_print " Installing custom debloated config"
ui_print " "
sleep 1
else
ui_print "Vol - Selected"
ui_print " Bypassing debloating options for full fat install"
ui_print " "
fi
ui_print " "
ui_print "Identifying Firmware's CSC"
csc_id=`cat /product/omc/sales_code.dat`
echo "Your active csc is $csc_id"
if [[ -d "/product/omc/$csc_id" || -d "/product/omc/single/$csc_id" ]]; then
echo "CSC code $csc_id found in rom zip"
else
echo "CSC not found in rom zip, will use XEU"
fi
ui_print "Identifying CSC completed"
ui_print " "
ui_print " "
ui_print "duplicating relevant CSCfeatures.xml"

copy_cscfeature_xml $csc_id AFG
copy_cscfeature_xml $csc_id AFR
copy_cscfeature_xml $csc_id ATO
copy_cscfeature_xml $csc_id AUT
copy_cscfeature_xml $csc_id BGL
copy_cscfeature_xml $csc_id BNG
copy_cscfeature_xml $csc_id BRI
copy_cscfeature_xml $csc_id CAC
copy_cscfeature_xml $csc_id CAM
copy_cscfeature_xml $csc_id CAU
copy_cscfeature_xml $csc_id CHO
copy_cscfeature_xml $csc_id COO
copy_cscfeature_xml $csc_id DBT
copy_cscfeature_xml $csc_id DKR
copy_cscfeature_xml $csc_id DTM
copy_cscfeature_xml $csc_id ECT
copy_cscfeature_xml $csc_id EGY
copy_cscfeature_xml $csc_id EON
copy_cscfeature_xml $csc_id EUR
copy_cscfeature_xml $csc_id ILO
copy_cscfeature_xml $csc_id INS
copy_cscfeature_xml $csc_id ITV
copy_cscfeature_xml $csc_id KSA
copy_cscfeature_xml $csc_id LAO
copy_cscfeature_xml $csc_id LUX
copy_cscfeature_xml $csc_id MWD
copy_cscfeature_xml $csc_id MXO
copy_cscfeature_xml $csc_id MYM
copy_cscfeature_xml $csc_id NEE
copy_cscfeature_xml $csc_id NPL
copy_cscfeature_xml $csc_id ORX
copy_cscfeature_xml $csc_id PAK
copy_cscfeature_xml $csc_id PEO
copy_cscfeature_xml $csc_id PHE
copy_cscfeature_xml $csc_id PHN
copy_cscfeature_xml $csc_id ROM
copy_cscfeature_xml $csc_id SEB
copy_cscfeature_xml $csc_id SEE
copy_cscfeature_xml $csc_id SEK
copy_cscfeature_xml $csc_id SKZ
copy_cscfeature_xml $csc_id SLK
copy_cscfeature_xml $csc_id SMP
copy_cscfeature_xml $csc_id THL
copy_cscfeature_xml $csc_id THR
copy_cscfeature_xml $csc_id TKD
copy_cscfeature_xml $csc_id TPA
copy_cscfeature_xml $csc_id TPH
copy_cscfeature_xml $csc_id TTT
copy_cscfeature_xml $csc_id TUN
copy_cscfeature_xml $csc_id TUR
copy_cscfeature_xml $csc_id XEF
copy_cscfeature_xml $csc_id XEH
copy_cscfeature_xml $csc_id XEO
copy_cscfeature_xml $csc_id XEU
copy_cscfeature_xml $csc_id XEZ
copy_cscfeature_xml $csc_id XFE
copy_cscfeature_xml $csc_id XME
copy_cscfeature_xml $csc_id XSG
copy_cscfeature_xml $csc_id XSP
copy_cscfeature_xml $csc_id XTC
copy_cscfeature_xml $csc_id XXV
copy_cscfeature_xml $csc_id ZTO

copy_cscfeature_xml_single $csc_id BTC
copy_cscfeature_xml_single $csc_id BTU
copy_cscfeature_xml_single $csc_id CPW
copy_cscfeature_xml_single $csc_id DOO
copy_cscfeature_xml_single $csc_id EMP
copy_cscfeature_xml_single $csc_id GLB
copy_cscfeature_xml_single $csc_id GTO
copy_cscfeature_xml_single $csc_id ILP
copy_cscfeature_xml_single $csc_id LYS
copy_cscfeature_xml_single $csc_id MAT
copy_cscfeature_xml_single $csc_id MID
copy_cscfeature_xml_single $csc_id MM1
copy_cscfeature_xml_single $csc_id NZC
copy_cscfeature_xml_single $csc_id OPS
copy_cscfeature_xml_single $csc_id SER
copy_cscfeature_xml_single $csc_id SIN
copy_cscfeature_xml_single $csc_id SIO
copy_cscfeature_xml_single $csc_id SMA
copy_cscfeature_xml_single $csc_id STH
copy_cscfeature_xml_single $csc_id TEL
copy_cscfeature_xml_single $csc_id TNZ
copy_cscfeature_xml_single $csc_id VAU
copy_cscfeature_xml_single $csc_id VNZ
copy_cscfeature_xml_single $csc_id XFA
copy_cscfeature_xml_single $csc_id XFV
copy_cscfeature_xml_single $csc_id XNZ
copy_cscfeature_xml_single $csc_id XSA