[Miscellaneous Android Development] 4ld0u5:
Rooting And TWRP for Samsung J2 Prime SM-G5325

By: Aldous M.C

https://xdaforums.com/member.php?u=7506444

warning: not for noobs who dont know anything about odin/flashing/rooting

I found this in 4pda.ru forums i could not really understand even the page was translated from russian to english. though i figured out how they did this

The concept was to create a odin package with a patched boot.image of samsung a3 with twrp recovery.img inside odin package then flashing it thru odin and after that flashing back the stock boot.img of Samsung J2 Prime then booting directly to recovery to flash SuperSU to patch the Stock Boot.img to make TWRP stick and not be replaced by stock recovery or giving a SEAndroid enforing error when booting to TWRP

So this is how you do it. First you need A full official firmware of Samsung SM-G532G (J2 Prime) Odin, and a Tar-Tool to convert boot.img from firmware to a odin package

WHAT YOU NEED (download links below)

1. Download latest firmware for J2 prime

2. Open Firmware file open the AP file, inside you will see folders and the boot.img. extract the boot image by draging it out from the AP file

3. Download tar-tool and extract folder to deskop or anywhere then Place boot.img inside TAR-Tool

4. then run the ImgToTar.MD5.bat file and you will see a boot.tar.md5 file appear. (do not rename it to anything else odin will not recognize this as boot.img and will not flash)

5. Now you have a Odin flashable boot.img from your original firmware. place it somewhere you can easily access we will use it later.

FLASHING THE TWRP

1. on your phone go to developer options and enable usb debbuging and toggle oem unlock to ON

2. power of your phone

3. Open odin on pc and click AP then select/browse the A3 boot img+TWRP odin package select it.

4. then go to options tab uncheck the auto reboot and do not check anything else just the auto-reboot

5. Open your phone to ODIN mode Press and hold home key + Volume down then power

6.Plug in your phone to your pc and press volume up to continue download

7. in PC start the download in Odin if it says pass go to next step

8. at this point you cannot power off the device all you have to do is remove the battery and put it back in BUT DO NOT TURN IT ON YET!

9. Go to ODIN mode again on your phone and the flash the stock boot.img you created with the TAR-Tool (REMEMBER TO ALWAYS UNCHECK AUTO-REBOOT in Odin so you will not end up with a reboot after a succesful flash. again you cannot turn off the phone, just pull the battery and put it back in. Do not turn it on yet dont boot it else your TWRP recovery will be replaced by stock or put you in a boot loop

10. Now Go to Recovery mode, while phone is powered off Press and hold home key + volume up + power key.

11, Tadaa, you have your TWRP recovery booted, now you can flash SUPERSU (use flashable SuperSU 2.79 or latest)

[almost forgot before doing all this place the SuperSU flashable zip on both storages internal and sdcard]

12. now the stock boot.image is patched by SuperSU and it will now hold the TWRP even after reboot.

13. Your done turn your phone on and you have a rooted Samsung J2 Prime.

DOWNLOADS

https://yadi.sk/d/zsYDiUSk3FJHPX - A3+TWRP odin package

https://xdaforums.com/showthread.php?t=2446269 - TAR-Tool

https://drive.google.com/uc?id=0B4fZWSYgVIIOR2kxSVBsYTdmWFE - SAMSUNG J2 Prime FIRMWARE (SM-G532G) you can also find other sources with updated firmwares for your region.

BIG thanks to:

Mk.Mourad for the Tar-Tool script

A Russian comrade JacobN of 4pda,ru forum for the A3+twrp odin package

i am not responsible for anything that happens to your phone while doing this. tested by me and will work if you follow carefully all procedures.

Aldous M.C