FORUMS
Remove All Ads from XDA

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

n/a posts
Thanks Meter: 0
 
By dg28gadhavi, Guest on 10th April 2017, 12:14 AM
Post Reply Email Thread
Introduction

TERMUX
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

Click image for larger version

Name:	Screenshot_20170409-232306.png
Views:	960
Size:	247.3 KB
ID:	4107113
The Following 4 Users Say Thank You to dg28gadhavi For This Useful Post: [ View ] Gift dg28gadhavi Ad-Free
dg28gadhavi
10th April 2017, 12:52 AM |#2  
Guest
Thanks Meter: 0
 
More
Guide

Files to be download:
  1. Termux app
  2. Termux Api app
  3. Commands.txt
  4. Zarchiver app
  5. AIK app
  6. Es file explorer
  7. 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
Attached Files
File Type: txt Commands.txt - [Click for QR Code] (846 Bytes, 2690 views)
The Following 7 Users Say Thank You to For This Useful Post: [ View ] Gift Ad-Free
19th July 2017, 04:36 PM |#3  
kubersharma's Avatar
Recognized Developer
Flag New Delhi , India
Thanks Meter: 5,056
 
Donate to Me
More
Good Guide.
5th October 2018, 08:37 PM |#4  
HemanthJabalpuri's Avatar
Senior Member
Flag Repalle
Thanks Meter: 241
 
More
Quote:
Originally Posted by dg28gadhavi

Guide

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
The Following 2 Users Say Thank You to HemanthJabalpuri For This Useful Post: [ View ] Gift HemanthJabalpuri Ad-Free
29th March 2019, 09:21 AM |#5  
Wahyu6070's Avatar
Member
Flag Bojonegoro
Thanks Meter: 82
 
Donate to Me
More
Pack ke system.new.dat TO system.new.dat.br what do you do
29th March 2019, 11:09 AM |#6  
HemanthJabalpuri's Avatar
Senior Member
Flag Repalle
Thanks Meter: 241
 
More
Quote:
Originally Posted by Wahyu6070

Pack ke system.new.dat TO system.new.dat.br what do you do

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
The Following User Says Thank You to HemanthJabalpuri For This Useful Post: [ View ] Gift HemanthJabalpuri Ad-Free
30th March 2019, 12:07 PM |#7  
Wahyu6070's Avatar
Member
Flag Bojonegoro
Thanks Meter: 82
 
Donate to Me
More
Thumbs up Repack system.new.img to system.new.dat

repack system.new.img to system.new.dat how do you do it
30th March 2019, 12:17 PM |#8  
HemanthJabalpuri's Avatar
Senior Member
Flag Repalle
Thanks Meter: 241
 
More
Quote:
Originally Posted by Wahyu6070


repack system.new.img to system.new.dat how do you do it

https://github.com/xpirt/img2sdat

https://forum.xda-developers.com/and...es-to-t2978952
13th April 2019, 01:31 AM |#9  
Wahyu6070's Avatar
Member
Flag Bojonegoro
Thanks Meter: 82
 
Donate to Me
More
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.
13th April 2019, 02:51 AM |#10  
Wahyu6070's Avatar
Member
Flag Bojonegoro
Thanks Meter: 82
 
Donate to Me
More
xpirt posts use linix instead of termux
how to use linux pc instead of android thermux and use sudo command
13th April 2019, 03:39 AM |#11  
HemanthJabalpuri's Avatar
Senior Member
Flag Repalle
Thanks Meter: 241
 
More
Quote:
Originally Posted by Wahyu6070

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.

How you got system folder? Did you mounted system.img to some folder?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes