[Q] Flashing system.img to a bricked handset - Hero, G2 Touch Android Development

Ok, now i've read through various magic and dream forums, and i think i've got this, but i wanted to check...it's not my phone and i don't want to get fired
I could tell you all the background that got me to this point, but it's really long winded and would bore you to death.
Basically, i have been given a bricked phone that i need to recover for the company i work for. Someone tried to update it with a heroimg.zip file and it trashed it.
Fastboot and Hboot work fine and i only have the boot.img, system.img and recovery.img files to do it.
If i understand this right, i should be able to flash these img files to the device while in fastboot.
Code:
fastboot flash boot boot.img
fastboot flash system system.img
fastboot recovery recovery.img
fastboot reboot
Should that work? I've happily used the amon RA recovery to do update.zip updates on my own phones, but company procedures and stuff won't let me do anything other than leave it as standard.
I don't claim to understand adb/fastboot really, but i think those are the commands i need to flash the img files across manually.
am i right? Just hoping someone here who is a lot more intelligent than I can just confirm it before i totally kill the damn thing!​

Don't know if this helps, but Paul has the 'stock' shipping (ie unmodified and unrooted) update.zip files on Modaco here
You could use the latest one of these after Fastbooting the latest AmonRA. That way, you're not flashing AmonRA to the device or anything like that. This should give you a stock Hero with no modifications to it.
But then again, your company might not like this either. In that case, I haven't tried those commands, but they should, in theory, work (I've used 1 or 2 to flash a custom boot.img so I could modify the ramdisk, but that's about it for me)

that's why i figured they might work...i've used the boot.img one to flash a recover on mine, but i was just working from a 'how to guide'.
still not got my head around the commands yet. Not as confident playing with these things as i was on WinMo in the past...

any chance you boot the custom recovery from fastboot and flash the update.zip from there?

maddie said:
any chance you boot the custom recovery from fastboot and flash the update.zip from there?
Click to expand...
Click to collapse
TBH, if you're not comfortable with the commands for flashing yet, I would not try and learn on a work phone.
To do it this way, as suggested before, download an update.zip from Modaco for the latest 'stock' official Hero build.
Now download the latest AmonRA recovery image and put it in a folder to hand. Rename it to recovery.img for ease of typing later on.
Install the Android SDK if you don't have it already, and boot the phone to fastboot (Power + Back IIRC)
Now type into a command prompt window
Code:
fastboot devices
and make sure the phone's serial number appears.
Code:
fastboot boot C:\recovery.img
to boot the custom AmonRA recovery image (not the stock one!)
Optional step here is to do a 'wipe' if there is something wrong with the data (user) partition, but this depends on circumstances.
Once in the recovery image, choose to apply a named update file, and point it to the file on the root of the SD Card (put it there from within Windows Explorer. You will need to use a card reader or another phone to do this since this one is 'bricked'.
Now wait patiently for the flash to happen. It is usually done for me in 10 mins when flashing a Modaco ROM, but if it stops working, DO NOT TURN IT OFF OR UNPLUG THE BATTERY!!! (sorry for caps, but it's really important as this seems to be no.1 cause of proper 'bricks')
Phone should then reboot into new ROM.

I should add ... that following the anon2122 guide will leave your phone "stock" as in... there will be no way to tell that anything has been done... no lasting recovery image, a stock ROM etc etc..
anon2122's method is the way to go.
Your method wont work unless the phone has an "S-OFF" SPL... You likely don't! If you happen to ... then your steps will work fine. Although ... You may also need to wipe the user data if the phone doesn't boot after your steps!
Code:
fastboot erase cache
fastboot erase userdata

Thanks for all the tips guys, they did indeed help.
In the end, it turned out that the phone was S-Off, as we do tend to get some test rigs in at various points.
I've got the recovery image already installed on my personal phone, but for various reasons couldn;t use it in this case.
But thatnks for the help, and it's all working now.
And yes, i did need to do a wipe afterwards.
Thanks all. That's some more commands i understand now.

Good to hear that it worked.
Thanks for letting us know, since it is all too often that the OP doesn't let others who may find this thread in future know whether the fix worked or not.

well, that's why i responded. It winds me up no end when people don;t bother to tell you if it worked or not.
And i did learn something new as i was not aware of the erase commands. Yet another thing to add to my little box of tricks....

Related

[Q] assistance with hboot flash

Hi people. I've just s-off'd my phone. I am now desperate to get all the new space.
However, when i try to use the rename to "PM99IMG.zip" etc, the file is not recognised and i have tried every thing else, remamed it without the zip on the on the end used my goldcard. For whatever reason it won't work.
So, i am going to use ADB.
But i ain't confident with this aspect of andriod, never used a command line in my life, apart from creating my goldcard.
I was kind hoping some kind soul would help me out. I know that there are post on this but i cannot figure them out.
For example after cd ing in to sdk tools and then specifying the file path, there is an instruction "Fastboot reboot-bootloader" . Thats all. Is that a command or someting else. I would massively appreciate any help.
Thanx in advance
Well that is a command yes. But first test if fastboot and adb commands is working by entering the following(after cd'ing into the folder):
"adb devices" (done while the device is booted, and should output your device id if working)
If this works, please enter:
"adb reboot bootloader" (this will make the device reboot to bootloader and you should see the fastboot screen)
Now enter:
"fastboot devices" (again you should see your device listed if it works)
If it worked, you can now flash the new hboot:
"fastboot flash hboot bootloader.img"
Where "bootloader.img" is the path to the img file on your computer.(it's VERY important this is a correct hboot image because otherwise you'll end up with a device that won't ever turn on again due to missing bootloader)
edit:
you can now enter:
"fastboot reboot-bootloader" (to reboot the bootloader so now the screen should show the info of your new hboot)
do "fastboot reboot" to go back to system, but you'll probably need to reflash your system after this procedure.
hi,
agree with motenmhp,
a details, he just fogot the following:
fastboot reboot-bootloader
fastboot erase cache
I would advice to use cmd line (faster and easer) however zip from sd-card should be rename. be caution to download the right bootoader as mortenmhp said...
rename the zip file as PB99IMG.zip and reboot. should be detected by bootloader and flash process start from this.
hope this help
However neither is necessary. There should be no reason to clear cache and rebooting the bootloader is just for seeing if it worked(actually never did this myself, but mentioned it in my edit before you posted )
thanx for your quick replys, you guys have helped me on this whole process. much appreciated.
Just wanted to check. In "bootloader.img" i would put "c:\PM99IMG.zip",(i have changed the name and put in the root of my c drive for ease of use). Do i need o add the ".zip" in the command?
Edit:
I have done all of the test steps and every thing is fine! Just about to do the next bit. Thus the clarification.
2nd Edit: After fastboot devices i get "SH117PL08127 fastboot". Is this correct? Sorry, don't mean to be demanding, but really nervous not to mess up my phone!
copernicus666 said:
thanx for your quick replys, you guys have helped me on this whole process. much appreciated.
Just wanted to check. In "bootloader.img" i would put "c:\PM99IMG.zip",(i have changed the name and put in the root of my c drive for ease of use). Do i need o add the ".zip" in the command?
Edit:
I have done all of the test steps and every thing is fine! Just about to do the next bit. Thus the clarification.
Click to expand...
Click to collapse
If you want to flash if with fastboot, then you have to download hboot .img file from Alpharev, flashing .zip under fastboot wont work and might end up really bad...
Just pray to not have power outtage hehehe..
Sorry wrote that wrong. I have downloaded the IMG, just changed the name did not include the zip bit.
copernicus666 said:
2nd Edit: After fastboot devices i get "SH117PL08127 fastboot". Is this correct? Sorry, don't mean to be demanding, but really nervous not to mess up my phone!
Click to expand...
Click to collapse
That's fine dont worry.
Also i dont see why would you be nervous, sometimes im changing hboot few times a week using third party tools lol. (custom hboots)
Really difficult to screw up. ;-)
copernicus666 said:
thanx for your quick replys, you guys have helped me on this whole process. much appreciated.
Just wanted to check. In "bootloader.img" i would put "c:\PM99IMG.zip",(i have changed the name and put in the root of my c drive for ease of use). Do i need o add the ".zip" in the command?
Edit:
I have done all of the test steps and every thing is fine! Just about to do the next bit. Thus the clarification.
2nd Edit: After fastboot devices i get "SH117PL08127 fastboot". Is this correct? Sorry, don't mean to be demanding, but really nervous not to mess up my phone!
Click to expand...
Click to collapse
Well then that is why you couldn't get the zip file working...
There are 2 files on the site. One in zip format for flashing using the "PB99IMG.ZIP" method and one in .img format for flashing using fastboot commands. Renaming the .img to .zip will not make it a zip file.
But just make sure it's the right one you downloaded(the .img one) and don't rename it. If it's the wrong one, it'll just flash it anyway, and you'll end up with a device that will not come back to life.
THANK YOU!! You guy really know your stuff. All done. Gone from s-on to s-ff and oxygen hboot in 24 hrs. Much and much appreciated
Edit: Just seen your post. i double checked and triple check. i had zip for the easy way and then went back and downloaded img for ADB. Just ignore my post there the whole thing was backward. got mixed up for a second by reading the second reply. it mentions zips.
No problem now dont forget to full wipe/factory reset and cache + dalvik wipe in recovery prior to flashing new ROM.
Also when you'll encounter some reception problems (sometimes it happens when you upgrade to Gingerbread with old radio) you might aswell need to update it, you do it same way as hboot just different command.
fastboot flash radio radio.img
Latest radio images can be found on forums.

[Q] Phone only starting in Clockwork and Fastboot

After attempting to install franco kernel, my nexus was stuck at the Google logo upon startup. After attempting to recover via clockwork recovery, I found it to be missing (temporary install perhaps?). Currently I have installed clockwork recovery via nexus toolkit. The problem I am now trying to address is that I have no way of putting .zip files on my phone. Some Google searches did not come up with anything quite like this. I am new to this, so any information is good information. Thanks in advance
luminuss3 said:
After attempting to install franco kernel, my nexus was stuck at the Google logo upon startup. After attempting to recover via clockwork recovery, I found it to be missing (temporary install perhaps?). Currently I have installed clockwork recovery via nexus toolkit. The problem I am now trying to address is that I have no way of putting .zip files on my phone. Some Google searches did not come up with anything quite like this. I am new to this, so any information is good information. Thanks in advance
Click to expand...
Click to collapse
Your boot image is missing...
When your phone boots in bootloadermode, it should (now, anyway) say: boot.img missing. Or something of that nature. Check this, flash it via fastboot, then everything should be back to normal...
EDIT:
It works with both: CDMA & GSM
luminuss3 said:
After attempting to install franco kernel, my nexus was stuck at the Google logo upon startup. After attempting to recover via clockwork recovery, I found it to be missing (temporary install perhaps?). Currently I have installed clockwork recovery via nexus toolkit. The problem I am now trying to address is that I have no way of putting .zip files on my phone. Some Google searches did not come up with anything quite like this. I am new to this, so any information is good information. Thanks in advance
Click to expand...
Click to collapse
do you know how to use fastboot and adb?
Excuse my lack of knowledge, but how exactly do I flash something over fastboot? Thanks in advance again.
Edit: And I do know how to use adb, however it does not connect. I do not know how to use fastboot
After some playing around with fastboot, I now have a basic understanding. However, I am not sure where I should be flashing that file you have linked.
Today, a friend suggested I try mounting via, and copying roms over that way. However, even with all the drivers installed on my computer, I get nothing.
If anyone has ANY insight on this problem, it would be be greatly appreciated. My new toy is a brick at the moment
Thanks in advance!
luminuss3 said:
Today, a friend suggested I try mounting via, and copying roms over that way. However, even with all the drivers installed on my computer, I get nothing.
If anyone has ANY insight on this problem, it would be be greatly appreciated. My new toy is a brick at the moment
Thanks in advance!
Click to expand...
Click to collapse
I'd seriously try to go back to stock first. I'm not a Windows user but if you have adb, fastboot, and your drivers setup, it should be easy. Mark is a great help in this thread and you can use his script I guess:
http://forum.xda-developers.com/showthread.php?t=1400871
You need to also realize that if you have wiped everything to install a new rom, you have nothing to boot to. Also there is install-recovery.sh file that keeps re-writing your recovery to stock erasing custom recovery (CWR) until you rename or erase that file. So going back to stock would be the safest and then you can try again.
You can use adb in recovery and fastboot in bootloader. If you have everything setup correctly (sdk, adb, fastboot, drivers for windows) either of these commands should recognize your phone:
In Bootloader (the first screen you see with big arrow on top):
Code:
fastboot devices
In recovery:
Code:
adb devices
If you don't have a recovery, then use the first one. If you see your phone's serial number like this
Code:
List of devices attached
HT12HS005115 device
you can now use it to flash things onto your phone. As I said I am not a windows user so I can't be specific, sorry. But adb and fastboot, once you are at their prompt, should work the same.
In general, when fastboot is recognizing your phone in the bootloader, you can use:
Code:
fastboot flash zip YOURFILENAME.zip
changing yourfilename of course. This zip file could be a stock imaqe or a custom recovery. Again, you need someone with windows to give you exact steps, this is just general stuff.
if your phone is yakju build then you can get the stock images from google.
download and unzip the files to your fastboot folder and use these commands, the file names in these commands are for the Android 4.0.1 (ITL41F) build so you will have to change the filenames if you use a different build.
Code:
fastboot devices (to make sure your phone is connect to fastboot)
fastboot flash bootloader bootloader-maguro-primekj10.img
fastboot reboot-bootloader
fastboot flash radio radio-maguro-i9250xxkk1.img
fastboot reboot-bootloader
fastboot -w update image-yakju-itl41f.zip

[Q] Completely wiped my One X, cannot mount usb, no backups, need backups

Hello everybody,
This is my first post on XDA, although I've visited the site oftne
Anyways:
Yesterday I successfully rooted my One X and unlocked its bootloader. I also installed CWM recovery.
As the day came to a close I tried to install LC_MOD in an attempt to change the multitasking softkey to a menu button.
I did not make a backup, and the phone had no backups.
Needless to say the phone wouldnt boot. I panicked and in blind fear sortof erased everything off of my phone. everything. What I basically did was i went into advanced settings and formatted my /sdcard and all those other folders, hoping that would solve the issue (a simple data/cache wipe didnt work). So much data has been erased from the phone that I cannot even mount usb storage through CWM because im missing a file.
So, I come to you all, you gods of the tech world, with my head bowed, to ask for your help. I have literally tried everything in my power to fix the issue. I tried to install custom roms manually, that didnt work. I tried to install an RUU, and even that didnt work (the software could not detect my device). This was all made even more difficult because I myself have a mac, and much of the software I had to use was windows based, which led me on a journey to create a virtual machine.
I know i messed up, and what I'm really hoping someone out there cn do is upload one of their own backups of their One X's software, and show me how to use that to restore my phone.
Somebody out there please please help me :'(
Hi;
There is a reason all developers here shout out loud:
1- BACKUP YOUR PHONE BEFORE YOU F*** IT UP
2- DO NOT DO ANYTHING UNLESS YOU ABSOLUTELY KNOW HOW TO
But anyways, you ruined it, you should get it back, Hopefully you did not drain the battery below 30%, in that case keep on reading the next paragraph, but if you dropped the battery below 30, you should go to CWM Recovery, connect your phone to charger, and wait until it's charged properly...
After charging the phone, you need the correct RUU for your phone... As it seems, you don't know what you're doing, so go to fastboot, type this command:
Code:
fastboot oem readcid
Then post the code here in this topic, so someone can help you find the correct RUU for your phone...
After that go to THIS topic and follow the part where it says "If you DON'T have custom rom or Nandroid backup on internal SD card"
Thanks
Thanks a bunch bro!! And ye i get that it was completely my fault. I normally do backup before i do anything, but i guess i was just a bit too anxious. And I think you've told me everything i need to know, ill get that code out to you asap... And you're right, i seriously have no clue what im doing ^.^, I've never F***ed up this hard on any phone before
Xial649 said:
Thanks a bunch bro!! And ye i get that it was completely my fault. I normally do backup before i do anything, but i guess i was just a bit too anxious. And I think you've told me everything i need to know, ill get that code out to you asap... And you're right, i seriously have no clue what im doing ^.^, I've never F***ed up this hard on any phone before
Click to expand...
Click to collapse
Don't worry, with the correct version of RUU you can restore your phone...
Sent from my HTC One X using XDA
Next?
Alright I got the code:
<bootloader> DEBUG: cid: VODAP102
Whats next?
Xial649 said:
Alright I got the code:
<bootloader> DEBUG: cid: VODAP102
Whats next?
Click to expand...
Click to collapse
Your phone is from Voda Germany, and most probabely your correct RUU is this:
Code:
http://www.filefactory.com/file/t7qugfd3ey9/n/RUU_ENDEAVOR_U_ICS_40_Vodafone_CH-DE_1.26.166.2_Radio_1.1204.90.13_release_251279_signed.exe
Download it. Hopefully it would be the correct RUU for your phone.
1- Now open the exe file you just downloaded and make sure that it fully started.
2- Don't click anything, just open "Computer" (formerly known as my computer) in windows and enter %temp% in your address bar.
3- You will now see some folders, just search through these folders for the ROM.zip (using windows search function)
4- When you found it, copy it to your desktop.
5- Extract it with WinRar,7-zip or something like that and take the boot_signed.img and system.img.
6- Now copy the two files into the folder where the fastboot.exe is placed (if you have installed the Android SDK, it should be in platform-tools)
7- Go to your One X, go into the bootloader and go into fastboot mode. then connect your phone to computer.
8- Open CMD and navigate to the folder in which you have the two images and the fastboot file. (using cd command and after that the address you want to go to)
9- Now type in that
Code:
fastboot flash boot boot_signed.img
10- Now this one
Code:
fastboot flash system system.img
if all this is successful, you can just reboot your phone and everything is OK.
If you can't do any of these, let us now, we will help you through it...
Good lock
---------- Post added at 03:52 PM ---------- Previous post was at 03:41 PM ----------
In other note, RUUs are build to do an stand alone recovery of your phone. So you can first try, just running the RUU application and following the instruction given in the RUU. it may work correctly
This is good
Alright so i got everything going after downloading the RUU and it was in the process of restoring my phone, but then it said my battery went below 30% so i needed to recharge. At that point i had to leave, and so I noticed that if i left my phone in the booting animation (HTC logo) the LED light indicated that the phone was charging. Since I wasnt entirely convinced that my CWM recovery was actually charging the phone, i left it on booting while connected to my pc and hopefully itll be fully charged and ready to be restored tomorrow..... I really appreciate all the help you've given me man you've practically saved my life here , and I'd like to say that you've made my first cry for help a simple and smooth one.... Thank you very much my friend :victory: :highfive:
Problem
Ok so we have a new problem, the system.img file didnt flash. I tried and it said "FAILED"
What now??
& is the boot image supposed to only be around 4300 kb?
Could the sending of "system" failed because my phone had less than 30% batterylife???? & if its in Clockworkmod recovery5.8.4 while connected to an outlet will it be charging???
Edit: I've searched around and I saw this one guy who extracted the "boot_signed.img" and the "recovery_signed.img" (NOT the system.img), flashed them onto his phone, locked the bootloader with "fastboot oem lock", and then RAN the RUU..... He said he bricked his phone, and the situation he described is similar to mine. Any thoughts on which method of the two (yours and his) i should use?
Thanks again :3
Xial649 said:
Ok so we have a new problem, the system.img file didnt flash. I tried and it said "FAILED"
What now??
& is the boot image supposed to only be around 4300 kb?
Could the sending of "system" failed because my phone had less than 30% batterylife???? & if its in Clockworkmod recovery5.8.4 while connected to an outlet will it be charging???
Edit: I've searched around and I saw this one guy who extracted the "boot_signed.img" and the "recovery_signed.img" (NOT the system.img), flashed them onto his phone, locked the bootloader with "fastboot oem lock", and then RAN the RUU..... He said he bricked his phone, and the situation he described is similar to mine. Any thoughts on which method of the two (yours and his) i should use?
Thanks again :3
Click to expand...
Click to collapse
That's another method you can try, boot_signed is the stock kernel (and yes it's that small) and the recovery_signed is the stock recovery...
Since my previously mentioned method didn't work, do this:
1- flash the boot_signed.img into your device (fastboot flash boot boot_signed.img)
2- flash the recovery_signed.img in the device (fastboot flash recovery recovery_signed.img)
3- erase cache (fastboot erase cache)
4- lock your phone (fastboot oem lock)
5- now try again to flash the system image (fastboot flash system system.img)
And also, try having around 40% battery to do all this, don't let the battery drops under 30%
ALRIGHT!!!!
alright man!!!! that sounds like a plan... First thing tomorrow I'm going to try this method out.... and btw the RUU you linked me wasnt exactly working right (the software kept saying i had the wrong ruu), so i searched around and found someone with the same CID (VODAP102) and apperantly the uk RUU works fine on it, so i guess ill use that one ye? And btw does the bootloader have to be unlocked before i can flash these items? because i do believe its locked atm....
Xial649 said:
alright man!!!! that sounds like a plan... First thing tomorrow I'm going to try this method out.... and btw the RUU you linked me wasnt exactly working right (the software kept saying i had the wrong ruu), so i searched around and found someone with the same CID (VODAP102) and apperantly the uk RUU works fine on it, so i guess ill use that one ye? And btw does the bootloader have to be unlocked before i can flash these items? because i do believe its locked atm....
Click to expand...
Click to collapse
Your phone is "Vodafone Germany" version and the link I gave you is the "Voda DE" which seems right, but you can try that as well, doesn't heart...
No, for original ROM (RUU) you should have a locked boot-loader, unlocking is just for custom ROMs.
ok
ok so this is what ill do tomorrow:
1) make sure bootloader is unlocked
2) fastboot flash boot boot_service.img
3) fastboot flash recovery recovery_service.img
4) fastboot oem lock
5) fastboot flash system system.img
did i get everything?
Xial649 said:
ok so this is what ill do tomorrow:
1) make sure bootloader is unlocked
2) fastboot flash boot boot_service.img
3) fastboot flash recovery recovery_service.img
4) fastboot oem lock
5) fastboot flash system system.img
did i get everything?
Click to expand...
Click to collapse
The two first commands should work on a LOCKED boot-loader, so I think step 1 would not be necessary... If your phone is locked you should be able to do all steps 2, 3, 5 without problem (step 1 and 4 are the exact opposite of each other and if the phone is locked already I think can be skipped)
ok so its still not working.... I managed to flasht he boot_signed.img and the recovery_signed.img, clear cache and lock the bootloader after it, but i still cannot seem to flash the damn system.img... Any thoughts?
what happens is command prompt stays static for a second and then says sending 'system' (1000596 KB)
FAILED (remore: (00000006))
finished. total time: -0.000s
so? What now??
Xial649 said:
ok so its still not working.... I managed to flasht he boot_signed.img and the recovery_signed.img, clear cache and lock the bootloader after it, but i still cannot seem to flash the damn system.img... Any thoughts?
what happens is command prompt stays static for a second and then says sending 'system' (1000596 KB)
FAILED (remore: (00000006))
finished. total time: -0.000s
so? What now??
Click to expand...
Click to collapse
Any luck in running the RUU itself directly?
i gave up
alright so nothig worked. Not the manual flash, and not the RUU itself. So ive resolved to visit my local help center for HTC devices, and see what they can do, if they cant fix it the least they can do is send it to the german branch for repairs. Thanks for all your help mate, you've really proven to be a great guide, but I guess something just isnt clicking in this case :/.......... i love u man
I'm not sure if this would work.
If you are still htcdev unlocked:
1. Enter bootloader in fastboot usb
2. Fasboot flash recovery -your recovery .img here"
3. Boot into recovery
4. Go to "mounts and storage"
5. Mount SD(I think this is right) and your sd should show up in your pc
6. Copy your rom zips and other zips you need/want
7. Unmount SD
8. By this time you should be able to flash your rom
9. Make sure you flash boot.img again in bootloader.
Hope this helps
Sent from my HTC One X using xda app-developers app
Isn't it mount usb storage?
Sent from my HTC One X using XDA Premium App
You couldn't mount the USB storage / sdcard because you were running CWM from the bootloader. If you connect it to the pc you can put the recovery file you flashed into the fastboot folder and do:
fastboot boot *recoveryfilename*.img
Then you can mount the sdcard etc.
If you have photos and things you don't want an ruu to get ride of, you can fix the ROM. You broke it by trying to install an deodrexed mod for an odexed Rom. If you're interested I can tell you how to fix it.
You could also take this opportunity to install a custom Rom, with which I can also help.

Developer Options Off and no OS. only TWRP.

Hello I have an urgent request. My phone isn't working currently because I tried to switch kernels but ended up flashing the wrong boot.img and was stuck on boot. With g logo.
Now whenever I try to boot system it goes to TWRP. due to bank of America app not allowing developer options, I had it turned off but I know USB debugging was on. When I used Tool All in one, it did recognize my phone but typing adb devices on command prompt doesn't show anything. Please help!!!
Flash magisk
@trizzv: There should be two ways for you to resolve your issue. The first and arguably the least painful is to change your slot and reboot, which you can do in the reboot menu of TWRP. The second is to download the latest full OTA image from Google and flash it through TWRP. And yes, flashing the OTA through TWRP will work, although you will end up losing TWRP and will need to reinstall it after fully booting the system.
@akellar: His boot.img is the wrong one. Flashing Magisk won't help here, based upon what trizzv has said.
Flash flactory image if all else fails. Don't panic. I got into a similar situation.
Strephon Alkhalikoi said:
@trizzv: There should be two ways for you to resolve your issue. The first and arguably the least painful is to change your slot and reboot, which you can do in the reboot menu of TWRP. The second is to download the latest full OTA image from Google and flash it through TWRP. And yes, flashing the OTA through TWRP will work, although you will end up losing TWRP and will need to reinstall it after fully booting the system.
@akellar: His boot.img is the wrong one. Flashing Magisk won't help here, based upon what trizzv has said.
Click to expand...
Click to collapse
I can't drag any files to my phone and right now it doesn't have anything-- magisk, TWRP file, or boot.img
azpatterson3 said:
Flash flactory image if all else fails. Don't panic. I got into a similar situation.
Click to expand...
Click to collapse
What would be the steps? Fastboot? Tried that but I couldn't get it to work
trizzv said:
What would be the steps? Fastboot? Tried that but I couldn't get it to work
Click to expand...
Click to collapse
https://developers.google.com/android/images
If for some reason it won't write and ends with an error. Open the flash script and remove the "-w" on the last line before it says "update"
I wonder, since you can boot into TWRP, if sideloading an OTA image won't fix your boot partition -- as I understand it, OTA's would overwrite and essentially reinstall/reinitialize the boot partition... If others concur or you decide you wish to try this route, say so and I could lay out steps to take...
But, if anything, reboot into Bootloader (can be done from TWRP), open up a command prompt (elevated, or powershell if you're more familiar with), have it directed at your platform-tools folder (or whatever folder you have adb.exe and fastboot.exe), and input the commands
Code:
fastboot --version
and
Code:
adb devices
*to load emulator and such...
if, after all of this, those two commands return info without an error, that should establish that you would be good to go in re-flashing the boot partition (as well as the system, vendor, modem, etc.) without losing any data and, at the very least, confirm that you have fastboot working...
do these and get back to us/me and can take steps from there towards repairing your pixel...
use Deuces Bootloop-Recovery & Flashing Script and just follow instruction :good:
https://forum.xda-developers.com/pi...ol-deuces-bootloop-recovery-flashing-t3704761
simplepinoi177 said:
I wonder, since you can boot into TWRP, if sideloading an OTA image won't fix your boot partition -- as I understand it, OTA's would overwrite and essentially reinstall/reinitialize the boot partition... If others concur or you decide you wish to try this route, say so and I could lay out steps to take...
But, if anything, reboot into Bootloader (can be done from TWRP), open up a command prompt (elevated, or powershell if you're more familiar with), have it directed at your platform-tools folder (or whatever folder you have adb.exe and fastboot.exe), and input the commands and *to load emulator and such...
if, after all of this, those two commands return info without an error, that should establish that you would be good to go in re-flashing the boot partition (as well as the system, vendor, modem, etc.) without losing any data and, at the very least, confirm that you have fastboot working...
do these and get back to us/me and can take steps from there towards repairing your pixel...
Click to expand...
Click to collapse
Please let me know what the steps are. Will try it today.
trizzv said:
Please let me know what the steps are. Will try it today.
Click to expand...
Click to collapse
...the suggestion @goti(0) actually gave is rather simpler, but do require pretty much the same steps (downloading factory image, extracting, placing the files in correct place, etc.)...
What did the commands return when you entered them? I am not reluctant to give you the steps, rather I gave you those commands to narrow down where your issues might be; if your fastboot and emulator aren't set up properly, giving you further steps might carry you down a less-stable and "skewed" path because things would be "based" at it's source incorrectly...
Let us/me know what those commands return and I'll get those steps to ya right away!
goti(0) said:
use Deuces Bootloop-Recovery & Flashing Script and just follow instruction :good:
https://forum.xda-developers.com/pi...ol-deuces-bootloop-recovery-flashing-t3704761
Click to expand...
Click to collapse
THIS WORKED!!!!! THANK YOU so much for the suggestion.
trizzv said:
THIS WORKED!!!!! THANK YOU so much for the suggestion.
Click to expand...
Click to collapse
it was a great suggestion...I'm glad it worked out for you! :victory:
Also you can just reflash corrupt boot.img the original for what image you have. You can load on flash drive through your type c .
There's a lot of ways to fix your stuff

The Complete Noob Guide to Rooting MetroPCS XT1955-5 Qualcomm Variant

This tutorial is for people like me than ran into problems rooting the Moto G7 Power XT-1955-5 (MetroPCS Qualcomm Variant) running on stock Pie. I got two of these literally today brand new in the box after swapping out that mess Samsung Galaxy A20 crap.
Follow the following at your own risk! I am not responsible for any mishaps with your devices. I also don't know if this will work on other variants, as I only have these for MetroPCS, and from my understanding this will NOT obviously work for Verizon, AT&T, and Cricket phones.
I want to thank @diversenerd, and @jhjhjhjhjhjh for their hard work tinkering with the phone as I tried to figure it all out from their notes and instructions. And for the rest of the contributors that I took bits and pieces from that helped me figure out rooting this, as the information wasn't quite clear in some places and I got some bootloops.
Introduction/Preparation
First, go and prepare by READING EVERYTHING IN THIS FORUM. Very important. Don't even jump into this without reading this thread here all the way to the last page: https://forum.xda-developers.com/g7-power/how-to/versions-moto-g7-power-supra-magisk-t3923857 (this is so you know start to finish what worked for some might not work for this variant).
Second, unlock the bootloader. The MetroPCS variant can be unlocked by Motorola; follow their instructions, it's easy peasy. If you do it in firefox it may not go to the third step page and hang on the page where you put the long code in (follow instructions on page to get the unlock code you'll see what I'm talking about). I did it in Firefox this go round and it sent the codes immediately . When you get it, follow Motorola's instructions for unlocking the bootloader in fastboot. It will show you that the bootloader is unlocked.
***NOTES SO YOU DON'T FREAK OUT***
1. Every time you power up the phone after you unlock the bootloader Moto will try and make you feel like crap with a bad key error in the middle of a nice message that your phone is not to be trusted. :laugh: This is normal. Give it a minute, you havent broke it.
2. There is no custom recovery/TWRP for this variant, so read carefully so you don't delete something you might not be able to flash back later.
3. OEM Unlocking toggle switch is interesting. On my first phone it was activated once the bootloader is unlocked and greyed out to where it couldn't be accessed anymore; On the significant other's phone it is still accessible and can be toggled even with the bootloader unlocked.
Files
There is confusion in some of the threads about leaving the Sim Card/SD Card in while flashing. Yes, pull it out and flash without it. Flashing with the sim card/SD card in can cause problems flashing. I did my first phone without it, but forgot to take it out with my second and had to start from scratch. Avoid that step.
1. Get Minimal ADB and Fastboot (it's easier to use than Android SDK and smaller).
2. Download the Motorola Drivers from their site (if you run into problems you will have to uninstall and reinstall them through their utility which is found on PC here: C:\Program Files\Common Files\Motorola Shared\Mobile Drivers
3. Cpu-Z.apk (This is a good thing to have to know your hardware responsibly).
4. Stock Firmware. I used XT1955-5_OCEAN_RETUS_9.0_PPO29.114-63-2_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml which is the US Retail software instead of MetroPCS's firmware because of the issues I was having with it straight out the box. Both of my phones flashed fine with it and you can find it here: https://mirrors.lolinet.com/firmware/moto/ocean/official/RETUS/ I used the 2nd one with success - the first one doesn't play nice with Magisk.
5. MagiskManager-v7.3.2 apk.
6.The Boot .img separately extracted from the Firmware listed in Step 4.
7. Root Checker.apk
8. Patience (and a good movie keeping you going).
Pre-Rooting
1. Make sure the phone is fully charged.
2. Make sure your sim card and SD card is REMOVED from the phone. Again, this is to prevent problems in the flashing.
3. Make sure your wifi is OFF. Every time you wipe the phone or do anything messing with the boot image the phone resets itself to factory settings, and immediately pushes updates galore.
4. Make sure you save Magisk and the Boot .img to your phone directly. Using the Download folder is a great place and easily accessible in Magisk. You will not be able to add files once in fastboot).
5. Make sure your developer options are activated.
6. Make sure your USB debugging is enabled AND you've given permissions for your computer to have administrative access with it enabled (more on this below).
7. Make sure to check CPU-Z for your hardware specs and to make sure you're avoiding potential problems.
8. Make sure you manually set USB to Transfer files (no other option will work and by default its set to Charge this Device). Once you flash, you have to constantly check USB to Transfer because it will not do it.
9. Make sure you have the STOCK CABLE that comes with the phone. This model is funky about using other cables.
10. Make sure you set your display to time out to ten minutes. If the phone screen goes to sleep mode, it may interfere with flashing.
Rooting
Here is the fun part. Please keep in mind you may get a bootloop. I did on both phones on the first try with two different methods. I was on the infamous March 1 2019 security update and still got a bootloop from the patching. The second phone I just flashed ahead of time to the new firmware and still got a bootloop until I flashed again. Expect it.
1. Go into your developer options and DISABLE Automatic Updates. This is important for later on.
2. With the phone on, install Magisk. Make sure you use the version 7.3.2 or update to it since it's the latest version at the time of this guide.
3. Say yes when your phone asks whether or not you want to install things from unknown sources. It will grant access for this application only.
4. Open Magisk Manager and turn on your Wifi. If you don't Magisk will hang at checking updates. If necessary, force close Magisk and open it up again with Wifi on. It should bring you to One Green Check Mark that Magisk Manager is Up To Date, and One Red Mark above it that says Magisk isn't installed.
5. Click install on that tab ONLY (there is no need to click install by the Green Check Mark one). Magisk will then ask you "Do You Want To Install Magisk v19.3(193000) now? and click Install again.
6. Under Select Method, navigate to the folder on the phone where you saved your boot.img file (or whatever you named it). Once you select it you will be taken to a screen where the letters are funky looking but spell FLASHING at the top. Once it patches your file, it will tell you when it's done. Should it hang or you get errors, you WILL HAVE TO REFLASH THE FIRMWARE AND START OVER.
7. When the screen tells you it's all done, plug your phone up to the computer and drag the patched img file (it should by default say magisk_patched.img) and put it in the folder with Minimal ADB and Fastboot.
8. Turn the phone completely OFF.
9. Plug your phone via USB cable into the computer.
10. Press Volume Down and Power to boot into fastboot mode.
11. Open up Minimal ADB and Fastboot (Make sure you don't have it set to open this as an administrator, it messes with permissions) Make sure your boot image file is in the Minimal ADB directory or it won't work.
12. Type "fastboot flash boot thenameofyourrecoveryfile.img" and hit enter.
If all goes well it should flash to "a" partition, and you should see in the command prompt "image signed with key bad key" before it says done. If it doesn't take do not re-flash as it will flash to "b" partition which will definitely bootloop and ensure you have to reflash the firmware.
13. When it is done, reboot phone by selecting START (keep pressing volume rockers until you see it, then press the power button).
14. Wait for the bad key/device cannot be trusted screen to pass (may take a minute) and wait for the Hello Moto opening.
15. Open Magisk Manager. The icons should be in green, letting you know you have root. Follow @diversenerd advice and Click Tap To Start SafetyNet Check. Make sure your Wifi is on for that check. This apparently tests to see if it can deceive Google checks and possibly install OTA (can't say I did all that, not a update junkie).
16. Install Root Checker and confirm root.
17. Disable Updates. I know this is hard for some people, but you dont know if a forced OTA update will take root away, and leave us with no option to get it back or roll back to an earlier version of Pie.
***NOTES SO YOU DON'T FREAK OUT***
1. Do NOT flash someone else's patched boot image. It WILL NOT WORK. Do the work, find your firmware, and patch the boot image yourself. I have no idea why it doesn't work device to device, but it doesn't. And while I thank @jhjhjhjhjhjh for giving up his original files, it was incompatible with my phone (even though we are on the same variant) and bootlooped me.
2. You may have followed everything perfect and it still bootlooped. Save yourself the frustration and just flash it over. See the next section on the proper way to flash so you don't lose your baseband, IMEI, or any other important stuff.
3. You will lose everything datawise flashing and playing with the boot.img. My phone reset itself tinkering with flashing, every time. Don't be alarmed if it takes you through a reset.
4. I wasn't able to confirm by going into updates (couldn't find the system settings) and verifying that nothing said anything about Device Integrity Compromised. I just assumed it.
5. Magisik is TEMPERAMENTAL. So if first you don't succeed, reflash the firmware and try again.
6. You cannot just go into the Stock Rom file and extract the boot.img file, put it in the Minimal ADB file folder and flash it if it bootloops. YOU MUST REFLASH ALL THE FIRMWARE OVER.
****Notes on Flashing The Stock Firmware if you have to****
In the event you bootloop and have to start from scratch, here's what you're going to have to do. And don't worry - it won't relock the bootloader.
1. Make a duplicate folder of Minimal ADB & Fastboot that is clean (doesn't have any boot images or any added files in it).
2. Extract the firmware to the folder where Minimal ADB & Fastboot are at on your computer.
3. Turn the phone completely OFF and back ON if you haven't done so yet. Make sure there is no Sim Card of SD card in it.
4. Press Volume Down and Power to boot into fastboot mode.
5. Plug your phone via USB cable into the computer.
6. Open up Minimal ADB and Fastboot (Make sure you don't have it set to open this as an administrator, it messes with permissions) Make sure all your firmware files have been extracted in the Minimal ADB directory or it won't work.
7. Cut, Copy, and Paste in Fastboot All Together the following:
Code:
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
fastboot flash system_b system_b.img_sparsechunk.2
fastboot flash vendor vendor.img_sparsechunk.0
fastboot flash vendor vendor.img_sparsechunk.1
fastboot flash oem oem.img
fastboot flash oem_b oem_other.img
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot reboot
8. When it is done it will stop on fastboot reboot. Hit enter and the phone will reboot.
9. Repeat all steps in the Pre-Rooting and Rooting section to obtain root.
Hope this helps my fellow MetroPCSers. I boot looped both of my phones this evening and brought them back with this method, and eventually achieved root on the 2nd tries, respectively. Old girl is working and I got Root Explorer and Titanium Backup going full stop. At least this root was easier than on my E4, lol.:laugh:
I will try and answer questions if I can or point you in the right direction.
I believe my boot img was flashed to "b" partition and everything is fine...
do you know a way to sim unlock it?
edwardxi said:
I believe my boot img was flashed to "b" partition and everything is fine...
do you know a way to sim unlock it?
Click to expand...
Click to collapse
Make sure it is okay, because when I flashed it the first time and it flashed to "a" and it bootlooped the Moto intro, I only flashed the boot image again and it flashed to "b" and hung at the "This Device Cannot Be Trusted/Bad Key" Screen.
I have no way to test sim unlock as MetroPCS locks their sims to the phone via IMEI and don't let you hotswap them, mostly to charge you 11 bucks reactivation fee. But in theory it should be sim unlocked by flashing to a different Carrier/Retail Rom, or at least that is how in the more budget line phones it worked.
Articul8Madness said:
Make sure it is okay, because when I flashed it the first time and it flashed to "a" and it bootlooped the Moto intro, I only flashed the boot image again and it flashed to "b" and hung at the "This Device Cannot Be Trusted/Bad Key" Screen.
I have no way to test sim unlock as MetroPCS locks their sims to the phone via IMEI and don't let you hotswap them, mostly to charge you 11 bucks reactivation fee. But in theory it should be sim unlocked by flashing to a different Carrier/Retail Rom, or at least that is how in the more budget line phones it worked.
Click to expand...
Click to collapse
I have been using it for couples of days, and definitely, everything is fine:laugh:
For metro, it's controlled by their Unlock app, you can't simply flash a different rom to unlock it... used to $10 on eBay, now $40... too expensive
edwardxi said:
I have been using it for couples of days, and definitely, everything is fine:laugh:
For metro, it's controlled by their Unlock app, you can't simply flash a different rom to unlock it... used to $10 on eBay, now $40... too expensive
Click to expand...
Click to collapse
Well, on My E4 I was able to unlock it by flashing Lineage Nougat. I could put any sim in it but Metro, because they lock by IMEI. Can't speak for this one, I just jumped back to Metro from Tmobile, who was HIDDEOUS.
Maybe you might get lucky and get some Moto support from Chimera. Then for 11 euro you could unlock it with their tool. But stay on their behinds and make sure its working first.
Articul8Madness said:
Well, on My E4 I was able to unlock it by flashing Lineage Nougat. I could put any sim in it but Metro, because they lock by IMEI. Can't speak for this one, I just jumped back to Metro from Tmobile, who was HIDDEOUS.
Maybe you might get lucky and get some Moto support from Chimera. Then for 11 euro you could unlock it with their tool. But stay on their behinds and make sure its working first.
Click to expand...
Click to collapse
yeah, can't agree more, they are terrible...
@Spaceminer. This is the post I'm talking about
If you want to get rid of the bad key message at boot, you can flash the logo.bin file from the link below with fastboot. Just place the downloaded logo.bin in the minimal adb and fastboot folder, open a cmd window and type fastboot flash logo logo.bin and press enter. Next boot you should have a plain white screen with a large black moto symbol instead.
https://forum.xda-developers.com/g7-power/themes/remove-bad-key-start-boot-t3947359
Going to root mumy G7 power from metroPCS. Can anyone confirm is there a way to SIM unlock after root?
aggresive said:
Going to root mumy G7 power from metroPCS. Can anyone confirm is there a way to SIM unlock after root?
Click to expand...
Click to collapse
There is no SIM unlock per se with MetroPCS. They tie their SIMS into the IMEI of the phone you're using. So you can't just take the sim out and put it in another phone easy peasy without going through them and paying them to do it.
However, if a custom rom comes out, which will happen once we get a TWRP, you'll be able to do that probably on Lineage. But until then, there will be no confirmation.
Beetle84 said:
If you want to get rid of the bad key message at boot, you can flash the logo.bin file from the link below with fastboot. Just place the downloaded logo.bin in the minimal adb and fastboot folder, open a cmd window and type fastboot flash logo logo.bin and press enter. Next boot you should have a plain white screen with a large black moto symbol instead.
https://forum.xda-developers.com/g7-power/themes/remove-bad-key-start-boot-t3947359
Click to expand...
Click to collapse
This is correct and I have contributed my custom made logo.bin image on said thread, even though you can still see bad key its cute, lol.
i got it all rooted but now it shows i have no imei and sim status not available any suggestions do i need to flash modem or radio
626jose said:
i got it all rooted but now it shows i have no imei and sim status not available any suggestions do i need to flash modem or radio
Click to expand...
Click to collapse
try
Code:
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
Thanks figured it out i used the 2nd download like the op said. I didnt check to see if it was the same version i was on so it bootlooped and i flashed the whole thing so i downloaded the original firmware reflashed it that didnt work so i let it update and it came back good as new. So for anyone else doing this make sure its the same version youre on i found it on a different site just google it
626jose said:
Thanks figured it out i used the 2nd download like the op said. I didnt check to see if it was the same version i was on so it bootlooped and i flashed the whole thing so i downloaded the original firmware reflashed it that didnt work so i let it update and it came back good as new. So for anyone else doing this make sure its the same version youre on i found it on a different site just google it
Click to expand...
Click to collapse
I used the RETUS version and didn't have that problem; are you sure you didn't accidentally click the wrong version and flashed that (like a CDMA version)? At any rate, glad you got it back. Interesting you updated....I NEVER EVER EVER EVER do that because updating can break root if the manufacturer patches it.
Also, make sure you are on the OS version March1st; I didn't update my phone and used that stock.
Articul8Madness said:
I used the RETUS version and didn't have that problem; are you sure you didn't accidentally click the wrong version and flashed that (like a CDMA version)? At any rate, glad you got it back. Interesting you updated....I NEVER EVER EVER EVER do that because updating can break root if the manufacturer patches it.
Also, make sure you are on the OS version March1st; I didn't update my phone and used that stock.
Click to expand...
Click to collapse
Yep made sure to follow everything word for word pretty sure thats why it bootloops the 1st time then after you flash the whole thing it works ive looked at them and the one that matches my firmware is the last 1 with the 2nd one i had 2 unlock apps one from metro and one from tmobile idk if thats your case or something didnt flash right or dirty flashed i was wondering also if that twrp river works has anyone tried it or is there twrp for this device and is there a way to rewrite the imei using adb or some other way
626jose said:
Yep made sure to follow everything word for word pretty sure thats why it bootloops the 1st time then after you flash the whole thing it works ive looked at them and the one that matches my firmware is the last 1 with the 2nd one i had 2 unlock apps one from metro and one from tmobile idk if thats your case or something didnt flash right or dirty flashed i was wondering also if that twrp river works has anyone tried it or is there twrp for this device and is there a way to rewrite the imei using adb or some other way
Click to expand...
Click to collapse
@Geofferey has created an unofficial TWRP here https://forum.xda-developers.com/g7-power/development/port-twrp-g7-power-t3963738
Warning: DO NOT USE RIVER twrp - Our device is Ocean and River will Bootloop and possibly brick it.
We can't rewrite the imei or any of that yet - we still are working on custom roms. I've been trying to make stock roms for our variant, but unlike the old Moto I had, the new android OS has new permissions and all that with Pie and it keeps messing up on the porting.
Well after installing adaway and it not working i tried uninstall phone froze so i turned it off by holding the power button now its stuck in a bootloop idk if it finally ran out of power everytime i shut it off it kept rebooting can i recover without reflashing everything or do i have to start from scratch tia for the help
626jose said:
Well after installing adaway and it not working i tried uninstall phone froze so i turned it off by holding the power button now its stuck in a bootloop idk if it finally ran out of power everytime i shut it off it kept rebooting can i recover without reflashing everything or do i have to start from scratch tia for the help
Click to expand...
Click to collapse
I've never had that problem before, so I'll give my suggestions.
1. Try a factory restore from the Fastboot Menu. That may set everything easy peasy BUT it will wipe the phone.
2. If #1 doesn't work, then see if you can just reflash the magisk patch. That may do it.
3. If #1 and #2 don't work, then yeah, back to the drawing board.
Adaway maybe messed with Magisk; did you set the proper permissions in Adaway to give it root access? Anybody else care to weight in?
I'm not able to upload Magisk or boot.img directly to moto g7 phone from computer through Windows. I can transfer both to SD card, but doesn't allow access directly to phone file directly. Yes, bootloader is unlocked.

Categories

Resources