[TOOL][ARM]sdat2img for Android! - Android Software/Hacking General [Developers Only]

sdat2img for Android!
Most of us, have no pc for converting system.new.dat to system.img...
So, this is why i create this tool!​
Code:
[B]Post 1[/B] → Introduction, installation, downloads
[B]Post 2[/B] → Changelog
[B]Post 3[/B] → How to use
sdat2img is a tool, that write on python language, to convert system.new.dat into system.img
This tool was only work on Windows and Linux
So i adapt it into android that can be runned in the Terminal​
Requirements:
Custom Recovery
Around 30-50MB of free system
a Terminal
Installation:
Download the zip
Install via custom recovery
Reboot!
Uninstalling:
I should have the uninstaller, but it is gone somewere in my PC. So maybe later gonna add this.
Download links:
AndroidFileHost
Credits:
@xpirt for sdat2img.py
@7175 for python for android
XDA:DevDB Information
sdat2img for Android, Tool/Utility for the Android General
Contributors
RendyAK
Version Information
Status: Beta
Current Beta Version: 0.2
Created 2016-08-27
Last Updated 2016-08-27

Changelog:
0.2 BETA
Code:
[Fixed] Convert error
Old Changelog
Code:
[B]0.1 BETA[/B]
- Intial Release

How to use!
Well, this is pretty simple, haha.
Just like the @xpirt sdat2img.
Code:
Usage: sdat2img <system_transfer_list> <system_new_file> <system_img>
And wait for the process finish.
WARNING!
I SUGGEST YOU TO "cd" TO THE DIRECTORY OF system.new.dat FIRST!
How to extract the system.img?
Just simply enter this command
Dont forget to "cd" to the directory of system.img
Code:
mkdir system
mount -t ext4 -o loop system.img system
cp -rf system system2
And the output is on system2 folder.
Dont forget to press enter each command you type!

Reserved for some case.

Update!
0.2 BETA
Code:
[Fixed] Convert error

Incredible! Thank you so much for this, can't wait to try it out! :good:

RendyAK said:
Changelog:
0.2 BETA
Click to expand...
Click to collapse
After unpacking the file sdat2img-android-arm-0.2.zip, catalog python3.4.2 occupies 42.6 MB of valuable space on the system partition.
Could you just leave these components python that are needed?
Thanks.

ze7zez said:
After unpacking the file sdat2img-android-arm-0.2.zip, catalog python3.4.2 occupies 42.6 MB of valuable space on the system partition.
Could you just leave these components python that are needed?
Thanks.
Click to expand...
Click to collapse
I didnt know whats the python main file.
But it think for best result its need all of the python files.

On Android! Just what I was searching for. Thank you @RendyAK. This is awesome stuff.

hi @RendyAK
I have a cm12 system.new.dat. What will your program do to this
I floop the pig

Everything had worked fine till i tried to convert a dat file of over 4gb. It says
[email protected]:/ $ su
[email protected]:/ # cd /storage/sdcard1
system.transfer.list system.new.dat system.img <
Traceback (most recent call last):
File "/system/python3.4.2/sdat2img.py", line 99, in <module>
main(sys.argv)
File "/system/python3.4.2/sdat2img.py", line 78, in main
init_output_file_size(output_img, commands)
File "/system/python3.4.2/sdat2img.py", line 73, in init_output_file_size
output_file_obj.flush()
OSError: [Errno 27] File too large
1|[email protected]:/storage/sdcard1 #

adithbalan said:
Everything had worked fine till i tried to convert a dat file of over 4gb. It says
0_a1[email protected]:/ $ su
[email protected]:/ # cd /storage/sdcard1
system.transfer.list system.new.dat system.img <
Traceback (most recent call last):
File "/system/python3.4.2/sdat2img.py", line 99, in <module>
main(sys.argv)
File "/system/python3.4.2/sdat2img.py", line 78, in main
init_output_file_size(output_img, commands)
File "/system/python3.4.2/sdat2img.py", line 73, in init_output_file_size
output_file_obj.flush()
OSError: [Errno 27] File too large
1|[email protected]:/storage/sdcard1 #
Click to expand...
Click to collapse
Please make sure you have 4-8GB free on your sdcard.

PiggyFlooper said:
hi @RendyAK
I have a cm12 system.new.dat. What will your program do to this
I floop the pig
Click to expand...
Click to collapse
It just do the same with the xpirt's sdat2img.
Go to xpirt thread for more info

@RendyAK, can you give me a link to the python for android

When i write this command
mount -t ext4 -o loop system.img system
Then it shows device or resource busy

@RendyAK
Hi is there a way to uninstall this zip ?

Help me !
RendyAK said:
Well, this is pretty simple, haha.
Just like the @xpirt sdat2img.
Code:
Usage: sdat2img <system_transfer_list> <system_new_file> <system_img>
And wait for the process finish.
WARNING!
I SUGGEST YOU TO "cd" TO THE DIRECTORY OF system.new.dat FIRST!
How to extract the system.img?
Just simply enter this command
Dont forget to "cd" to the directory of system.img
Code:
mkdir system
mount -t ext4 -o loop system.img system
cp -rf system system2
And the output is on system2 folder.
Dont forget to press enter each command you type!
Click to expand...
Click to collapse
After I type and enter " Usage: sdat2img...." , terminal display this "
/system/bin/sh: syntax error: '< ' unexpected
"

Lordlight said:
After I type and enter " Usage: sdat2img...." , terminal display this "
/system/bin/sh: syntax error: '< ' unexpected
"
Click to expand...
Click to collapse
Don't type it literally. You supposed to replace stuff in brackets with your filenames. "Usage:" should be there too.

Thanks a lot !
Not_Sure said:
Don't type it literally. You supposed to replace stuff in brackets with your filenames. "Usage:" should be there too.
Click to expand...
Click to collapse
Could you please give me an example ?

It is better.
Binary sdat2img, no python

Related

How to mount & modify system.img (Ubuntu)

Hi to all. I am a newbie ... but I try to do all my best
Above all please make a directory under /mnt (I called the directory "MyMount1"); "mylogin" represents your login name.
Open the terminal and type the next commands:
-sudo mkdir /mnt/MyMount1
-sudo chown mylogin:mylogin /mnt/MyMount1
-copy system.img & paste it into MyMount1 (computer/mnt/MyMount1)
-cd /
-cd mnt
-cd MyMount1
-mkdir sys/ && sudo mount -t ext4 -o loop system.img sys/
-sudo chown mylogin:mylogin sys (without this command you will not be able to copy and modify anything)
-cd sys
-sudo chown mylogin:mylogin addon.d (without this command you will not be able to copy and modify anything)
-then copy addon.d & paste it into Ubuntu Desktop (now you can make any changes you want)
-then delete addon.d into /mnt/MyMount1/sys
-copy addon.d (into Ubuntu Desktop) & paste it into /mnt/MyMount1/sys
-then apply the same command to every folder inside system.img (/mnt/MyMount1/sys) and repeat the procedure (copy it into Ubuntu Desktop, make changes and paste it into /mnt/MyMount1/sys).
The following screenshot will help you better understand all the steps :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Before "sudo chown mylogin:mylogin sys" command :
After "sudo chown mylogin:mylogin sys" command :
Before "sudo chown mylogin:mylogin addon.d" command :
After "sudo chown mylogin:mylogin addon.d" command :
That's all ... for now
XDA:DevDB Information
System.img, ROM for all devices (see above for details)
Contributors
Cleopatra Bianchi
ROM OS Version: 6.0.x Marshmallow
Version Information
Status: Testing
Created 2016-03-24
Last Updated 2016-03-24
hey there!!! i can give you a couple of suggestion, even if i don't get if you are only extracting or also editing and repacking since i don't see any repack code.. anyway.. first of all you definitely should use -R in yoour chown code.. this means recursive.. so you don't have to do it for every folder, subfolder and so on!! do a chown -r for sys and you're done with it.
then another thing.. i personally use a script that will handle all this by itself, i put it in the file explorer script folder and so you can access it from everywhere just right-clicking on the file you want to mount.. it will need to edit path for pass it as variable, but it's easy.. at least once you know how to
so this is my script:
Code:
#!/bin/bash
CWD=(pwd)
simg2img [email protected] img.img; mkdir /tmp/system; mate-terminal -x sudo mount -t auto -o loop img.img /tmp/system; mate-terminal -x sudo chown -R login:login /tmp/system
just to explain, you see simg2img because i work with sparse img ( from samsung) that must be converted to regular img before get mounted, so i have the simg2img binary compiled and moved into /usr/local/bin path to access it from any path.. you will need to do the same or to remove that part if you don't need it.
also you must change mate-terminal to plain terminal since you're on unity i can see
then move the script to /home/your_login/.nautilus/script (again because you're on unity using nautilus i think) check if it has the exec bit enbled from permission and then enjoy..
oh another thing.. in case you need to copy keeping the permissions and ownership, so that you don't ahve to fix all that later you simply don't set the last part of the script - the chown part, since you can access the subfolders and files anyway and for ex. use the "cp -a /tmp/system/app /your_desired_path to work on it.
Wuby986 said:
hey there!!! i can give you a couple of suggestion, even if i don't get if you are only extracting or also editing and repacking since i don't see any repack code.. anyway.. first of all you definitely should use -R in yoour chown code.. this means recursive.. so you don't have to do it for every folder, subfolder and so on!! do a chown -r for sys and you're done with it.
then another thing.. i personally use a script that will handle all this by itself, i put it in the file explorer script folder and so you can access it from everywhere just right-clicking on the file you want to mount.. it will need to edit path for pass it as variable, but it's easy.. at least once you know how to
so this is my script:
Code:
#!/bin/bash
CWD=(pwd)
simg2img [email protected] img.img; mkdir /tmp/system; mate-terminal -x sudo mount -t auto -o loop img.img /tmp/system; mate-terminal -x sudo chown -R login:login /tmp/system
just to explain, you see simg2img because i work with sparse img ( from samsung) that must be converted to regular img before get mounted, so i have the simg2img binary compiled and moved into /usr/local/bin path to access it from any path.. you will need to do the same or to remove that part if you don't need it.
also you must change mate-terminal to plain terminal since you're on unity i can see
then move the script to /home/your_login/.nautilus/script (again because you're on unity using nautilus i think) check if it has the exec bit enbled from permission and then enjoy..
oh another thing.. in case you need to copy keeping the permissions and ownership, so that you don't ahve to fix all that later you simply don't set the last part of the script - the chown part, since you can access the subfolders and files anyway and for ex. use the "cp -a /tmp/system/app /your_desired_path to work on it.
Click to expand...
Click to collapse
Thank you very much for your suggestions
I have to admit that I am a newbie/noob ... particularly on Linux (I have installed Ubuntu OS just a week ago ... I come from the planet Windows). I have tried "android_img_repack_tools-android-6.0.1_r3_x64.tar.gz" ... but simg2img doesn't works (I am not able to convert system.img in raw). I'm trying to mod a system.img Mediatek Marshmallow.
Kindest Regards.
Cleopatra Bianchi said:
Thank you very much for your suggestions
I have to admit that I am a newbie/noob ... particularly on Linux (I have installed Ubuntu OS just a week ago ... I come from the planet Windows). I have tried "android_img_repack_tools-android-6.0.1_r3_x64.tar.gz" ... but simg2img doesn't works (I am not able to convert system.img in raw). I'm trying to mod a system.img Mediatek Marshmallow.
Kindest Regards.
Click to expand...
Click to collapse
i hano NO idea about mediatek devices, you should ask in the corresponding fora, but most likely you don't need simg 2 img since that's not a sparse img, so you could be able to mount it strait away.. or at least try first without converting it.
what's the error you're getting in terminal?
Wuby986 said:
i hano NO idea about mediatek devices, you should ask in the corresponding fora, but most likely you don't need simg 2 img since that's not a sparse img, so you could be able to mount it strait away.. or at least try first without converting it.
what's the error you're getting in terminal?
Click to expand...
Click to collapse
This is the error in terminal :
Cleopatra Bianchi said:
This is the error in terminal :
Click to expand...
Click to collapse
yeah then is definitely not a sparse img.. maybe a regular img or other kinda of..
you should search for the mtk device forum for this info.. or better yet maybe the @dsixda kitchen has a conversion binary for it, so you can see which is and use it instead of the simg2img.. this kitchen is not anymore updated, so you cannot use it for everything like repack or root, but should work for unpack
Wuby986 said:
yeah then is definitely not a sparse img.. maybe a regular img or other kinda of..
you should search for the mtk device forum for this info.. or better yet maybe the @dsixda kitchen has a conversion binary for it, so you can see which is and use it instead of the simg2img.. this kitchen is not anymore updated, so you cannot use it for everything like repack or root, but should work for unpack
Click to expand...
Click to collapse
Ok ... I'll do it. Thank you very much for your suggestions.
Happy Easter
Cleopatra Bianchi said:
Hi to all. I am a newbie ... but I try to do all my best
Above all please make a directory under /mnt (I called the directory "MyMount1"); "mylogin" represents your login name.
Open the terminal and type the next commands:
-sudo mkdir /mnt/MyMount1
-sudo chown mylogin:mylogin /mnt/MyMount1
-copy system.img & paste it into MyMount1 (computer/mnt/MyMount1)
-cd /
-cd mnt
-cd MyMount1
-mkdir sys/ && sudo mount -t ext4 -o loop system.img sys/
-sudo chown mylogin:mylogin sys (without this command you will not be able to copy and modify anything)
-cd sys
-sudo chown mylogin:mylogin addon.d (without this command you will not be able to copy and modify anything)
-then copy addon.d & paste it into Ubuntu Desktop (now you can make any changes you want)
-then delete addon.d into /mnt/MyMount1/sys
-copy addon.d (into Ubuntu Desktop) & paste it into /mnt/MyMount1/sys
-then apply the same command to every folder inside system.img (/mnt/MyMount1/sys) and repeat the procedure (copy it into Ubuntu Desktop, make changes and paste it into /mnt/MyMount1/sys).
The following screenshot will help you better understand all the steps :
Before "sudo chown mylogin:mylogin sys" command :
After "sudo chown mylogin:mylogin sys" command :
Before "sudo chown mylogin:mylogin addon.d" command :
After "sudo chown mylogin:mylogin addon.d" command :
That's all ... for now
XDA:DevDB Information
System.img, ROM for all devices (see above for details)
Contributors
Cleopatra Bianchi
ROM OS Version: 6.0.x Marshmallow
Version Information
Status: Testing
Created 2016-03-24
Last Updated 2016-03-24
Click to expand...
Click to collapse
pro tip use -R to make chown reclusive and include all the subfolders
sudo chown login:login -R (folder in sys)
---------- Post added at 08:59 AM ---------- Previous post was at 08:59 AM ----------
Cleopatra Bianchi said:
Hi to all. I am a newbie ... but I try to do all my best
Above all please make a directory under /mnt (I called the directory "MyMount1"); "mylogin" represents your login name.
Open the terminal and type the next commands:
-sudo mkdir /mnt/MyMount1
-sudo chown mylogin:mylogin /mnt/MyMount1
-copy system.img & paste it into MyMount1 (computer/mnt/MyMount1)
-cd /
-cd mnt
-cd MyMount1
-mkdir sys/ && sudo mount -t ext4 -o loop system.img sys/
-sudo chown mylogin:mylogin sys (without this command you will not be able to copy and modify anything)
-cd sys
-sudo chown mylogin:mylogin addon.d (without this command you will not be able to copy and modify anything)
-then copy addon.d & paste it into Ubuntu Desktop (now you can make any changes you want)
-then delete addon.d into /mnt/MyMount1/sys
-copy addon.d (into Ubuntu Desktop) & paste it into /mnt/MyMount1/sys
-then apply the same command to every folder inside system.img (/mnt/MyMount1/sys) and repeat the procedure (copy it into Ubuntu Desktop, make changes and paste it into /mnt/MyMount1/sys).
The following screenshot will help you better understand all the steps :
Before "sudo chown mylogin:mylogin sys" command :
After "sudo chown mylogin:mylogin sys" command :
Before "sudo chown mylogin:mylogin addon.d" command :
After "sudo chown mylogin:mylogin addon.d" command :
That's all ... for now
XDA:DevDB Information
System.img, ROM for all devices (see above for details)
Contributors
Cleopatra Bianchi
ROM OS Version: 6.0.x Marshmallow
Version Information
Status: Testing
Created 2016-03-24
Last Updated 2016-03-24
Click to expand...
Click to collapse
pro tip use -R to make chown reclusive and include all the subfolders
sudo chown login:login -R (folder in sys)

[GUIDE][Linux/Win] How to unpack system_1.img+system_2.img+...+system_*.img | 2019

A youtube video on this guide
Watch video
Hello guys,
I rarely write guide and tutorials .so neglect my typos and gramatical mistakes
Today im gonna show you how to unpack sparsed system.img files (system_1.img+system_2.img+............+system_*.img)
supports system / cache / userdata / persist / vendor / cust / odm /oem partitions from QFIL firmwares
Lets get started
LINUX
Things Needed:
1) Packsparseimg
2) Imgextractor.exe -Need wine for this
Procedure:
1) First of all extract you device firmware in which you have sparse system.img files in a folder.
(folder path ex:~/Desktop/firmware)
2) Copy the downloaded packsparseimg_v1.1 and Imgextractor.exe in the same folder where you extracted your firmware
(ex:~/Desktop/firmware)
3) Open terminal and enter below commands.
4)
Code:
chmod 0755 packsparseimg_v1.1
5)This command will pack sparse system_1.img....files to system.raw
Code:
./packsparseimg_v1.1
you can use these commands to pack sparse cache and userdata persist,vendor,cust,odm partitions
Code:
Usage of ./packsparseimg_v1.1:
-o string
output dir path (default "./")
-t string
image to unsparse: system / cache / userdata / persist / vendor / cust / odm / oem (default "system")
-x string
xml file to load (default "./rawprogram_unsparse.xml")
6) After joining of sparse system.img's finishes you will get system.raw file
7) Use below commands to unpack system.raw to system folder
Note: You need wine on your linux to run imgextractor.exe
Code:
wine imgextractor.exe system.raw
8) Hell Yeah! you have successfully unpack those system_1,2,3,4....imgs
now you can make your own stock deodexed rom
Downloads For linux:-
[MOD EDIT: URL REMOVED]
Password:innfinite4evr
Imgextractor.exe
WINDOWS
Things Needed:
1) packsparseimg_v1.1
2) Imgextractor.exe
Procedure:
1) First of all extract you device firmware in which you have sparse system.img files in a folder.
(folder path exesktop/Myfirmware)
2) Copy the downloaded packsparseimg_v1.1 and Imgextractor.exe in the same folder where you extracted your firmware
(exesktop/Myfirmware)
3) Open Command Prompt (cmd.exe) and enter below commands.
PS: you can open command propmt by any of these methods. Here method 1 is preferred
Method 1: Most suitable method for this guide
hold down shift key while pressing the right mouse onto the folder you want to open "command prompt" then a new menu item will appear in your context menu offering you exactly that: "open command prompt here" select it and command prompt will open.
Method 2:Search is very helpful. In Windows 7, open the Start Menu and type command or cmd. Then, click or tap the Command Prompt
Method 3ne of the quickest ways to launch the Command Prompt is to use the Run window (press Win+R on your keyboard and type cmd and press enter to open it).
i guess three methods are enough for windows users
4) AFter command prompt opens enter below comamnds to proceed further
5)This command will pack sparse system_1.img....files to system.raw
Note default is "system"
Code:
packsparseimg
you can use these commands to pack sparse cache and userdata persist,vendor,cust,odm partitions
Code:
Usage of packsparseimg:
-o string
output dir path (default "./")
-t string
image to unsparse: system / cache / userdata / persist / vendor / cust / odm (default "system")
-x string
xml file to load (default "./rawprogram_unsparse.xml")
6) After joining of sparse system.img's finishes you will get system.raw file
7) Use below commands to unpack system.raw to system folder
Code:
imgextractor.exe system.raw
8) Now you will get unpacked system folder
Hell Yeah! you have successfully unpack those system_1,2,3,4....imgs
now you can make your own stock deodexed rom
Downloads for windows:-
Imgextractor.exe
Password:innfinite4evr
[MOD EDIT: URL REMOVED]
Changelog:-
in update v1.1
now supports system / cache / userdata / persist / vendor / cust / odm /oem partitions from QFIL firmwares
Credits:
kidd for initially making packsparseimg binary
@and_pDA for imgextractor,exe(Based on sources ext4_unpacker)
@Innfinite4evr for testing this method and write this guide​
Great work bro :good: Nice job and thanks for this
great work man. thanks
can you share code?
There is another way to unpacj that instead of using wine.
Code:
mount -o loop -t ext4 system.img [path]
Replace:
[Path] with path to the output directory you want (ex: ~/sys-img)
ext4: This might be different, check it by yourself, but most device now using ext4
Thanks for the info, btw
Please can somebody tell me how to revert the process? To create again sparse images and flash via qfil? Thanks in advance!
cofface said:
can you share code?
Click to expand...
Click to collapse
only prebuilts
cofface said:
can you share code?
Click to expand...
Click to collapse
only prebuilts
I get this error on Ubuntu:
bash: ./packsparseimg: cannot execute binary file: Formato eseguibile non valido
What is the procedure to do the reverse?
How to repack as parts
sir i was trying to repack system folder to system_1.img system_2.img etc.
is there any way for that?
i need to repack and flash to my phone
Doesn't seem to work for Oreo a/b system
@Innfinite4evr Hi there, can you add vendor, cust and odm support ?
AL_IRAQI said:
@Innfinite4evrHi there, can you add vendor, cust and odm support ?
Click to expand...
Click to collapse
Yes there is.
Im thinking to update this stuff
AL_IRAQI said:
@Innfinite4evrHi there, can you add vendor, cust and odm support ?
Click to expand...
Click to collapse
Ive updated the tool, maybe you can try for odm partition.
Innfinite4evr said:
Ive updated the tool, maybe you can try for odm partition.
Click to expand...
Click to collapse
I've try to buy, with all my2 credit card (master card and american express)
I was addebited 1€ in my mastercard, but it always give me error and I can't download the program.
I do not want the refund, I'd like to have the tool!
Samuele Bonzio
I give you my phone number by PM if that need!
Thank you!
Thread closed. PM me when you have download links that don't require payment to be added to the OP.

[Dev tool] Unpack .Dat compression on Your Android phone itself [Using Termux]

Introduction​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Well I was Going Through The possibilities of Termux and was extracting .Dat compression in my PC to extract some files out of system folder Then i readed in one xda thread that Termux can install Python,cmake, and all in our Android itself also seen that Python script by @xpirt on @matrixex thread for unpack repack .Dat on pc I seen that this Python script converts .dat to .img Then suddenly One idea arised in my mind Why don't I try that in my phone itself I tried and the result was just insane it worked like a charm in real. Now we want files but it is in .img extension how can we extract that then i Found This app called Zarchiver on playstore You can unpack the image now and use those files or edit them Also i found Another interesting app Android image kitchen by which you can unpack the image and make changes in the image content by import export of files but it leaves the image as it is in .img extension only can edit but can't unpack so the Zarchiver method is the best.....
This can help Rom porters and Rom developing Dev's​
Plz don't forget to hit the thnx button it can appreciate someone ???
I am still a noob so i can't answer Dev's professional questions but I think Other Dev's Moderators and Contributors will help the DEv's​
Special thnx to
@xpirt
@matrixex
@termuxAppDevloper
@ZArchiverAppDevloper
@aindroidImageKitchenAppDevloper
@dg28gadhavi Aka me
Guide​
Files to be download:
Termux app
Termux Api app
Commands.txt
Zarchiver app
AIK app
Es file explorer
Quick text editor
Links:
TermuxApp
TermuxApiApp
Zarchiver
AikApp
EsFileexplorer
Quickest ditor
Pythonscript
Commands.txt
1. Install the given apps and download all requirements
2. Open Termux app and let it be initialize 1st
3. Copy commands from command.txt step by step
4. Download python by apt-get install python (note but follow the commands.txt commands first and go step by step)
5. Make a folder name ext in internal memory/download
6. Extract the python script zip (sdatmaster.zip) and copy it in internal memory/download/ext
7. Also copy Your system.new.dat , system.transfer.list and filecontext in internal memory​/download/ext folder
8. Now Following the command.txt Type this command- termux-setup-storage
9. Now change path to directory as mentioned in command.txt- cd storage/downloads/ext
10. Now execute that python script as mentioned in commands.txt- python sdat2img.py system.transfer.list system.new.dat system.img
11. Copy the code to convert​.dat to .img
12. Use Zarchiver to unpack/extract the image
13. Unpacking done enjoy
Note
Root required
And it can't extract OEM Delta OTA updates​
Good Guide.
dg28gadhavi said:
Guide
Click to expand...
Click to collapse
We can also use Image Factory app to do this https://m.apkhere.com/app/crixec.app.imagefactory
For new brotli packages we need additional commands
Code:
cd /sdcard/Download/ext
pkg install brotli
brotli -d system.new.dat.br -o system.new.dat
Pack ke system.new.dat TO system.new.dat.br what do you do
Wahyu6070 said:
Pack ke system.new.dat TO system.new.dat.br what do you do
Click to expand...
Click to collapse
Try the below command to compress system.new.dat to brotli
Code:
cd <path to system.new.dat directory>
brotli system.new.dat -o system.new.dat.br
Repack system.new.img to system.new.dat
:good:
repack system.new.img to system.new.dat how do you do it
Wahyu6070 said:
:good:
repack system.new.img to system.new.dat how do you do it
Click to expand...
Click to collapse
https://github.com/xpirt/img2sdat
https://forum.xda-developers.com/an.../how-to-conver-lollipop-dat-files-to-t2978952
python img2simg.py system.img fail
to repack the system folder to system.img. the code that I use: python img2simg.py system.img system2.img, posted on xpirt the way it is but can't.
xpirt posts use linix instead of termux
how to use linux pc instead of android thermux and use sudo command
Wahyu6070 said:
to repack the system folder to system.img. the code that I use: python img2simg.py system.img system2.img, posted on xpirt the way it is but can't.
Click to expand...
Click to collapse
How you got system folder? Did you mounted system.img to some folder?
I rented dat to img. then I uninstall the file system.img using zarchiver, and in that folder there are build pro files, prive apps etc., and how do I change it back to img ... then to dat
Wahyu6070 said:
I rented dat to img. then I uninstall the file system.img using zarchiver, and in that folder there are build pro files, prive apps etc., and how do I change it back to img ... then to dat
Click to expand...
Click to collapse
I dont know how to do that from a folder....
But If you are using mobile you can mount it somewhere and tweak it....
Code:
mkdir /data/local/system
mount -t ext4 -o rw,noatime <system.img path> /data/local/system
You can now tweak /data/local/system folder ...
After tweaking that system folder you have to unmount /data/local/system
Code:
umount /data/local/system
img2simg system.img system_sparse.img
img2simg binary can be found in FlashFire apk lib folder for your arch...
Then you have to use img2sdat.py code.....
HemanthJabalpuri said:
I dont know how to do that from a folder....
But If you are using mobile you can mount it somewhere and tweak it....
Code:
mkdir /data/local/system
mount -t ext4 -o rw,noatime <system.img path> /data/local/system
You can now tweak /data/local/system folder ...
After tweaking that system folder you have to unmount /data/local/system
Code:
umount /data/local/system
img2simg system.img system_sparse.img
img2simg binary can be found in FlashFire apk lib folder for your arch...
In flashfire.apk / lib / exist 2 folders (armeabi-v7a and x86) and deep in the folders of the fishery format libimg2simg.so not img2simg.py do I have to change the format
Click to expand...
Click to collapse
Wahyu6070 said:
In flashfire.apk / lib / exist 2 folders (armeabi-v7a and x86) and deep in the folders of the fishery format libimg2simg.so not img2simg.py do I have to change the format
Click to expand...
Click to collapse
You have to rename it to img2simg.......
Note that img2simg and img2sdat.py are different ones.....
HemanthJabalpuri said:
I dont know how to do that from a folder....
But If you are using mobile you can mount it somewhere and tweak it....
Code:
mkdir /data/local/system
mount -t ext4 -o rw,noatime <system.img path> /data/local/system
You can now tweak /data/local/system folder ...
After tweaking that system folder you have to unmount /data/local/system
Code:
umount /data/local/system
img2simg system.img system_sparse.img
img2simg binary can be found in FlashFire apk lib folder for your arch...
Then you have to use img2sdat.py code.....
Click to expand...
Click to collapse
I think the code that is used cannot
Code:
1|[email protected]:/data/data/com.termux/files/home #
rw,noatime system.img /data/local/system <
mount: 'system.img'->'/data/local/system': No such file or directory
Wahyu6070 said:
I think the code that is used cannot
Click to expand...
Click to collapse
You need to first change working directory if you want to only use system.img as arg instead of whole path
Code:
cd <directory path to system.img>
HemanthJabalpuri said:
You need to first change working directory if you want to only use system.img as arg instead of whole path
Code:
cd <directory path to system.img>
Click to expand...
Click to collapse
Code:
ount -t ext4 -o rw,noatime <system.img path> /data/local/system <
mount: bad /etc/fstab: No such file or directory
still can't
Wahyu6070 said:
still can't
Click to expand...
Click to collapse
Your code is wrong...
Place system.img extracted from .dat file in /sdcard/Music folder and type following
Code:
su
mkdir /data/local/system
mount -t ext4 -o rw,noatime /sdcard/Music/system.img /data/local/system
Now you can go to /data/local/system and tweak it and unmount afterwards
Place img2simg binary in /sdcard/Music and
Code:
umount /data/local/system
exit
cp /sdcard/Music/img2simg $HOME
chmod +x $HOME/img2simg
cd $HOME
./img2simg /sdcard/Music/system.img /sdcard/Music/system_sparse.img
HemanthJabalpuri said:
Your code is wrong...
Place system.img extracted from .dat file in /sdcard/Music folder and type following
Code:
su
mkdir /data/local/system
mount -t ext4 -o rw,noatime /sdcard/Music/system.img /data/local/system
Now you can go to /data/local/system and tweak it and unmount afterwards
Place img2simg binary in /sdcard/Music and
Code:
cp /sdcard/Music/img2simg $HOME
chmod +x $HOME/img2simg
umount /data/local/system
cd $HOME
./img2simg /sdcard/Music/system.img /sdcard/Music/system_sparse.img
Click to expand...
Click to collapse
Code:
/system/bin/sh: su: not found
127|[email protected]:/data/data/com.termux/files/home #
d/Music/system.img /data/local/system <
[email protected]:/data/data/com.termux/files/home #
cp /sdcard/Music/img2simg $HOME
cp: //img2simg: Read-only file system
1|[email protected]:/data/data/com.termux/files/home #
chmod +x $HOME/img2simg
chmod: //img2simg: No such file or directory
1|[email protected]:/data/data/com.termux/files/home #

rsync Android / TWRP

I'm trying to create rsync to my andorid / TWRP So i can backup android folder
My code for compile:
Code:
Downloaded from (https://github.com/WayneD/rsync/releases)
./configure --host=arm-linux-gnueabi CFLAGS="-static" --disable-xxhash --disable-zstd
make
make prefix=/home/fredy/Desktop/rsync install
i copy the file ("rsync", "rsync-ssl") into /sbin
But i got this error here and testet with command "rsync":
Code:
/sbin/rsync: line 1: syntax error: unexpected "("
Can you help me out?
Thanks for your time

Question [SOLVED] How to extract files from super.img?

I am using global ROM in TB-J706F but I wanted to extract the original wallpaper from chinese ROM, so I downloaded the one available in lolinet.
Then I did (I am using Linux):
Extract files
Merge super_* to a single file with
Bash:
cat super_1.img super_2.img super_3.img super_4.img > super.img
Extract system_a.img with
Bash:
lpunpack -p system_a super.img ./super
Now I don't know how to mount system_a.img, this is what I tried:
Bash:
> simg2img super/system_a.img super/system_a.ext4.img
Invalid sparse file format at header magic
Failed to read sparse file
Bash:
> sudo mount -t ext4 -o loop super/system_a.img ./system
mount: ./system: wrong fs type, bad option, bad superblock on /dev/loop2, missing codepage or helper program, or other error.
Bash:
> file super/system_a.img
super/system_a.img: data
What am I missing?
P.S.
Anyway if someone has the wallpaper and can upload it somewhere would be great.
MrCrayon said:
I am using global ROM in TB-J706F but I wanted to extract the original wallpaper from chinese ROM, so I downloaded the one available in lolinet.
Then I did (I am using Linux):
Extract files
Merge super_* to a single file with
Bash:
cat super_1.img super_2.img super_3.img super_4.img > super.img
Extract system_a.img with
Bash:
lpunpack -p system_a super.img ./super
Now I don't know how to mount system_a.img, this is what I tried:
Bash:
> simg2img super/system_a.img super/system_a.ext4.img
Invalid sparse file format at header magic
Failed to read sparse file
Bash:
> sudo mount -t ext4 -o loop super/system_a.img ./system
mount: ./system: wrong fs type, bad option, bad superblock on /dev/loop2, missing codepage or helper program, or other error.
Bash:
> file super/system_a.img
super/system_a.img: data
What am I missing?
P.S.
Anyway if someone has the wallpaper and can upload it somewhere would be great.
Click to expand...
Click to collapse
Have you read the link below?
Editing system.img inside super.img and flashing our modifications
I'm trying to modify my system.img (/system/build.prop) to include support for multi users. After struggling a lot, I've succeeded following your guide (that's an awesome work btw) to unpack, mount, modify, umount and repack super.img. Then...
forum.xda-developers.com
mardon85 said:
Have you read the link below?
Editing system.img inside super.img and flashing our modifications
I'm trying to modify my system.img (/system/build.prop) to include support for multi users. After struggling a lot, I've succeeded following your guide (that's an awesome work btw) to unpack, mount, modify, umount and repack super.img. Then...
forum.xda-developers.com
Click to expand...
Click to collapse
Yes, I got some of the commands from there, as far as I understand what they do there is aimed to mount system rw so I shouldn't need it, I tried to mount read only and it gives the same error.
Also I cannot use resize2fs or e2fsck because it's not recognized as an image, I get:
Bad magic number in super-block
I think system_a.img needs an additional step but it's not even compressed, so I'm stuck.
Ok, I solved it.
It was actually very easy, starting from the ROM:
Extract files
Mount super_2.img for system with:
Bash:
sudo mount -t ext4 -o ro,loop super_2.img ./system
The trick is that it needs to be mounted read only with ro.
Nicely done. Did you find the wallpaper?
Yes, it was in system/media/wallpaper.

Categories

Resources