25

Question - [fixed] rooted a325m suddenly no imei, no sim | Page 4 | XDA Forums

 2 years ago
source link: https://forum.xda-developers.com/t/fixed-rooted-a325m-suddenly-no-imei-no-sim.4386753/page-4#post-87048613
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Question [fixed] rooted a325m suddenly no imei, no sim

craaziik

Member
Feb 5, 2022
Will rooting affect me with imei? (my processor is listed on picture)

Screenshot_20220528-110925_CPU-Z.jpg
Last edited by a moderator: May 29, 2022

samsung_f22

Member
May 21, 2022
@dronkit and everyone else.

I deleted the old nvd_imei folder, sim starts working, network is back , then when i make or receive calls the network drops completely for a few seconds ( sometimes drops in the middle of the call ).

I looked for the missing files(that were missing in the new nvd_imei folder) in my old nvd_imei folder but those weren't the same as yours.

I could only find

FILELIST
IP07_000
IP21_000

and others were different. However, i tried to move all the files that were in my old nvd_imei folder but not in my new one to the new folder, and the network totally broke again.

What files exactly to put in the new folder from the old one so that the occasional brief network drop stops. Please advice.

IP21_000 is evil, it is solely responsible for permanent signal loss in my F22.

Just by removing it, signal appears again(if it doesn't, NVD_DATA has been corrupted too and you may delete whole NVRAM folder, reboot to regenerate it, and then apply chmod 550 on NVD_IMEI after reboot).

Once you make a call, system again tries to write a new IP21_000, unless you have already applied 'chmod 550 NVD_IMEI' (note that this permission also goes away after deleting NVD_IMEI). I have inspected (in hex editor) a few IP21_000 thus generated after each call, and they are NOT identical. Another important file IP03_001 that is rewritten after each call remains the same though.

My gut tells me that restricting write permission to NVD_IMEI is not the correct way to go. System perhaps needs to generate/write something to IP21_000 after every call to work smoothly. Maybe its writing errors due to something else being broken after root. But whenever we deny it write access, the modem crashes and restarts. But again, I am not a programmer, I wish experts could take over from here!

Last edited: May 28, 2022

Reactions: dronkit

Jul 1, 2021
IP21_000 is evil, it is solely responsible for permanent signal loss in my F22.

Just by removing it, signal appears again(if it doesn't, NVD_DATA has been corrupted too and you may delete whole NVRAM folder, reboot to regenerate it, and then apply chmod 550 on NVD_IMEI after reboot).

Once you make a call, system again tries to write a new IP21_000, unless you have already applied 'chmod 550 NVD_IMEI' (note that this permission also goes away after deleting NVD_IMEI). I have inspected (in hex editor) a few IP21_000 thus generated after each call, and they are NOT identical. Another important file IP03_001 that is rewritten after each call remains the same though.

My gut tells me that restricting write permission to NVD_IMEI is not the correct way to go. System perhaps needs to generate/write something to IP21_000 after every call to work smoothly. Maybe its writing errors due to something else being broken after root. But whenever we deny it write access, the modem crashes and restarts. But again, I am not a programmer, I wish experts could take over from here!

very interesting find. So just to have more clarity about this, where do you stand at the moment with your phone's network. Have you done the same procedure as above to get your network to partially work ? ( does your network still totally break for a few seconds after a call ).

But if not, and you have got your network to work fully without any network drops, may I know how you achieved it and what I can do to achieve the same? Thanks!

samsung_f22

Member
May 21, 2022
I
Have you done the same procedure as above to get your network to partially work ? ( does your network still totally break for a few seconds after a call ).

Testing on unrooted, stock reflashed F22 with a locked bootloader now, with WIFI on, mobile data off. Yes, most of the time still it breaks for 12 secs after call ends. But there is an important exception (may not be a true rule, just an erratic behaviour of the phone, this evening). For the follwing, check Settings->Connections-> SIM card manager.

Stage-1: I have only one SIM (say SIM1) in my phone, but due to corrupt NVRAM, phone also shows SIM2 in turned off state with unknown number and carrier.

Stage-2: I now turn on SIM2 and make a call, and disconnect. After restoration of signal, if I go back to SIM manager, SIM2 now becomes greyed out(No SIM card).

Stage-3: I make a call again, disconnect, come back after restoration of signal, SIM2 becomes active again, but this time , it is in a turned on state.

Stage-4: I turn SIM2 back off, it displays 'no SIM card inserted' message (although the network is fine, as it is coming from SIM1). SIM card manager now greys out both SIMs (displays 'No SIM' in both slots). However, network remains fine, making more calls again DOES NOT drop network, and DOES NOT change status in SIM manager.

Stage-5: I restart the phone. SIM card manager now correctly shows SIM1 and correctly greys out SIM2. However, after making a call, disconnecting, network temporarily drops again, and after restoration, coming to SIM card manager, I find myself back again in Stage-1.

Toggling Wifi/Mobile data/Airplane mode also might lead to different stages mentioned above. We now have to find what happens to IP03_001/IP07_000/IP21_000 at each of the stages assuming these stages also occur in a rooted phone(But I am currently unrooted).

Last edited: May 31, 2022

dronkit

Senior Member
Jan 14, 2013
What files exactly to put in the new folder from the old one so that the occasional brief network drop stops. Please advice.

like I said, in my case they were all these:

The missing files are:
CS10_001
CS12_000
FILELIST
IP07_000
IP12_000
IP21_000

The problem with the "evil file" IP21_000 maybe, like @samsung_f22 proposed and I also discussed with him, you should not copy it and wait for it or other files to be created, without changing permissions on NVD_IMEI to allow it.

Last edited: Jun 1, 2022

dronkit

Senior Member
Jan 14, 2013
Will rooting affect me with imei? (my processor is listed on picture)

View attachment 5624987

I'm surprised, I didn't know there were any samsungs with that processor brand. What model is your phone?

dronkit

Senior Member
Jan 14, 2013
IP21_000 is evil, it is solely responsible for permanent signal loss in my F22.

Just by removing it, signal appears again(if it doesn't, NVD_DATA has been corrupted too and you may delete whole NVRAM folder, reboot to regenerate it, and then apply chmod 550 on NVD_IMEI after reboot).

Once you make a call, system again tries to write a new IP21_000, unless you have already applied 'chmod 550 NVD_IMEI' (note that this permission also goes away after deleting NVD_IMEI). I have inspected (in hex editor) a few IP21_000 thus generated after each call, and they are NOT identical. Another important file IP03_001 that is rewritten after each call remains the same though.

My gut tells me that restricting write permission to NVD_IMEI is not the correct way to go. System perhaps needs to generate/write something to IP21_000 after every call to work smoothly. Maybe its writing errors due to something else being broken after root. But whenever we deny it write access, the modem crashes and restarts. But again, I am not a programmer, I wish experts could take over from here!

that's very interesting. You've made me check and actually, with "my" method, te NVD_IMEI folder is read-only to system and to radio, but that only means those users can see it, list its contents, but not create or delete files. However, I didn't change the permissions of the files inside, they are owned by system and the group system and their permissions are rw-rw----, so they CAN be overwritten by system. And actually HAVE BEEN overwritten by system. I have files with last modified date of today.

Honestly, since i did the two things i've had zero problems and never changed anything else, but,

-if you want to allow the user "system" and/or the group "radio" to create files, change the permissions of the folder to rwxrwx--- or rwxr-x--- (chmod 770 or 750 NVD_IMEI) respectively.

-have you tried to actually make the files unwritable? like, for each file in NVD_IMEI a chmod 550 ? (which I didn't)

-MAYBE what is needed is to delete NVD_IMEI like I said, reboot, maybe make a call, sms, an USSD code, and then see if new files were created, and then, if necessary paste missing old files, and only then restrict writing on the folder and maybe on the files

-maybe in my case I had zero problems after my "fix" cause Magisk was actually fixed and it doesn't break the imei anymore. I've updated it frequently and i'm currently on Magisk 24301 stable.

dronkit

Senior Member
Jan 14, 2013
I have never used linux, but have tried to learn about (user, group), ls, cp, rm, chmod, chown, -R commands, which are needed to implement what dronkit is suggesting.

awesome!

Problem is I have little idea about which permissions/ownership to set for my phone. I also have no idea who should be user and group among system and radio inside files of NVD_IMEI

Just after rooting using Magisk 24's AP patch, entering aeroplane mode and logging in to adb as su, I can see NVD_IMEI folder has ownership 'system system'. However, this is 'system radio' if I use Magisk 23's AP patch instead.

Similarly, not all files of the NVD_IMEI folder have same permission in Magisk 23, one file IP03_001 has 'system radio' ownership whereas rest of them have 'system system'. However, in Magisk 24, this is not the case.

[/QUOTE]
weird, no idea if it should be always the same or not, is your phone the A325M?
anyway my NVD_IMEI folder has user system, group radio, and originally was rwxrwx--- which I changed to r-xr-x---
and all the files inside currently are owned by system, group system. rw-rw----
maybe you could try changing that, or as I said before, do the procedure, reboot, make some calls and stuff, then copy what's missing, and only then restricting access, or maybe, don't restrict access at all, provided you have an up-to-date magisk

When I try to copy some specific old files (IP21_000) manually into regenerated NVD_IMEI folder, IMEI is permanently lost.

didn't happen to me, maybe then don't copy it and it will be created by system as it was suggested above by you (the permissions on the folder should not be restricted to allow that to happen)

Is NVD_DATA possibly corrupt? Should I erase it after taking a backup, so that it regenerates and repairs itself like NVD_IMEI?

honestly, no idea if it would be auto-restored. If you just rename it instead of erasing it you can try without consequences, you can always re-rename it

Last edited: Jun 1, 2022

craaziik

Member
Feb 5, 2022
I'm surprised, I didn't know there were any samsungs with that processor brand. What model is your phone

hi! im sorry for the VERY late reply but its a A325M

dronkit

Senior Member
Jan 14, 2013
Will rooting affect me with imei? (my processor is listed on picture)

oh, i didn't know that was the processor. I was thinking Mediatek, which is the chipset.
If it's an A325M, it's just like mine. IDK if you will lose IMEI after rooting via patching an image file. But when it happened to me, this is the procedure that brought it back. Maybe you won't have any problems, since Magisk has been updated. Try getting the latest Magisk. I'm on 24.3 but i think there's a 25 beta.

craaziik

Member
Feb 5, 2022
oh, i didn't know that was the processor. I was thinking Mediatek, which is the chipset.
If it's an A325M, it's just like mine. IDK if you will lose IMEI after rooting via patching an image file. But when it happened to me, this is the procedure that brought it back. Maybe you won't have any problems, since Magisk has been updated. Try getting the latest Magisk. I'm on 24.3 but i think there's a 25 beta.

i did use magisk before i knew this issue (i installed it when i got it in november 2021) so yeah i might use it again

FIXED! (working and stable so far)
Thanks to @Mighty_Rearranger

In more detail:
PREPARATION
1) root your phone by patching the stock ROM with the magisk app, as per Magisk's installation instructions. Reboot, install the app and everything Magisk asks until it works fully.
2) install and get ADB working in your PC. I love this one which is super lightweight.
3) enable ADB on your phone by enabling the developer options, turning on USB debugging.

ERASING
4) open a CMD terminal on your PC as administrator, go to the minimal ADB folder and run
adb shell
you will be running a terminal on your phone
5) make it a root terminal by running
su
in the phone, Magisk should ask for root permission for "system", allow it
the prompt should now have a "#" in the end, indicating you are root
6) go to the folder in question
cd /mnt/vendor/nvdata/md/NVRAM
7) delete the NVD_IMEI folder
rm -R NVD_IMEI
the IMEI appears instantly, but just in case, do the reboot.

RECOMMENDED BACKUP
7) optionally, instead of deleting the folder, rename it
mv NVD_IMEI NVD_IMEI.old
and move the backup NVD_IMEI to phone storage so you can save it on your PC
mv NVD_IMEI.old /storage/self/primary
copy that folder to your PC using the usual windows explorer or whatever
then reboot

AFTERWARDS
after reboot maybe you'll like to turn on airplane mode just in case so the IMEI doesn't die again.
then, as the post says, you can uninstall magisk (use the uninstall button on the app!!)
or try to keep it maybe installing it this time on the recovery partition and only booting root for necessary setup keeping airplane mode just in case to prevent IMEI loss again (didn't try this though),

or, to try to keep Magisk you can do the following:

[EDIT: Magisk ppl say "latest canary builds maybe work fine" (I take it they mean you won't lose IMEI after recovering it, with no need to do the following steps, and you won't lose IMEI in the first place with these versions, but who knows)]

8) enter adb again and make it root and go to the folder as in steps 4-6

OPTIONAL BACKUP
9) optionally, backup the newly appeared NVD_IMEI folder
cp -R NVD_IMEI /storage/self/primary
and the copy will go to phone storage so you can take it to your PC

MAKE FOLDER READ-ONLY
10) do a
chmod 550 NVD_IMEI
the NVD_IMEI folder is owned by user system and the radio group. This command will make the folder readable but unwritable for those users. Only the root user will be able to undo this or write to the NVD_IMEI folder.

CLOSING UP
exit
exit

after uninstalling magisk/making the folder read-only, turn off airplane mode and start normal use

Thanks, great fixed 😉 i use root explorer, work fine again thanks


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK