[Q] to Developers, How to Preroot. - Sony Xperia P, U, Sola, Go

Hi developers, i know sometimes i can be too insistent but, i really want to learn how to make those prerooted system.iso to help the comunity (Specially the spanish comunity, we have an spanish version of XDA for the people that does not understand english).
I've been searching a lot on google and this forum but i cant find anithing.
I would like to know at least where to look to find this info, what i need to know or some links to read. (Note: im not a developer, just a user wanting to learn xD)
Thanks in advance.
PD: I assume OTA rootkeeper doesnt work when flashing an .ftf

Sorry for repost, i found something, i know i have to make an .img from our system partition (i dont know how) then unpack the .img, then add superuser.apk and correct permissions and then repack the img.
oh, and i found this: http://www.mobi-forum.de/handys-sma...npack-repack-system-image-and-add-root-to-it/
as i understand is something like...
extract system.img from the device (dont know if we can do this from the system.sin, and dont know how)
extraxt system.img to a folder (dont know if this is an ext4 or yaffs2 partition but i can extract with ext2eplore but it seems that if you extract system.img on windows you lose all permissions so.. need linux?)
include superuser and correct permissions
include binaries and correct permissions
include or delete other apps and correct permissions
take that system folder to an .img
flash (yay! i know how to do it!)
so.. i know what must i do, but i dont know how to do it.
im not dev. im not a linux user but i learn fast

I would like to learn how to make prerooted images too. I've been looking for information about it but I haven't found anything
Any help will be appreciated

Just look in the Development section, and PM the people who are posting the pre-rooted images.

I have more info:
extract system.img ···> i think we can do that with sin2img (it extracts to yaffs partition, but i cant extract it with unyaffs)
extraxt system.img to a folder ···> We need linux to do this, im ussing Ubuntu for my first time and i downloaded:
These files for ext4 extracting and packing
These files to unyaff
But i have some errors line "command not found" with ext4 extractors, and "exceptions or corruptions" with unyaffs (it seems sin2img does not work properly)
include superuser and correct permissions
include binaries and correct permissions
include or delete other apps and correct permissions
take that system folder to an .img

I have similary problem.I cannot unpack system.img.So I cannot get root to my office firmware.If you have any progress,please tell me.Thanks.

well i found this, but when using unyaffs it gives me an error like "system.img not suported or corrupted"
http://wikiwiki.jp/knot/?SK17i-en

Yakandu said:
well i found this, but when using unyaffs it gives me an error like "system.img not suported or corrupted"
http://wikiwiki.jp/knot/?SK17i-en
Click to expand...
Click to collapse
system.img for XS is ext4, not yaffs.

Related

[Q] How do I make a CwM flashable .zip with edify scripting?

Hi all,
I need to make a CwM flashable .zip, but I don't know how. All I need to do is replace a few files in the /system/lib/ folder. Can anyone help me? I've been looking all over XDA and Google, but I just can't seem to find help for exactly the problem I have.
put whatever files you want on your phone and move them to wherever with root explorer ?? easier than making a zip to flash them instead
kyle51 said:
put whatever files you want on your phone and move them to wherever with root explorer ?? easier than making a zip to flash them instead
Click to expand...
Click to collapse
like that answers the OP's question....
@OP here:
http://forum.xda-developers.com/showthread.php?t=936175
http://forum.xda-developers.com/showthread.php?t=994940
http://www.synfulgeek.com/main/inde...d-off-of-kernel-source-code&catid=57:articles
http://spblinux.de/2.0/doc/commands.html
and of course you'll need some linux knowledge.
http://www.wikihow.com/Learn-to-Use-Linux
saw this before create thread.. linux not same as windows rite? i m new and confuse with those command

[Q] Creating boot.img for Galaxy S Advance

I hope this IS the thread for asking questions..haha...
Firstly I'm a noob at Android developing, but I'm willing to learn..So I just got myself a Samsung Galaxy S Advance, and I'm going to try to root it myself.. But I'm quite buffled with the firmwares that I downloaded at samfirmware for this phone, cos the file inside are quite different from what we always see, listed like this:
cache.img.md5
system.img.md5
hidden.img.md5
kernel.bin.md5
modem.bin.md5
And there is also this file (SS_DL.dll) which I don't know how to use.. for rooting, I'm supposed to find the boot.img and modify some files in it, but I have no idea where to look for it... I suspected it would be in the kernel.bin, or compiled from that file, but that would be out of my knowledge... Is there anyone who can point me to the right direction?
So far i have been trying to decompile the system.img to get their NAND imgs using unyaffs and unyaffs2, but both are not working (segmentation fault and file is not multiple of 2048 + 64 or something)... Is there any other way for me to extract boot.img from the files above?
I have decompiled system.img with dsixda kitchen, to get system files, but I don't know how to get boot.img (kernel). I think it is in the kernel.bin file, but the kitchen can't decompile it. I've been asking around how to get boot.img from this phone but nobody gives me any answer. If we somehow manage to get boot.img and decomple it, we can than make insercure kernel, which could be used for rooting the phone.
Here is the guide for rooting Samsung Galaxy S I9070 Advance.
http://software2tech.com/2012/05/01/root-galaxy-s-advance-i9070/#more-18866
There is one problem though, the most important files, that we need, haven't been uploaded yet. I've already searched this group on facebook, and nwrite them to publish those files (kernels), but there was no answer. So I doubt that they even have those rooted kernels. Maybe you could write them too, and lets hope that they will publish kernels soon!
I think they don't really have the rooted kernel.. Cos Samsung haven't even release the opensource k kernel yet.. But yeah, right now I'm stuck.. I have been trying almost every possible way to create the boot.img, including unyaffs and unyaffs2, but keep getting errors... If we can just ask the guys at rootzwiki to port CWM recovery for us, but maybe they need rooted source too..
This would be great if they could build us CWM recovery. I don't think they need kernel source they just need stock recovery, but to get stock recover.img from our phone we need to know here is located. I have pull partitons layout from the phone, but unfortunatly it doesnt tell anything useful. You can see it in the attachment.
whoa...that is great...maybe that could help...i will try to check with other phones, cos it might be that one of this partitions would contain boot.img as well as recovery.img... how exactly you extract this information, using kitchen, perhaps? haha...
No my phone used to be rooted, until I have upgrade it to new firmware (stupid me I know, but I had test firmware before, and had quite few bugs). And I've pulled this from system partition (in /proc folder). But you can also get it with this:
adb shell
cd proc
cat partitions
I can provide some other files, that might be useful. We just need some help from experienced developers, but so far no help was offered. I've been starting threads all over the place, but nothing .
In the attachment are all the files that might help some developer to get us recovery working!
well, after searching throughout the web, I'm starting to think that without the opensource kernel from samsung, it might be quite impossible for us to root this phone... every other imaginable ways to make these system or boot images seemed to require root access... so far samsung had done a very well job in patching those root exploits...
kilsmap said:
well, after searching throughout the web, I'm starting to think that without the opensource kernel from samsung, it might be quite impossible for us to root this phone... every other imaginable ways to make these system or boot images seemed to require root access... so far samsung had done a very well job in patching those root exploits...
Click to expand...
Click to collapse
Yeah I think you are right, but I wish you wer not . Well no we have to wait for samsung to release source code of the kernel.
Ok source code for kernel is now available!!! You can download it from opensource.samsung.com. I will make a thread later, with mirror links! Now lets compile that sh*** !
hahahahaha...at last...i was checking that site every few hours...this would make it!!
I've just made a thread on XDA:
http://forum.xda-developers.com/showthread.php?p=25782811#post25782811
If you managed to compile it before me please PM . I'm just installing linux, but I won't be able to continue until tommorow, cause I do this on work computer .

[Q] Help on unpack repack ext4 system image

Does any one know how can I unpack and repack ext4 system images using cygwin? can you give me the complete and understandable tutorials on it? I have tried all of the tutorials here in XDA, but it seems that I can't follow the right way. Please to someone, extend a helping hand on me.
Try this software it has helped me a lot
Nice Tool but i need something similar for userdata, or maybe the cygwin command to pack a folder in a sp_tool flushable img.

[Q] How to Extract data from .Backup file ? - Created with android system recovery

I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
looking for the same
reena0307 said:
I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
Click to expand...
Click to collapse
me too looking for the same thing ..how to extract from or decompile .backup file which we get thru recovery.
hi loverboyritesh :: i and you are in same position.. but some advaaanced users are here that we are telling rumors and lies.. dont worry bro.. even i'm trying to get solution.. will tel you after geeing one.. Still no one can tell me hoe to extract .BACKUP file..
same
i am looking for how to reinstall .backup myself so i can have my original rom install.
but i have notice my .backup is 700+mb while custom rom is 200+mb
do you know how to?
reena0307 said:
I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
Click to expand...
Click to collapse
same here. dunno how to open and extract the files from a .backup file. hoping you know already
siiingkeeet said:
same here. dunno how to open and extract the files from a .backup file. hoping you know already
Click to expand...
Click to collapse
Nope.. Still i'm having that file but no one knew
reena0307 said:
Nope.. Still i'm having that file but no one knew
Click to expand...
Click to collapse
been searching for 5 days now :<
not a single answer found on google and forums
cant even post a new thread yet. just joined
hope someone will drop by this thread
still no solution?
got same problem here
Got a bootloop issue with an ASUS MeMo Pad 7 HD and I've booted in recovery <3e> to make a backup.
I've got a userdata_YYYYMMDD_HHMMSS.backup. I tried opening it with a bunch of tools like unyaffs, abe (Android backup extractor), going live on the file using linux tools (open as 7zip, zip, rar, tar, tar.gz, gz, bz2 , mount as iso, ext4 and so on....)
Still no luck :-/
Only clue is that the file seems compressed. During the backup under recovery, it told me 3600MB to backup and the file userdata_xxxxxxxx_xxxxxx.backup show only 2.61GB
I did this backup 3 time to ensure there were no corruption during the write process from the pad and did again the same "tests" to open the file...Not better.
If any dev' have any clue of the file format, I'd be glad to help
It doesn't seem to be a valid unix img file. Tried mounting it to no avail. When it's restored by the recovery it also extracts the individual files because i fails on one in my case and stops the entire restore... I tried unzipping it, changed extension to ,jar, .tar, .zip, etc., none of them are recognised...amazing for a standard android feature to find so little info about it
Any solution?
I called Alcatel's technical service today and they told me that you can use the backup file only from the phone. Mine gives me the following error when I try to restore it: Error Magic header
If anyone knows how to unpack the backup file I would be more than grateful.
It's a 512 byte header in front of a "tar.gz"
hexdump -C userdata_xxxxxxxx_yyyyyy.backup | less​showed the magical zip header "1f8b0800 00000000" at offset 0x200
So, skipping 512 bytes, the rest can be gunzip | tar
dd if=userdata_xxxxxxxx_yyyyyy.backup bs=512 skip=1 | gunzip -c | tar xv​
Sir ektoric what d u mean on ur post?
Sorry cant understand it..
Can u please d a step by step procedure? Please...pls...plss
Thanks in advance...
Steps?
@ektoric sir im a noob in this... Can u show a step by step procedure?
@killen00 sorry, I assume you have a linux machine (or have access to one). The command is actually all there is to it.
Code:
dd if=userdata_xxxxxxxx_yyyyyy.backup bs=512 skip=1 | gunzip -c | tar xv
If you don't have a linux machine available, might I suggest one of the many distros of your choice, most of which have LiveCDs which you can run without installing.
script for gunzip method
maybe on xda it is common sense, but for me it was necessary to know, that these stock android recovery extracted files can be restored with nandroid custom recovery, if you simply repack them into tar archive.
i put this two command lines in a dirty shell script (extract + repack as tar).
thanks to ektoric figuring out his gunzip method!
edit: notamamasboy's mount method added (but not tested yet). if script not works come back few days later, download again and check version, maybe it has changed meanwhile.
with this you're able to transfer data of non-rooted phone to (rooted) similar one.
this is useful in case touchscreen is broken, you haven't custom recovery installed, usb-debugging is disabled and connecting usb-otg-mouse doesn't work.
tested on my Archos 50 b Oxygen (Mediatek MT6582).
it works for me, feel free to improve, port to busybox and publish. no support. use at own risk.
edit: bckp2cwm.sh is deprecated it is FOR JELLY BEAN ONLY (no selinux support)
a newer (selinux) version bckp2win.sh for TWRP you can find here:
http://forum.xda-developers.com/showthread.php?t=3775129
How did you go about determining the magic number found at 0x200? My hexdump output does not have that magic number (1f 8b) in any instance. Leads me to believe my backup is not a tar file. Any suggestions then?
@notamamasboy, you are unfortunately correct.
Someone else also mentioned that their
Code:
userdata_xxxxxxxx_yyyyyy.backup
file was not of the same format I tried some "known magic headers", and could not find anything tell-tale. In which case, without some clues, you are back at square one.
ektoric said:
@notamamasboy, you are unfortunately correct.
Someone else also mentioned that their
Code:
userdata_xxxxxxxx_yyyyyy.backup
file was not of the same format I tried some "known magic headers", and could not find anything tell-tale. In which case, without some clues, you are back at square one.
Click to expand...
Click to collapse
Even more peculiarly, two backups were created a .backup and a .backup2, I wonder if combining with cat I can get somewhere...

Converting Amlogic firmware IMG files into flashable ZIP for custom recovery

While trying to create my first ever Android firmware I had solve several problems, especially if you consider that I prefer under Windows instead of Linux.
I won't go into too many details as I have to assume everyone attempting this did at least some reading on the general how to of firmware installations and modifications.
Things you need:
Original firmware for your device as a IMG file
Amlogic's Customisation tool
A Rom Kitchen of your choice (I use Carliv)
System_Extractor-WIN-master
Some time...
Step1: Load the firmware into the AML tool and tick all boxes except the last one.
In the tmp folder you will find the unpacked files.
Under Level one are the files we want.
You will see a bunch of "PARTITION" files, we copy the following ones into a seperate folder for further use to create the ZIP.
I suggest to name the folder "Install" so we are all on the same page here.
boot.partition
bootloader.partition
logo.partition
recovery.partition
If you checked a flashable ZIP update before you will notice some files are missing, let's try to fix that.
Rename all partition files you copied to img, so instead of boot.partition you get boot.img.
Unpack the boot.img with your kitchen.
You will find a file "boot.img-second" - copy that into your install folder and rename it to dtb.img.
Inside the unpacked ramdisk (In your kitchen) of the boot.img you will fing the "file_contexts" file - copy that into your install folder as well.
Most AML firmware I had so far used a system.new.dat and a system.transfer.list to create the system partition.
We can create them from the system.partition file after renaming to system.img in System_Extractor-WIN-master .
To do this the system.img needs to be unpacked and we need again a copy of the file_contexts.
After the image is unpacked we can pack it again as system.new.dat and system.transfer.list.
The last missing bits can be tricky though as now we need a META-INF folder that works for our device in question.
There are two way to fix that.
Method one:
Search the usually chinese websites using Google to find original firmware for your device.
Chance are that you will find something like an OTA update - in there you will find what you need.
Method two (I never tested that):
Take the META-INF folder from an OTA update of a box with identical hardware specs.
Most important part here is the memory configuration so for a 2/16GB box you need a 2/16GB OTA update.
Next of same importance is the WiFi/Bluetooth config.
If you only have Wifi than an update for a box With daul wifi and BT4.0 won't help you.
If the actual Wifi chip is a different one but CPU, GPU, Memory and connections are the same it should still work.
Once you have the META-INF folder included into your Install folder the firmware is ready to be zipped - in theory!
The X96 for example uses a hash check for the update and created system partition.
To be able to flash your image you need to know what the original recovery would expect - has check or not.
The updater script within the META-INF folder needs to be updated to match your build.prop details as well hash check/no hash check.
Again, with an original OTA update you will find these infos.
Only if you don't have the OTA and no clue what your updater script and recovery needs you are a bit lost.
I know I has not all the steps in detail and if you are without and OTA update you need to search but otherwise feel free to ask and I will try to assist to make it complete if I can.
Downunder35m said:
While trying to create my first ever Android firmware I had solve several problems, especially if you consider that I prefer under Windows instead of Linux.
I won't go into too many details as I have to assume everyone attempting this did at least some reading on the general how to of firmware installations and modifications.
Things you need:
Original firmware for your device as a IMG file
Amlogic's Customisation tool
A Rom Kitchen of your choice (I use Carliv)
System_Extractor-WIN-master
Some time...
Step1: Load the firmware into the AML tool and tick all boxes except the last one.
In the tmp folder you will find the unpacked files.
Under Level one are the files we want.
You will see a bunch of "PARTITION" files, we copy the following ones into a seperate folder for further use to create the ZIP.
I suggest to name the folder "Install" so we are all on the same page here.
boot.partition
bootloader.partition
logo.partition
recovery.partition
If you checked a flashable ZIP update before you will notice some files are missing, let's try to fix that.
Rename all partition files you copied to img, so instead of boot.partition you get boot.img.
Unpack the boot.img with your kitchen.
You will find a file "boot.img-second" - copy that into your install folder and rename it to dtb.img.
Inside the unpacked ramdisk (In your kitchen) of the boot.img you will fing the "file_contexts" file - copy that into your install folder as well.
Most AML firmware I had so far used a system.new.dat and a system.transfer.list to create the system partition.
We can create them from the system.partition file after renaming to system.img in System_Extractor-WIN-master .
To do this the system.img needs to be unpacked and we need again a copy of the file_contexts.
After the image is unpacked we can pack it again as system.new.dat and system.transfer.list.
The last missing bits can be tricky though as now we need a META-INF folder that works for our device in question.
There are two way to fix that.
Method one:
Search the usually chinese websites using Google to find original firmware for your device.
Chance are that you will find something like an OTA update - in there you will find what you need.
Method two (I never tested that):
Take the META-INF folder from an OTA update of a box with identical hardware specs.
Most important part here is the memory configuration so for a 2/16GB box you need a 2/16GB OTA update.
Next of same importance is the WiFi/Bluetooth config.
If you only have Wifi than an update for a box With daul wifi and BT4.0 won't help you.
If the actual Wifi chip is a different one but CPU, GPU, Memory and connections are the same it should still work.
Once you have the META-INF folder included into your Install folder the firmware is ready to be zipped - in theory!
The X96 for example uses a hash check for the update and created system partition.
To be able to flash your image you need to know what the original recovery would expect - has check or not.
The updater script within the META-INF folder needs to be updated to match your build.prop details as well hash check/no hash check.
Again, with an original OTA update you will find these infos.
Only if you don't have the OTA and no clue what your updater script and recovery needs you are a bit lost.
I know I has not all the steps in detail and if you are without and OTA update you need to search but otherwise feel free to ask and I will try to assist to make it complete if I can.
Click to expand...
Click to collapse
Thank you for this explanation, but the explanation of the video to better understand everyone
Will see if I can at least add some pics while working on Nougat.
Hello,
Thanks for you tutorial.
I have a h96 Pro+ and the last firmware was a .img file... (Link of the firmware : https://mega.nz/#F!d1tHVZgA!Qc0mAom7FBHT9HDv3rGtGQ )
Is there a good guy who can convert this .img to a .zip file please ?
A lot of users are asking for this, me too and if you can help me to do this it will be really cool and appreciate
Thank you,
Carmin.
Thanks for your explanation im trting to port 7.1.1 to my tv box and i have found one funcional the only troble is the wi fi drivers not working ill give it a try latter today
Sent from my SM-N9300 using Tapatalk

Categories

Resources