Error: 'zlib' is an invalid command

后端 未结 2 434
小蘑菇
小蘑菇 2020-12-12 20:55

How can I run this command in OSX?

dd if=mybackup.ab bs=24 skip=1|openssl zlib -d > mybackup.tar

When I run this I get the following errors <

相关标签:
2条回答
  • 2020-12-12 21:17

    Openssl on mac is compiled without zlib support. Alternative method described in this article works on my Yosemite:

    dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
    

    Optionaly, if you just want to convert it into tar archive:

    dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" > backup.tar
    

    It skips first 24 bytes of Android header and then uncompresses zlib data.

    0 讨论(0)
  • 2020-12-12 21:39

    Just fix it

    Get latest version from OpenSSL Official Repo.

    $ wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
    $ tar -zxvf openssl-1.1.0e.tar.gz
    $ cd openssl-1.1.0e
    

    Configure OpenSSL with zlib support

    $ ./config zlib
    $ make 
    $ sudo make install
    

    Happy days

    $ which openssl
    /usr/local/bin/openssl
    
    0 讨论(0)
提交回复
热议问题