@classmethod<EOL><INDENT>def open(cls, filename):<DEDENT>
asarfile = open(filename, '<STR_LIT:rb>')<EOL>asarfile.seek(<NUM_LIT:4>)<EOL>header_size = struct.unpack('<STR_LIT:I>', asarfile.read(<NUM_LIT:4>))<EOL>if len(header_size) <= <NUM_LIT:0>:<EOL><INDENT>raise IndexError()<EOL><DEDENT>header_size = header_size[<NUM_LIT:0>] - <NUM_LIT:8><EOL>asarfile.seek(asarfile.tell() + <NUM_LIT:8>)<EOL>header = asarfile.read(header_size).decode('<STR_LIT:utf-8>')<EOL>files = json.loads(header)<EOL>return cls(filename, asarfile, files, asarfile.tell())<EOL>
Opens a *.asar file and constructs a new :see AsarArchive instance.

        Args:
            filename (str):
                Path to the *.asar file to open for reading.

        Returns (AsarArchive):
            An insance of of the :AsarArchive class or None if reading failed.