⚠️Galaxy A51 Root || Unlock Bootloader || Flash Official Firmware [Binary 3] May

gabrielfrias

Senior Member
May 27, 2012
63
37
0
I think something very weird is happening here... this phone was released 4 months ago and until today there's is no TWRP for it? it's, at least, VERY weird, to not say something else. The process of the first thread is used on M30s, wich has the SAME chipset, GPU and CPU, just to show an exemple. I hope they release a way to TWRP/root this phone soon as I can't use it in stock mode. I could even make a donation to encourage anyone to do this...

---------- Post added at 08:01 PM ---------- Previous post was at 07:09 PM ----------

Did someone try this?

Attention : with this methode, phone is totally reset
Attention 2 : have a full samsung ROM from sammobile, to reflash it with odin in case of problem !

What I do :
_ copy/extract a boot.img from a sammobile firmware (boot.img.lz4 is in AP_xxx)
_ patch this file with magisk manager -> rename to boot.img and tar to boot.img.tar
_ I unlock bootloader (when phone is shutdown, press vol+ + vol-, then plug power cable)
_ wait long time for the phone factory reset
_ now you will have a message at each boot time (ignore it, press power button) and knox is 1 !!!!!
_ boot to download mode and flash boot.img.tar with odin
_ after reboot (boot error..), I have to factory reset again in recovery mode !
_ after long time, in android, reinstall magisk manager -> all fine, root is now working !

source: https://forum.xda-developers.com/showpost.php?p=81795603&postcount=2
 
  • Like
Reactions: ghaniso1 and Xiomax

HEROMEROHD

Member
Dec 26, 2017
42
5
8
I think something very weird is happening here... this phone was released 4 months ago and until today there's is no TWRP for it? it's, at least, VERY weird, to not say something else. The process of the first thread is used on M30s, wich has the SAME chipset, GPU and CPU, just to show an exemple. I hope they release a way to TWRP/root this phone soon as I can't use it in stock mode. I could even make a donation to encourage anyone to do this...

---------- Post added at 08:01 PM ---------- Previous post was at 07:09 PM ----------

Did someone try this?

Attention : with this methode, phone is totally reset
Attention 2 : have a full samsung ROM from sammobile, to reflash it with odin in case of problem !

What I do :
_ copy/extract a boot.img from a sammobile firmware (boot.img.lz4 is in AP_xxx)
_ patch this file with magisk manager -> rename to boot.img and tar to boot.img.tar
_ I unlock bootloader (when phone is shutdown, press vol+ + vol-, then plug power cable)
_ wait long time for the phone factory reset
_ now you will have a message at each boot time (ignore it, press power button) and knox is 1 !!!!!
_ boot to download mode and flash boot.img.tar with odin
_ after reboot (boot error..), I have to factory reset again in recovery mode !
_ after long time, in android, reinstall magisk manager -> all fine, root is now working !

source: https://forum.xda-developers.com/showpost.php?p=81795603&postcount=2
The reason this won't work is that we don't have a ramdisk. Did anyone try to build a kernel with the source with dm-verity and Knox disabled and/or tried to modify the system? Maybe we can use classic root to get supersu on it working, though the last update is from 2017 and safetynet would be doomed.
 
Last edited:

gabrielfrias

Senior Member
May 27, 2012
63
37
0
Maybe a developer on Telegram has better success
hope so

---------- Post added at 11:32 AM ---------- Previous post was at 11:29 AM ----------

The reason this won't work is that we don't have a ramdisk. Did anyone try to build a kernel with the source with dm-verity and Knox disabled and/or tried to modify the system? Maybe we can use classic root to get supersu on it working, though the last update is from 10.2019 and safetynet would be doomed.
No cellphone without ramdisk was ever rooted before? What's the importance of SafetyNet in my daily life?
 

HEROMEROHD

Member
Dec 26, 2017
42
5
8
hope so

---------- Post added at 11:32 AM ---------- Previous post was at 11:29 AM ----------



No cellphone without ramdisk was ever rooted before? What's the importance of SafetyNet in my daily life?
There are cellphones without ramdisk which got rooted. But these either are on a lower android version than q or don't have the second vbmeta. You want to pass SafetyNet if you want to use banking apps or other apps which check if your device passes SafetyNet.
 

[email protected]

Senior Member
Feb 13, 2015
258
521
0
Panamá
Hello, I have the SM-A515F / DS and I have changed the firmware to TPA panama, but I have not been able to activate or see the OEM, does anyone know how to make it visible for activation?
 

HEROMEROHD

Member
Dec 26, 2017
42
5
8
Keep Internet On For a While... the OEM option will be back after some minutes..!!
because it's fetches the data from the database server.. so your device should be connected to the intenet.

so before flashing twrp go through initial setup first then remember to check OEM option in developer option everytime..
Just do that and the option should be available.
 

map220v

Member
Jul 26, 2016
49
36
18
I think something very weird is happening here... this phone was released 4 months ago and until today there's is no TWRP for it? it's, at least, VERY weird, to not say something else. The process of the first thread is used on M30s, wich has the SAME chipset, GPU and CPU, just to show an exemple. I hope they release a way to TWRP/root this phone soon as I can't use it in stock mode. I could even make a donation to encourage anyone to do this...

---------- Post added at 08:01 PM ---------- Previous post was at 07:09 PM ----------

Did someone try this?

Attention : with this methode, phone is totally reset
Attention 2 : have a full samsung ROM from sammobile, to reflash it with odin in case of problem !

What I do :
_ copy/extract a boot.img from a sammobile firmware (boot.img.lz4 is in AP_xxx)
_ patch this file with magisk manager -> rename to boot.img and tar to boot.img.tar
_ I unlock bootloader (when phone is shutdown, press vol+ + vol-, then plug power cable)
_ wait long time for the phone factory reset
_ now you will have a message at each boot time (ignore it, press power button) and knox is 1 !!!!!
_ boot to download mode and flash boot.img.tar with odin
_ after reboot (boot error..), I have to factory reset again in recovery mode !
_ after long time, in android, reinstall magisk manager -> all fine, root is now working !

source: https://forum.xda-developers.com/showpost.php?p=81795603&postcount=2
TWRP doesn't support Dynamic Partition(super.img) introduced in Android 10. We need to wait until TWRP gets twrp-10.0 branch on github.

Also boot.img uses System as Root introduced in Android 10 too. Thats why we need to patch recovery.img instead (AP.tar.md5 on Samsung phones)
But on this Phone signed recovery.img required to boot. geiti94 can sign it, but he waiting for updated TWRP.

---------- Post added at 09:44 AM ---------- Previous post was at 09:33 AM ----------

The only way to get Root on this device is intalling custom ROM like AOSP by replacing system.img inside super.img
 
Last edited:

gabrielfrias

Senior Member
May 27, 2012
63
37
0
Thanks for all explanation! Did geiti94 wrote an tutorial to teach us how to sign the recovery? I couldn't find any custom ROM for A51 and I guess in order to install it, we need TWRP, so, we still need to wait for its release, right? Thanks

---------- Post added at 02:29 PM ---------- Previous post was at 02:12 PM ----------

TWRP doesn't support Dynamic Partition(super.img) introduced in Android 10. We need to wait until TWRP gets twrp-10.0 branch on github.

Also boot.img uses System as Root introduced in Android 10 too. Thats why we need to patch recovery.img instead (AP.tar.md5 on Samsung phones)
But on this Phone signed recovery.img required to boot. geiti94 can sign it, but he waiting for updated TWRP.

---------- Post added at 09:44 AM ---------- Previous post was at 09:33 AM ----------

The only way to get Root on this device is intalling custom ROM like AOSP by replacing system.img inside super.img
...
 

map220v

Member
Jul 26, 2016
49
36
18
Thanks for all explanation! Did geiti94 wrote an tutorial to teach us how to sign the recovery? I couldn't find any custom ROM for A51 and I guess in order to install it, we need TWRP, so, we still need to wait for its release, right? Thanks

---------- Post added at 02:29 PM ---------- Previous post was at 02:12 PM ----------


...
No i heard geiti94 will not reveal it.
It's possible to flash Custom ROM without TWRP using Odin. But you need to unpack super.img using lpunpack tool, replace system.img (i used AOSP A/B arm64) , and then pack all files back using lpmake.
 

gabrielfrias

Senior Member
May 27, 2012
63
37
0
No i heard geiti94 will not reveal it.
It's possible to flash Custom ROM without TWRP using Odin. But you need to unpack super.img using lpunpack tool, replace system.img (i used AOSP A/B arm64) , and then pack all files back using lpmake.
Ok, I'll search how to do it. Do you know where can I find a custom ROM for the A51? Thanks
 
  • Like
Reactions: YOisuPU

map220v

Member
Jul 26, 2016
49
36
18
Last edited:
  • Like
Reactions: YOisuPU

gabrielfrias

Senior Member
May 27, 2012
63
37
0
AOSP 10.0 v214 arm64 A/B Gapps

This AOSP ROM only works on:
AP — A515FXXU2ATB1
CSC — A515FOXM2ATB1
CP — A515FXXU2ATA8

https://drive.google.com/file/d/1PXe5cFyZxms3Lkyo9Ne4TkJQNyZDI5SM/view?usp=sharing

I used to flash Odin 3.14.4 after flashing i did factory reset using recovery mode.
since I updated mine to UI2 and my region is different, I'll have to make another .tar to flash, but you gave me a lot of information, thanks a lot! if all goes right, maybe I write a tutorial here to help others :good:
in treble check is showed the system is A only. can I install a A/B GSI?
 
  • Like
Reactions: YOisuPU

map220v

Member
Jul 26, 2016
49
36
18
since I updated mine to UI2 and my region is different, I'll have to make another .tar to flash, but you gave me a lot of information, thanks a lot! if all goes right, maybe I write a tutorial here to help others :good:
in treble check is showed the system is A only. can I install a A/B GSI?
Idk why it's says A only. But im using A/B GSI.
After i installed A/B GSI. treble check says A/B.

Edit: Maybe SELinux preventing treble check from getting info
 
Last edited:

gabrielfrias

Senior Member
May 27, 2012
63
37
0
Idk why it's says A only. But im using A/B GSI.
After i installed A/B GSI. treble check says A/B.

Edit: Maybe SELinux preventing treble check from getting info
I downloaded SM-A515F_1_20200318014603_dh9s0uenbv_fac.zip with Frija, then extracted it with 7zip, then AP_A515FXXU3ATC5_CL17851094_QB29854347_REV00_user_low_ship_meta_OS10.tar.md5 with 7zip again, all in Windows, then I go to Linux and when I insert "./lpunpack --slot=0 super.img.lz4 <destination dir>", I'm facing this problem:
lpunpack E 04-07 21:46:41 2145 2145 reader.cpp:81] [liblp]Logical partition metadata has invalid geometry magic signature.
lpunpack E 04-07 21:46:41 2145 2145 reader.cpp:81] [liblp]Logical partition metadata has invalid geometry magic signature.
Image does not appear to be in super-partition format.

do you know this?
 

map220v

Member
Jul 26, 2016
49
36
18
I downloaded SM-A515F_1_20200318014603_dh9s0uenbv_fac.zip with Frija, then extracted it with 7zip, then AP_A515FXXU3ATC5_CL17851094_QB29854347_REV00_user_low_ship_meta_OS10.tar.md5 with 7zip again, all in Windows, then I go to Linux and when I insert "./lpunpack --slot=0 super.img.lz4 <destination dir>", I'm facing this problem:
lpunpack E 04-07 21:46:41 2145 2145 reader.cpp:81] [liblp]Logical partition metadata has invalid geometry magic signature.
lpunpack E 04-07 21:46:41 2145 2145 reader.cpp:81] [liblp]Logical partition metadata has invalid geometry magic signature.
Image does not appear to be in super-partition format.

do you know this?
First you need to uncompress super.img.lz4
Then if uncompressed super.img gives error try to use simg2img
 

gabrielfrias

Senior Member
May 27, 2012
63
37
0
First you need to uncompress super.img.lz4
Then if uncompressed super.img gives error try to use simg2img
mate, if you downloaded the .tar file containing the super.img, could you please share its source? I think the russian may have a tutorial explaining how to make this file and I want to look for it. Thanks!
 
Last edited:
  • Like
Reactions: YOisuPU

map220v

Member
Jul 26, 2016
49
36
18
mate, if you downloaded the .tar file containing the super.img, could you please share its source? I think the russian may have a tutorial explaining how to make this file and I want to look for it. Thanks!
I used this command to get super.img from super.img.lz4
lz4 -d super.img.lz4 super.img
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone