need help with shell coding - One (M8) Q&A, Help & Troubleshooting

need help with some shell coding
somebody pls help me why this code is not working in recovery
(1)
aim- to rename m8,s boot sound from mp3 to mp3.bak
sed -i 's/HTC_Sense5_Boot.mp3/HTC_Sense5_Boot.mp3.bak/g' /system/customize/resource;
or
mv HTC_Sense5_Boot.mp3 HTC_Sense5_Boot.mp3.bak /system/customize/resource;
file is located in /system/customize/resource in htc m8
(2)
aim-add a new line media _rw to get sd card write access
sed -e '/WRITE_EXTERNAL_STORAGE" >$/N;s/\n\(\([ \t]*\)<group gid="sdcard_rw".*$\)/\n\2<group gid="media_rw" \/>\n\1/' -i /system/etc/permissions/platform.xml
file is located in /system/etc/permissions/platform.xml in htc m8
(3)
and this also not working
aim-rename a string in build prop
sed -i 's/ro.product.device=htc_m8/ro.product.device=htc_One/g' /system/build.prop;
sed -i 's/ro.build.product=htc_m8/ro.build.product=htc_One/g' /system/build.prop;
file is located in /system/build.prop in htc m8
(4)
is there any editor to find coding mistakes in .sh programs which we run in update zip
(5)
how to rename a system file call ime.apk to ime.apk.bak by a shell and by edify want to know both ways
file is located in /system/app/ime/ime.apk in htc m8
device-htc one m8 international
os-lollipop
skin-sense 6
kernel and rom-stock dev edition 4.16.1540.8
bootloader-unlocked
security status-S-off
recovery i use-twrp 2.8.7.0.
i already post it in question answer thread but no luck:crying:

to be honest, i havent looked at your script code, but if you're changing things in the /system partition you'll need to mount the partition first, twrp usually doesnt mount system by default,
and also be careful about the 2.8.7 series, even if mounting, it may only mount is as read only (if it's a stock system partition)

nkk71 said:
to be honest, i havent looked at your script code, but if you're changing things in the /system partition you'll need to mount the partition first, twrp usually doesnt mount system by default,
and also be careful about the 2.8.7 series, even if mounting, it may only mount is as read only (if it's a stock system partition)
Click to expand...
Click to collapse
thank you for reply
i somehow managed to make them work accept media rw code

shikhar.bagde said:
thank you for reply
i somehow managed to make them work accept media rw code
Click to expand...
Click to collapse
easiest way, is to test it in an "adb shell"
but briefly looking at the various things, your point (3) about device/product isnt the best idea imho.... someone using "automated apps", such as flashify or whatever, may end up with a brick there

nkk71 said:
easiest way, is to test it in an "adb shell"
but briefly looking at the various things, your point (3) about device/product isnt the best idea imho.... someone using "automated apps", such as flashify or whatever, may end up with a brick there
Click to expand...
Click to collapse
because those apps will think its a htc one not htc one m8 with diffrent partition table oh my god never thought about that
thanks you save me

shikhar.bagde said:
because those apps will think its a htc one not htc one m8 with diffrent partition table oh my god never thought about that
thanks you save me
Click to expand...
Click to collapse
sure no problem,
depending on the app and how it reads the information, it may even get the partition correct, but would likely still mess up... for example, I tested an app quite a while ago (can't remember which), I changed the build.prop to look like an M8 on my M7, it got the M7 recovery partition correct, but downloaded the M8 recovery ... oops

Related

How to change the boot images without ADB?

How would it be able to do this? I've seen terminal codes floating around, but none of them look like they'd be replacing the proper files for a cupcake build (old RC33 builds I believe, long lost now!)
I'm running TheDude's 1.3 RC2. I've seen plenty of ADB commands, however I've never been able to get ADB to work on my computer, and I don't feel like putting more pointless hours into it
So how would the terminal commands work, and what would the pre-requisites for the files have to be? Thanks!
http://forum.xda-developers.com/showthread.php?t=467693 Im pretty sure all you need is fastboot not adb for splash1 the animated splash just requires you to resign an update.zip http://forum.xda-developers.com/showthread.php?t=467693
crotalusfreak said:
http://forum.xda-developers.com/showthread.php?t=467693 Im pretty sure all you need is fastboot not adb for splash1 the animated splash just requires you to resign an update.zip http://forum.xda-developers.com/showthread.php?t=467693
Click to expand...
Click to collapse
I'm pretty sure it uses ADB, hence why I'm asking...Fastboot IS ADB
yea fastboot is the only other way that I know of!!
this is where i downloaded the tools for creating your own boot image!
http://www.modmygphone.com/forums/downloads.php?do=file&id=1471&act=down
this is the link that teaches on how to make one and im pretty sure there is one here in the forums!
http://modmygphone.com/forums/showthread.php?t=10461
if you need help PM me ill take you step by step!
or email [email protected]
lukekirstein said:
I'm pretty sure it uses ADB, hence why I'm asking...Fastboot IS ADB
Click to expand...
Click to collapse
it wont use ADB, fastboot is like an alternate route...
Drizzy Drake Rogers said:
yea fastboot is the only other way that I know of!!
this is where i downloaded the tools for creating your own boot image!
http://www.modmygphone.com/forums/downloads.php?do=file&id=1471&act=down
this is the link that teaches on how to make one and im pretty sure there is one here in the forums!
http://modmygphone.com/forums/showthread.php?t=10461
if you need help PM me ill take you step by step!
or email [email protected]
Click to expand...
Click to collapse
Step number two of those directions: "2. Get ADB setup and working. Read here. "
Let's clarify. I cannot get ADB to work, at all, on my computer. Fastboot doesn't work because I can't get ADB to work. Moreso, I just realized that I can't even find my data cord.
Either way, the point of my post is to find a way to change the boot animation at start up, without having to use anything but the phone and maybe some photo editing software.
So how can we do this?
You do not have to have the whole sdk(adb etc..) for fastboot to work you do have to have a driver running for android found in the sdk or here http://dl.google.com/android/android_usb_windows.zip .
The boot animation is found in /system/framework/framework-res.apk/assets/images,android-logo-mask.png and android-logo-shine.png are the images you wanna edit.Dont believe you can get it back on your phone without the sdk set up with adb working though as you will either have to resign an update or push the edited files back somehow.
Edit:without a data cord I think this is an impossibility I dont think you can go through the process needed on your phone,dont hold me to that though good luck man.
crotalusfreak said:
You do not have to have the whole sdk(adb etc..) for fastboot to work you do have to have a driver running for android found in the sdk or here http://dl.google.com/android/android_usb_windows.zip .
The boot animation is found in /system/framework/framework-res.apk/assets/images,android-logo-mask.png and android-logo-shine.png are the images you wanna edit.Dont believe you can get it back on your phone without the sdk set up with adb working though as you will either have to resign an update or push the edited files back somehow.
Edit:without a data cord I think this is an impossibility I dont think you can go through the process needed on your phone,dont hold me to that though good luck man.
Click to expand...
Click to collapse
Alright, I just confirmed the location on the phone. So if I upload a file onto my SD card, and overwrite it through Terminal, what do you think that'll do? I'm not big into the Themes section, I'm into the Development section, so I'm not sure what overwriting will do to my phone.
Actually you might be able to get away with that.Try backing up framework res in terminal type:
$su
#mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
#cp -r /system/framework/framework-res.apk /sdcard
Now the .apk you want is on your sdcard root pull that onto a computer unzip it with 7zip.In the framework-res folder there are some more folders go to assets then images edit those two images to your liking.Then go back to your framework-res.apk that you backed up add .zip to the end,right click it and choose open or explore navigate back to the images folder and paste your edited boot images in there.Now remove .zip so it is framework-res.apk again put that back on your sd cards root.Go to terminal and type
$su
#mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
#cp -f /sdcard/framework-res.apk /system/framework
#reboot
If all goes well that should work.
crotalusfreak said:
Then go back to your framework-res.apk that you backed up add .zip to the end,right click it and choose open or explore navigate back to the images folder and paste your edited boot images in there.Now remove .zip so it is framework-res.apk again put that back on your sd cards root.
Click to expand...
Click to collapse
Lost you at naming it as a .zip. I can't explore or open the file, as Windows Vista doesn't know how to handle it. Any ideas?
lukekirstein said:
Lost you at naming it as a .zip. I can't explore or open the file, as Windows Vista doesn't know how to handle it. Any ideas?
Click to expand...
Click to collapse
right click-> open with -> WinRAR
Or go to Folder Options and uncheck "Hide extensions for known filetypes" (you should do that for all folders.... its a bad idea not to because a virus may look like *.doc instead of *.doc.exe anyways its also more convenient)
does anyone know how to change the boot image for a rogers g1 none of these things work for me i bricked my last phone a week ago cause someone said it would work
jokefox said:
does anyone know how to change the boot image for a rogers g1 none of these things work for me i bricked my last phone a week ago cause someone said it would work
Click to expand...
Click to collapse
Well if you're bricking phones, I wouldn't recommend trying it again

Busybox?

Root from Paul didn't come with one, and seeing as we can't get full system access (from what i understand) im curious as to if we can actually get busybox?
The 'busybox on rooted desire' on MoDaCo didn't help at all.
I've installed bb via Titanium, yet Metamorph didn't recognise it anywhere.
Cheers in advance for help
It comes with A2SD - but you can push the busybox binary to /system while the phone is in recovery.
If you pushed bb yourself, use its absolute path (like /data/somewhere/busybox) or put its path in your $PATH to get it going. I personally, without root, put busybox in the free-to-write-to /sqlite* directory (I put * because I don't recall the full name) and it runs fine from there.
do you have a link to apps2sd & does it come with a guide as to how to install it so noobs can understand?
A2SD was taken down "temporarily".
http://android.modaco.com/content/h...ide-now-with-new-improved-easier-root-method/
Sorry
Although this still seems to work:
http://android.modaco.com/content/htc-desire-desire-modaco-com/307398/apps2sd-miniguide/
LeszekSwirski said:
Although this still seems to work:
http://android.modaco.com/content/htc-desire-desire-modaco-com/307398/apps2sd-miniguide/
Click to expand...
Click to collapse
Bare in mind I think it was taken down as (for some) it 'removed root' and also got some phones stuck in a reboot loop. Bad times.
GANJDROID said:
Root from Paul didn't come with one, and seeing as we can't get full system access (from what i understand) im curious as to if we can actually get busybox?
The 'busybox on rooted desire' on MoDaCo didn't help at all.
I've installed bb via Titanium, yet Metamorph didn't recognise it anywhere.
Cheers in advance for help
Click to expand...
Click to collapse
You didn't read to the end of that thread
* install Titanium
* run Titanium
* click the "problems" button and install Busybox
* boot into recovery
* adb shell from my Mac
* mount /system
* cp /data/data/com.keramidas.TitaniumBackup/files/busybox /system/bin
* cd /system/bin
* ./busybox --install -s .
Click to expand...
Click to collapse
By what I've read, though, Metamorph dies on its arse because of the lack of system rw access.
Loccy said:
You didn't read to the end of that thread
Click to expand...
Click to collapse
Aye, I read that, but no Mac, and I can't get to the folder where Titanium saved bb to (assuming that because it's not on the sd card in any data or the titanium folders) the phone system(?)
jayshah said:
Bare in mind I think it was taken down as (for some) it 'removed root' and also got some phones stuck in a reboot loop. Bad times.
Click to expand...
Click to collapse
Had heard about that, but I think he may be working for a solution?
From what I can remember from the rooting guide he said it was 'currently unavailable'
GANJDROID said:
Had heard about that, but I think he may be working for a solution?
From what I can remember from the rooting guide he said it was 'currently unavailable'
Click to expand...
Click to collapse
Yeah, hence it's hopefully only temporary.
GANJDROID said:
Aye, I read that, but no Mac, and I can't get to the folder where Titanium saved bb to (assuming that because it's not on the sd card in any data or the titanium folders) the phone system(?)
Click to expand...
Click to collapse
Install Titanium. Then get your phone into recovery using Paul's Linux ISO. In the Linux console (i.e. where you'll have typed ./step2.sh to get the recovery up), you should be able to do adb shell from there. Then follow my instructions from mount /system onwards.
I didn't follow Pauls guide as I only have access to Windows, so I used the lanarchy guide, which I think might have been taken from The Unlockr.
Maybe fill me in w/ bb according to that?
i am a bit ashamed to ask this but:
....
* boot into recovery
* adb shell from my Mac
* mount /system
....
boot into recovery -> ok
adb shell from mac.. ok? hm, i have macos as a seperate installation and i used it for rooting, so there is a pushfiles folder with recovery-mac.sh.. sudo ./recovery-mac.sh?
How do i mount /system then? Don't know where to navigate to find access to the sdcard . @volumes there are only my harddrive partitions, can't see the sdcard?
No idea, sorry, first time (ok, second time after root) i get in touch with adb, mac, sudo wtf?
Ok, all you need is some kind of environment where adb actually works.
Get your phone into recovery (the green menu screen) using whatever means or method you have.
Then, if you have Windows, you'll need the Android SDK. Ditto on a Mac. Anything with adb so that you can plug your device into your computer, do adb shell, and get a shell window up. Then
mount /system
onwards.
The key is that your phone needs to be in recovery before you do adb shell, otherwise you have no r/w access to /system.
ah! ok, perfect. The android sdk is on my windows computer, the push-files on my mac, that's the problem
thanks for your help!
the recovery is not the problem, but mount /system did nothing because there is no android sdk on my mac.. got it now i think.
mount system -> ok
copy busybok -> ok
when i try to install i get dozens of lines with "no such file or directory".
reboot -> phone not booting, hangs when displaying the HTC Logo omg
flash rom again?
same problem as watercool. Loads of "No such file or directory" messages.
But, I rebooted and it went through as normal, booted the OS fine.
hm, dont want to wipe again, pff..
flashed AhmgskMod mod again without wiping, everything ok now
watercool said:
mount system -> ok
copy busybok -> ok
when i try to install i get dozens of lines with "no such file or directory".
reboot -> phone not booting, hangs when displaying the HTC Logo omg
flash rom again?
Click to expand...
Click to collapse
Sounds like you missed the . off of the end of the
./busybox --install -s .
command.
You need that . if you're following my instructions.
ok, i did it with and without the "."
With the dot there was no response (so probably it installed correctly?).
Anyway it didn't boot afterwards. i will try it again
edit: ok, tried again and my phone stucks @ htc screen
i think busybox is installed but for some reason it doesn't boot (using the ahmgsk mod)
anyway, thanks for your kind help!

Remove ALL Sprint Crapware? (Q from an ex-WinMo Poweruser)

I moved from an HD2 to the Evo this week (no more TMobile, woot!). I am very familiar with custom WMO ROMS, Hard SPL, blah blah...
I have nearly zero Android development, custom ROM knowledge, etc, however.
I'd like to flash a custom ROM based on the factory, without all the Sprint programs preloaded.
Clearly I need to root; I am on steady ground with that knowledge. After that? Not so clear. There doesn't seem to be a thread with the steps I need to proceed.
Any info would be invaluable, thanks!
(PS - side question: why does Android launch all sort of processes in the background seemingly at random?)
ifiweresolucky said:
I moved from an HD2 to the Evo this week (no more TMobile, woot!). I am very familiar with custom WMO ROMS, Hard SPL, blah blah...
I have nearly zero Android development, custom ROM knowledge, etc, however.
I'd like to flash a custom ROM based on the factory, without all the Sprint programs preloaded.
Clearly I need to root; I am on steady ground with that knowledge. After that? Not so clear. There doesn't seem to be a thread with the steps I need to proceed.
Any info would be invaluable, thanks!
(PS - side question: why does Android launch all sort of processes in the background seemingly at random?)
Click to expand...
Click to collapse
This should be in Q & A.. But unless someone creates a rom with the apps removed. Its easier to just do it yourself.
If you did toasts method of rooting. Boot into recovery and type this
adb remount
adb shell
cd /system/app
ls
This displays all apps on the phone. Do this to delete them.
rm NameOfApp.apk
rm NameOfApp.odex
It is caps sensitive and make sure you type the apk exactly as its written.
Jus10o said:
This should be in Q & A.. But unless someone creates a rom with the apps removed. Its easier to just do it yourself.
If you did toasts method of rooting. Boot into recovery and type this
adb remount
adb shell
cd /system/app
ls
This displays all apps on the phone. Do this to delete them.
rm NameOfApp.apk
rm NameOfApp.odex
It is caps sensitive and make sure you type the apk exactly as its written.
Click to expand...
Click to collapse
any reason adb remount isn't working for me? I do adb devices and my devices is there but when i type adb remount i get "remount faild: Invalid argument"
I started Toasts root directions, placing PC36IMG.zip on the base directory of the SD card. Shut down, loaded with the Vol Down and Power buttons. The bootloader checked the file on the SD card but then stopped on the white screen.
It seems it was supposed to proceed automatically? But I am dropped off with options on the white screen: FASTBOOT, RECOVERY, CLEAR STORAGE, SIMLOCK, and HBOOT USB.
Directions show Vol Up and Down for previous and next and Power for select.
Alright, I resolved this issue. I recopied the file to the SD card and made sure to eject drive before shutting the device down. Seemed to make all the difference! Proceeding with the remainder of Toast's directions now...
p-slim said:
any reason adb remount isn't working for me? I do adb devices and my devices is there but when i type adb remount i get "remount faild: Invalid argument"
Click to expand...
Click to collapse
I'm running in to the same issue...
rgordon3091 said:
I'm running in to the same issue...
Click to expand...
Click to collapse
i fixed it. you have to do this.
adb shell
mount /dev/block/mtdblock4 /system
cd /system/app
ls
Getting error trying to remove nascar..
Code:
rm Sprint_NASCAR.apk
rm failed for Sprint_NASCAR.apk, Directory not empty
Any ideas?
That's Linux trying to protect you. Essentially the rm command by default just removes one file at a time.
Try...
rm -r NameOfFolder
...to delete recursively.
Sent from my EVO 4G using Tapatalk
Go see the thread in the apps sub-forum about this. I have a post (#28, I believe) with the exact code to remove the bloatware. You can just copy any paste.
-------------
Sent from my HTC EVO 4G using Tapatalk Pro.
nick325i said:
Getting error trying to remove nascar..
Code:
rm Sprint_NASCAR.apk
rm failed for Sprint_NASCAR.apk, Directory not empty
Any ideas?
Click to expand...
Click to collapse
you shouldn't have a problem deleting the apk, because an apk is not a directory.
i deleted it without the same message.
p-slim said:
i fixed it. you have to do this.
adb shell
mount /dev/block/mtdblock4 /system
cd /system/app
ls
Click to expand...
Click to collapse
'
hmmm i put im adb shell then i got a "#" so i put in "mount /dev/block/mtdblock4 /system"
and i got mount:mounting /dev/block/mtdblock4 /system failed: No such file or directory
so what did i do wrong?
Found the issue. Thanks all
Jus10o said:
This should be in Q & A.. But unless someone creates a rom with the apps removed. Its easier to just do it yourself.
If you did toasts method of rooting. Boot into recovery and type this
adb remount
adb shell
cd /system/app
ls
This displays all apps on the phone. Do this to delete them.
rm NameOfApp.apk
rm NameOfApp.odex
It is caps sensitive and make sure you type the apk exactly as its written.
Click to expand...
Click to collapse
By the way, when I "cd /system/app" and then "ls" I see only NamesOfApps.apk. There are displayed no *.odex files. Is that normal?
thread dead?
IDK if this threads still monitored by anyone, but here's my question: I don't use adb, but I just rused root explorer to locate sprint crap, and added a .bak to the end of all of them to essentially 'disable' them. Is this a safe method? Will Android system waste energy looking for them anymore (they no longer show in app tray, but are they still using resources) ? Thanks much.
scottspa74 said:
IDK if this threads still monitored by anyone, but here's my question: I don't use adb, but I just rused root explorer to locate sprint crap, and added a .bak to the end of all of them to essentially 'disable' them. Is this a safe method? Will Android system waste energy looking for them anymore (they no longer show in app tray, but are they still using resources) ? Thanks much.
Click to expand...
Click to collapse
I was just about to say something similar. I had uninstalled Nascar using Titanium Backup, and the found out that I cant do the 2.2 OTA unless its there. TB didn't have the ability to restore it for some reason, so I got an APK from XDA, and put it in the system/app folder via Root Explorer. Then, I had to reset the permissions to match the other APK's, and it showed up and launched perfectly. Even did an update. Much easier than all that adb stuff, I think.
I used system app uninstaller for a buck on the market.. Easy and all there with the icons for easy to find and delete sprint and gapps.
Sent from my PC36100 using XDA App
scottspa74 said:
IDK if this threads still monitored by anyone, but here's my question: I don't use adb, but I just rused root explorer to locate sprint crap, and added a .bak to the end of all of them to essentially 'disable' them. Is this a safe method? Will Android system waste energy looking for them anymore (they no longer show in app tray, but are they still using resources) ? Thanks much.
Click to expand...
Click to collapse
Thats a good way.. If something goes wrong just have to rename.
Sent from my PC36100 using XDA App
Flash this zip and it should remove most of the Sprint apps. It will back them up to /sdx on your SD card so if anything is removed that you want, it will still be there. It's signed to work with RA.
http://grathwohl.me/uploads/android/evo/Sprint-Apps-Remover-signed.zip
I've seen a few people reference my post, but my post was really just trying to ask if anyone knew if, now that I've renamed them, and they don't run, they shouldn't be using up resources? Right, is that correct, or am I wrong in thinkin this?
And thanks cosine83, that's a really helpful post for a lot of people.

[Help] problems with current ROM + trouble going back to stock Froyo or similar

Hello guys.
Once again I need your help.
Following my last thread:
http://forum.xda-developers.com/showthread.php?t=847320
(AKA "Help! no SD recognition, USB link doesn't work and no signal!")
After taking martijn_bakker's and ianmufc's advice regarding how to issue the correct command from fastboot:
- My phone regained sd functionality.
- My phone had proper signal again.
- BUT I still have USB issues, AND more:
I am currently running Cyanogenmod 6.1.1 for HTC Desire, and I have the following issues:
- When I try to go back to the stock Froyo, or anything that resembles it really (LeeDroid for example), my signal goes bananas: When I try to call anyone, it rings the person, then "ends" the call, only to bring it back again after a few seconds and then disconnect again.
I've also tried different radios (including the one LeeDroid recommended) to no avail.
So basically I cannot make calls with the original ROM.
- USB: When I connect my phone to my PC it charges it, BUT my PC doesn't recognize it, and I cannot transfer files between the SD card and the PC, or sync etc.
- I've got no Bluetooth! (Not sure if this is a Cyanogenmod issue or not though)
- Phone turns off when released from electricity charging (Doesn't happen with PC USB charging though).
The thing is I really didn't mind the original Froyo 2.2 ROM, infact I like it very much. I really like the HTC Sense features and the weather+clock widget with the animations.
The only reason I ever rooted my phone was to get apps2sd on it, so I don't keep running out of space when installing new apps. But I never even got that to work...
My question to you guys is how can I fix my current problems and have a properly working HTC Desire with a stock/custom Froyo ROM (that can make phone calls ) with apps2sd on it?
Thanks in advance!
Liran
First how have you been getting stock on your phone? Have you tried the ruu? If you are zip flashing have you wiped everything? Go to recovery wipe data/factory reset, wipe cache, advanced then wipe dalvik cache, back button, mounts then wipe everything except sd-card. Make sure you wipe sdext. Then try to flash.
Sent from my HTC Desire using Tapatalk
Well as you still don't have usb-connectivity, it sounds like you need to continue on the usb-brick fix. You have issued the command, which let you use the sd-card again. Now you just need to write a new misc partition as described here:
http://forum.xda-developers.com/showthread.php?t=691639
Doing this should make your phone work like it used to, as this is the only thing that is not fixable by flashing another rom if you need some help on it, i might be able to help, but in short terms, you need to flash a misc image, which have the right values, as the one on your phone have been changed in some way. The image is provided in the thread.
edit: and for god's sake do not try to run a ruu, as flashing the misc image might require root, and you may not be able to regain root without usb-connectivity. Also an ruu does not overwrite the misc partition, so it won't help your problem.
edit2: also you should try flashing a new radio that is known to work like 5.09.05.30_2 just to make sure this isn't also causing problems. It should be possible from a zip file using recovery.
_Dennis_ said:
First how have you been getting stock on your phone? Have you tried the ruu? If you are zip flashing have you wiped everything? Go to recovery wipe data/factory reset, wipe cache, advanced then wipe dalvik cache, back button, mounts then wipe everything except sd-card. Make sure you wipe sdext. Then try to flash.
Sent from my HTC Desire using Tapatalk
Click to expand...
Click to collapse
TBH I don't exactly know what RUU is. I've heard it before but I'm not sure exactly what it means.
When I said I flashed the stock Froyo I meant this: Official_FroYo_2.10.405.2
and I also tried LeeDrOiD_v2.2f_A2SD.
Regarding the wipes I've done everything you wrote above to no avail.
mortenmhp said:
Well as you still don't have usb-connectivity, it sounds like you need to continue on the usb-brick fix. You have issued the command, which let you use the sd-card again. Now you just need to write a new misc partition as described here:
http://forum.xda-developers.com/showthread.php?t=691639
Doing this should make your phone work like it used to, as this is the only thing that is not fixable by flashing another rom if you need some help on it, i might be able to help, but in short terms, you need to flash a misc image, which have the right values, as the one on your phone have been changed in some way. The image is provided in the thread.
edit: and for god's sake do not try to run a ruu, as flashing the misc image might require root, and you may not be able to regain root without usb-connectivity. Also an ruu does not overwrite the misc partition, so it won't help your problem.
Click to expand...
Click to collapse
Thanks mate I will try that.
One thing I forgot to mention though - My phone is S-ON.
I'm not sure if it used to be S-OFF or not though.
Does that make any difference or does it not matter?
Hum. I appologize I never had a USB brick (knock in wood) so I assumed his problem would be in the rom possibly something he did while fixing the USB brick.
Sent from my HTC Desire using Tapatalk
It does make a difference yes, but you doesn't need s-off for this. It would just make it a whole lot easier. But just get your CID like described in the thread and change the misc image to this. Then flash it like described
edit:
dennis: np something else is wrong as well, but fixing the usb is very urgent, and the other problem should be fixable by running a ruu or simply flashing a new radio+rom afterwards.
mortenmhp said:
It does make a difference yes, but you doesn't need s-off for this. It would just make it a whole lot easier. But just get your CID like described in the thread and change the misc image to this. Then flash it like described
Click to expand...
Click to collapse
Will do!
I'll update when I'm done
liranh said:
Will do!
I'll update when I'm done
Click to expand...
Click to collapse
A bit stuck... Here is what I've done:
1. Got the CID.
2. Got a hex editor. wrote the new CID instead of the one in the img file. Saved it.
3. I put the new img file and flash_image.zip in the /data on my sd card.
I Put the card in my phone, started my phone, opened Terminal Emulator and typed in "/data/flash_image misc /data/mtd0.img" (without the quotes of course). the phone said: "/data/flash_image: not found".
What am I doing wrong?
Well you should not have a /data folder on your sd card it is a partition on the phone. In order to put it there, save the 2 files in the root of the sd-card and issue those commands in a terminal emulator:
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0.img > /data/mtd0.img
As written in the thread, you might have to do 'chmod u+x /data/flash_image' before you run the commands (or chmod 755 /data/flash_image) but try to do it without those
Then you should be able to run the command you specified in the previous post
Edit: and the reason you got the error before was of course, that your files was in /sdcard/data and not in /data
liranh said:
A bit stuck... Here is what I've done:
1. Got the CID.
2. Got a hex editor. wrote the new CID instead of the one in the img file. Saved it.
3. I put the new img file and flash_image.zip in the /data on my sd card.
I Put the card in my phone, started my phone, opened Terminal Emulator and typed in "/data/flash_image misc /data/mtd0.img" (without the quotes of course). the phone said: "/data/flash_image: not found".
What am I doing wrong?
Click to expand...
Click to collapse
Actually, should it not be like this:
su
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0.img > /data/mtd0.img
chmod 755 /data/flash_image
/data/flash_image misc /data/mtd0.img
Reboot.
Masdroid: Yes exactly apart from that he apparently didn't have the files on the sdcard root
MasDroid said:
Actually, should it not be like this:
su
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0.img > /data/mtd0.img
chmod 755 /data/flash_image
/data/flash_image misc /data/mtd0.img
Reboot.
Click to expand...
Click to collapse
mortenmhp said:
Well you should not have a /data folder on your sd card it is a partition on the phone. In order to put it there, save the 2 files in the root of the sd-card and issue those commands in a terminal emulator:
cat /sdcard/flash_image > /data/flash_image
cat /sdcard/mtd0.img > /data/mtd0.img
As written in the thread, you might have to do 'chmod u+x /data/flash_image' before you run the commands (or chmod 755 /data/flash_image) but try to do it without those
Then you should be able to run the command you specified in the previous post
Edit: and the reason you got the error before was of course, that your files was in /sdcard/data and not in /data
Click to expand...
Click to collapse
Using a file manager on my phone, I put both files on the root of my SD card.
I then issued the following commands using Terminal Emulator:
su
(granted)
cat /sdcard/flash_image > /data/flash_image
Phone says: /sdcard/flash_image: No such file or directory
I should mention that I took out the card and connected it to my PC again to confirm the files have actually gone onto the root of the SD card (and they have), put the SD card back in my phone, issued the same commands in Terminal Emulator and got the same message...
Any ideas?
Sounds strange, just to make sure. You have unzipped the flash_image, so that it is not the flash_image.zip you have on you sd-card.
Also run "ls /sdcard" in terminal emulator to see a list of the files in the root and check, that it's there, and do not have a file extension. If it's there and the name is "flash_image" then it should work.
mortenmhp said:
Sounds strange, just to make sure. You have unzipped the flash_image, so that it is not the flash_image.zip you have on you sd-card.
Also run "ls /sdcard" in terminal emulator to see a list of the files in the root and check, that it's there, and do not have a file extension. If it's there and the name is "flash_image" then it should work.
Click to expand...
Click to collapse
Mate you are spot on with your first sentence. Give me a minute
Haha nice one thought i could've made the same mistake
mortenmhp said:
Haha nice one thought i could've made the same mistake
Click to expand...
Click to collapse
Yeah cause you know how when you put files on your phone to flash them you usually keep them in their zip format - that's what tricked me...
Haha yea let us know if you get it sorted
mortenmhp said:
Haha nice one thought i could've made the same mistake
Click to expand...
Click to collapse
Well spotted
mortenmhp and MasDroid thank you both so much!
Everything is working perfectly now!
I thought I would never get my phone to work properly again!
If any of you is ever in London - drinks are on me!

[GUIDE] Flash any recovery easily on the phone using flash_image

Background
To update (flash) a recovery image onto your phone allows you to update or replace your recovery environment on your phone. There are a number of ways to flash a new recovery image, some of the more commonly used methods are using a tool such as ROM Manager or using development tools such as Fastboot. There is also a third method using a standalone utility "flash_image" which allows the flashing of recovery using the terminal emulator on the phone.
flash_image is not a new tool, it has been used on Android since the beginning, many custom ROMs include the utility as part of the ROM itself though not all stock ROMs (including the stock ROM on the G2) include it.
Requirements
1. A permanently rooted (with S-OFF) phone
2. The flash_image binary
3, A recovery image that is compatible with your phone and ROM
3. A terminal emulator application on the phone or use of an ADB shell
Overview:
1. Get the flash_image binary and recovery image onto your phone
2. Copy or move the flash image binary to your system and make executable
3. Use flash_image to update your recovery environment
Stage 1: Get flash_image and recovery image on your phone
1. Download the flash_image binary (not needed if you are running a custom ROM that includes this binary)
2. Download the recovery image you wish to use
You can either directly download the files onto your phone or onto your PC and transfer to your phone. Probably the easiest way to do this is to connect your phone to your computer via USB and mount USB storage, then copy the files to your SD Card. Alternatively you can use ADB Push, bluetooth file transfer or several other methods.
Stage 2: Copy or move the flash image binary to your system and make executable
In terminal emulator:
su
mount -o remount, rw /system
cd /sdcard (or wherever you downloaded/copied the file)
cp flash_image /system/bin
cd /system/bin
chmod 777 flash_image
Click to expand...
Click to collapse
Stage 3: use flash_image to update your recovery environment
In terminal emulator:
su (not needed if using the same terminal session used in the steps above)
cd /sdcard (or wherever you downloaded/copied the recovery image)
flash_image recovery recovery.img (use the appropriate file name for the image file you are flashing)
Click to expand...
Click to collapse
Reboot into recovery and verify that the correct recovery environment is installed
Notes
Any of the commands that call for using a terminal emulator on the phone should work fine using an ADB shell if you prefer.
This was tested on G2 but I can't think of why it would not work on Desire Z or any other phone for which this version of flash_image works. Obviously different phones have different compatible recovery images.
I've attached a zip file containing the flash_image binary that I extracted from the CM 6.1 update zip. I suspect most custom ROMs already have flash_image.
If you are wondering "Why should I use this method over using ROM Manager?" you could be using a recovery image that ROM manager doesn't support, for example ClockWorkMod Recovery 3.x which is required for some experimental ROMs.
If you are wondering "Why should I use this method over using fastboot?" The two main reasons are you can't use fastboot if you are not with a computer with working ADB and using fastboot requires that you have previously flashed the engineering HBOOT.
This is my first guide so I'm open to suggestions or feedback.
Nice one
Though I would suggest that
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
could be simplified to :
Code:
mount -o remount,rw /system
Edit - actually /system isn't even on /dev/block/mtdblock3, and it's not a yaffs2 file system, I suspect that's come from another phone model ?
"dd" will do exactly the same, but no need to install extra stuff since its already there.
dhkr123 said:
"dd" will do exactly the same, but no need to install extra stuff since its already there.
Click to expand...
Click to collapse
I wouldn't have a problem using dd myself. But I would have thought it was much more risky, since instead of typing something relatively user-friendly like "recovery", you're typing in /dev/xyz/abc or similar, which if you get it slightly wrong could be disastrous ?
Excellent, worked for me, flashed CW 3.0 without fastboot
steviewevie said:
Nice one
Though I would suggest that
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
could be simplified to :
Code:
mount -o remount,rw /system
Edit - actually /system isn't even on /dev/block/mtdblock3, and it's not a yaffs2 file system, I suspect that's come from another phone model ?
Click to expand...
Click to collapse
Interesting, I've been using that command since forever (since I first rooted my G1 in early 2009) and it definitely does work on my G2 as well as my wife's MT4G.
I just tried "mount -o remount,rw /system" on my phone and it does not work, mount gives me the "Usage:" messages which seems to mean it wants more parameters.
steviewevie said:
I wouldn't have a problem using dd myself. But I would have thought it was much more risky, since instead of typing something relatively user-friendly like "recovery", you're typing in /dev/xyz/abc or similar, which if you get it slightly wrong could be disastrous ?
Click to expand...
Click to collapse
Unless you run wpthis before dd, you're perfectly safe. The radio partitions are all protected by the power-on write protect feature of the eMMC AS WELL as the linux kernel write protect on low addresses. Worst you can do is blow away your system, data, cache, misc, boot, or recovery partitions, and these are trivial to recover from.
raitchison said:
Interesting, I've been using that command since forever (since I first rooted my G1 in early 2009) and it definitely does work on my G2 as well as my wife's MT4G.
I just tried "mount -o remount,rw /system" on my phone and it does not work, mount gives me the "Usage:" messages which seems to mean it wants more parameters.
Click to expand...
Click to collapse
Depends on whether or not the mount command can tell the associations between the devices and mount points, which is determined by either system configuration, or what mount command you are using (i.e. android's mount or busybox mount).
raitchison said:
Interesting, I've been using that command since forever (since I first rooted my G1 in early 2009) and it definitely does work on my G2 as well as my wife's MT4G.
I just tried "mount -o remount,rw /system" on my phone and it does not work, mount gives me the "Usage:" messages which seems to mean it wants more parameters.
Click to expand...
Click to collapse
Sorry, there should have been an extra space, this works on my phone :
Code:
mount -o remount, rw /system
I don't have a "/dev/block/mtdblock3" on my system. My system partition is mounted on /dev/block/mmcblk0p25, and it is ext3 not yaffs2.
What ROM are you running ? I am running the stock DZ 1.34 ROM. I wonder if you are running Gingerbread ?
steviewevie said:
Sorry, there should have been an extra space, this works on my phone :
Code:
mount -o remount, rw /system
I don't have a "/dev/block/mtdblock3" on my system. My system partition is mounted on /dev/block/mmcblk0p25, and it is ext3 not yaffs2.
What ROM are you running ? I am running the stock DZ 1.34 ROM. I wonder if you are running Gingerbread ?
Click to expand...
Click to collapse
I'm running the Stock G2 T-Mobile post-OTA ROM, definitely not Gingerbread.
Edit: I just tried your method and it works, I will update the guide because your way is simpler and sounds like a safer choice.
you could just rename the CW 3.x.x recovery to the exact named recovery slap it in the cloclwork download folder after you delete the old one and flash it with CW just a quicker trick for GB roms
Not sure that's actually quicker, at least I don't think it would be for me, especially if you are changing recoveries with any frequency (like if tying out Gingerbread ROMs then going back to a 2.2 ROM) because you'd need to constantly rename your recovery images. With my method you would only need to leave the two files named as they are, or for expediency you could rename to recovery.img and recovery3.img then when you wanted to switch you could just execute:
flash_image recovery recovery.img
Click to expand...
Click to collapse
or
flash_image recovery recovery3.img
Click to expand...
Click to collapse
Depending on which recovery you wanted at that point & time.
As I said in the guide, there are already a number of options available, using ROM Manager and fastboot are the most commonly seen in guides but your method and mine are other options for people for whom they work better.
Works!!!
Hi my friends!
It worked for me flawlessly. I was using virtuos 0.9 on my desireZ
Great description, but file did not work for me
It's a very good description that a novice like me can follow. And, I am sure the provided file works for many of you, since many of you reported it to work. After following this guide, and not getting it to work (Stopping Signal error), I decided to find another binary file for flash_image, and the other flash_image file worked for me on my Sprint CDMA Hero. My phone currently has aospMod v0.9.9.2 | AOSP 2.2.1(12/10/2010), if it matters.
One can download a flash_image from here http://cyanogen-files.carneeki.net/flash_image.zip
Then unzip and place on sdcard - follow all the steps in the original post of this thread.
It is my understanding that this file is not unique for different android phones, but if I am incorrect, someone please reply to this thread to correct me.
Again, great job in summarizing the steps.
Regards,
Sanjiv
so darn easy! thank you!
Also usable for splash screen ??
Just curious,
Anybody tried to use flash_image to flash a custom splash screen ?
Something like :
flash_image splash1 customsplash.img
very good post for a newbie like me, just want to make sure, do i need to do the stage 2 every time I flash the recovery?
jaoyina said:
very good post for a newbie like me, just want to make sure, do i need to do the stage 2 every time I flash the recovery?
Click to expand...
Click to collapse
No, you only need to do stage 2 once, whenever you update/change recoveries from that point forward just use stage 3.
Is there a way I can reflash a recovery without access to the ROM?
I'm stuck at the HTC splash screen, so I'm basically stuck in my current (broken) recovery.
sanjivp2000 said:
One can download a flash_image from here (..)[/URL]
Click to expand...
Click to collapse
The flash_image in the start post did not work for me, the one above did.
Also, my HTC Hero was missing the cp command.
Instead, I used: cat /sdcard/flash_image > /system/bin/flash_image
Successfully flashed recovery again

Categories

Resources