Git Product home page Git Product logo

convert-apk's People

Contributors

mathieures avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

convert-apk's Issues

zip on Linux requires CD to the unzipped dir

compress_with_zip()
{
zip -n resources.arsc -qr "$dst" "$unzipped"
}

should be

compress_with_zip()
{
    pushd $unzipped >/dev/null
    zip -n resources.arsc -qr "$dst" *
    popd >/dev/null
}

otherwise zip will copy the absolute path of the unzipped dir starting from / root dir. Later when installing the apk the installer will fail to find the AndroidManifest.xml file because it's not in the root of the archive anymore.

Zip version

❯ zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.

Compiled with gcc 6.3.0 20170415 for Unix (Linux ELF).

apksigner on Linux is a Bash file, not JAR

# Quick hack to know if the script is run on Git Bash
which 'cmd' >/dev/null 2>&1
if [ $? -eq 0 ]; then
apksigner_path=apksigner.bat
else
apksigner_path="java -jar $(which apksigner)"
fi

I have Android build tools 30.0.3 and Ubuntu 20.4, here apksigner is a bash file which resolves the JAR location and calls java. convert-apk is handling it like it's a JAR file and calling java on a bash file.

tar on Linux has no "--options" argument

compress_with_tar()
{
dst_zip="$dst.zip"
# tar -C does not work on Git Bash so we have to cd
pushd $unzipped >/dev/null
tar -P -acf $dst_zip --options compression-level=0 *
# Move the zip file outside
wd=$(pwd)
popd >/dev/null
# Move and rename the file
mv "$wd/$dst_zip" "$dst"
}

Tried running ./convert-apk.sh -t ... but got error on Ubuntu 20.04

Zipping back into ...
 using tar
tar: unrecognized option '--options'
Try 'tar --help' or 'tar --usage' for more information.

Version:

❯ tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

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.