Simplified root / recovery process - Hero CDMA Android Development

I've updated my recovery install process instructions here:
http://android.modaco.com/content/h...ng-the-patched-recovery-image-on-your-device/
Looking for CDMA testers... you can help test even if you are already rooted / recovery'd.
P

how can i test this even though i've already rooted?

hi i just wanted to know if this is like a one step root or something like that, i am new to android and have no clue how to do everything so im looking for the easiest way to root my phone

aim1126 said:
hi i just wanted to know if this is like a one step root or something like that, i am new to android and have no clue how to do everything so im looking for the easiest way to root my phone
Click to expand...
Click to collapse
You could always... oh, I don't know... actually READ it?

posguy99 said:
You could always... oh, I don't know... actually READ it?
Click to expand...
Click to collapse
haha sorry i thought the link was to download some sort of program, my bad, and dont need to be nasty about it either, i was just asking a question (which was a pretty stupid one i know lol)

Ok, just tried this on my xp machine with an unrooted hero. I think that I'm missing a few steps here based on the somewhat vague instructions.
I mounted my hero, opened up cmd.exe and cd'd into '1.1-hero-recovery'. From there I ran 'install-recovery-cdma-windows.bat'
Obviously missing something here.
Code:
C:\>cd 1.1-hero-recovery
C:\1.1-hero-recovery>install-recovery-cdma-windows.bat
C:\1.1-hero-recovery>./adb-windows push asroot2 /data/local/
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell chmod 0755 /data/local/asroot2
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell /data/local/asroot2 /system/bin/sh
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell mount -o remount,rw -t yaffs2 /dev/bloc
k/mtdblock3 /system
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell cd /system/bin
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell cat sh 1>su
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell chmod 4755 su
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows push recovery-RA-heroc-v1.2.3.img /sdcard/
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>./adb-windows shell flash_image recovery /sdcard/recovery-R
A-heroc-v1.2.3.img
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\1.1-hero-recovery>

Related

modified: Installing & Run application on sdcard

WARNING: Proceed at your own risk, this may damage your phone and/or make it unstable. This is for advanced users only and should only be attempted by those who understand the risks of the following changes
Original post: http://www.androidin.net/thread-1099-1-1.html
AS usual, this is for those WITH ROOT ONLY
Preparation:
1. Installed JF RC30 V1.2 (only if you are using JF RC30 1.2 , this is not compatible with RC8)
2. Make a NANDROID backup (you may get everything back to normal if the phone screw up)
3. A MICRO-SD card with 2 partitions divided : (1) a fat-32 partition, (2) a ext2, you need a linux/mac to format the sdcard with ext2 partition
* the fat 32 will be mounted as sdcard and the ext2 will be mounted as /sd for application data, make your own decision for the size*
4. insert the sdcard with 2 partition on the phone
5. set the phone to aeroplane mode for safe
Procedure:
1. adb pull /system/etc/mountd.conf /*somewhere you may want to back it up*
2. rm -f /system/etc/mountd.conf
3. using the modified mountd.conf, adb push /*the path of modified mount.conf */mount.conf /system/etc/mountd.conf
4. adb pull /system/init.rc /*somewhere you may want to back it up*
5. rm -f /system/init.rc
6. using the modified init.rc, adb push /*the path of modified init.rc*/init.rc /system/init.rc
7. reboot
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
Now, the phone will install and run everyone on /sd, still mounting /sdcard as usual. It is possible that to mount or unmount /sdcard by usb without everything screwed up. Beware that your sdcard will be used as part of system, removing the sdcard may freeze the phone. If the phone get freeze because of removing the sdcard, plug the sdcard again and soft reset.
It is also possible that copy the application data to another card. If you want to change the sdcard, switch the phone off, mounting the sdcard to computer directory, copy the /sd partition to another sdcard with ext2 partition
Back to normal:
1. rm -f /system/etc/mountd.conf
2. adb push /*the backup of mountd.conf* /system/etc/mountd.conf
3. rm -f /system/init.rc
4. adb push /*the backup of init.rc* /system/init.rc
5. busybox cp -a /sd/ /data/app
6. rm -r /sd/
Change of mountd.conf:
changing /dev/block/mmcblk0 to /dev/block/mmcblk0p1
change of init.rc:
adding
insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko
mknod /dev/mmcblk0p2 b 179 2 1000
mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime
Any chance of this being simplified into the actual commands necessary for this!?
I'm a semi-noob at *nix stuff... I can format my SD card into 2 partitions, but I'm lost at step 4... What do we need to edit??
Changed step 4...just adb pull the mount.conf for editing..open the file in text editor..find "mmcblk0" and change it "mmcblk0p1" ..save the .conf...del the original one..push the new one to the original directory..
Yay. Now hopefully we can get this in an update.zip to flash
Yeah, I'm putting off doing this until someone makes an update.zip which I definitely know how to apply and get rid of if I screw anything up
REPLACES the internal memory...?
So the internal memory isnt used?
kinda the same trick as the browser cache and market cache, just a bit more complex as its an entire filesystem your moving, which wouldnt let the sys see the internal, mem, please correct me if im reading it wrong, Im not a total noob at linux but no guru dev either...
bhang
The internal memory is still used, just not for /data/app
19.rm -r /data/app
20.ln -s /sd/app /data/app
Click to expand...
Click to collapse
It should probably be /sdcard/app. In any case, this is a fairly complex mod that is not suited for Linux newbies. I would advise against folks considering this mod unless they understand and can test each step before attempting.
I agree and added a warning to the first post
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?
This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.
Stericson
Stericson said:
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?
This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.
Stericson
Click to expand...
Click to collapse
The procedure calls for two partitions on the microsd, one FAT32, other EXT. Theoretically it should work with mounting for mass storage. However, I agree that it's a rather sloppy hack.
There is talk about a similar strategy being officially implemented by the Android team. Instead of two partitions, it would be loopback mounted to a file in the FAT32. That would also provide some encryption security. See here. It's just talk though. Won't be a reality for at least a few months.
Well talk is certainly better than nothing...thanks for the info....
Stericson
I post a method withtout compiling the ramdisk.img but that do not force mounting the sd ext2 drive under rootfs but still workable...probably when i back to work I can compile 1 to flash
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?
I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.
I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.
TheDudeOfLife said:
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?
I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.
I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.
Click to expand...
Click to collapse
/sd is /sdcard (mount point for the micro sd card's partition)
I'm getting stuck right here:
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
It's saying read only system blah blah, even though I have indeed mounted it is rw
pershoot said:
/sd is /sdcard (mount point for the micro sd card's partition)
Click to expand...
Click to collapse
No....no it is not.
/sd is a mount of the ext2 partition used for the 'copy' of /data/app (one of the things i disagreed with is picking /sd as a mount point for the second partition.)
/sdcard is the fat32 mount point...used as usual for mounting files.
IzzeLing said:
I'm getting stuck right here:
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot
It's saying read only system blah blah, even though I have indeed mounted it is rw
Click to expand...
Click to collapse
Type mount in adb shell and see if /sd is even mounted. I wasn't seeing it in my list. I don't think his mount command in the init.rc is correct, but I'm too busy with holiday stuff.
Don't rm -r /data/app if you have not 100% verified the copy works.
This line looks mangled (need flags in the args):
Edit: nevermind, looks like it should work in the init.rc
TheDudeOfLife said:
No....no it is not.
/sd is a mount of the ext2 partition used for the 'copy' of /data/app (one of the things i disagreed with is picking /sd as a mount point for the second partition.)
/sdcard is the fat32 mount point...used as usual for mounting files.
Click to expand...
Click to collapse
ahh yea. i just re-glanced over the instructions.
cool.
TheDudeOfLife said:
Type mount in adb shell and see if /sd is even mounted. I wasn't seeing it in my list. I don't think his mount command in the init.rc is correct, but I'm too busy with holiday stuff.
Don't rm -r /data/app if you have not 100% verified the copy works.
Click to expand...
Click to collapse
Yeah, don't see it. Hm.

Can't use ringtones that stored on /sdcard/ringtones

Suddenly I couldn't find any of my ringtones that stored on the /sdcard/ringtones directory from Ringtones Settings.
The /sdcard/ringtones is still avaliable on the sdcard and If I tried to play them throw the mp3 player they works fine.
I found out that the sdcard is mounted as Read-Only and not Read/Write as before. Even if I plug it in to the PC I can't change any of the data on the sdcard only read it.
The latest change that I made few days ago was to store all cache files on the sdcard. I am not sure that this is the reason but it could be.
Does anyone here have any idea why it happened?
install Rings Extended from the market. Open your soundsettings with the program. It will prompt to open with rings extended or standard.
Don't know about the read-only stuff, but you could take a look at the ownership and the rights you have as a user/admin... if all fails.. format?
thanks for the advice, I will try it...
does anyone have more ideas regarding the read only issue?
yes could this be your problem too http://forum.xda-developers.com/showthread.php?t=473256
unfortunately its not the same issue, I have root access to the phone and when I run the mount command this is the output I have for /sdcard
/dev/block/mmcblk0p1 on /sdcard type vfat (ro,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,codepage=cp437,iocharset=iso8859-1,utf8)
I can't use the camera and the ringtones because of that.
I do able to remount the /sdcard as rw but any time I reboot the phone it become ro.
can you please copy for me the output that you have from mount command on /sdcard/ and the permissions you have on that directory from ls -l command?
zrubi said:
unfortunately its not the same issue, I have root access to the phone and when I run the mount command this is the output I have for /sdcard
/dev/block/mmcblk0p1 on /sdcard type vfat (ro,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,codepage=cp437,iocharset=iso8859-1,utf8)
I can't use the camera and the ringtones because of that.
I do able to remount the /sdcard as rw but any time I reboot the phone it become ro.
can you please copy for me the output that you have from mount command on /sdcard/ and the permissions you have on that directory from ls -l command?
Click to expand...
Click to collapse
I suspect the fat partition on your sdcard got corrupted. Try a reformat
you were right thanks
I did chkdisk from windows and it did fix the fs.
now its working just fine...

[How to] mount SD card in recovery.

Please add this thread to the sticky!
If you messed up your ROM, and want to just reflash, but don't have your update on the SD card... or you mess up apps2sd and you need to clear them, this thread is for you. I've needed to do this MANY times, and it's a pain in the ass to remember how to do it every time.
Get into the recovery, and ./adb shell (if you can). Otherwise, hit alt + x to drop into the terminal. Then type this:
Code:
echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file
Then, if you need to unmount:
Code:
echo "" > /sys/devices/platform/usb_mass_storage/lun0/file
This allows you to drag/drop files right from your PC to the sd card.
.... this is why i have card readers.
on another note, if you can get into adb cant you just
Code:
adb push /sdcard/
Simplest way - if you dont`t have update.zip on card simple click Alt-S. Recovery menu mount sdcard and show error (update.zip not found) but don`t unmount card
dbhatesyou said:
.... this is why i have card readers.
on another note, if you can get into adb cant you just
Code:
adb push /sdcard/
Click to expand...
Click to collapse
Because then you'd have to mount the sdcard to the device, it's easier to just do it this way. Although the post below yours does give a good example of how to easily mount it, I often keep updates on the card.
So by using this and mounting it to the PC, I can easily change files/names/etc.
thanks
dude i registered just to thank you for this piece of advice. thanks gary works perfectly
this works for me and is much simpler:
adb shell
mount /sdcard
exit
once you do that you can:
adb push updateofyourchoice.zip /sdcard/update.zip
edit: you can even shorten it to:
adb shell mount /sdcard
Gary13579 said:
Please add this thread to the sticky!
If you messed up your ROM,
Click to expand...
Click to collapse
Learn to speak with out school yard language.
just bookmared this page hahha
agreed, this bit ought to be in the index...added to the "how to" section
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
alapapa said:
this works for me and is much simpler:
adb shell
mount /sdcard
exit
once you do that you can:
adb push updateofyourchoice.zip /sdcard/update.zip
edit: you can even shorten it to:
adb shell mount /sdcard
Click to expand...
Click to collapse
Yep, I have to agree, this is what I do too... much easier really
Gary13579 said:
Please add this thread to the sticky!
If you messed up your ROM, and want to just reflash, but don't have your update on the SD card... or you mess up apps2sd and you need to clear them, this thread is for you. I've needed to do this MANY times, and it's a pain in the ass to remember how to do it every time.
Get into the recovery, and ./adb shell (if you can). Otherwise, hit alt + x to drop into the terminal. Then type this:
Code:
echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file
Click to expand...
Click to collapse
First of all, thanks for this thread!
When I get to this point, I get a Permission Denied message.
(The way I typed it was echo /dev/block/mmcblk0 press enter /sys/devices/platform/usb_mass_storage/lun0/file)
Long story short.
I have Hero ROM (2.4). I had the FAT32/Ext2 partition. I used Paragon Partition Manager to complete delete partition and created a new FAT32/Ext3.
After I did this, it said that my SD card was not "formatted". I hit FORMAT button, but it gave me a force close error. I had no other choice but to turn off G1, when I turn on again (since HERO depends on your SD Card FAT32/Ext2,3 to load correctly, not it won't get pass HERO screen, it loops forever).
I will buy a SD card reader today (The way I have been working is thru another Phone (T-Mobile Wing, I removed SD card from G1 and put it on the Wing, but now it won't even read that, so that's another issue), regardless of this outcome. But I wanted to share my story.
I want to format my SD card thru the recovery console, if it's possible.
By the way, I typed also:
adb shell
It says Not found
Thanks in advanced.
thanks
after typing this in i get
"mount: mounting /dev/block/mmcblk0p1 on /sdcard failed: No such file or directory" no matter if my sdcard is inserted or not.
Ya'know, if you have Cyanogen's recovery image (which is awesome, has JF recovery features and more) you can just use:
ums_enable
ums_disable
Click to expand...
Click to collapse
to mount and unmount, works great.
AdrianK said:
Ya'know, if you have Cyanogen's recovery image (which is awesome, has JF recovery features and more) you can just use:
ums_enable
ums_disable
Click to expand...
Click to collapse
to mount and unmount, works great.
Click to expand...
Click to collapse
Wow, thats easier to remember, thanks!!! Now if he could add this into his menu would be even better!
bassbox said:
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
Click to expand...
Click to collapse
From Terminal:
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# rm -rf /system/sd/*
# reboot recovery
ive gota say top advice from all of you!! it would have been a paper weight untill i got home but all working now..
YOU SIR
Are a lifesaver.
i thought i'd ruined my phone which means my om woulda killed me. but i didnt thanks to your halp!
bassbox said:
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
Click to expand...
Click to collapse
not the best at unix and assuming 2nd partition is your ext2/3/4 ...
from console or better yet adb shell
mount /dev/block/mmcblk0p2 /system/sd
cd /system/sd
ls -l (to see the contents)
rm [filenames] (to delete the files)
rmdir (to delete empty directories)
.

How to decrypt SD storage(removable) | Phone to PC transfers | Easy | Automagically

I wanted an encrypted external sd on my phone that i could remove and transfer files to as needed.
This is the solution I conjured up after doing some testing and research
Thanks to @POQDavid who wrote How to decrypt and split adopted storage? which ive modified
Make sure your SD card is formatted as internal storage
Your device must be rooted.
Use a file browser like ES Explorer/Ghost/TotalCommander, browse to /data/misc/vold.
Copy the .key file to another folder and then move to your pc
DO NOT need to dump the hex like in other guides
Copy your key somewhere safe on PC
Code:
sudo mkdir /etc/keys/
cp <keyfilename>.key /etc/keys
On any Linux distro check where your drive is mounted, you can use
Code:
fdisk -l or lsblk
to find the large encrypted partition of the SD card, my SD card was mounted to /dev/sdd2.
Create the mount point:
Code:
sudo mkdir /mnt/1
Then run this command
Code:
sudo cryptsetup create usbcrypt1 /dev/sdd2 --key-size 128 --key-file /etc/keys/<keyfilename>.key
If your key is correct you can mount it by
Code:
sudo mount /dev/mapper/usbcrypt1 /mnt/1/
Test the mount
Code:
ls /mnt/1
Finally you can run
Code:
cd /mnt/1
to browse the decrypted storage.
Automation
Im tired now and so far I have automated this using terminal aliases
Just drop the alias into command and hit enter, the cryptmount to mount and cryptumount to unmount. (alias will be removed on reboot) edit and insert into ~./bashrc to make aliases stay
Code:
# alias mounting
[B]alias cryptmount="sudo su -c 'cryptsetup create usbcrypt1 /dev/sdd2 --key-size 128 --key-file /etc/keys/<keyfilename>.key' && sudo su -c 'mount /dev/mapper/usbcrypt1 /mnt/1'"[/B]
#alias unmounting and luksClose
[B]alias cryptumount="sudo su -c 'umount /mnt/1' && sudo su -c 'cryptsetup luksClose usbcrypt1'"[/B]
Remember to replace <keyfilename> with your keyfile name to make it work.
Next step make this automount in crypttab using dm-crypt method if thats possible... Any help appreciated.
cheers and good night
Table reserved for 2
Ok it works, but kind of a hassle. To copy files over you basically should copy them to a readable folder like user or any other one you can create directories in after mounting.
Copy your files to the encrypted drive, unmount .
then using a file manager with root access on your phone copy them from /mnt/expand/<UUID> to /mnt/sdcard and you should be good. It works for be but i wont be using this method anymore because its a pain to copy large amounts of files so many times. better to use an OTG usb for that
However this does have benefits if your phone is destroyed and only the adapted sd card exists and you need access to your files.
Enjoy.
[xzel] said:
Ok it works, but kind of a hassle. To copy files over you basically should copy them to a readable folder like user or any other one you can create directories in after mounting.
Copy your files to the encrypted drive, unmount .
then using a file manager with root access on your phone copy them from /mnt/expand/<UUID> to /mnt/sdcard and you should be good. It works for be but i wont be using this method anymore because its a pain to copy large amounts of files so many times. better to use an OTG usb for that
However this does have benefits if your phone is destroyed and only the adapted sd card exists and you need access to your files.
Enjoy.
Click to expand...
Click to collapse
Is it possible to browse adoptable storage from twrp using the aforementioned method?
I have busybox and cryptsetup in termux so i can use it from twrp terminal..?
Unreal_Hawkz said:
Is it possible to browse adoptable storage from twrp using the aforementioned method?
I have busybox and cryptsetup in termux so i can use it from twrp terminal..?
Click to expand...
Click to collapse
I believe you can mount it thru termux but I havent tried, I tried this on an Ubuntu system.

Question Trying to backup phone with adb, where is sdcard?

Right now I am backing up my files with adb and I have tried the following commands
adb pull /sdcard D:\[backupfolder]
adb pull /sdcard
But they just copy the internal storage folders, while what I want is to copy the stuff in the sdcard. I have tried
/storage/sdcard0
/storage/sdcard
/storage/0
/disk (it is how the folder is called in my phone)
but none of them exist.
Can anyone who has backed up their sd card on a Poco X3 tell me the actual storage path to use in adb? Thanks!
You can't.
Cuz SD card is always some strange digit number.
Try to enter ADB shell and then use the ls command to list all folders.
It should be in Mount or mnt
/sdcard is usually a chain of links that is not followed by ADB.
You need to:
Code:
$ stat /sdcard
And it will tell you where it points to. Then you stat that and keep on going until you stat something that is a real directory.

Categories

Resources