Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i compress xamarin DLL files using lz4? #22

Open
flex0geek opened this issue Jul 10, 2022 · 1 comment
Open

How can i compress xamarin DLL files using lz4? #22

flex0geek opened this issue Jul 10, 2022 · 1 comment

Comments

@flex0geek
Copy link

I have a xamarin application and its files are compressed using lz4 I could easily decompress the files it using lz4.block.decompress but I couldn't compress it again, can anyone help me with that?

I used the following script to decompress the file and I could read the content of the DLL file but when I modified something and try to recompress it again to patch the APK file I couldn't compress the file in the right format.

with open(input_filepath, "rb") as xalz_file:
    data = xalz_file
    header = data.read(8)
    if header[:4] != b"XALZ":
        sys.exit("The input file does not contain the expected magic bytes, aborting ...")

    payload = data.read()
    decompressed = lz4.block.decompress(payload)
            
    with open(output_filepath, "wb") as output_file:
        output_file.write(decompressed)
        output_file.close()
    print("result written to file")

Note that I couldn't decompress or compress the DLL file using lz4tools.

@flex0geek
Copy link
Author

xamarin apks use lz4 compress as shown here dotnet/android#4686

@flex0geek flex0geek reopened this Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant