Giter Site home page Giter Site logo

kuustudio / zsign Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhlynn/zsign

0.0 1.0 0.0 130 KB

Maybe is the most quickly codesign alternative for iOS12+ in the world, cross-platform ( Linux & macOS ), more features. sign!

C++ 88.56% C 10.35% Dockerfile 0.14% Lua 0.95%

zsign's Introduction

zsign

Maybe is the most quickly codesign alternative for iOS12+ in the world, cross-platform ( Linux & macOS ), more features.
If this tool can help you, please don't forget to star me. :)

Compile

You must install openssl library at first.

macOS:

brew install openssl

and then (attention to replace your openssl version)

g++ *.cpp common/*.cpp -lcrypto -I/usr/local/Cellar/openssl/1.0.2s/include -L/usr/local/Cellar/openssl/1.0.2s/lib -O3 -o zsign

CentOS7:

yum install openssl-devel

and then

g++ *.cpp common/*.cpp -lcrypto -O3 -o zsign

Usage

I have already tested on macOS and Linux, but you also need unzip and zip command installed.

Usage: zsign [-options] [-k privkey.pem] [-m dev.prov] [-o output.ipa] file|folder

options:
-k, --pkey          Path to private key or p12 file. (PEM or DER format)
-m, --prov          Path to mobile provisioning profile.
-c, --cert          Path to certificate file. (PEM or DER format)
-d, --debug         Generate debug output files. (.zsign_debug folder)
-f, --force         Force sign without cache when signing folder.
-o, --output        Path to output ipa file.
-p, --password      Password for private key or p12 file.
-b, --bundleid      New bundle id to change.
-n, --bundlename    New bundle name to change.
-e, --entitlements  New entitlements to change.
-z, --ziplevel      Compressed level when output the ipa file. (0-9)
-l, --dylib         Path to inject dylib file.
-w, --weak          Inject dylib as LC_LOAD_WEAK_DYLIB.
-i, --install       Install ipa file using ideviceinstaller command for test.
-q, --quiet         Quiet operation.
-v, --version       Show version.
-h, --help          Show help.
  1. Show mach-o and codesignature segment info.
./zsign demo.app/execute
  1. Sign ipa with private key and mobileprovisioning file.
./zsign -k privkey.pem -m dev.prov -o output.ipa -z 9 demo.ipa
  1. Sign folder with p12 and mobileprovisioning file (using cache).
./zsign -k dev.p12 -p 123 -m dev.prov -o output.ipa demo.app
  1. Sign folder with p12 and mobileprovisioning file (without cache).
./zsign -f -k dev.p12 -p 123 -m dev.prov -o output.ipa demo.app
  1. Inject dylib into ipa and re-sign.
./zsign -k dev.p12 -p 123 -m dev.prov -o output.ipa -l demo.dylib demo.ipa 
  1. Change bundle id and bundle name
./zsign -k dev.p12 -p 123 -m dev.prov -o output.ipa -b 'com.tree.new.bee' -n 'TreeNewBee' demo.ipa
  1. Inject dylib(LC_LOAD_DYLIB) into mach-o file.
./zsign -l "@executable_path/demo.dylib" demo.app/execute
  1. Inject dylib(LC_LOAD_WEAK_DYLIB) into mach-o file.
./zsign -w -l "@executable_path/demo.dylib" demo.app/execute

Use xmake to compile

If you have xmake installed, you can use xmake to quickly compile and run it.

Build

xmake

Run

xmake run zsign [-options] [-k privkey.pem] [-m dev.prov] [-o output.ipa] file|folder

Install

xmake install

Get zsign binary

xmake install -o outputdir

binary: outputdir/bin/zsign

Docker

  1. Build:
docker build -t zsign https://github.com/zhlynn/zsign.git
  1. Run:

Mount current directory (stored in $PWD) to container and set WORKDIR to it:

docker run -v "$PWD:$PWD" -w "$PWD" zsign -k privkey.pem -m dev.prov -o output.ipa -z 9 demo.ipa

If input files are outside current folder, you will need to mount different folder:

docker run -v "/source/input:/target/input" -w "/target/input" zsign -k privkey.pem -m dev.prov -o output.ipa -z 9 demo.ipa

Copyright

zsign is completely free. Please mark the source of zsign in your commercial product if possible.

How to sign quickly?

You can unzip the ipa file at first, and then using zsign to sign folder with assets.
At the first time of sign, zsign will perform the complete signing and cache the signed info into .zsign_cache dir at the current path.
When you re-sign the folder with other assets next time, zsign will use the cache to accelerate the operation. Extremely fast! You can have a try!:)

zsign's People

Contributors

zhlynn avatar ddzobov avatar waruqi avatar oisann avatar clementarnaudmicrofocuscom avatar

Watchers

 avatar

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.