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

Status
Not open for further replies.
Search This thread

Innfinite4evr

Senior Member
May 1, 2016
247
356
Hyderabad
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 :p


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 ex:Desktop/Myfirmware)
2) Copy the downloaded packsparseimg_v1.1 and Imgextractor.exe in the same folder where you extracted your firmware
(ex:Desktop/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 3:eek:ne 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 :p
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 :p


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:cool:
 
Last edited by a moderator:

RendyAK

Senior Member
Sep 28, 2014
472
276
Depok
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 :)
 

alessio89g

Senior Member
  • Mar 22, 2014
    462
    100
    I get this error on Ubuntu:
    bash: ./packsparseimg: cannot execute binary file: Formato eseguibile non valido
     
    Last edited by a moderator:

    EbinShaji

    New member
    Oct 30, 2018
    3
    0
    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:confused::confused:
     

    BadCluster

    Senior Member
    Sep 21, 2008
    331
    136
    45
    Venice
    www.giocoleria.org
    Ive updated the tool, maybe you can try for odm partition.

    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!
     
    Status
    Not open for further replies.

    Top Liked Posts

    • There are no posts matching your filters.
    • 21
      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 :p


      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 ex:Desktop/Myfirmware)
      2) Copy the downloaded packsparseimg_v1.1 and Imgextractor.exe in the same folder where you extracted your firmware
      (ex:Desktop/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 3:eek:ne 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 :p
      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 :p


      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:cool:
      1
      Great work bro :good: Nice job and thanks for this :)
      1
      Thread closed. PM me when you have download links that don't require payment to be added to the OP.
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone