sebaubuntu-python / dumpyara

Android firmware dumper, rewritten in Python
115 stars 25 forks source link

Failing to create dump from stock rom #19

Closed sultanahamer closed 1 year ago

sultanahamer commented 2 years ago

Hi There,

I am not sure if this tool extracts from stock ROMS yet. Here is what is present inside the zip

➜  dumpyara git:(master) ls working/capri_latest_stock/temp_extracted_archive
BTFM.bin                                                                           gpt.bin                             super.img_sparsechunk.1  super.img_sparsechunk.8
CAPRI_RETAIL_RRB31.Q1-3-58_subsidy-DEFAULT_regulatory-XT2127-4-INDIA_CFC.info.txt  logo.bin                            super.img_sparsechunk.2  super.img_sparsechunk.9
boot.img                                                                           radio.img                           super.img_sparsechunk.3  vbmeta.img
bootloader.img                                                                     regulatory_info_xt2127_4_india.png  super.img_sparsechunk.4  vbmeta_system.img
dspso.bin                                                                          servicefile.xml                     super.img_sparsechunk.5  vendor_boot.img
dtbo.img                                                                           slcf_rev_d_default_v1.0.nvm         super.img_sparsechunk.6
flashfile.xml                                                                      super.img_sparsechunk.0             super.img_sparsechunk.7

Download link: https://mirrors.lolinet.com/firmware/motorola/capri/official/RETIN/XT2127-4_CAPRI_RETIN_11_RRBS31.Q1-3-58-11_subsidy-DEFAULT_regulatory-XT2127-4-INDIA_CFC.xml.zip

Error trying to dumpyara:

Dumpyara
Version 1.0.0

[INFO] Step 1 - Extracting archive
[INFO] Step 2 - Preparing partition images
[INFO] Found multipartition image: super.img_sparsechunk.4
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/sultanm/Projects/Android_stuff/dumpyara/dumpyara/__main__.py", line 11, in <module>
    main()
  File "/Users/sultanm/Projects/Android_stuff/dumpyara/dumpyara/main.py", line 36, in main
    dumpyara = Dumpyara(args.file, args.output)
  File "/Users/sultanm/Projects/Android_stuff/dumpyara/dumpyara/dumpyara.py", line 67, in __init__
    func(multipart_image, self.raw_images_tempdir_path)
  File "/Users/sultanm/Projects/Android_stuff/dumpyara/dumpyara/utils/multipartitions.py", line 28, in extract_super
    lpunpack(image, output_dir)
  File "/usr/local/lib/python3.10/site-packages/liblp/partition_tools/lpunpack.py", line 87, in lpunpack
    metadata = ReadMetadata(image, slot)
  File "/usr/local/lib/python3.10/site-packages/liblp/reader.py", line 275, in ReadMetadata
    geometry = ReadLogicalPartitionGeometry(fd)
  File "/usr/local/lib/python3.10/site-packages/liblp/reader.py", line 97, in ReadLogicalPartitionGeometry
    geometry = ReadPrimaryGeometry(fd)
  File "/usr/local/lib/python3.10/site-packages/liblp/reader.py", line 84, in ReadPrimaryGeometry
    return ParseGeometry(buffer)
  File "/usr/local/lib/python3.10/site-packages/liblp/reader.py", line 54, in ParseGeometry
    assert geometry.magic == LP_METADATA_GEOMETRY_MAGIC, \
AssertionError: Logical partition metadata has invalid geometry magic signature.
cd-Crypton commented 2 years ago

Have you solve this? I am facing this issue too.

sultanahamer commented 2 years ago

@carlodeeCrypton As of now, I have used some work arounds like https://github.com/anestisb/android-simg2img and few other tools to extract all the individual product.img, vendor.img etc from super image and then zipped them all together and give it to dumpyara.

SebaUbuntu commented 1 year ago

https://mirrors.lolinet.com/firmware/motorola/capri/official/RETIN/XT2127-4_CAPRI_RETIN_11_RRBS31.Q1-3-58-11_subsidy-DEFAULT_regulatory-XT2127-4-INDIA_CFC.xml.zip

404, can you repro the issue with another firmware?

sultanahamer commented 1 year ago

@SebaUbuntu you can check with this

https://mirrors.lolinet.com/firmware/motorola/capri/official/RETIN/XT2127-4_CAPRI_RETIN_11_RRBS31.Q1-3-58-15_subsidy-DEFAULT_regulatory-XT2127-4-INDIA_CFC.xml.zip