Credits: corsicanu for original c2s source
Everything works except for the following:
- Decryption*
Decryption does not work on this device and if your device is encrypted then TWRP will be unable to view your files. To Decrypt your device, enter the terminal in TWRP and run the multidisabler
command
- DTB: Imported KawaKernel A12 DTB
- DTBO: Imported KawaKernel A12 DTBO
- Implemented multidisabler command
- Implemented sgdisk command
- Recovery Kernel: KawaKernel-R
Make tw directory and go into it
mkdir tw; cd tw
Clone A21s device tree to device/samsung/a21s
git clone https://github.com/DozNaka/android_device_samsung_a21s device/samsung/a21s
Init TWRP AOSP 12.1 manifest repo
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
Sync repo and wait
repo sync
Begin building TWRP
export ALLOW_MISSING_DEPENDENCIES=true; . build/envsetup.sh; lunch twrp_a21s-eng; mka recoveryimage
Output will be in tw/out/target/product/a21s/recovery.img
If you do not do this then you will get KG STATE blocked and you will have to flash stock firmware anyway to fix it. So sorry linux users but you will need to use Odin (Not JOdin or heimdall) to reflash stock rom
Requirements: Rooted by flashing AP file via Odin that was patched using Magisk App OR patched vbmeta
To root your device with the patch AP method you do the following:
- Install Bifrost apk
- Download stock firmware using the Bifrost app
- Extract AP from firmware
- Install Magisk
- Open Magisk, press Install and then Select and Patch a File
- Select the AP file you have extracted from stock firmware
- Once finished patching, you will find the patched AP file in Downloads
- Move the patched AP file to your computer
- Flash the patched AP file with Odin
If you are on linux then extract the AP file and flash vbmeta and boot images with heimdall
Once you have finished this you can proceed with the methods below:
Method 1: recovery.img
- If you are on linux then flash recovery.img with heimdall
heimdall flash --RECOVERY recovery.img
- You can the TWRP app to flash the recovery.img
- You can use the dd command to flash recovery.img by placing the recovery.img in /sdcard and running these commands
su
dd if=/sdcard/recovery.img of=/dev/block/by-name/recovery
Method 2: recovery.tar
- Place the tar file in AP in Odin then flash
- Once TWRP is flashed, boot to it with volume up + power combo
- Go to Advanced -> Terminal, then you will enter the
multidisabler
command - Reboot to recovery again
- Format data as you will get bootloops if you don't