This tutorial is made for Linux users (it may not work on WSL).
It is instuction how to to everything Samsung Multi-Disabler does by hand.
It is handy if you want to make installing TWRP easier (no recovery override),
or just to make a playground for toying with Android.
Package android-tools should be installed, and your device should be connected.
Also, this is only for Samsung, do not try this on any other device.
Convert sparse image to raw ext4 image, create mount point directories, mount raw ext4 images.
System is /mnt/system/ and vendor is /mnt/vendor/.
simg2img system.img.ext4 system.raw
sudo mkdir /mnt/system/
sudo mount -t ext4 -o loop system.raw /mnt/system/
simg2img vendor.img.ext4 vendor.raw
sudo mkdir /mnt/vendor/
sudo mount -t ext4 -o loop vendor.raw /mnt/vendor/Root for everything below is /mnt/vendor/
Check which file you have, /etc/fstab.exynos or /etc/fstab.qcom.
sudo sed -i -e 's/^\([^#].*\)fileencryption=[^,]*\(.*\)$/# &\n\1encryptable\2/g' "<file_path_here>"Please check that adb shell getprop ro.boot.dynamic_partitions is not true.
Here are the required files: /etc/init/vk*.rc /etc/init/vaultkeeper*
* is a wildcard and means "anything".
For each file that meets these naming rules, do sed -i -e 's/^[^#].*$/# &/' "<file_path_here>"
Click here for instructions. It is in System patching!
Disable "vaultkeeper" service.
Run this: sudo chmod 0 /bin/vaultkeeperd
The required file is /etc/init/pa_daemon*.rc
* is a wildcard and means "anything".
For each file that meets these naming rules, do sed -i -e 's/^[^#]/# &/' "<file_path_here>"
Disable "proca" service.
Next steps are only for Android 10 and below. This is a warning for Vendor patching only.
Model is not Galaxy A20s or similar. It is A207F, for example.
This step is required only if you have any output from this command: echo "<device_model_here>" | grep -E 'G97([035][FNUW0]|7[BNUW])|N97([05][FNUW0]|6[BNQ0]|1N)|T860|F90(0[FN]|7[BN])|M[23]15F'
The required files are /vendor/init/cass.rc /vendor/etc/init/cass.rc
Just run this for each of these files: sed -i -e 's/^[^#].*cass.*$/# &/' -re '/\/(system|vendor)\/bin\/cass/,/^#?$/s/^[^#]*$/#&/' "<file_path_here>"
Root for everything below is /mnt/system/.
The required file is recovery-from-boot.p.
It may be in the root or in system directory.
Just run this in each directory mentioned above: mv recovery-from-boot.p recovery-from-boot.p~
Please check that adb shell getprop ro.boot.dynamic_partitions is not true.
Click here for instructions. If you did it already, you can skip that. It is in Vendor patching!
Just run this:
sed -i -e 's/^[^#].*vaultkeeper.*$/# &/' \
-re '/\/system\/bin\/vaultkeeperd/,/^#?$/s/^[^#]*$/#&/' init.rcRun this: sudo chmod 0 /bin/vaultkeeperd
Model is not Galaxy A20s or similar. It is A207F, for example.
This step is required only if you have any output from this command: echo "<device_model_here>" | grep -E 'G97([035][FNUW0]|7[BNUW])|N97([05][FNUW0]|6[BNQ0]|1N)|T860|F90(0[FN]|7[BN])|M[23]15F'
Just run this: sed -i -e 's/^[^#].*cass.*$/# &/' -re '/\/(system|vendor)\/bin\/cass/,/^#?$/s/^[^#]*$/#&/' init.rc
Follow this step only if you have any other Android version than 10.
Model is not Galaxy A20s or similar. It is A207F, for example.
Just run this:
local f=/system/lib64/libbluetooth.so
local tf=/tmp/f
if echo "<device_model_here>" | grep -E '[GN]9[67][03567][UW0]|F90(0[FN]|7[BN])|T86[05]' >/dev/null; then
substitute='s/88000054691180522925c81a69000037e0030032/04000014691180522925c81a69000037e0031f2a/'
else
substitute='s/c8000034f4031f2af3031f2ae8030032/1f2003d5f4031f2af3031f2ae8031f2a/'
fi
xxd -p $f | tr -d '\n ' | sed -e $substitute | xxd -rp > $tf
if ! cmp $tf $f >/dev/null && [ $(stat -c '%s' $tf) -eq $(stat -c '%s' $f) ]; then
echo "Patching successful!"
touch -r $f $tf
chmod 644 $tf
mv $tf $f
else
echo "Patching failed, no changes vere made."
rm -f $tf
fiVariable service should be set to what service you want to disable.
The required files are /mnt/vendor/etc/vintf/manifest.xml /mnt/system/system/etc/vintf/compatibility_matrix.device.xml /mnt/vendor/etc/vintf/manifest/vaultkeeper_manifest.xml
sed -i -e '/<hal format="hidl">/{N;/<name>vendor\.samsung\.hardware\.security\.'"$service"'<\/name>/{:loop;N;/<\/hal>/!bloop;d}}' $ised -i -e '/<hal format="hidl">/{N;/<name>vendor\.samsung\.security\.'"$service"'<\/name>/{:loop;N;/<\/hal>/!bloop;d}}' $iConvert raw ext4 image to sparse.
mkdir patched
img2simg system.raw patched/system.img.ext4
sudo umount /mnt/system/
sudo rm -rf /mnt/system/
img2simg vendor.raw patched/vendor.img.ext4
sudo umount /mnt/vendor/
sudo rm -rf /mnt/vendor/