FORUMS
Remove All Ads from XDA

[TOOL] Convert sin to flashable.zip

8,794 posts
Thanks Meter: 21,669
 
By munjeni, Senior Member on 18th October 2019, 09:21 PM
Post Reply Email Thread
Disclaimer:

Our tool was made for testing and educational purposes, ME is not responsible for what you do on/with your device using our tool, you must agree that you using our tool on your own risk, I am not responsible if you brick your device or anything else!

What is this for:

This tool converts xperia sin file and directly create flashable.zip for use to flash your android device with recovery.

Changelog:

- version 1. (missing selinux label generator)
- version 2. (implemented selinux label generator tool. Missing static busybox)
- version 3.
- version 4. some small corections, added missing update-binary
- version 5. some improvements, new sin unpack tool

How to use:

Extract sin2zip.rar archive & simple run CONVERT.bat & chose system.sin image , tool will produce flashable.zip

What you need to check or probably modify in generated flashable.zip:

1. busybox I have used is 32bit, it will work on 64bit too (not busybox.exe !!), I not recommend to change busybox, but before you go for busybox replace make sure it is STATIC busybox and have working (chcon and chown) with -h parameter!
2. check updater-script e.g. first 3 lines and last 2 lines!
3. this -> https://forum.xda-developers.com/sho...39&postcount=7

Source code:

modified ext4_read tool is in attachment. Original ext4_read is here, many thanks to author! I have notified Igor, hope we see selabels listing integration in 7z without need for hackish ext4_read
sony dump tool -> https://github.com/munjeni/anyxperia_dumper
Attached Files
File Type: rar ext4_read.rar - [Click for QR Code] (7.8 KB, 62 views)
File Type: rar sin2zip.rar - [Click for QR Code] (2.06 MB, 40 views)
The Following 8 Users Say Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
19th October 2019, 12:48 PM |#2  
bigrammy's Avatar
Senior Member
Flag huddersfield
Thanks Meter: 2,398
 
More
Quote:
Originally Posted by munjeni

This tool converts xperia sin file and directly create flashable.zip for using with recovery. 75 percent is done. 25 percent of the things is missing, selinux related things. I need help for implement selinux to the 7z to list selinux labels from ext4! Here is work in proogress

Maybe @SuperR. of SuperR's Kitchen fame HERE could give you some pointers on this.
Maybe you could work together to integrate some of your great Sony specific tools into the Kitchen
19th October 2019, 02:46 PM |#3  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
That kitchen do not have anything related to our tool. I have done some progress in extracting selabels from ext4 by searcing with inode number \0/
Right now tool is able to extract selabels by inode number pointing
The Following 3 Users Say Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
19th October 2019, 04:26 PM |#4  
serajr's Avatar
Recognized Developer / Recognized Themer
Flag Rafard - SP
Thanks Meter: 18,578
 
Donate to Me
More
So you are on the drawing board again! Cool...
About what you wrote in the j4nn's thread (1. to make fota unpack tool), count on me if you need help, ok!
If I'm not mistaken, I sent you a ota update_package file from my x performance some time ago, but if I am, here it goes again.
Cheers.
The Following User Says Thank You to serajr For This Useful Post: [ View ]
19th October 2019, 06:32 PM |#5  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
Quote:
Originally Posted by serajr

So you are on the drawing board again! Cool...
About what you wrote in the j4nn's thread (1. to make fota unpack tool), count on me if you need help, ok!
If I'm not mistaken, I sent you a ota update_package file from my x performance some time ago, but if I am, here it goes again.
Cheers.

Thanks! I will look into ota package till after I finish our tool
The Following User Says Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
19th October 2019, 06:34 PM |#6  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
Almost done! New version v2 is out! Made small tool to read ext4 image and print selabels to updater-script, it look like this:

if regular file or folder:
Code:
run_program("/tmp/busybox", "chcon", "u:object_r:location_exec:s0", "/system/bin/xtwifi-inet-agent");
if symlink:
Code:
run_program("/tmp/busybox", "chcon", "-h", "u:object_r:vendor_file:s0", "/system/bin/xxd");
Tool is curently 95 percent done, not realy ready for flashig produced flashable.zip , need to implement 5 percent of the things. You can try but plese do not try to flash with recovery it will not work corectly!
The Following User Says Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
19th October 2019, 08:04 PM |#7  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
Version 3 done! Before you flash flashable.zip please check updater-script first 3 lines and last 2 lines! Do in mind our tool didn't include the rest of firmware like kernel, vendor...etc, tool only convert one sin file to flashable.zip, if you need the rest of firmware run CONVERT.bat and chose another sin file, do merges in zip by hand and do merges-modification in updater-script by hand too. Not recommended for newbies! I can't tell you if produced flashable.zip is working I'm not tried to flash flashable.zip, but I think it going work. Important thing is initial tool is done and somebody need to test. Let me know Enjoy!
The Following 2 Users Say Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
19th October 2019, 10:03 PM |#8  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
Version 4 done. Enjoy!
The Following 3 Users Say Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
20th October 2019, 10:51 AM |#9  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
@serajr here is some info https://forum.xda-developers.com/sho...postcount=1330 , your file is the same format as j4nn
The Following User Says Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
29th October 2019, 03:06 PM |#10  
munjeni's Avatar
OP Senior Member
Thanks Meter: 21,669
 
Donate to Me
More
Version 5 done.
The Following 4 Users Say Thank You to munjeni For This Useful Post: [ View ] Gift munjeni Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes