How To Guide [Tutorial] Recover from IMEI or GPS not working due to corruption (restoring efs and sec_efs) - Samsung Galaxy A53 5G

I was trying to enable the privacy wifi feature that changes the MAC address of the wifi adapter on every connection (see https://github.com/phhusson/vendor_hardware_overlay/pull/610 as an alternative to https://github.com/Magisk-Modules-Alt-Repo/MacRandomizationEnabler).
While doing this, I encountered an issue that all of a sudden, the phone would not connect to cellular (IMEIs were gone) and GPS would not work anymore. This is quite frustrating and could essentially render your phone unusable with respect to its main functionality.
I was not aware of the fact an efs backup is required. However, I had backed up efs and sec_efs right after the problem.
I also found that the problem could occur just due to the use of Magisk (after some weeks).
The public documentation on efs in general is already sparse, but the one for the Exynos based models is close to non-existent from what I found. That's why I thought I would share my journey and findings.
This is how I went ahead to restore the functionality. In particular, due to the Exynos chip, things are different to other tutorials which either rely on MediaTek or Qualcomm chipsets, which store the NVRAM (responsible for IMEI, ...) in a different way (not in Samsungs own encrypted and obfuscated .bin format) and have more accessible ways of setting IMEI (via serial console, external tools, ...). There, the restore process is different.
Prerequisites
Backup (potentially corrupted) of efs and sec_efs
TWRP
How to proceed
Code:
- Remove any root app that might infringe with the "efs" data, such as MAC address changers, ...
- Restore both "efs" and "sec_efs" partitions with TWRP (with no intermediate reboot)
In my case, the most recent "nv_data.bin" inside the "efs" backup was corrupt (as I backed it up AFTER the corruption), so I needed to continue as follows
Code:
- Do not reboot to system directly after restore
- In TWRP, reboot to "fastboot" and enter ADB
- Run "adb shell"
- cd /mnt
- mkdir test
- mount /dev/block/by-name/efs test
- cd test
- ls -al
in addition to "nv.log" (just a log file), "nv_data.bin", "nv_data.bin.md5" (the corrupted ones), ensure there is also ".nv_data.bak", ".nv_data.bak.md5" (the timestamps of which were in the future, but that's ok)
- mv nv_data.bin nv_data_corrupt.bin
- mv nv_data.bin.md5 nv_data_corrupt.bin.md5
this will cause "nv_data.bin" and "nv_data.bin.md5" to be restored from the ".nv_data.bak", ".nv_data.bak.md5" files on the next reboot, observe this later in the "nv.log" by the following lines
[none]DATE:Not exist secure efs
[none]DATE:Nv restored 3
- cd ..
- umount test
- rmdir test
- Turn the phone FULLY off
- Reboot
- Cellular connectivity and GPS should be working again!
- Make an immediate backup of "efs" and "sec_efs"
In theory, you should also backup "persist", but I didn't find a corresponding partition.
- (Optional) Remove the corrupt ".bin" and ".bin.md5" files in "efs"
I hope this gives some insights on nv_data on Exynos chips and potentially helps anybody in a similar situation.
Spoiler: Useful resources that helped me along my journey
Fix for missing IMEI & Baseband
https://forum.xda-developers.com/t/imei.4419517/#post-86621473 Thanks to @MauriJ2001 for suggesting this guide. It worked for A12 too. I am currently on BVB4 firmware version with IMEI & Baseband working. Hopefully it works for everyone else tho.
forum.xda-developers.com
Imei
I lost imei/baseband after flashing stock ROM Build number: A125FXXU2BVB4
forum.xda-developers.com
[fixed] rooted a325m suddenly no imei, no sim
I rooted my a325m by patching the stock AP file with magisk, had to use FRP hijacker by hagard to be able to flash the patched file. I root uninstalled several apps for debloating. The phone worked fine for like a couple of weeks, and now...
forum.xda-developers.com
Need nvram donors
We need a donor nvram. All you need is files: nvram.bin, nvdata. img, persist. img, nvcfg. img, protect1. img, protect2. img, as well as pc. Goal: We will not take your imei. The most important thing for us is to understand what imei format miui...
forum.xda-developers.com
Wifi don't work? Flash this! /Persist Repair
Well, many people have problems on the /persist partition, maybe because some bad rom, or maybe because by a mistake you formatted them on a recovery (a bad recovery without forbid partitions). Before this zip, you have to copy the...
forum.xda-developers.com
reverse-engineering nv_data.bin
I have a rooted Galaxy Nexus GSM (Maguro) running ClockworkMod and the stable version of CM9. I've been trying to find out how exactly the IMEI is stored --- whether it's baked into the radio component or whether it's controllable from firmware...
forum.xda-developers.com
Docomo SIM unlock: Jup's Grand Theory of Permanent SIM Unlock
This theory now seems to be confirmed by number of successful applications & my additional research. It should be generally safe to try both experiments. However, it still requires you know basics of shell. Above all, backup. And as allways, I am...
forum.xda-developers.com
[SOLVED] suddenly unknown imei
ok so, i was using my phone normally yesterday, but out of nowhere, my SIM card stopped working and i couldn't use mobile internet/calls anymore. So i checked my settings and i saw my IMEI was marked as unknown, the same with baseband. The A32...
forum.xda-developers.com
[Fixed] Repair IMEI and fix deleted EFS folder for Note10+ N975F
Hi bros First of all I am not a developer, the EFS folder of my Note10+ was deleted by mistake and I lost my IMEI numbers, after a lot of concern, researches and tests I fixed my Note10+ and I want to share my very hard and bad experience maybe...
forum.xda-developers.com
Lost my efs backup.. can I use another one?
So basically I dont have my efs backup.. and twrp messed up my efs partition.. Is it possible to use another efs?
forum.xda-developers.com
How to mount TWRP backup files in Linux
Hello, I want to inspect backup files create by TWRP backup. The file structure is this: $ ll /mnt/HD403LJ/oneplus5t/TWRP/BACKUPS/b94a5888/2019-05-27--00-44-45 .rwxr-xr-x root root 1.0 MB Fri Apr 3 20:13:36 2020  bluetooth.emmc.win .rwxr-xr-x...
forum.xda-developers.com
[V1.0]01.05.14 EFS/IMEI Tool G900M/F/T Cmplete backup EFS + Modemst1 and 2 - Galaxy S 5 Android Development (Snapdragon)
[V1.0]01.05.14 EFS/IMEI Tool G900M/F/T Cmplete backup EFS + Modemst1 and 2 - Galaxy S 5 Android Development (Snapdragon)
www.bettermobileapp.com
subject:"\[Replicant\] \[libsamsung\-ipc\] \[PATCH\] nv_data\-imei\: indicate that write\-imei may or may not work"
[HOW-TO] Sim-Unlock via nv_data.bin!
Also den xdaLeuten hats geholfen! Ich dachte mir ich übersetze es für euch! Edit: Hier gibt's eine App die das ganze erleichtern soll: https://play.google.com/store/apps/details?id=org.projectvoodoo.simunlock&hl=de ALS ERSTES: Android Hilfe.de und Ich übernehmen keine Haftung wenn etwas schief...
www.android-hilfe.de

Related

[Q] EFS Professional backup PROBLEM

I have been trying to backup the efs folder on Samsung galaxy Music GT-S6010 using EFS Professional v2.0.62 and when the software is "Extracting PIT from device for mapping ..." it shows "operation failed" and gives a prompt showing it was "Unable to extract PIT from device!".
I have attached a screenshot of the issue, anyone kindly help.
Similar problem on Galaxy S GT I9000, MORE DETAILS given
Hello,
I have a problem with EFS Professional. I searched the development thread (http://forum.xda-developers.com/showthread.php?t=1308546) and googled it as well. Although some solutions were offered my problem is not solved. I am not a complete newbie but not an expert either, so maybe I have a really simple issue here?
I am simply trying to backup the EFS partition on Samsung Galaxy S GT I9000.
The problem in short:
1. All seems to be well on welcome tab.
2. While running the backup, I get “Unable to read PIT file!” and the process stops.
3. If I run it again it skips the PIT file part saying “Skipped, already exists.” And then a popup shows saying “unable to create archive!”
4. Note: a tar.gz file is actually created and placed in a new EFSProBackup folder on the phone under /mnt/sdcard. The size of this file is only 29 Bytes and I think its basically an empty file).
Note that I did change my Busybox to version 1.20.0.git (but not 1.20.0 if it makes any difference?) as was suggested).
Can anyone help?
Please see a detailed description below.
Many thanks!
Detailed description:
• Using Windows XP
• EFS Professional 2.0.70
• Busybox 1.20.0.git
• Samsung USB Driver: 1.5.27.0_2
• Firewall – OFF
• USB Debugging – ON
• Mass Storage – OFF (I tried it with Mass Storage ON as well and it gives only the result as in step 2 described above no matter how many times I run it)
• Unknown Sources (if at all relevant) – ON
• Allow mock locations (if at all relevant) - ON
EFS Professional selections, logs & popups:
Welcome tab:
Log:
Checking application environment... Okay.
Initializing ADB server... Okay.
-----------------------------------
Performing device checks...
-----------------------------------
Root status: Perm Rooted.
SU binary version: 3.1.1
-----------------------------------
BusyBox status: Installed.
BusyBox binary version: 1.20.0.git
-----------------------------------
EFS Professional is ready for use.
-----------------------------------
Backup tab:
• device filter set to “*** All Partitions ***”
• selected the (only) one EFS partition found: /dev/block/stl3
• Pressed Backup
Log:
Checking device connection... Device is connected!
Checking for block device: '/dev/block/mmcblk0'... Okay.
Extracting PIT from device for mapping... Okay.
Operation failed!
A popup comes up saying: “Unable to read PIT file!”
• When I press Backup again
Log:
Checking device connection... Device is connected!
Checking for block device: '/dev/block/mmcblk0'... Okay.
Extracting PIT from device for mapping... Skipped, already exists.
Checking backup folder location... Okay.
Backing up selected partition(s)...
Creating archive: GT-I9000_20130928_114424.tar.gz...
Operation failed!
A popup comes up saying: “Unable to create archive”
Efs backup
Try online Nandroid backup app. It will back up everything including the EFS folder.
Perfect!
It's so much simpler and works like a dream! I just hope it will work as promised if anything goes wrong while flashing a new ROM!
Many thanks for your reply!
:good:
backup IMEI on galaxy ace 2 i8610
Hello
I have the same problem with my galaxy ace 2 i8610
I get a popup shows saying “unable to create archive!”
Does anyone can help me ?
Thanks
---------- Post added at 03:38 AM ---------- Previous post was at 03:29 AM ----------
Hello
I have a galaxy ace 2 i8610 and when I try to backup on EFS pro 2.0.70, I get this message :
Checking device connection... Device is connected!
Checking for block device: '/dev/block/mmcblk0'... Okay.
Extracting PIT from device for mapping... Skipped, already exists.
Checking backup folder location... Okay.
Backing up selected partition(s)...
Creating archive: GT-I8160_20131105_101505.tar.gz...
Operation failed!
Does anyone can help me ?
Thanks[
efs professinal erorr!
hiii....I was backuping my efs or radio's data from tablet n8000 but today i see this erorr!!! my efsprofessinal is in c:\ and adb devicse is working!!please guide mi...tanks

[V1.0]01.05.14 EFS/IMEI Tool G900M/F/T Cmplete backup EFS + Modemst1 and 2

[V1.0]01.05.14 EFS/IMEI Tool G900M/F/T Cmplete backup EFS + Modemst1 and 2 (Needs Rooted device)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As we know on qualcomm device IMEI number no more stored on EFS partition so no meaning to make backup of only efs.img
Here is simple tool to make backup of complete IMEI (efs.img.ext4 + nvrebuild1.bin and nvrebuild2.bin)
As we know sometimes we do have multiple device and multiple backup and that making us confuse which backup is for which device, also it difficult to guess when exactly we made particular backup. to overcome all these issue this tool will make backup in folder name MyEFS_MM-dd-yyyy_hh.mm_Device IMEI So you can keep multiple backup. (* This is Pro feature)
Also it will copy build prop file along with backup, so that will give complete information about your ROM when you made backup.
- To backup long press EFS backup option icon, it will backup all three required partition like efs.img.ext4,nvrebuild1.bin and nvrebuild2.bin. Also you will find build.prop file, which is just to get information about ROM when backup was created.
- To restore simply copy all three backup files efs.img.ext4, nvrebuild1.bin and nvrebuild2.bin to root directory of Int SD card and then long press Restore option icon.
Read this for more about EFS
http://forum.xda-developers.com/showthread.php?t=2420881
ChangeLog
V1.0 Initial version
Needs Rooted device
Download : (If your device model is different read this to add support for your device)
Pro Version
OR
IMEI Tool G900M/F/T Free 1.0 - Download for free for XDA users. This have same function for EFS backup as PRO Only difference is Free version save backup in IntSD/MyEFS folder and if you make repeat backup, older one will be overwrite unless you move manually. While PRO version will store backup in MyEFS_date_time_your IMEI and it will create new folder every time and keep all backup on different folder.)
What is EFS
This part of the device contains some important and some basic info related to our device identity like Bluetooth MAC address, wireless devices MAC addresses, product code (also in the nv_data.bin) and the very main IMEI address (nv_data.bin), programming parameters for the device such as your account information (phone number, etc), data provisioning parameters, and a whole bunch of other things. So you can guess it's will be different for each device and one can't use others. In latest samsung device this information store in other partition so requires to make backup of that partition too.
How it can corrupt :
- Any bad flashing, mishandling system modification can cause this.
- Also It can be corrupted by downgrading stock ROM. If you flash any old ROM on newer ROM it can corrupt EFS. Basically newer ROM believed to have new kernel that changes EFS data which older Modems can't read and results to fail in reading IMEI.
Impact on device/How I know I have corrupted EFS
When there is EFS partition is corrupted, device loses IMEI and due to this device can't gets connected to network. Baseband info also sometimes shows unknown.
-Check your IMEI in setting / by dialling *#06# if it is null OR if it starts with 0049** then IMEI is generic and corrupted. In Normal case IMEI which you can see in device setting or dialing *#06# is exactly same you can see on bill/box/sticker under battery compartment
-If you are unable to connect to network in spite of correct IMEI, chance are
A. Your device is Locked to specific Network OR
B. Your device is banned due to tempered IMEI
-If your AP,CP,CSC all are correct and even you are getting error (unknown CSC XXX) on kies update, it may be due to corrupt Product code in EFS. Read This for detail.
What care should i take
Before flashing anything, first thing you should do is to make EFS backup. Every person who have rooted device should make EFS backup earliest and place it to safer place on PC and /Cloud.
If you are on older ROM, make EFS backup on older ROM as well make another after upgrading ROM too.
If you have already updated to newer ROM, make backup on current ROM.
Exit "Permanent Safe Mode" This condition represent with loss of IMEI + yellow text box on homescreen with device info.here is Screenshot
Here is different method to remove it.
Method1 :
Open root explorer.
Navigate to /efs/FactoryApp/
Open "factorymode" file as Text and edit it:
Change this:
Code:
OFF
To:
Code:
ON
Open "keystr" file as Text and edit it:
Code:
OFF
To:
Code:
ON
Reboot device.
Method2:
Open Terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Write the following & click enter:
Code:
rm /efs/FactoryApp/keystr
Write the following & click enter:
Code:
rm /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/keystr
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/factorymode
Reboot your device
Method3
Install attached safemode_exit apk as regular app. Open from drawer - Grant su permission - Reboot when asked.
e:failed to mount /efs(invalid argument) error with bootloop
This condition usually happens with using unsupported tool (usually from play store).
To recover this, needs to use adb shell
Code:
adb shell
mke2fs / dev/block/mmcblk0p[COLOR="Red"]x[/COLOR]
mount-w-t ext4 / dev/block/mmcblk0p[COLOR="red"]x[/COLOR] / efs
x means your device EFS partition number
PS : It needs CWM and busybox installed.
So the backup goes into a folder called "MyEFS" on internal SD card initially and you have to store it away in a safe place, right?
Moe5508 said:
So the backup goes into a folder called "MyEFS" on internal SD card initially and you have to store it away in a safe place, right?
Click to expand...
Click to collapse
correct.
If you making subsequent backup, you should move/rename older backup otherwise it will be replaced. (For Pro version it will create everytime new folder bcoz it stamps time of backup, so they need not to rename)
But for both version I recommend to keep extra copy on Cloud/PC
More than 50 download, can anyone tell me it's fine and backup created as per said in MyEFS folder for free users
Also few user have purchased, kindly tell me if it is working as per said.
Also tell me size of backup of all three files except build.prop
Thank you.
Easy and fast.
dr.ketan said:
More than 50 download, can anyone tell me it's fine and backup created as per said in MyEFS folder for free users
Also few user have purchased, kindly tell me if it is working as per said.
Also tell me size of backup of all three files except build.prop
Thank you.
Click to expand...
Click to collapse
Thanks, works quite effortlessly. As for backup sizes... I'm on a G900T. efs.img.ext4=14MB, nvrebuild1.bin=3MB, nvrebuild2=3MB.
as always another great contribution from dr.ketan
thanks mate
Inviato dal mio SM-G900F utilizzando Tapatalk
soloilmeglio said:
as always another great contribution from dr.ketan
thanks mate
Inviato dal mio SM-G900F utilizzando Tapatalk
Click to expand...
Click to collapse
Thank you.
I forget to tell you that I have heads up your concern here.
dr.ketan said:
More than 50 download, can anyone tell me it's fine and backup created as per said in MyEFS folder for free users
Also few user have purchased, kindly tell me if it is working as per said.
Also tell me size of backup of all three files except build.prop
Thank you.
Click to expand...
Click to collapse
it worked for me in both free and paid. efs=14MB, nv1=3MB, nv2=3MB
only build.prop in MyEFS folder,there's no other files (G900Frooted phone with stock rom)
Check your supersu app tab. Have you granted supersu permission?
If it's not green then select to forget and re do backup and grant permission when ask.
Sent from my SM-N900 using xda premium
Works great paid version. Thanks.
Gesendet von meinem SM-G900F mit Tapatalk
works perfekt!
paid over google Play
Hi.
I am trying to figure out where actually imei is located in phone.
I see imei folder in efs but it's empty.
do it works for xiaomi mi3 snapdragon 800 Modemst1 and 2 ?
change imei
hello I need to change the IMEI of my device g900m someone could help me with a link how to do that?And if I take the backup of another cell g900m will change my IMEI?
odjmoon said:
hello I need to change the IMEI of my device g900m someone could help me with a link how to do that?And if I take the backup of another cell g900m will change my IMEI?
Click to expand...
Click to collapse
Good luck with that bro...
thatsupnow said:
Good luck with that bro...
Click to expand...
Click to collapse
But will it work?
This worked for me on my G900I thanks very much.
Woah, @dr.ketan you have an S5?

[Guide] [XT16XX] [Solve] G4+ Baseband/Network/Volte issue, Lost 1 IMEI & fingerprint

[Guide] [XT16XX] [Solve] G4+ Baseband/Network/Volte issue, Lost 1 IMEI & fingerprint
Important:
If you have IMEI=0, then this is the wrong thead. Follow this: [Guide] [XT16XX] [Solve] Moto G4/Plus IMEI=0 issue
This method is only tested on Nougat for now, for Oreo, new files will be needed.
Code:
#include <disclaimer.h>
/*
* Your warranty is now.......(wait a minute)........still valid?
*
* I am not responsible for bricked devices.
* YOU are choosing to make these modifications, and if you point
* your finger at me for messing up your device, I will laugh at you.
*/
This thread addresses the following problems:
Baseband version changed to some other country
Sim card getting detected, but no network
Both sims having a network but VoLTE doesn't work
G4 Plus turned to G4, i.e phone just shows one IMEI and no fingerprint
This method is only for the retail models of Moto G4/Plus, it may or may not work on any other models.
All of these issues have a common reason,
The modem files for your device has been corrupted/has some issue or have been changed to some other country.
Voltes isn't working since your baseband is of some other country and not Indian. If you have Indian baseband and still Volte doesn't work, then your modem files have been corrupted/ have some issues.
You have to push the modem, hw, fsg files for your own device.
We already had a thread addressing this issue, but it didn't have modem files for all baseband.
Finally, thanx to our fellow Moto G4 Plus users, for providing these files, we now have hw, modem, fsg files for all the five basebands i.e BRAZIL, LATAM, EMEA, INDIAN, and RETUSA.
Link to the files:
XT1640 [BRAZIL]:
Link: https://www.androidfilehost.com/?fid=11410963190603873179
md5: 8db666f13700e3d12b01051989e3f068
XT1641 [LATAM]:
Link: https://www.androidfilehost.com/?fid=11410963190603873829
md5: cab09417be82e508d0c54f54aac56498
XT1642 [EMEA]:
Link: https://www.androidfilehost.com/?fid=11410963190603873183
md5: e046d911b23c76cb88d5ccd7967d621f
XT1643 [INDIA]:
Link: https://www.androidfilehost.com/?fid=11410963190603873250
md5: d509c5a26305cc5261e707bdf91268e9
XT1644 [RETUSA]:
Link: https://www.androidfilehost.com/?fid=11410963190603873181
md5: 598191e577db1137df62ae996055f5da
Download modem, fsg, hw files according to your original baseband/device model.
Code:
Model Number Baseband
XT1640 BRAZIL
XT1641 LATAM
XT1642 EMEA
XT1643 INDIA
XT1644 RETUSA
Note: These files are extracted from the dual-SIM variant of Moto G4 Plus, so if you flash these on your Moto G4, these will work, but your device name will be changed to Moto G4 Plus (everything will still work fine, just your device will be treated as Moto G4 Plus by all apps) and if you flash these images on single SIM Moto G4 Plus, it will still work.
Pre-requisites:
You must be on Stock Nougat 7.0 (latest version preferred)
You must be rooted (install Elemental-X kernel first and then flash Magisk otherwise you will have boot issues)
Terminal app or adb drivers in PC/Laptop (I wouldn't recommend TWRP (official or unofficial as it has issues flashing hw.img)
Step 1: Download files
Download and place these files in your /sdcard directory.
/sdcard is the same as the Internal storage directory. Do not confuse it with micro Sdcard as it has its directory named as /external_sd
Step 2: Flash the files
Note: The below commands are to be typed in a terminal app or adb shell.
Q) How to type in adb shell?
A) Open command prompt in the folder where you have adb and fastboot installed and type:
Code:
adb shell
So lets start now!
Code:
su
This command it to get root access for the terminal/shell. Grant the root access and you will see that the $ symbol is replaced with # symbol which means that root access has been granted.
Code:
dd if=/sdcard/modem.img of=/dev/block/bootdevice/by-name/modem
dd if=/sdcard/fsg.img of=/dev/block/bootdevice/by-name/fsg
dd if=/sdcard/hw.img of=/dev/block/bootdevice/by-name/hw
Step 3: Flash the latest Stock ROM (April 2018)
That's it. After flashing, reboot and check your baseband. You would be on the baseband which you flashed in step 2.
Indian users, you will see INDIAN baseband if you flashed the files for it, and Volte would work.
Flash the latest Stock ROM from here: Stock N Firmware [Apr 01 Security Patch][fastboot]
Contributors:
@djumie and Erick Lima (for providing BRAZILIAN modem files)
@Nacoro and @Deivid_21 (for providing LATAM modem files)
@echo92 (for providing EMEA modem files)
@checksamir (for providing INDIAN modem files)
@Jleeblanch (for providing RETUSA modem files)
@Pranav (for testing the files)
@Heeth21 (and lastly, myself)
Also all the others who helped during the process
Complete Backup Zip/Script (All partitions)
Now since you have faced this issue, make sure to take a complete backup of all the partitions so that if you ever face an issue like this in future, you will always have your partitions with you to restore your device.
Here is the link to the thread to take complete backup of all partitions: [Guide] [XT16XX] Moto G4/Plus Complete Partition Backup/Restore Zip/Script
The above thread can backup/restore using TWRP flashable zip files for convenience.
reserved
Thank you for this guide, but unfortunately it didn't work. When I pushed the hw image my phone stop responding and I have to force a reboot with the power buttom. I will give up on this issue for now on. Thank you again.
I attached a logcat in case you can find something that could give an anwser about what happens after i push the hw img
Do I have to be on stock ROM for this to work? Can't it work when I'm on a custom ROM?
What happened was I flashed the latest arrow os build, which was faulty. I then clean flashed crdroid. After reboot, sim isn't working, and imei isn't showing anything. I restored my persist partition, with no result.
Any help?
Wow after Restoring Indian Baseband Volte works now.
Thanks Sir.
sxbino said:
Thank you for this guide, but unfortunately it didn't work. When I pushed the hw image my phone stop responding and I have to force a reboot with the power buttom. I will give up on this issue for now on. Thank you again.
I attached a logcat in case you can find something that could give an anwser about what happens after i push the hw img
Click to expand...
Click to collapse
There are a few more ways to make this work, so its too early to give up.
Are you on the latest Stock ROM (April 2018)? You need to be on the latest stock firmware for this to work as the files are extracted from the latest stock firmware.
1. Flash Stock ROM (latest version - April 2018) once again.
2. Flash official TWRP (I repeat official TWRP only).
3. Then go in Terminal of TWRP (Settings>Terminal), and then repeat step 2, but this time no need to type "su" command.
Edit: @sxbino, now that I have learnt a little to read logs, it appears that the logs doesn't contain anything about flashing those files.
Please collect logs from adb using the command:
Code:
adb logcat>log.log
This will start collecting and saving logs in a file named "log" which will be saved in the same folder where you have adb.
If you are using PC/Laptop to push the files, you can open 2 terminal/command prompt windows, one to collect logs and other to flash the files.
But is missing Brazil baseband.
I'm from Brazil and change mine for LATAM.
Does anyone have this files?
edjalmo said:
But is missing Brazil baseband.
I'm from Brazil and change mine for LATAM.
Does anyone have this files?
Click to expand...
Click to collapse
Right now, we haven't been able to get modem files for BRAZILIAN baseband. Will add them in the Google Drive link once they are available from fellow Brazilian users.
Edit: @edjalmo, BRAZILIAN modem files are now available.
CMKdaGreatest said:
Do I have to be on stock ROM for this to work? Can't it work when I'm on a custom ROM?
What happened was I flashed the latest arrow os build, which was faulty. I then clean flashed crdroid. After reboot, sim isn't working, and imei isn't showing anything. I restored my persist partition, with no result.
Any help?
Click to expand...
Click to collapse
You may try if you'd like to. It just didn't work for me(flashing/pushing those files on custom ROM) so I am asking to be on stock ROM.
All of the 64-bit Pie ROMs are causing this error. The developers are working hard to fix it.
I would recommend flash stock ROM. No need to worry about losing IMEI after flashing stock as now it is recoverable, the only condition is you should not try to restore somebody else's persist or efs partitions.
Heeth21 said:
You may try if you'd like to. It just didn't work for me so I am asking to be on stock ROM.
ArrowOS is causing some problem with efs partition. The developer Lyuu is working hard to fix it.
I would recommend flash sSock ROM. No need to worry about losing IMEI after flashing stock as now it is recoverable, the only condition is you should not try to restore somebody else's persist or efs partitions.
Click to expand...
Click to collapse
Somehow, I clean flashed crdroid again, this time restoring the efs partition right after ROM flash. Now my sim is working. Silly me
Update: BRAZLIAN modem files are now available and have been added to the drive link. OP has been updated.
Heeth21 said:
Right now, we haven't been able to get modem files for BRAZILIAN baseband. Will add them in the Google Drive link once they are available from fellow Brazilian users.
Edit: @edjalmo, BRAZILIAN modem files are now available.
Click to expand...
Click to collapse
Thank you very much
edjalmo said:
Thank you very much
Click to expand...
Click to collapse
@edjalmo, Please report back whether they worked or not. I have 2 pairs of modem files. If this one didn't work, I will upload the second pair of files.
Heeth21 said:
@edjalmo, Please report back whether they worked or not. I have 2 pairs of modem files. If this one didn't work, I will upload the second pair of files.
Click to expand...
Click to collapse
Yes! I tested and it worked! My model is XT1640.
Heeth21 said:
You may try if you'd like to. It just didn't work for me so I am asking to be on stock ROM.
ArrowOS is causing some problem with efs partition. The developer Lyuu is working hard to fix it.
I would recommend flash sSock ROM. No need to worry about losing IMEI after flashing stock as now it is recoverable, the only condition is you should not try to restore somebody else's persist or efs partitions.
Click to expand...
Click to collapse
The ArrowOS also broke the imei of my smartphone, I have tried everything but nothing, I hope that the developer of ArrowOS get a solution!
Heeth21 said:
Code:
#include <disclaimer.h>
/*
* Your warranty is now.......(wait a minute)........still valid?
*
* I am not responsible for bricked devices.
* YOU are choosing to make these modifications, and if you point
* your finger at me for messing up your device, I will laugh at you.
*/
This thread addresses the following problems:
Baseband version changed to some other country
Sim card getting detected, but no network
Both sims having a network but Volte doesn't work
G4 Plus turned to G4, i.e phone just shows one IMEI and no fingerprint
This method is only for the retail models of Moto G4/Plus, it may or may not work on any other models.
All of these issues have a common reason,
The modem files for your device has been corrupted/has some issue or have been changed to some other country.
Voltes isn't working since your baseband is of some other country and not Indian. If you have Indian baseband and still Volte doesn't work, then your modem files have been corrupted/ have some issues.
You have to push the modem, hw, fsg files for your own device.
We already had a thread addressing this issue, but it didn't have modem files for all baseband.
Finally, thanx to our fellow Moto G4 Plus users, for providing these files, we now have hw, modem, fsg files for all four basebands i.e LATAM, EMEA, BRAZIL, and INDIAN.
Here is the link to the files: https://drive.google.com/open?id=1NtOTKgmJIP_Ys26CYd9KBdwhWdGfbCqH
Download modem, fsg, hw files according to your baseband.
Note: These files are extracted from the dual-SIM variant of Moto G4 Plus, so if you flash these on your Moto G4, these will work, but your device name will be changed to Moto G4 Plus (everything will still work fine, just your device will be treated as Moto G4 Plus by all apps) or if you flash these images on single SIM Moto G4 Plus, it will still work.
Pre-requisites:
You must be on Stock Nougat 7.0
You must be rooted (install Elemental-X kernel first and then flash Magisk otherwise you will have boot issues)
Terminal app or adb drivers in PC/Laptop (I wouldn't recommend TWRP (official or unofficial as it has issues flashing hw.img)
Step 1: Download files
Download and place these files in your /sdcard directory.
/sdcard is the same as the Internal storage directory. Do not confuse it with micro Sdcard as it has its directory named as /external_sd
Step 2: Flash the files
Note: The below commands are to be typed in a terminal app or adb shell.
Q) How to type in adb shell?
A) Open command prompt in the folder where you have adb and fastboot installed and type:
Code:
adb shell
So lets start now!
Code:
su
This command it to get root access for the terminal/shell. Grant the root access and you will see that the $ symbol is replaced with # symbol which means that root access has been granted.
Code:
dd if=/sdcard/modem.img of=/dev/block/mmcblk0p1
dd if=/sdcard/fsg.img of=/dev/block/mmcblk0p16
dd if=/sdcard/hw.img of=/dev/block/mmcblk0p43
Step 3: Flash the latest Stock ROM (April 2018)
That's it. After flashing, reboot and check your baseband. You would be on the baseband which you flashed in step 2.
Indian users, you will see INDIAN baseband if you flashed the files for it, and Volte would work.
Contributors:
@echo92 (for providing EMEA modem files)
@checksamir (for providing INDIAN modem files)
@Nacoro and @Deivid_21 (for providing LATAM modem files)
@djumie and Erick Lima(for providing BRAZILIAN modem files)
@Pranav (for testing the files)
@Heeth21 (and lastly, myself)
Also all the others who helped during the process
Click to expand...
Click to collapse
I do not understand where to enter the commands, can you explain more detailed? does this also work for IMEI = 0?
luis dambrowski said:
I do not understand where to enter the commands, can you explain more detailed? does this also work for IMEI = 0?
Click to expand...
Click to collapse
Nope, if you have IMEI=0, go to this thread: https://forum.xda-developers.com/moto-g4-plus/how-to/guide-moto-g4-plus-imei0-issue-t3859068
If there is any problems like baseband/network after restoring IMEI, come to this thread.
Update: RETUSA modem files are now available and have been added to the drive link. OP has been updated.
I just installed the files of the Brazilian version, they worked perfectly in the g4 xt1626, only the part of tv does not appear because my model is the version no plus, but the baseband is now correct, brazilian version. I just have to thank Heeth21, his job in keeping a baseband database and etc is phenomenal, will help a lot of people.

[PX5][Android 10] Patched recovery

This is the Android 10 recovery image by HCT (version 10.3.1) patched to skip signature checking on .zip files
Tested on MTCE_LM (Eunavi). Use at your own risk
It can be flashed from a root shell (either adb or via terminal emulator) by performing the following steps
1. upload recovery via adb
Code:
adb push hct_recovery_patched.img /sdcard/
2. flash recovery
Code:
# backup current recovery
dd if=/dev/block/by-name/recovery of=/sdcard/recovery_backup.img
# write new recovery
dd if=/sdcard/hct_recovery_patched.img of=/dev/block/by-name/recovery
NOTE: If you do not disable the "flash_recovery" service in /init.rc, AND you have a stock kernel, recovery will be restored to the original version after rebooting.
There are 3 ways to avoid this:
- Flash magisk (or a modified kernel) while in recovery. The patch will then fail to apply and recovery won't be overwritten
- Disable "flash_recovery" by doing "adb remount" and editing /init.rc (comment out the following)
Code:
service flash_recovery /system/bin/install-recovery.sh
class main
oneshot
- Neuter the service by either:
- removing /system/bin/install-recovery.sh​- replacing /system/bin/install-recovery.sh with a dummy script​- removing /system/recovery-from-boot.p​
Woo-hoo, after hundreds of rubbish posts in the MTCD forums, we have a real development post!
Great work and thanks for sharing this, these forums need more like you.
Thanks for the kind comment!
I have to admit that it was frustrating to see the lack of information sharing on this forum, and the pervasive pay-per-use model.
I spent a lot of time just getting Android 10 installed (starting from Android 9), and i had to bring the head unit to my desk as working in the car was rather hard and all i achieved was a brick.
I unfortunately had to bring it back in the car now (can't sit on my desk forever) but, now that i figured out how to make bootable recoveries, i was wondering how hard it could be to have TWRP or at least a hassle-free recovery to install Android 10 from Android 9.
As a first step, this recovery makes it possible to install Magisk or other zip files without doing it manually within adb.
Cheers!
Your work is really good!
Thanks a lot for it.
Now you can also modify ROM's without signatur errors when installing.
Wouldn't it be good if we had an app like the ModInstaller ?
So a one click installation of the recovery without shell or adb.
I have now built an app.
And now need help.
Namely, in the app is the recovery and the script.
Unfortunately, the flash process is not started.
It always comes only the first message from the script.
The app is open source and the script and the recovery are in res/raw.
In the attach you will find the finished app and pictures.
If someone has a solution, he can write me or make a pull request on Github.
Source code:
GitHub - jamal2362/RK33XX-Custom-Recovery-Installer: Application for flashing custom recovery on Rockchip Android Head-Units.
Application for flashing custom recovery on Rockchip Android Head-Units. - GitHub - jamal2362/RK33XX-Custom-Recovery-Installer: Application for flashing custom recovery on Rockchip Android Head-Units.
github.com
The script:
RK33XX-Custom-Recovery-Installer/script at master · jamal2362/RK33XX-Custom-Recovery-Installer
Application for flashing custom recovery on Rockchip Android Head-Units. - RK33XX-Custom-Recovery-Installer/script at master · jamal2362/RK33XX-Custom-Recovery-Installer
github.com
First of all, congrats for the work!
DISCLAIMER:
I don't own ModInstaller, i have never bought a copy of it and i don't intend to do so.
Analysis is purely done from Youtube videos, open source code analysis and existing and openly available binary images.
I was working to figure out how to make a FLOSS alternative to ModInstaller.
The issues i found in all my attempts are the following:
- A6 recovery is the only one that can boot from SD Card (which can then be used to flash A9 -> A10 with the 2SD trick)
- (it took me a long time to pull these information together and unbrick my unit)​- The A6 recovery is unable to directly flash A10 RKAF/RKFW images (sdupdate.img) due to the code being too old
- a failure will be observed while writing super.img. This happens because the device needs to be repartitioned, and the A6 recovery is not doing it correctly​- A9 recovery is buggy. Booting it with no system installed will result in a black screen.
- it will only boot succesfully after being written by the A6 flash tool, which writes the "misc" partition with the recovery commands to run (the "hint" i get from this is that the misc partition is important)​- A10 recovery can't be loaded by the A6 recovery. I always got a black screen after flash. Is it a flash issue? is it an issue with the recovery itself? hard to know
Theory: maybe the recovery could be written over the kernel partition? ("boot")
This way, the recovery will always run after being flashed instead of requiring an explicit "enter recovery" trigger (buttons, misc partition, etc.)
Besides these experiments, in parallel, i did some bug fixing to this repository: https://github.com/liftoff-sr/rockchip-tool/commits/master (i'm "smx-smx")
That allows me to unpack nad repack "sdupdate.img" , "reduced recovery images" and "full IMG files".
With those tools. i tried to swap "recovery.img" in the A6 image, but i always got the black screen upon booting from SD.
Either A9/A10 breaks sdboot or the bootloader crashes before it gets there.
Since this also happens when being flashed, this could either be a bug in the flashing program or a bug in the boot stack (which fails to run recovery perhaps due to a dirty state of the internal flash). It's hard to know for sure without having a UART connection with the board.
BUT, we have an alternative, in the form of the recovery built-in ISP flash tool.
This is the code that reads "sdupdate.img" from the SD Card and flashes it
After reading the recovery source code, i realised that this code can only be triggered correctly when booting from the SD card.
It detects this state by reading /proc/cmdline and probing for specific values (https://github.com/rockchip-android...6f72b7d3123dab27135ac41d55029/sdboot.cpp#L206)
This means the bootloader can (and will) pass those arguments under specific conditions (https://github.com/rockchip-linux/u...c873f178c/arch/arm/mach-rockchip/board.c#L358)
If you check here https://github.com/rockchip-linux/u...3f178c/arch/arm/mach-rockchip/boot_mode.c#L47 you can see the magic word that needs to be written to the "misc" partition in order to trigger that code.
Note that, besides the well known "sdboot", "usbboot" is also possible.
I'm not sure if the ROM can physically boot from USB, but the bootloader and recovery do support (according to code) passing the flag to enable flashing from USB.
So, recapping, there are these ways we can try:
a - try to overwrite "boot" with "recovery" (but it might not work due to the partitioning layout, e.g. jumping from A6 -> A10)
- note: uboot might also need to be written when doing this.
b - making a modified "sdupdate.img" that flashes recovery on top of boot, and all the other core partitions like "misc", "uboot", "trust", "vbmeta"
c - writing "misc" from android in order to triggers the "rkfwupdate" mode
d - taking a dump of the first portion of the flash in various states (A6, A8, A9, A10), and having a "dd" that writes it back to the beginning of the flash (i suspect this is how ModInstaller does it)
Considering cases "b" and "c" depend on a recovery that can write them correctly (and the A6 one is buggy), this leaves us with "a" and "d"
Considering that ModInstaller does it in one shot, and doesn't seem to matter about the partitioning layout, i believe "d" might be the most viable option...
Using the "rockchip-tool" repository i linked from github, the partition table can be dumped from any .img file
You can observe "Image/parameter.txt" from the extracted firmware
This is the partition table from A6's recovery:
[email protected](uboot)
[email protected](trust)
[email protected](misc)
[email protected](resource)
[email protected](kernel)
[email protected](dtb)
[email protected](dtbo)
[email protected](vbmeta)
[email protected](boot)
[email protected](recovery)
[email protected](backup)
[email protected](security)
[email protected](cache)
[email protected](system)
[email protected](metadata)
[email protected](vendor)
[email protected](oem)
[email protected](frp)
[email protected](userdata)
And this is the partition table from A9's recovery
[email protected](uboot)
[email protected](trust)
[email protected](misc)
[email protected](resource)
[email protected](kernel)
[email protected](dtb)
[email protected](dtbo)
[email protected](vbmeta)
[email protected](boot)
[email protected](recovery)
[email protected](backup)
[email protected](security)
[email protected](cache)
[email protected](system)
[email protected](metadata)
[email protected](vendor)
[email protected](oem)
[email protected](frp)
[email protected](userdata)
Notice how uboot, trust, misc, resource, kernel, dtb, and others live in the same space. (2000, 4000, 6000, 8000, 10000, ...)
What we could do is create a raw blob that spans that address range, and "dd" it directly to /dev/mmcblk0 at the right offset.
So i would focus on converting recovery images to raw blobs, with recovery-as-kernel so it boots straight away on the first try.
Bump a real thread.
Is it possible to convert it to a file installed by SDDiskTool?
marchnz said:
Bump a real thread.
Click to expand...
Click to collapse
I created a flashing tool to flash recovery within Android, using Rockchip's own code: https://forum.xda-developers.com/t/...chip-firmware-flash-tool-for-android.4458299/
blala said:
I created a flashing tool to flash recovery within Android, using Rockchip's own code: https://forum.xda-developers.com/t/...chip-firmware-flash-tool-for-android.4458299/
Click to expand...
Click to collapse
This file hct_recovery.patched.img does not appear to be installed via rkupdate
sadaghiani said:
Is it possible to convert it to a file installed by SDDiskTool?
Click to expand...
Click to collapse
It needs to be converted, yes
I'll take a look this afternoon
blala said:
It needs to be converted, yes
I'll take a look this afternoon
Click to expand...
Click to collapse
Is it possible to create a boot image that includes moded recovery & magisk and moded kernel ?
If by image you mean firmware image then yes, it can be done with https://github.com/liftoff-sr/rockchip-tool
But what i would recommend is the modded recovery only, with the magisk .zip to use in Recovery
Otherwise you risk flashing a kernel that doesn't match with kernel modules or is otherwise not fully compatible with the installed system
blala said:
If by image you mean firmware image then yes, it can be done with https://github.com/liftoff-sr/rockchip-tool
But what i would recommend is the modded recovery only, with the magisk .zip to use in Recovery
Otherwise you risk flashing a kernel that doesn't match with kernel modules or is otherwise not fully compatible with the installed system
Click to expand...
Click to collapse
boot.img file included recovery+magisk+kernel
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell
Flashing a boot.img (Kernel, for example) in an Android mobile phone via adb shell - script.sh
gist.github.com
MTCD has separate boot and recovery partitions.
Perhaps you can adapt both recovery/kernel to be in the same image but the bootloader won't know about that (and will always boot from "recovery" partition)

Mobile/Android devices architecture

I'm having trouble understanding the architecture of mobile (and Android) devices. I compare it a lot to the design of PCs, laptops, etc, which I know quite well.
Here's my understanding on how PCs work when booting:
​The hardware has firmware stored in ROM (Read Only Memory). Actually, Flash memory is used nowadays, on which the stored content can of course be changed, unlike real ROM memories in the old days. Because the firmware is hardware-specific and its operation is very critical, its content is rarely updated or otherwise changed. Installing new firmware is called flashing. Firmware in a PC is most commonly BIOS or UEFI, the task of which is (briefly) to first run the POST tests, provide some interfaces and finally start the software in the mass storage. By mass storage, I mean memory separate from the firmware's Flash memory, which can also be Flash memory, such as an SSD disk, or a more traditional hard disk.​The BIOS (i.e. firmware) in the specified order (which first is the internal NVMe SSD or the external USB hard disk?) tries to load the software into the RAM memory for execution from mass storage MBR (Master Boot Record) part . Master boot record is a physical defined area in mass storage. Bootloader software is stored on this MBR part.​​When the bootloader (located on the MBR part) is loaded into RAM and run, it knows the contents of the end of the disk and starts the kernel from there.​​The kernel starts (in Linux) the init process, nowadays often Systemd, which starts the rest of the software.​--------------------
What kind of memories and storages are most commonly found in Android devices? One main memory (i.e. RAM)? One Flash memory for firmware (i.e ROM)? Another separate flash drive that acts as mass storage? Possibly SD card and USB stick as external mass storage?
What is firmware on Android devices?
What is the bootloader in (located in MBR part) on Android?
Linux is the kernel used by Android, which is started by the bootloader? After that, Android continues to boot, how?
A pile of terms, which I have ambiguities:
Bootloader; What's it like on Android? It is often characterized as hardware specific. So is it the case that the bootloader in Android is firmware? So in Android, the firmware runs the tasks of the PC world BIOS and bootloader (located in the MBR part), and then starts the Android located on the mass storage?
Recovery; What is this technically?
Android ROM; I can't understand this. As far as I know, Android is an operating system located mass storage, not Read-Only-Memory firmware.
Rooting; On a PC, we are used to the fact that the owner of the device has root rights. Is it just that the manufacturers have decided to set the default root password to some generated random string, and by default, the user only has access to the basic user account?
After the above has been answered, I would like someone to explain to me (separately) technically, starting from the hardware level (where and how), how do Android devices booting and work? Links to additional information are also welcome. hank you very much! If anyone can answer my questions, thank you very much!
Your questions should put you to shame.
Start reading yourself, building up your knowledge as you read.
Anyway, welcome to the forum. After a year of reading, you will laugh at your post.
ze7zez said:
Your questions should put you to shame.
Start reading yourself, building up your knowledge as you read.
Anyway, welcome to the forum. After a year of reading, you will laugh at your post.
Click to expand...
Click to collapse
I know my questions are stupid, but I'm impasse. It seems that there is much less information about designing for mobile devices than PCs. Could you link some articles on this? As the last article I read this, but it didn't help much, because I compare too much what I learned on PCs.
There are no stupid questions, there are only stupid answers.
Start with the basics based on information from google:
Architecture overview | Android Open Source Project
source.android.com
ze7zez said:
There are no stupid questions, there are only stupid answers.
Start with the basics based on information from google:
Architecture overview | Android Open Source Project
source.android.com
Click to expand...
Click to collapse
That is useful, but there is a reason why I asked about mobile/Android device design/architecture. Android itself is as far as I know (if I'm not mistaken) just an operating system, like the desktop operating systems Windows and Ubuntu, but mobile/Android devices are very different from PCs in terms of hardware and firmware. For example: https://www.quora.com/Is-there-anything-like-BIOS-in-mobiles-How-do-they-boot
How long is a huge ball of string?
No simple answer...
This is for those who are new to Android development and basically have NO understanding about the partition structure. I will give a high-level introductory explanation. PC GNU/Linux users: please note this is completely different from x86 (PC Linux) partition table. You will not come across partitions denoted as sda1, sda2, sdb1, sdb2, and so on. Instead, it will be structured as follows:
/boot
This is the partition that has all the data that is necessary for the phone to boot. It includes the kernel and the RAMDISK (these are the only components of the operating system that are stored in this partition. The remaining are stored in /System). Without this partition, the device will simply not be able to boot. Wiping this partition from recovery should only be done if absolutely required and once done, the device must NOT be rebooted before installing a new one, which can be done by installing a ROM that includes a /boot partition.
/system
This partition basically contains the entire operating system, except the kernel and the RAMDISK (as mentioned in /boot explanation). This includes the Android User Interface as well as all the system applications that come pre-installed on the device. Wiping this partition will remove Android from the device without rendering it unbootable, but you will still be able to boot into the /recovery partition to install a new ROM.
/recovery
The recovery partition can be considered as an alternative boot partition that lets you boot the device into a recovery console for performing advanced recovery and maintenance operations on it. Think of this like a proprietary recovery partition that PC companies put on prebuilt PCs. When you flash a custom recovery such as TWRP or CWM, you are overwriting this partition.
/data
Also called userdata, the data partition contains the user’s data – this is where your contacts, messages, settings and apps that you have installed go. Wiping this partition essentially performs a factory reset on your device, restoring it to the way it was when you first booted it, or the way it was after the last official or custom ROM installation. When you perform a wipe data/factory reset from recovery, it is this partition that you are wiping.
/cache
This is the partition where Android stores frequently accessed data and app components. Wiping the cache doesn’t effect your personal data but simply gets rid of the existing data there, which gets automatically rebuilt as you continue using the device.
/misc
This partition contains miscellaneous system settings in form of on/off switches. These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc. This is an important partition and if it is corrupt or missing, several of the device’s features will will not function normally.
/sdcard
This is not a partition on the internal memory of the device but rather the SD card. In terms of usage, this is your storage space to store your media, documents, downloads, pictures, videos, ROMs etc. on it. It is like the equivalent of the ' Users/[Username] ' folder in Windows and ' /home/~ ' folder in x86 Linux. Wiping it is perfectly safe as long as you backup all the data you require from it, to your computer first. Though several user-installed apps save their data and settings on the SD card and wiping this partition will make you lose all that data.
On devices with both an internal and an external SD card – devices like the Samsung Galaxy S and several tablets – the /sdcard partition is always used to refer to the internal SD card. For the external SD card – if present – an alternative partition is used, which differs from device to device. In case of Samsung Galaxy S series devices, it is /sdcard/sd while in many other devices, it is /sdcard2. Unlike /sdcard, no system or app data whatsoever is stored automatically on this external SD card and everything present on it has been added there by the user. You can safely wipe it after backing up any data from it that you need to save.
/sd-ext
This is not a standard Android partition, but has become popular in the custom ROM scene. It is basically an additional partition on your SD card that acts as the /data partition when used with certain ROMs that have special features called APP2SD+ or data2ext enabled. It is especially useful on devices with little internal memory allotted to the /data partition. Thus, users who want to install more programs than the internal memory allows can make this partition and use it with a custom ROM that supports this feature, to get additional storage for installing their apps. Wiping this partition is essentially the same as wiping the /data partition – you lose your contacts, SMS, market apps and settings.
/Boot (Is NOT viewable in Android)
/Recovery (Is NOT viewable in Android)
/Data (Userdata) (Is viewable in Android)
/Cache (Is viewable in Android)
/System (Is viewable in Android)
/Misc (Is NOT viewable in Android)
Ram
https://developer.android.com/topic/performance/memory-management
Understanding Firmware naming:
N986USQU1ATGM
N=Note
986U or F etc, the model of device
SQ, FX etc = CPU and model specific
U,S,E = Update, Security, Engineering, respectively
1,2,3,4,5 etc = bootloader revision (This is important! You cannot go to a previous revision)
A,B,C,D = Android version
T, U = Year (T=2020, U=2021 etc)
A,B,C etc = month (January A - December L)
1 - 9 and then A - Z =build compilation. This basically means how many builds there are in a month. They start at 1 and go to Z
So N986USQU1ATGM would be
N968-U-SQ-U-1-A-T-G-M
N968U (Note 20 Ultra Carrier version), SQ (Snapdragon), U (Update), 1 (Bootloader version), A (Build 10), T (2020), G (July), M (22nd build)
How to enter Download Mode:
Turn off the device.
Connect USB cable to your PC (Leave it disconnected from the phone)
Press and hold down the Volume Up and Volume Down buttons. While they are still pressed, plug in the USB cable into your phone.
The phone will go into download mode press volume up. In Odin you will see that phone is added.
Dirty Flash:
I would only do this if you are having to manually update to the newer firmware and would not do it if you are coming/going to U/U1 or from beta firmware or if you are on an old firmware. I'd also highly recommend doing a back up prior to the doing this
Load these into Odin
BL
AP
CP
HOME_CSC
Do NOT flash CSC or USERDATA, either of these WILL wipe your device
This is a "dirty flash" and these can sometimes cause issues. Keep in mind if things start going sideways and stuff starts not working right, your first step to a solution will be to wipe the device.
Tips on flashing U1 Firmware:
You will have to wipe, can NOT dirty Flash going between U and U1 firmware
Use the patched ODIN linked in post #2 or #3, Odin3_v3.13.3b (They are exactly the same)
Have an active US Carrier SIM installed to get carrier features
If you get your CSC Stuck on XAA/XAA/(Insert your carrier here), and can not get Carrier options back.
PIT files
https://ihax.io/samsung-pit-files-explained
plus_rlus said:
I know my questions are stupid, but I'm impasse. It seems that there is much less information about designing for mobile devices than PCs. Could you link some articles on this? As the last article I read this, but it didn't help much, because I compare too much what I learned on PCs.
Click to expand...
Click to collapse
The are no stupid questions.
Questions are asked when we do not understand something and want to learn.
There is nothing wrong or negative about asking questions.
Questions are a part of how we learn.
Cheers.
plus_rlus said:
<SNIP>
What kind of memories and storages are most commonly found in Android devices? One main memory (i.e. RAM)? One Flash memory for firmware (i.e ROM)? Another separate flash drive that acts as mass storage? Possibly SD card and USB stick as external mass storage?
What is firmware on Android devices?
What is the bootloader in (located in MBR part) on Android?
Linux is the kernel used by Android, which is started by the bootloader? After that, Android continues to boot, how?
A pile of terms, which I have ambiguities:
Bootloader; What's it like on Android? It is often characterized as hardware specific. So is it the case that the bootloader in Android is firmware? So in Android, the firmware runs the tasks of the PC world BIOS and bootloader (located in the MBR part), and then starts the Android located on the mass storage?
Recovery; What is this technically?
Android ROM; I can't understand this. As far as I know, Android is an operating system located mass storage, not Read-Only-Memory firmware.
Rooting; On a PC, we are used to the fact that the owner of the device has root rights. Is it just that the manufacturers have decided to set the default root password to some generated random string, and by default, the user only has access to the basic user account?
After the above has been answered, I would like someone to explain to me (separately) technically, starting from the hardware level (where and how), how do Android devices booting and work? Links to additional information are also welcome. hank you very much! If anyone can answer my questions, thank you very much!
Click to expand...
Click to collapse
Firmware is the hardware specific drivers, library files and other resources that are supplied by the manufacture(s) and are chipset specific.
The firmware is proprietary and normally closed source. Basically the parts that make the hardware work.
The bootloader is what actually boots the device.
This is supplied by the device manufacture(s) and is device specific.
It is separate from the system.​
Recovery is a mini Android environment.
- Factory (Stock) recoveries are restricted to the user but have unrestricted (root) access to the device.
- Custom recoveries (TWRP, OrangeFox, ..) allow the user unrestricted (root) access to the device.
Android ROM (rom) is the actual system (OS) and normally you would include the version that you are running.
Stock roms - Google 12L, AOSP xx, OOS 12, MIUI xx, ColorOS xx, ...
Custom roms - Lineage 19.1, crDroid 12.1, AospExtended 12.1, ...
In computer terms it would be..
Windows 7, Linux (Fedora 34), MacOS Monterey.​I am not sure what the current versions of MIUI and ColorOS are, hence the xx.​
Once the bootloader boots the device, a few things can happen.
- The system boot image (system kernel) takes over and boots the device into system (rom).
- The recovery boot image (recovery kernel) takes over and boots the device into recovery (mini Android environment).
- If system fails to boot, device reboots into recovery (Recovery Party) if recovery can boot.
- If no boot image takes over, you will stay in the bootloader, reboot into some special mode or just a good old fashion boot-loop.
There have been a lot of changes to Android though the years..
Each device, manufacture, Android version.. can be different from another.
The most common bootloader is (or supports) fastboot but, this is manufacture and device specific.
Not to be confused with fastboot_d (new story that started with Android 10/11?).​This has also changed though the years, some manufacture use their own variation of bootloader.
HTC had H-BOOT, Samsung does their own thing along with some other manufactures.
Rooting....
By default the substitute (switch) user su command is removed from Android.
This is what most refer to as superuser since it defaults to root user if you do not specify a substitute user.​
This has been a long and changing story in the Android world also.
Old but, well worth the read.
How-To SU - [chainfire.eu] - Link
The current most popular used root solution is Magisk.
It is a little more than just su. ​Magisk - [GitHub] - Link
---
It might be easier if you see an actual partition table.
Nexus 7 16 Gig WiFi - [PastBin] - Link
Might as well make it an ... interesting one.
In this example, userdata only has 1.2 Gigs since the rest is used by other partitions.
userdata is mounted as /sdcard.​
Save for boot, cache, system, misc, recovery and userdata.
The other partitions would be considered firmware.
When the device boots, the partitions get mounted to /dev/block.
Hope it helps more than confuse.
Cheers.

Categories

Resources