From bf6d9dbb57698d19b69ea8ae6c113fe747184d7d Mon Sep 17 00:00:00 2001 From: corsicanu Date: Sun, 9 Jan 2022 14:17:00 +0200 Subject: [PATCH] recovery: introduce nuker, a valid replacement for multidisabler Signed-off-by: corsicanu --- BoardConfig.mk | 7 --- addons/multidisabler-samsung-3.1.zip | Bin 4000 -> 0 bytes recovery/root/init.recovery.exynos9825.rc | 9 +++ recovery/root/sbin/nuker.sh | 64 ++++++++++++++++++++++ 4 files changed, 73 insertions(+), 7 deletions(-) delete mode 100644 addons/multidisabler-samsung-3.1.zip create mode 100755 recovery/root/sbin/nuker.sh 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 2058fc63c2b36ee7b9766c19f930bef261dec6d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4000 zcma)eai(`EcgW`tCkI_StK_Wu5cyG14PD!$=1BF?-b2MnCtjq5Sb;pk<~e zt_#wZH2O=n`!^ZQX_@m~$SLW7O_brUw4a;t?^5@>ciq9RryM&Da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huUf`{4?5EaQxdu0uXv`D(m$$p`tse|apj0W|DAPOV zU?ZEtByW#aJogufH`=o8V?`||wYRYj*%C@GL$oAVfbTNm^W3x+1Z@=0jO5s}TR+aK zHRtSHDcavA?Y9`O7_VbG^Mx!u!7JHq9FO%R!_SA-G05j{H%fcd_AILMKGbX~KL*BM z0sHaLDF`w$Cw=V99N3Lu>ikqcqu9B2xf+qn8)n~rCK;5&<`)19Gb9pTXVwOGv#{{U zbxrd*)ZoF~>%elaSNt4}^aReQ+C*3Bk}N{5>ugIj1l#tlXdidS&!#I;M4*OU_AWgeb)tRhcLW2z)o5UDDCHrQScnx47>lJ%IIq) z&n_KQHpMsrwpddBz}!w>!hHCTBP8uQl%oTQ0)fXkJP#hTGn_?=$ZSQb@96KjaD@`T zQ4S5}im2oJN|#W5>w~wDfiDnp1BK>QY6CH{M7OO(>Vhc!ye0og= z&?Bvi#Ne?u_-9~kp!DGAh8OpErO6zzP85rI{FujFLPAytFl) z9wqs8pN{?~ww;c?@+0Z5=${bxTfDb}@o({e-lyaLiF&8wP5vJLC;0u=awOH)QHJ}^ zM+BuEMAhL)PPhCM4^Ov5|4Yj+Sp2Q6ap)lL=dWUrKK|eR=l!3y{|hO9wOx9+7SZxw c+I|Df|6ldlb3ZZxXMa4DqyRv~PqGI5562QGFaQ7m 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 +