Giter VIP home page Giter VIP logo

lpunpack's Issues

Can't start: TypeError: 'type' object is not subscriptable

$ python3 lpunpack/lpunpack.py -h
Traceback (most recent call last):
File "lpunpack/lpunpack.py", line 183, in
class UnpackJob:
File "lpunpack/lpunpack.py", line 186, in UnpackJob
parts: list[tuple[int, int]] = field(default_factory=list)
TypeError: 'type' object is not subscriptable

MacOS python 3.9.6

I run script to extract images, but it return error

File "/Users/bmx666/work/lpunpack/lpunpack.py", line 61
    match attributes:
          ^
SyntaxError: invalid syntax

Small Info

@unix3dgforce
LpMetadataPartition, LpMetadataExtent, LpMetadataPartitionGroup and LpMetadataBlockDevice are read from BackupMetadata instead from PrimaryMetadata.

self.in_file_fd.seek(offset + header.header_size, 0)

partition = LpMetadataPartition(self.in_file_fd.read(metadata.header.partitions.entry_size))

Is this intentional?

Thanks

IndexError: list index out of range

So I've been trying to unpack
OnePlus Nord 2 super images

But when extracting some partitions i get

python3 lpunpack.py -p odm super.img p
Traceback (most recent call last):
File "/storage/emulated/0/Download/update/lpunpack.py", line 450, in
LpUnpack(**vars(namespace)).unpack()
File "/storage/emulated/0/Download/update/lpunpack.py", line 405, in unpack
self.Extract(partition, metadata)
File "/storage/emulated/0/Download/update/lpunpack.py", line 369, in Extract
extent = metadata.extents[partition.first_extent_index]
IndexError: list index out of range

This happens both on PC and phone,

Just to add, if i don't specify any partition all files well be [OK] but they will be broken

`--info` does not work

lpunpack is able to extract a Fairphone 4 super.img file but --info does not show any information:

$ python3 ~/compilethings/lpunpack/lpunpack.py --info super.nonsparse.img 

$ python3 ~/compilethings/lpunpack/lpunpack.py super.nonsparse.img  --format text --info

$ python3 ~/compilethings/lpunpack/lpunpack.py super.nonsparse.img test
Extracting partition [odm_a] .... [ok]
Extracting partition [odm_b] .... [ok]
Extracting partition [product_a] .... [ok]
Extracting partition [product_b] .... [ok]
Extracting partition [system_a] .... [ok]
Extracting partition [system_b] .... [ok]
Extracting partition [system_ext_a] .... [ok]
Extracting partition [system_ext_b] .... [ok]
Extracting partition [vendor_a] .... [ok]
Extracting partition [vendor_b] .... [ok]

Firmware download URL is https://support.fairphone.com/hc/en-us/articles/18896094650513-Installing-Fairphone-OS-Manually (Android 13, FP4-TP1V-factory.zip)

Xiaomi Mi 11 uses LP header version 10.3

Traceback (most recent call last):
  File "/home/user/Apps/lpunpack/lpunpack.py", line 443, in <module>
    LpUnpack(**vars(namespace)).unpack()
  File "/home/user/Apps/lpunpack/lpunpack.py", line 377, in unpack
    metadata = self.ReadMetadata()
  File "/home/user/Apps/lpunpack/lpunpack.py", line 325, in ReadMetadata
    group.name = str(group.name, 'utf-8').strip('\x00')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 8: invalid continuation byte

It's failing to read the group names because the offsets have been updated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.