[Samsung Galaxy S20 FE Questions & Answers] ItsPi3141:
This is just a general outline of how to do it. There might be more steps required for your device. I don't know.

If you attempt this, remember that you are choosing to make these modifications yourself. I'm not responsible for anything that might happen.

First, you need to use Linux.

If you have Windows, use WSL. Just Google it.

Instructions taken from PBRP minimal manifest repo

GitHub - PitchBlackRecoveryProject/manifest_pb: Minimal manifest to compile PBRP

Minimal manifest to compile PBRP. Contribute to PitchBlackRecoveryProject/manifest_pb development by creating an account on GitHub.

github.com

Clone PBRP​

mkdir ~/pbrp
cd ~/pbrp
repo init -u https://github.com/PitchBlackRecoveryProject/manifest_pb -b android-12.1
repo sync

Device tree​

Take your device tree from TWRP and put it in /devices/samsung/r8q

git clone -b android-12.1 https://github.com/TeamWin/android_device_samsung_r8q.git device/samsung/r8q/

GitHub - TeamWin/android_device_samsung_r8q: Samsung Galaxy A52s (a52sxq) TWRP Device Tree.

Samsung Galaxy A52s (a52sxq) TWRP Device Tree. Contribute to TeamWin/android_device_samsung_r8q development by creating an account on GitHub.

github.com

Adapting the device tree​

Look at existing PBRP device trees for reference. Compare them to the TWRP device tree of the same device to see what changes were made.

GitHub - PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp: Samsung Galaxy A52s 5G (a52sxq) PBRP Device Tree.

Samsung Galaxy A52s 5G (a52sxq) PBRP Device Tree. Contribute to PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp development by creating an account on GitHub.

github.com

GitHub - Mesa-Labs-Archive/android_device_samsung_a52sxq: Samsung Galaxy A52s 5G (a52sxq) TWRP Device Tree.

Samsung Galaxy A52s 5G (a52sxq) TWRP Device Tree. Contribute to Mesa-Labs-Archive/android_device_samsung_a52sxq development by creating an account on GitHub.

github.com

You'll want to focus on this commit specifically

a52sxq: PitchBlack Bringup · PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp@2356bd0

Samsung Galaxy A52s 5G (a52sxq) PBRP Device Tree. Contribute to PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp development by creating an account on GitHub.

github.com

If you want flashlight to work, look at this commit

Only focus on BoardConfig.mk and recovery/root/init.recovery.qcom.rc

Ignore camera.ko, it's probably only specific to a52sxq and the same change will probably not apply to your device

a52sxq: Fix flashlight · PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp@e799fa9

Samsung Galaxy A52s 5G (a52sxq) PBRP Device Tree. Contribute to PitchBlackRecoveryProject/android_device_samsung_a52sxq-pbrp development by creating an account on GitHub.

github.com

Building​

cd ~/pbrp
. build/envsetup.sh
lunch pb_r8q-eng
mka pbrp

Flashing recovery and testing​

Once the build is done, it will be in ~/pbrp/out/target/product/r8q/

There's 2 ways to flash

- .tar file in ODIN (more convenient)

- .zip file in TWRP/OrangeFox

It probably won't work flawlessly on the first try. Look at different Samsung device trees and try fixing the errors.