[Samsung Galaxy A02s] Sirajul Hadi:
TWRP for a12s

=============

Mod Edit: TG link removed.

git config --global user.email "your email"

git config --global user.name "your name"

Basic Device Tree

==================

mkdir TWRP

cd TWRP

git init

git clone https://github.com/twrpdtgen/twrpdtgen

pip3 install twrpdtgen

sudo apt install cpio

copy stock recovery.img to ~/TWRP/twrpdtgen

cd twrpdtgen

python3 -m twrpdtgen recovery.img

rename ~/TWRP/twrpdtgen/output/samsung/a12s/omni_a12s.mk to twrp_a12s.mk

delete vendorsetup.sh

Make a copy of recovery.fstab and rename to twrp.flags

Move both files recovery.fstab and twrp.flags to recovery/root/system/etc

(create these folders)

open twrp_a12s.mk and

1. delete the 3 lines below # Inherit from those products, Most specific first.

replace those 3 lines with this

$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)

2. delete $(call inherit-product, vendor/omni/config/gsm.mk)

3. change omni to twrp (2 places)

open AndroidProducts.mk

change omni to twrp (4 spots)

Optional Extras

==================

To add extra options to recovery you can add theses lines to

boardconfig.mk

• # remove TrueType fonts

• TW_DISABLE_TTF:= true

• # exclude mtp from twrp (disable if you are not able to fix it device/kernel side, saves some space)

• TW_EXCLUDE_MTP := true

• # screen will stay awake

• TW_NO_SCREEN_TIMEOUT := true

• # needed on devices without a recovery partition (some devices have recovery included in boot.img)

• TW_HAS_NO_RECOVERY_PARTITION := true

• # removes the reboot option to boot into bootloader, needed e.g. on samsung devices which use Download mode instead

• TW_NO_REBOOT_BOOTLOADER := true

• # add an option in reboot menu to reboot into Download Mode

• TW_HAS_DOWNLOAD_MODE := true

• # some devices don't have a temp sensor, disable in such case to stop spamming recovery.log

• TW_NO_CPU_TEMP := true

• # recursive delete by default instead fotmatting (available optional inside recovery settings too)

• TW_ALWAYS_RMRF := true

• # system won't be unmounted,

• TW_NEVER_UNMOUNT_SYSTEM := true

• # don't blank screen (available optional inside recovery settings too)

• TW_NO_SCREEN_BLANK := true

• # ToyBox (disables busybox?)

• TW_USE_TOOLBOX := true

• # include f2fs support (make sure your kernel supports f2fs!)

• TARGET_USERIMAGES_USE_F2FS := true

• TW_DEVICE_VERSION : = Your Nikname or else

Establish Android Building Environment

=======================================

cd ~

sudo apt install git aria2 -y

git clone https://gitlab.com/OrangeFox/misc/scripts

cd scripts

sudo bash setup/android_build_env.sh

sudo bash setup/install_android_sdk.sh

• Make a directory called ~/a12s-twrp

cd ~/a12s-twrp

repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11

repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j4

copy ~/TWRP/twrpdtgen/output/samsung to /a12s-twrp/device

Building

========

. build/envsetup.sh

lunch twrp_a12s-eng

mka recoveryimage –j4

Recovery.img at out/Samsung/a12s/...img

Note: This LastPart Failed For Me For Lack Of RAM In My VB

To Add Things To Your Twrp, You Can Find Them On Experienced Dev's Githubs.

For Example

topser9 - Overview

Kernels for Exynos 7884B | 7904 | 9610 | 9611. topser9 has 16 repositories available. Follow their code on GitHub.

github.com

mohammad92 - Overview

mohammad92 has 2 repositories available. Follow their code on GitHub.

github.com

crazo7924 - Overview

Android Developer. crazo7924 has 51 repositories available. Follow their code on GitHub.

github.com