[Realme C12 Themes, Apps, and Mods] HemanthJabalpuri:
Here I will share some of the zips/scripts I made for some specific things

You are only responsible for what you do to your things. You have been warned.​

Flash GSI in TWRP​

As we all know from Android 10, Google introduced dynamic partitions. That is system, vendor, product and other partitions are now contain in single partition called *super*. The logical partitions in this super partition are resizable according to requirements.

We can flash GSI to system partition with `dd if=gsi.img of=/dev/block/mapper/system bs=10M`.

But it will fail if the size of partition is less than size of GSI. To increase the size, there is no normal way to resize in TWRP I know as of now.

To resize it to have more space, I used the trick that is used by custom ROMs. I made system.new.dat.br, system.transfer.list, system.patch.dat as empty and used dynamic_partitions_op_list to resize system.

We can do the same with `fastbootd` with `fastboot resize-logical-partition system <size-in-bytes>`, but it requires PC.

Usage:-

- Download below GSI_FLASHER.zip

- Place GSI.img/xz and the downloaded zip in same folder

- Flash the zip

- Wipe Dalvik, Data, Internal and Cache

- Reboot

Resize System​

When we want to flash GApps in vanilla GSI that is flashed with fastbootd, it will resize system to the size of GSI keeping no space left to add something. So I used the same above trick to resize system for making space in it.

We can do the same with `fastbootd` with `fastboot resize-logical-partition system <size-in-bytes>`, but it requires PC.

Usage:-

- Download below SystemResizer_RealmeC12.zip

- Flash the zip before flashing GApps

- Enjoy

Custom Recovery Keep​

When in Realme UI, if any recovery than stock recovery is detected then it will replace it with the stock recovery using /vendor/recovery-from-boot.p file. On every boot, /vendor/bin/oppo-install-recovery.sh is executed in UI 1.0 and /vendor/bin/install-recovery.sh is executed in UI 2.0. It will patch recovery. So replacing it will stop this process.

Usage:-

- Download below RealmeRecoveryKeep.zip for UI1 or RealmeRecoveryKeepUI2.zip for UI2

- Flash it in Magisk app as Magisk module

- Flash custom recovery

- Enjoy persistent recovery

Reference:- https://xdaforums.com/t/guide-back-to-stock-rom-howto-downgrade-howto.4014773/post-81108309

Flash Stock ROM .ozip in TWRP​

Note:- Realme C12 TWRP has 'Skip Treble Compatibility error' option in Settings. So no need of this.

When we flash a .ozip in TWRP by renaming it to .zip(since it is not encrypted), we will get Treble Compatibility error. It is because of compatibility.zip in the .ozip. If we remove it, then flashing will be fine.

But if we flash manually by executing update-binary with .ozip as argument, TWRP will not do any checks. So we can flash without removing compatibility.zip in .ozip.

Usage:-

- Download below Flash_OZIP_in_TWRP.zip

- Place .ozip and the downloaded zip in same folder

- Flash the zip(not .ozip)

- Enjoy

Sparse Data To Super Partition converter​

Realme is not providing flashtool or fastboot flashable firmwares. So only .ozip is the solution for us. It has all the .img files that can be flashed with fastboot except super.img.

To get this, we have to dump the super partition from device or convert .dat.br files to raw images and join them as super partition with `lpmake` tool.

I made a Shell Script to automate this.

Usage:-

- Download below sdat2super.zip in your Linux distribution

- Execute sdat2super.sh with path to ozip as argument

bash sdat2super.sh RealmeC12.ozip

- After sometime you will get super.img in same folder as script

Spoiler content hidden.