[Q] use 7za.exe to create update.zip - HTC Sensation

I have created a batch file to edit new roms I download. Basicilly the batch file takes the rom extracts it, then deletes all the apk's etc I dont want and then zips it up again as update.zip.
Once it has done this, it then copies the update.zip to my SD card and then uses the adb commmand to reboot the phone into the recovery menu.
This all works fine. The problem I have is when I go to flash the zip I get error aborted. I found that when it creates the zip file it doesn't add the META-INF folder as uppercase in the update.zip file.
As linux is cse sensitive I think this is my problem. Is there any way to use 7za.exe to add it as upper case into the update.zip and all the other folders as lower case?
The command I use to create the zip is: 7za a -tzip update.zip *

Any ideas on how to zip the file in dos and preserve the uppercase folders?
Fixed it needed to use the -r switch with 7za. Now when I get a new rom I can fully extract it, delete all the files I want zip it transfer it to the phone and reboot the phone!

Related

[GUIDE] How to create a your own ROM

How to create your own ROM update.zip for the T-Mobile MyTouch 3G
Things you will need to perform this:
Java SE Dev Kit from Sun. java.sun.com
May need Cygwin with zlib0 package, from cygwin.com
This will give you Android 1.6 with all the Google applications, Root access.
I never found one place where all this information is all together, so that is why I compiled this together.
Now anyone can do this themselves.
Thanks to all the hard work others have done before this.
1.
First Root your phone and install a new Recovery image, either Amon Ra or Cyanogens Recovery image.
Instructions for one-click root: http://theunlockr.com/2009/08/22/how-to-root-the-mytouch-3g-or-g1-in-one-click/
2.
Download the Android 1.6 System image from
http://developer.htc.com/google-io-device.html
extract the contents of signed-google_ion-img-14721.zip.
3.
You now need to extract the contents of system.img using a tool called unyaffs. The source code is here:
http://code.google.com/p/unyaffs/downloads/list
Or download a prebuilt win32 version here.
http://jiggawatt.org/badc0de/android/index.html
Note you may also need cygwin1.dll and cygz.dll (zlib0 package). Found at cygwin.com
Of course if you already have Cygwin installed with the GCC packages, you can just compile it yourself. Then also
if you comment out the line 67 to "// symlink(oh->alias, full_path_name);"
then it will not create the copies of the symbolic link file, and you will not have to worry about deleting duplicate
symbolic link files later.
Now in the directory where system.img exists, create a new directory called "system"
go into the "system" directory.
type the following command:
unyaffs ..\system.img
That should extract all the files from the system.img file into the system directory.
4.
Now we just need to clean up some items. Since the system.img is a linux file system, it has symbolic
links built into it, but when we extracted it, it just created duplicate files, if you used the prebuilt unyaffs.exe.
So we can just delete the duplicates and have a script recreate the symlink on install.
So we need to delete some extra files from the system\bin directory.
Run the attached DeleteExtras.bat file from the same directory where system.img is in.
If you notice, all the files it deletes are 28 byte files, and if you open them in notepad only contain:
"!<symlink>toolbox..."
And we will remake the symbolic link when it is installed.
5.
Now from the directory where the system.img is, enter the following commands
mkdir META-INF
mkdir META-INF\com
mkdir META-INF\com\google
mkdir META-INF\com\google\android
Now copy the included file "update-script.txt" into the "META-INF\com\google\android" directory
and RENAME it to just "update-script".
This update-script gets run to recreate the symbolic links.
Not sure if these two are needed but they are in some custom ROMs here:
Copy the two files "fix_permissions" and "flash_image" to the "system\bin" directory.
6.
-- Optional --
These add root and Superuser access to the ROM, plus the Terminal Emulator application.
Copy the file "su" from Cyanogen's rom to the folder "system\bin"
Copy the file "Superuser.apk" to the folder "system\app"
Copy the file "Term.apk" to the folder "system\app"
You can also replace the "system\etc\apns-conf.xml" with a more complete one from here:
http://forum.xda-developers.com/showthread.php?t=547718
or here
http://docs.google.com/Doc?docid=0AZNbAmKkmakoZGZxZHNwMnpfMjJkaHg3ejN3eg&hl=en
Turn data roaming off by default by editing line in the build.prop file:
ro.com.android.dataroaming=false
Also to fix the Market program to show "Protected" applications change the ro.build.fingerprint line to the following:
ro.build.fingerprint=tmobile/opal/sapphire/sapphire:1.5/COC10/150449:user/ota-rel-keys,release-keys
Only phones with a fingerprint of a "released" device can access some market applications.
--------------
7.
Now we just need to create a ZIP file for the final ROM
Zip up the following file and two folders:
boot.img
META-INF
system
8.
Now sign the zip file.
See here how to sign a ZIP file for flashing it.
http://androidforums.com/developer-101/8665-how-signing-roms.html
9.
Copy it to your SD card, boot into recovery, wipe, apply the update, Reboot.
You are now running Android 1.6!
the finger print is found in build.prop is this correct and what app do you use to edit your build.prop
Yes the fingerprint is in build.prop
Make sure to use an advanced text editor like TextPad, UltraEdit, or EditPlus. It has to handle UNIX text files.
Also use this for the update_script.
how abt kernel parameters?
How would one go about customizing this with Hero? Or is that not possible at this point?
detox702 said:
How would one go about customizing this with Hero? Or is that not possible at this point?
Click to expand...
Click to collapse
Would like more info on hot to incorporate senseui
Thanks for sharing... Got nothing to do today, so I experimented on my phone... I gotta say, I'm pretty amazed w/ this feature. Was able to sort out and organize my files.
Kudos!
How does one create the system.img file once one has the system files...
What I want to do is use some of the custom roms here and put it on an AVD emulator system.
Can someone help with this please.
NOTE: I dont have linux. So if there is an alternative to mkbootimg, it will be excellent.
the ion is the 32b if I'm not mistaken?
Is there an image for the 32a or do we always have to use the ion and throw a patch over it?
Sorry if this is a stupid question
in step 5. it says
Not sure if these two are needed but they are in some custom ROMs here:
Copy the two files "fix_permissions" and "flash_image" to the "system\bin" directory.
Where do i copy the files from or download please?
thanks in advance
P.S. any tips on changing the splash screen would be much appreciated.
DeleteExtras.txt or DeleteExtras.bat doesn't work. I have to delete the extra files by myself - one by one.
codysoloman said:
DeleteExtras.txt or DeleteExtras.bat doesn't work. I have to delete the extra files by myself - one by one.
Click to expand...
Click to collapse
check this: http://forum.xda-developers.com/showthread.php?t=633246
Perhaps someone here knows or could point me to the right resources, but if the phone isn't supported by Cyanogen, how would a custom rom be made in that case?
How is a custom rom made from scratch? Since android is just linux, is it simply a matter of building it with the right drivers for the phone and installing it? How can an image be manually copied to the phone if it isn't supported by Clockwork recovery? How can it's steps be manually done?
ping pong...
Can i install my own rom on samsung ace?????
anybody knows how to make a ROM customized and make a "update.img" to run on a un-rootable device? I know when you backup a linux image for example ubuntu, this image will run on all other PCs, the image will automatically knows the new PC's drivers and adapt everything with that, is it what happening to an android too ?
---------- Post added at 08:36 AM ---------- Previous post was at 08:33 AM ----------
and pls let me know how to open/edit a "update.img" file, thnx
Question
androidcustomrom said:
How to create your own ROM update.zip for the T-Mobile MyTouch 3G
Things you will need to perform this:
Java SE Dev Kit from Sun. java.sun.com
May need Cygwin with zlib0 package, from cygwin.com
This will give you Android 1.6 with all the Google applications, Root access.
I never found one place where all this information is all together, so that is why I compiled this together.
Now anyone can do this themselves.
Thanks to all the hard work others have done before this.
1.
First Root your phone and install a new Recovery image, either Amon Ra or Cyanogens Recovery image.
Instructions for one-click root: http://theunlockr.com/2009/08/22/how-to-root-the-mytouch-3g-or-g1-in-one-click/
2.
Download the Android 1.6 System image from
http://developer.htc.com/google-io-device.html
extract the contents of signed-google_ion-img-14721.zip.
3.
You now need to extract the contents of system.img using a tool called unyaffs. The source code is here:
http://code.google.com/p/unyaffs/downloads/list
Or download a prebuilt win32 version here.
http://jiggawatt.org/badc0de/android/index.html
Note you may also need cygwin1.dll and cygz.dll (zlib0 package). Found at cygwin.com
Of course if you already have Cygwin installed with the GCC packages, you can just compile it yourself. Then also
if you comment out the line 67 to "// symlink(oh->alias, full_path_name);"
then it will not create the copies of the symbolic link file, and you will not have to worry about deleting duplicate
symbolic link files later.
Now in the directory where system.img exists, create a new directory called "system"
go into the "system" directory.
type the following command:
unyaffs ..\system.img
That should extract all the files from the system.img file into the system directory.
4.
Now we just need to clean up some items. Since the system.img is a linux file system, it has symbolic
links built into it, but when we extracted it, it just created duplicate files, if you used the prebuilt unyaffs.exe.
So we can just delete the duplicates and have a script recreate the symlink on install.
So we need to delete some extra files from the system\bin directory.
Run the attached DeleteExtras.bat file from the same directory where system.img is in.
If you notice, all the files it deletes are 28 byte files, and if you open them in notepad only contain:
"!<symlink>toolbox..."
And we will remake the symbolic link when it is installed.
5.
Now from the directory where the system.img is, enter the following commands
mkdir META-INF
mkdir META-INF\com
mkdir META-INF\com\google
mkdir META-INF\com\google\android
Now copy the included file "update-script.txt" into the "META-INF\com\google\android" directory
and RENAME it to just "update-script".
This update-script gets run to recreate the symbolic links.
Not sure if these two are needed but they are in some custom ROMs here:
Copy the two files "fix_permissions" and "flash_image" to the "system\bin" directory.
6.
-- Optional --
These add root and Superuser access to the ROM, plus the Terminal Emulator application.
Copy the file "su" from Cyanogen's rom to the folder "system\bin"
Copy the file "Superuser.apk" to the folder "system\app"
Copy the file "Term.apk" to the folder "system\app"
You can also replace the "system\etc\apns-conf.xml" with a more complete one from here:
http://forum.xda-developers.com/showthread.php?t=547718
or here
http://docs.google.com/Doc?docid=0AZNbAmKkmakoZGZxZHNwMnpfMjJkaHg3ejN3eg&hl=en
Turn data roaming off by default by editing line in the build.prop file:
ro.com.android.dataroaming=false
Also to fix the Market program to show "Protected" applications change the ro.build.fingerprint line to the following:
ro.build.fingerprint=tmobile/opal/sapphire/sapphire:1.5/COC10/150449:user/ota-rel-keys,release-keys
Only phones with a fingerprint of a "released" device can access some market applications.
--------------
7.
Now we just need to create a ZIP file for the final ROM
Zip up the following file and two folders:
boot.img
META-INF
system
8.
Now sign the zip file.
See here how to sign a ZIP file for flashing it.
http://androidforums.com/developer-101/8665-how-signing-roms.html
9.
Copy it to your SD card, boot into recovery, wipe, apply the update, Reboot.
You are now running Android 1.6!
Click to expand...
Click to collapse
Could you tell me where I can correct the fake data in the phone like the real RAM is 512 MB but it say 1GB ,can you tell me how to
correct it thanks in advance:good:

[Need Help] Galaxy 3 Backup Tool

Hi,
i hope anybody can help me to make a Galaxy 3 Rom Backup Tool.
I made a little script for the German Forum, and it works fine but i can not flash the backupped Rom files.
Can somebody help me how i can push the backupped /data partition in datafs.rfs to the Phone without getting a Bootloop?
Here is a link to the Script http://www.multiupload.com/TAIJ9Z53J7
Sry for my english ^^
Nice work!
Will try ASAP...
And btw your english is good enough!
Ok, translated for you :
Code:
Install Total Commander and connect your Galaxy 3 to your PC in USB debugging mode
Next run Backup.bat
Your backup is finished when the window closes by itself. You can find the data in the folder backup on your SD
Copy the whole folder to your PC
Open the ROM Image.tar in total commander
Now you can flash your backup as One Package in Odin.
WARNING: please mention my name when you upload or translate the tool
Thanks for the code, I was just thinking along the same lines. You can skip the Total commander thing if you'd include something like 7zip commandline which is free. You can then call it from your batch file. Or tar it in the phone itself or is this too slow/bad for SD ?
You pull the files over with adb pull, but instruct to copy them from the SD as well.
As for why it bootloops : need to test it, but will probably wait for a fresh rom.
You can also put it back with dd ?
hmm
with which adb command i can put all 5 files in a flashable .tar file?
and how i can put the whole /data partition from the datafs.rfs in the /data folder and overwrite the files in the data folder?
Hmm, I see it's Busybox responding on my Galaxy, maybe it's not installed by default, but it was included in a custom ROM ?
Code:
BusyBox v1.18.4 (2011-03-20 15:16:04 CDT) multi-call binary.
Usage: tar -[cxtzjamvO] [-X FILE] [-f TARFILE] [-C DIR] [FILE]...
Create, extract, or list files from a tar file
Operation:
c Create
x Extract
t List
Options:
f Name of TARFILE ('-' for stdin/out)
C Change to DIR before operation
v Verbose
z (De)compress using gzip
j (De)compress using bzip2
a (De)compress using lzma
O Extract to stdout
h Follow symlinks
m Don't restore mtime
exclude File to exclude
X File with names to exclude
T File with names to include
You'd have to remount /data r/w to make any changes to it. But if you're dd-ing, it'll talk to the block device directly. Not sure how to clear it though, maybe dd does it by itself. Have a google for linux commands.
hmm ok,
and why i get a bootloop when i want to flash the files with odin?
one more question ^^
how i can pull the complete /data partition to SD card?
And Creating a .tar file with 7zip commandline works, but the File is not flashable.
you can find the info in i9000 forum
http://forum.xda-developers.com/showthread.php?t=943588
http://forum.xda-developers.com/showthread.php?t=960946
http://forum.xda-developers.com/showthread.php?t=965190
Okay i have a 1 click Rom backup now ^^
But its still the problem that i get a bootloop after flashing...
Ok, I tested it and /data was wiped, phone can't mount sd card etc. etc.
tgm28 said:
Ok, I tested it and /data was wiped, phone can't mount sd card etc. etc.
Click to expand...
Click to collapse
Use THIS from HERE.
Quoting deskjeti.
deskjeti said:
Hi,
I made a Backup & Recovery Script in the German Android Hilfe Forum for the Galaxy 3.
The Tool make a flashable Rom with 3 Clicks and Restore the Backup with one Flash and one Click.
The Script restores all Apps, app Data Google Account and Wifi key´s.
How To:
Unzip the zip file wherever you want and plug in your Phone with USB Debugging Mode.
Run the Step1 and wait, after Step1 is finished run Step2 and if Step2 finished Run Step3
In the "Alexgalaxys G3 Recovery v2 Final" Folder now is a CustomRom.tar.
Flash it as One Package.
If the Phone is started plug the Phone in Usb debugging mode and Run the Recovery.bat after it is complete you have to reboot you Phone.
Link: http://www.multiupload.com/NV0CFVYV2I
Click to expand...
Click to collapse
Although I edited the files to just be one click.

[GUIDE] How to extract system files from stock firmware

Ok, so I know many users are looking forward to create a custom rom. Where are you gonna get the system files from? Sure you can get it from a CWM backup. You can also extract the system files and the respective kernel from PDA.tar. Sure everyone knows it's in there but very few exactly know how to extract them. The system files are in the file "system.img".
So the 1st step is to open the PDA.tar using 7-zip and extract the system.img to a particular folder.
Download sgs2toext4.jar from attachment. It's a .jar file created by dphrozen to convert .img files to .ext4.img. Place that file anywhere in C:\ and then open the Command Prompt. In the command prompt, set the directory to the folder where sgs2toext4.jar is placed. Then type this command :-
Code:
java -jar sgs2toext4.jar
A window will open which is gonna ask you to drop the .img file in it. Simply drag the system.img to the window and the process of converting it to system.ext4.img will start. After the process is complete, you'll find system.ext4.img file in the same folder where your system.img file was placed.
Now, download Linux Reader. Install and then open it. At top left, go to Drives -> Mount Image. A window will open up. Browse to system.ext4.img and select it.
That's it! Now you can view all the system files. Export all of them to a particular folder. After exporting, you'll see an extension .efs.ntfs at the end of each file. Just delete that extension and you're good to go!

Universal Android Flasher

From now on, Android rom can be easy to pack. You don't need to worry about the permissions of the files or the symlinks anymore.
What does this package do:
1. Automatically find and recognize the img with patterned name in the same folder of this package.
2. Automatically wipe and flash the system partition when system.img is found.
3. Automatically flash the addon pack without wiping the system partition when addon.*.img is found.
4. Automatically backup efs and efs_gsm partition, on Samsung Duo sim card phones.
5. Be able to flash the unmountable partitions like boot, recovery, modem, etc.
How to pack:
1. Make you rom on on the Phone or Linux. On the Phone? Yes, you can test your patches on your phone.
2. No matter on the Phone or on Linux, cd /system/ or cd <your system folder>, check the permissions and symlinks. Usually I don't check cause I modify directly on a system I dumped from my phone. Yes a dump of system partition is a good idea.
3. You have two optitions: 1. Use the modified dumped system partition dump as system.img. This usually generate a big img to flash, but will flash faster. 2. If you use extracted folder or want to use small files, cd to the system folder in shell and make the folder to a tarball with the command: 'tar --lzma -cf <your tar file> * .[!.]*'. Why use * .[!.]*? This will put the .* files and folders in the tarball.
4. Then rename the dumped image or the tarball to system.img and put it in the same folder of the FLASHER.
5. Want to make an addon? Just make the name like addon.<your name>.img. Don't for get the permissions and ownership of the files and folders.
Future plan:
1. Make a packer/dumper for the system partition.
Github:
https://github.com/maxfu/universal_android_flasher
I will edit this post and post some pictures later.

Was the adb sideload successful?

So i adb sideloaded a vbmeta.zip file and at the time i thought it was successful.
But this zip file has a "magiskboot" file inside and a "META-INF" folder and i cannot find neither of them on root with the TWRP file explorer.
Does that mean that the sideload failed?
When you flash a .ZIP by means of ADB Sideload method then the script named updater-script housed in .ZIP's folder /META-INF/com/google/android gets processed.
Look inside this script to see what gets applied to Android.
jwoegerbauer said:
When you flash a .ZIP by means of ADB Sideload method then the script named updater-script housed in .ZIP's folder /META-INF/com/google/android gets processed.
Look inside this script to see what gets applied to Android.
Click to expand...
Click to collapse
That makes a lot of sense.
I just rerun it just in case

Categories

Resources