diff --git a/BoardConfig.mk b/BoardConfig.mk index 87e1143..84715c9 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -113,13 +113,6 @@ SHRP_EXTERNAL_ADDON_2_BTN_TEXT := "Patch now" SHRP_EXTERNAL_ADDON_2_SUCCESSFUL_TEXT := "Successfuly patched" SHRP_INC_IN_REC_EXTERNAL_ADDON_2 := true -SHRP_EXTERNAL_ADDON_3_NAME := "Samsung Multidisabler - v3.1" -SHRP_EXTERNAL_ADDON_3_INFO := "Simple Samsung security services disabler" -SHRP_EXTERNAL_ADDON_3_FILENAME := "multidisabler-samsung-3.1.zip" -SHRP_EXTERNAL_ADDON_3_BTN_TEXT := "Patch now" -SHRP_EXTERNAL_ADDON_3_SUCCESSFUL_TEXT := "Successfuly patched" -SHRP_INC_IN_REC_EXTERNAL_ADDON_3 := true - # Include TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include diff --git a/addons/multidisabler-samsung-3.1.zip b/addons/multidisabler-samsung-3.1.zip deleted file mode 100644 index 2058fc6..0000000 Binary files a/addons/multidisabler-samsung-3.1.zip and /dev/null differ diff --git a/recovery/root/init.recovery.exynos9825.rc b/recovery/root/init.recovery.exynos9825.rc index 8022a6b..28164c3 100755 --- a/recovery/root/init.recovery.exynos9825.rc +++ b/recovery/root/init.recovery.exynos9825.rc @@ -6,4 +6,13 @@ on boot setprop ro.boot.vbmeta.avb_version 1.1 setprop ro.boot.avb_version 1.1 +on property:sys.usb.ffs.ready=1 + start nuker + +service nuker /sbin/sh /sbin/nuker.sh + user root + group root + oneshot + disabled + seclabel u:r:recovery:s0 diff --git a/recovery/root/sbin/nuker.sh b/recovery/root/sbin/nuker.sh new file mode 100755 index 0000000..fdc7b96 --- /dev/null +++ b/recovery/root/sbin/nuker.sh @@ -0,0 +1,64 @@ +#!/sbin/sh +# Copyright 2019-2022 © corsicanu +# Licensed under CC BY-NC-SA 4.0 +# https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode +# +# An extent of original RMM patcher combined with +# Ian Macdonald's Samsung multidisabler, furtherly +# adapted for our specific needs with precious help +# from IvanMeler and AnanJaser1211 + +# Step 0 - Mount system/vendor and setenforce 0 {just in case} +setenforce 0 +mount /system_root +mount -o remount,rw /system_root +mount /vendor +mount -o remount,rw /vendor + +# Step 1 - Entirely nuke encryption +for i in /vendor/etc/fstab.exynos*; do + if [ -f $i ]; then + sed -i -e 's/^\([^#].*\),fileencryption=[^,]*\(.*\)$/# &\n\1\2/g' $i + fi +done + +# Step 2 - Nuke manifest lines for the given combo of trash services +combo=(vaultkeeper proca wsm) +for service in ${combo[@]}; do + for i in /vendor/etc/vintf/manifest.xml \ + /vendor/etc/vintf/manifest/vaultkeeper_manifest.xml \ + /vendor/etc/vintf/manifest/wsm_manifest.xml; do + if [ -f $i ]; then + sed -i -e '//{N;/vendor\.samsung\.hardware\.security\.'"$service"'<\/name>/{:loop;N;/<\/hal>/!bloop;d}}' $i + fi + done +done + +# Step 3 - Nuke trash services inits +for i in $ANDROID_ROOT/system/etc/init/vk*.rc \ + /vendor/etc/init/vk*.rc \ + /vendor/etc/init/vaultkeeper* \ + /vendor/init/cass.rc \ + /vendor/etc/init/cass.rc \ + /vendor/etc/init/pa_daemon*.rc \ + $ANDROID_ROOT/system/bin/vaultkeeperd \ + /vendor/bin/vaultkeeperd; do + if [ -f $i ]; then + echo "" > $i + fi +done + +# Step 4 - Others +r=recovery-from-boot.p +for i in $ANDROID_ROOT $ANDROID_ROOT/system /vendor; do + if [ -f $i/$r ] && [ ! -f $i/$r~ ]; then + mv $i/$r $i/$r~ + fi +done + +# Step 5 - Unmount system/vendor +umount /system_root +umount /vendor + +exit 0 +