I F*cked up! Help me please?

maserati2011

Senior Member
Aug 10, 2014
91
1
0
Long story short bought a G5 Cedric running latest official firmware oreo 8.1, didn't like it cuz it's too heavy, unlocked the bootloader, flashed twrp then flashed lineage 17 but can't pass safetynet,(clean) flashed resurrection remix after same problem, then i flashed omni rom and suddenly my IMEI was gone and can't install gapps, what to do now? I just want a good custom rom that passes safetynet, don't care if it's pie or Q.
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Flash a rom where imei works
Backup efs partition using 64bit twrp
You can then restore efs partition if you loose imei


With regards to safetynet none of the custom roms will pass without you doing some work
You need to flash magisk
Flash Busybox magisk module
Flash props config module and follow all the instructions on how to change device fingerprint eg to a pixel 4 https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228/
Hide magisk manager with a random package name from magisk settings
Hide app that detects root with magisk hide from its settings

You can also try the universal safetynet patcher magisk module if the above doesn't work but some report it causes bootloops on some devices/roms
 
Last edited:
  • Like
Reactions: maserati2011

maserati2011

Senior Member
Aug 10, 2014
91
1
0
Thank you for the quick response, i have a few questions regarding what you said:

1- how will i know which rom to flash where the IMEI works before flashing the actual rom itself?
2- how do i know if my current twrp is 64bit or not? it's the one from the Lineage 17 thread.
3- when im succesfull in executing those steps and i have to back up efs, where can i find it to restore it if i flash another rom again? because last time before flahsing i wiped system,dalvik & Cache & data but not the storage and yet my back-up was gone?


Flash a rom where imei works
Backup efs partition using 64bit twrp
You can then restore efs partition if you loose imei


With regards to safetynet none of the custom roms will pass without you doing some work
You need to flash magisk
Flash Busybox magisk module
Flash props config module and follow all the instructions on how to change device fingerprint eg to a pixel 4 https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228/
Hide magisk manager with a random package name from magisk settings
Hide app that detects root with magisk hide from its settings

You can also try the universal safetynet patcher magisk module if the above doesn't work but some report it causes bootloops on some devices/roms
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London
Thank you for the quick response, i have a few questions regarding what you said:

1- how will i know which rom to flash where the IMEI works before flashing the actual rom itself?
2- how do i know if my current twrp is 64bit or not? it's the one from the Lineage 17 thread.
3- when im succesfull in executing those steps and i have to back up efs, where can i find it to restore it if i flash another rom again? because last time before flahsing i wiped system,dalvik & Cache & data but not the storage and yet my back-up was gone?
1 - You will have to try roms yourself to find out
2 - All custom roms from oero onwards are 64bit - you wouldn't be able to flash them without a 64bit twrp so you already have one
3 - data/media/twrp/backups or storage/emulated/0/twrp/backups
I recommend changing the storage location to your sdcard so they don't get deleted when you wipe data or transferring to a pc

Formatting data is effectively formatting internal storage as the device is encrypted
 
Last edited:

maserati2011

Senior Member
Aug 10, 2014
91
1
0
1 - You will have to try roms yourself to find out
2 - All custom roms from oero onwards are 64bit - you wouldn't be able to flash them without a 64bit twrp so you already have one
3 - data/media/twrp/backups or storage/emulated/0/twrp/backups
I recommend changing the storage location to your sdcard so they don't get deleted when you wipe data or transferring to a pc

Formatting data is effectively formatting internal storage as the device is encrypted

I'm currently sticking with m_vaisakh's AOSP-10 as it shows both my IMEI numbers, its also the most stable and reliable out of the Android 10 roms for the G5 CEDRIC, i do have a problem though: i tried 2 simcards in the dual sim function and they both worked but no 4G, just 3G/HSPA+ both SIM-1 & SIM-2, how can i fix this issue?
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London

I'm currently sticking with m_vaisakh's AOSP-10 as it shows both my IMEI numbers, its also the most stable and reliable out of the Android 10 roms for the G5 CEDRIC, i do have a problem though: i tried 2 simcards in the dual sim function and they both worked but no 4G, just 3G/HSPA+ both SIM-1 & SIM-2, how can i fix this issue?
fastboot erase modemst1
fastboot erase modemst2
fastboot reboot

If rebuilding the efs doesn't work I do not know

Backup efs first incase it fails to rebuild and imei is 0 again - use a twrp 64 bit to back it up and obviously save to sdcard & pc incase you need to re-flash rom as wiping data will erase your backup on internal storage
 
Last edited:
  • Like
Reactions: maserati2011

maserati2011

Senior Member
Aug 10, 2014
91
1
0
fastboot erase modemst1
fastboot erase modemst2
fastboot reboot

If rebuilding the efs doesn't work I do not know

Backup efs first incase it fails to rebuild and imei is 0 again - use a twrp 64 bit to back it up and obviously save to sdcard & pc incase you need to re-flash rom as wiping data will erase your backup on internal storage

it didn't work as my IMEI was 0 on both sims, thankfully i backed up EFS before erasing, so I managed to restore the IMEI again.

Is there really no other way to get 4G back?
 

riyan65

Senior Member
Mar 22, 2018
797
215
0
I was using m_vaisakh's AOSP_10 where i retrieved my IMEI (after losing it on different roms) i tried both sims and had only 3G no 4G.

Now i have switched to OfficerJimLahey's CarbonROM_7 Android_9 both my IMEI numbers show but i haven't tested 4G with simcards yet.
If it doesn't work in rom then move back to stock Oreo and once you got the 4g take backup of efs and persist and move to custom ROM. If the 4g is available then no need to restore backup, if not restore the backup and enjoy 4g.
 

maserati2011

Senior Member
Aug 10, 2014
91
1
0
If it doesn't work in rom then move back to stock Oreo and once you got the 4g take backup of efs and persist and move to custom ROM. If the 4g is available then no need to restore backup, if not restore the backup and enjoy 4g.
How do i do that? using the Lenovo Moto Smart Assistant?
 

maserati2011

Senior Member
Aug 10, 2014
91
1
0
Flash stock rom firmware via fastboot

Stock rom firmware is available via
https://mirrors.lolinet.com/firmware/moto/cedric/official/

If you don't know what one to choose I suggest latest retail

If you don't know how to flash stock firmware via fastboot Google is your friend

i have flashed stock rom using Lenovo Moto Smart Assistant, IMEI is there, 4G works, how can i relock the bootloader from here? cuz i wanna sell the device.
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London

i have flashed stock rom using Lenovo Moto Smart Assistant, IMEI is there, 4G works, how can i relock the bootloader from here? cuz i wanna sell the device.
I wouldn't re-lock it for several reasons

1- you need the unlock code to unlock it again & Motorola will say its already been unlocked
2 - Even if you re-lock it it will still display its been unlocked previously
3 - if you ever need to flash stock firmware via fastboot again it may fail with permission denied as the firmware may not be fully signed & you can't flash unsigned firmware with a locked bootloader
4 - if you ota update & it it fails & you hardbrick then again same as point 3

If you really want to Google how to & you need fully signed firmware else it will not lock
 

maserati2011

Senior Member
Aug 10, 2014
91
1
0
I wouldn't re-lock it for several reasons

1- you need the unlock code to unlock it again & Motorola will say its already been unlocked
2 - Even if you re-lock it it will still display its been unlocked previously
3 - if you ever need to flash stock firmware via fastboot again it may fail with permission denied as the firmware may not be fully signed & you can't flash unsigned firmware with a locked bootloader
4 - if you ota update & it it fails & you hardbrick then again same as point 3

If you really want to Google how to & you need fully signed firmware else it will not lock

I'm going to respond to each point you mentioned:

1- I still have the email from Lenovo containing the unlock code, do i need the same code to relock the bootloader?
2-are you sure it will still say it's been unlocked before?
3-what does fully signed mean? i searched through the link you sent me earlier and i found the same one that i flashed through LMSA, that is XT1676_CEDRIC_RETEU_DS_8.1.0_OPP28.85-19-4-2_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip is the one I flashed through LMSA not fully signed?
4-there's no updates anymore after the version i mentioned in point 3.

side question: does this method you mentioned still applies to relock the bootloader without the aforementioned issues?

PS: it still says ID: bad key on the bootloader unlocked warning, even though i retrieved my IMEI number, shouldn't it display my IMEI number instead of bad key?
 

TheFixItMan

Senior Member
Jul 8, 2012
7,654
3,922
253
London

I'm going to respond to each point you mentioned:

1- I still have the email from Lenovo containing the unlock code, do i need the same code to relock the bootloader?
2-are you sure it will still say it's been unlocked before?
3-what does fully signed mean? i searched through the link you sent me earlier and i found the same one that i flashed through LMSA, that is XT1676_CEDRIC_RETEU_DS_8.1.0_OPP28.85-19-4-2_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip is the one I flashed through LMSA not fully signed?
4-there's no updates anymore after the version i mentioned in point 3.

side question: does this method you mentioned still applies to relock the bootloader without the aforementioned issues?

PS: it still says ID: bad key on the bootloader unlocked warning, even though i retrieved my IMEI number, shouldn't it display my IMEI number instead of bad key?
You don't need code to lock bootloader - just to unlock it
Yes the bootloader will display its locked but will also give a status code that states its been previously unlocked

Fully signed means each part of the firmware has been signed by Motorola - sometimes the boot.img isn't

You will always get bad key or n/a with an unlocked bootloader - this is normal - you can flash a modded logo.bin to replace this

Those are the steps to re-lock the boot-loader - obviously oreo firmware has more sparsechunk so add the extra parts
 

maserati2011

Senior Member
Aug 10, 2014
91
1
0
You don't need code to lock bootloader - just to unlock it
Yes the bootloader will display its locked but will also give a status code that states its been previously unlocked

Fully signed means each part of the firmware has been signed by Motorola - sometimes the boot.img isn't

You will always get bad key or n/a with an unlocked bootloader - this is normal - you can flash a modded logo.bin to replace this

Those are the steps to re-lock the boot-loader - obviously oreo firmware has more sparsechunk so add the extra parts
So basically i should leave it unlocked it's better this way yes? and if i want to flash a modded logo.bin do i need to flash TWRP again?