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

bagbyte

Member
Aug 16, 2009
24
6
0
So, @map220v, update, I managed to alter that kernel setting, by unpacking super.img, editing init.rc, repacking and flashing (confirmed and it sticked).
After that, I could direct-install the latest canary Magisk successfully, and boot, but although I keep root, there's no way to make any module work.

Actually, after I attempt to install them via the Manager app, they don't appear on the installed module list... and the logs don't show any useful info. :(:confused:
I'm trying to flash only AP, but every time, after he finish sending super.img, it stacks at userdata.img and red message appear on the screen saying "Only official released binaries are allowed to be flashed(SUPER)", any idea how to avoid this issue? Now I need to restart and I get the blue screen saying to use Smart Switch PC to restore, but actually it's enough if I flash the BT.

I'm stacked!
PS: my phone is not rooted
 
Last edited:

HEROMEROHD

Member
Dec 26, 2017
42
5
8
I'm trying to flash only AP, but every time, after he finish sending super.img, it stacks at userdata.img and red message appear on the screen saying "Only official released binaries are allowed to be flashed(SUPER)", any idea how to avoid this issue? Now I need to restart and I get the blue screen saying to use Smart Switch PC to restore, but actually it's enough if I flash the BT.

I'm stacked!
PS: my phone is not rooted
Flash stock, connect to the internet and try to update the firmware through the settings. You should be able to flash unofficial binarys after you did this.Your KG State was probably prenormal blocking every attempt to flash something besides official firmware. It should be checking after you did all of this, or you just forgot to unlock the bootloader, then look it up in this thread.
 

bagbyte

Member
Aug 16, 2009
24
6
0
Flash stock, connect to the internet, and try to update the firmware through the settings. You should be able to flash unofficial binarys after you did this.Your KG State was probably prenormal blocking every attempt to flash something besides official firmware. It should be checking after you did all of this, or you just forgot to unlock the bootloader, then look it up in this thread.
Finally, I've made it, my system.img now contains 2 properties in /system/build.prop that suppose to unlock multiple users accounts feature, but sadly, when I check getprop, those 2 variables are not set....am I missing something? At least my POC worked, I can change the file without root and without tripping Knox
 

bagbyte

Member
Aug 16, 2009
24
6
0
i have a dream i want root and knox 0 its funny
I don't want to root, maybe you missed that part, but actually I just want to change system.img in order to modify some system property without tripping Knox (which I already succeeded) to enable multiple users account, but even tho those property are set in the /system/build.prop it seems when the phone boot, those properties are not set
 
Last edited:

arfemre

Member
May 5, 2020
5
0
0
I don't want to root, maybe you missed that part, but actually I just want to change system.img in order to modify some system property without tripping Knox (which I already succeeded) to enable multiple users account, but even tho those property are set in the /system/build.prop it seems when the phone boot, those properties are not set
oh i see bro sorry
 

King_lilrowrow

Senior Member
Mar 16, 2016
771
3,286
0
22
London
github.com
It's can't mount system, vendor or product, but it can Wipe partitions like data and install boot and recovery images.
You got the source for this? Drop us a link and I'll either push the required patches if it's your repo or fork it and build it over the next few days, seems a simple few patches (if the TWRP Device tree is somewhat built)
 

truhlik

Member
Aug 5, 2008
19
2
0
Finally, I've made it, my system.img now contains 2 properties in /system/build.prop that suppose to unlock multiple users accounts feature, but sadly, when I check getprop, those 2 variables are not set....am I missing something? At least my POC worked, I can change the file without root and without tripping Knox
Hi,
would it be possible using your method to edit CSC files without tripping knox? I also don't need root, but just edit some features in CSC (carrier's device limitation).
Thanks
 

map220v

Member
Jul 26, 2016
49
36
18
You got the source for this? Drop us a link and I'll either push the required patches if it's your repo or fork it and build it over the next few days, seems a simple few patches (if the TWRP Device tree is somewhat built)
I Used TWRP-9.0 it's don't have super.img (Dynamic Partition) Support.
TWRP-10.0 still WIP and i can't build it (I Getting recovery.img without TWRP).

EDIT: I fixed TWRP-10.0 compilation. Now im going to try mounting system logical partition.
 
Last edited:

map220v

Member
Jul 26, 2016
49
36
18
@map220v did you manage to have Magisk working with modules? I've tried million things nad versions, but while root works, no luck with modules
I Don't know why Magisk causing kernel panic only on this phone.
Setting panic_on_oops to 0 only disables reboot when magisk daemon causes it. But it's not fixes problem.
 

bagbyte

Member
Aug 16, 2009
24
6
0
Hi,
would it be possible using your method to edit CSC files without tripping knox? I also don't need root, but just edit some features in CSC (carrier's device limitation).
Thanks
Actually, right now this is my experience changing system.img file using Samsung firmware:
  • For the first time since I have this phone, I've flashed the new firmware without any changes (BT + AP + CP + CSC) just to check how was it, and to check the Knox status
  • It worked smoothly, the status was 0 as always
  • I've restarted the phone, completed the initial configuration, enable USB debugging (checking OEM was still unlocked) and tried with the modified version
  • This time I've used again all the files but my AP file had a custom name (upload.tar), but every time Odin refused to flash it (it was just stacked and didn't move)
  • One time it was stacked in SettingConnection (something like that) and the only thing I could do was to force restart, upon restarting I've got a blue screen saying to use Samsung Smart PC to re-initiate the phone status (first mistake)
  • But actually, following some info on a forum, I just flashed the BT and force restart, and the phone started normally again
  • My second mistake (I was still not very practical with those things), instead of restart and initiate the phone with the first configuration, I kept flashing, so apparently in this state (without proper initialization) the bootloader is locked, so I start getting red messages that the software was not original
  • At the end, after several tries, I flash again the original software, restart and initialize the phone, so the bootloader was again unlocked
  • Then I flash all the files but this time I've renamed my file from update.tar with the original AP file name (excluding the md5) and everything was fine and Knox still 0
  • At this point, I don't know why, but when I was trying to execute getprop with the one I've set in the system/default.prop, they were still not set
  • I've tried different approaches (changing /default.prop) or even adding a setprop int he init.rc, but still I had no luck
  • Today I've noticed Knox status is 1 but the hex number us 0x0400, I've read a bit about it, and it seems this depends on the region and if the phone belongs to an operator or not, basically it means that Knox realized I was doing something wrong (probably trying to flash while the bootloader was locked?), so it secures the "working profile" (to save the private data from some malicious person trying to hack the phone), but the phone itself is still in warranty, it really depends from the country.

So, long story short, even tho I've been able to flash custom prop files, somehow their changes didn't take effect, I'm speculating, but I guess it depends on the "Android installation" blue screen that appears during the first reboot after flashing, maybe it overrides the data with some other data taken from somewhere else? I have no idea :(

Just an advise, in case you want to try, my suggestion is to:
  • Remove md5 to all the files
  • Rename your tar with the original file name you want to substitute (Odin does some very basic check using the filenames, and I actually also saw that every tar file has 3 lines the end with the release(?) number, the file size, and the md5, in case you want to be even more precise you should consider adding those lines at the end, cause honestly the files will have the same size, so since the md5 you can provide, I'm not sure in which other way Odin can understand it is not the official firmware, as also displayed in Download mode)
  • Flash all the files together

I hope my experience can help somebody else in case he wants to play with those files. If somebody knows why the changes made didn't have effect when rebooting, I would be really interested to know why.
 
Last edited:
  • Like
Reactions: truhlik

King_lilrowrow

Senior Member
Mar 16, 2016
771
3,286
0
22
London
github.com
TWRP Update
https://drive.google.com/file/d/1W1wPUEGjoYW5vuJlxkRKdiE7IECBaqk_/view?usp=sharing
I Fixed Brightness and Updated TWRP from Android 9 branch to Android 10 branch
System , Vendor , Product Mount still not working.
Also this TWRP uses A51 Device Tree instead of A50 Device Tree

Device Tree Link: https://github.com/map220v/android_device_samsung_a51nsxx

I've took a brief look over your recovery tree so far, submitted a few patches: https://github.com/map220v/android_device_samsung_a51nsxx/pull/1
 
  • Like
Reactions: YOisuPU

TheEmpathicEar

Senior Member
Jun 10, 2014
69
1
0
Actually, right now this is my experience changing system.img file using Samsung firmware:
  • For the first time since I have this phone, I've flashed the new firmware without any changes (BT + AP + CP + CSC) just to check how was it, and to check the Knox status
  • It worked smoothly, the status was 0 as always
  • I've restarted the phone, completed the initial configuration, enable USB debugging (checking OEM was still unlocked) and tried with the modified version
  • This time I've used again all the files but my AP file had a custom name (upload.tar), but every time Odin refused to flash it (it was just stacked and didn't move)
  • One time it was stacked in SettingConnection (something like that) and the only thing I could do was to force restart, upon restarting I've got a blue screen saying to use Samsung Smart PC to re-initiate the phone status (first mistake)
  • But actually, following some info on a forum, I just flashed the BT and force restart, and the phone started normally again
  • My second mistake (I was still not very practical with those things), instead of restart and initiate the phone with the first configuration, I kept flashing, so apparently in this state (without proper initialization) the bootloader is locked, so I start getting red messages that the software was not original
  • At the end, after several tries, I flash again the original software, restart and initialize the phone, so the bootloader was again unlocked
  • Then I flash all the files but this time I've renamed my file from update.tar with the original AP file name (excluding the md5) and everything was fine and Knox still 0
  • At this point, I don't know why, but when I was trying to execute getprop with the one I've set in the system/default.prop, they were still not set
  • I've tried different approaches (changing /default.prop) or even adding a setprop int he init.rc, but still I had no luck
  • Today I've noticed Knox status is 1 but the hex number us 0x0400, I've read a bit about it, and it seems this depends on the region and if the phone belongs to an operator or not, basically it means that Knox realized I was doing something wrong (probably trying to flash while the bootloader was locked?), so it secures the "working profile" (to save the private data from some malicious person trying to hack the phone), but the phone itself is still in warranty, it really depends from the country.

So, long story short, even tho I've been able to flash custom prop files, somehow their changes didn't take effect, I'm speculating, but I guess it depends on the "Android installation" blue screen that appears during the first reboot after flashing, maybe it overrides the data with some other data taken from somewhere else? I have no idea :(

Just an advise, in case you want to try, my suggestion is to:
  • Remove md5 to all the files
  • Rename your tar with the original file name you want to substitute (Odin does some very basic check using the filenames, and I actually also saw that every tar file has 3 lines the end with the release(?) number, the file size, and the md5, in case you want to be even more precise you should consider adding those lines at the end, cause honestly the files will have the same size, so since the md5 you can provide, I'm not sure in which other way Odin can understand it is not the official firmware, as also displayed in Download mode)
  • Flash all the files together

I hope my experience can help somebody else in case he wants to play with those files. If somebody knows why the changes made didn't have effect when rebooting, I would be really interested to know why.
Has anyone posted a comprehensive tutorial on how to get to the point where you are now?
 

bagbyte

Member
Aug 16, 2009
24
6
0
If I root with Magisk now, I read I will not be able to install original firmware anymore without patching them first, will I be able to install non-root/non-patched firmware later? maybe when TWRP will be available? Or I will never ever be able to install Samsung firmware without Magisk/patch?
 
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