[Samsung Galaxy A21s Questions & Answers] Wer99:
Please follow this tutorial instead.​

Root for Samsung a21s

Root your Samsung a21s with this method.

You can't use Magisk or the Stock ROM/Firmware with this method, instead you will use SuperSu and a customized pre-rooted ROM/GSI. For this, you need to backup all your data eventually. For now that's the only way to get this phone rooted. For more information about GSI click here.

UPDATE:

Now you can root your phone flashing this GSI with Odin. So no need to do the tutorial.

It will install a pre-rooted AOSP GSI on your phone.

If you already flashed the Android 11 GSI and want to downgrade, unfortunately you need to wipe your data. But if you already this Android 10 GSI and want to update to 11 you don't need to wipe your data.

Downloads:

Android 10 AOSP pre-rooted (Android 10 is highly recommended because it's more stable and faster.) (Download Screenshots)

Android 11 AOSP pre-rooted

Root Confirmations.

https://xdaforums.com/showpost.php?p=83929761&postcount=62 > Theqtest

https://xdaforums.com/showpost.php?p=83931905&postcount=69 > Eklipz3

https://xdaforums.com/showpost.php?p=83940297&postcount=80 > PamelaGirl

thenks for sharing your confirmations.

Follow this tutorial to flash any GSI ROM on your A21s using fastboot. If you are stock on fastboot (can't boot to bootloader) you need to follow the below tutorial or flash the super.tar above.

Backup all your data.

Requirements:

1. Virtual Box

2. Linux ISO (Mint or Ubuntu)

3. 7-Zip ZS Installer

4. Simg2img : thenks MrWaehere

5. Unlock your bootloader

6. GSI Android 10 A/B Gapps : Download only arm64, A/B GSIs.

Choose any ROM. Some does not work, so I recommend to use the Official Android 10 or 11.

Android 10 AOSP 10.0 v222 "system-quack-arm64-ab-gapps.img.xz" with Gapps. (USB does not work on this ROM, only ADB)

7. Odin

Download all the required files and tools Samsung_A21s.zip.

Don't forget to install 7-Zip ZS.

Sharing a folder from Windows to Linux

Fist you need to use both Windows and Linux using Virtual Box and share a folder from Windows to Linux.

Install Linux on Virtual Box following this tutorial and open the Terminal Win + T and run this code. Recommended Linux Mint.

Installing VirtualBox Guest Additions

sudo su root

Type your Password.

apt install build-essential dkms

Type Y and wait downloading...

mount /dev/cdrom /media/cdrom

cd /media/YOURUSERNAME/VBox_GAs_6.1.16

./VBoxLinuxAdditions.run

This will install the "VirtualBox Guest Additions" on your Linux, so without it we can't share the folders.

Type :

adduser YOURUSERNAME vboxsf

And reboot your Linux.

Create a folder on your Windows Desktop called "Samsung".

At the top bar of your Virtual Box click Devices and Shared Folders > Shared Folders Settings, then click the plus icon, select and add your Samsung folder, enable Auto-mount, click OK and close.

A drive will be mounted on your Linux as "sf_Samsung".

Now Save the state of your Linux. (Exitting)

File extraction

Download your stock ROM and extract the super.img.lz4 file from AP_A217XXXXXXXXXX_XXX_XXXX_REV00_user_low_ship_MULTI_CERT_meta_RKEY_OS10.tar.md5 with 7-Zip ZS.

Extract the "super.img.lz4" using the 7-ZIP ZS and copy the original super.img to your Samsung folder.

Extract all files from A21_Samsung.zip to your Samsung folder including your "AOSP ROM .IMG".

Convert super.img to raw

Open CMD Win + X, and select Command Prompt (Admin) or press A.

Type:

cd C:\Users\%USERNAME%\Desktop\Samsung

.

then:

simg2img super.img super.raw

.

Wait.

Move the super.raw to Samsung_Files folder.

Extracting super.raw

Now Start your Virtual Linux, open Terminal Win + T and type:

sudo su root

cd /media/sf_Samsung/System_Files

./lpunpack --slot=0 super.raw /media/sf_Samsung/System_Files

Wait the extraction and switch to your Windows.

Getting all the bytes from files and creating a modified super.img

Verify if the folder System_Files has this 4 files odm.img, system.img, vendor.img and product.img. Delete the product.img, we don't need it.

Rename your orginal System.img to Original_System.img, and rename your extracted AOSP ROM to System.img then move it to System_Files folder. We will switch the system.img.

Right click on each file > Properties, and copy all sizes in bytes of the original super.img, odm.img, Original_System.img and vendor.img. We don't need the AOSP ROM bytes.

Example:

--device super: super.img : 5557452800

--image system= Original_System.img : 3340271616

--image vendor= vendor.img : 474976256

--image odm= odm.img : 4349952

Calculate your Original_System.img bytes + vendor.img bytes + odm,img bytes.

(3340271616 + 474976256) + 4349952 = 3819597824 . And replace the bytes below "3819597824" with your result.

You need to update the below code with the actual sizes in bytes of your files.

Update the bytes and run

./lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:5557452800 --group main:3819597824 --partition system:readonly:3340271616:main --image system=./system.img --partition vendor:readonly:474976256:main --image vendor=./vendor.img --partition odm:readonly:4349952:main --image odm=./odm.img --sparse --output ./super.img

Flash the modified boot.tar, and the 2 vbmeta.tar via Odin inside of "Flash it" folder, reboot and boot to the Download Mode again. If bootloop flash only the boot.tar and flash the stock vbmeta downloading here.

Use 7-Zip to archive the new super.img to .tar, flash it via Odin (AP), wait your phone restarts.

That's it have fun.

Notes

I not an expert on this, I just sharing my research I found on the Internet that worked for me. I not responsible for any damage on your phone. It does not stuck or phone, if anything occurs just flash your stock regional ROM through Odin.

If this tutorial did not work, you did something wrong or your phone is not supported.

"Anyway until there is no TWRP or Magisk for this phone you can use it as an alternative.

And I'm sorry for my English. If you don't understood please search for "./lpmake --metadata-size 65536" on the Internet, and you'll find out more tutorials like it but not about for this phone, use it as reference.