zhlynn / zsign Goto Github PK
View Code? Open in Web Editor NEWMaybe it is the most quickly codesign alternative for iOS12+, cross-platform ( macOS, Linux , Windows ), more features.
License: BSD 3-Clause "New" or "Revised" License
Maybe it is the most quickly codesign alternative for iOS12+, cross-platform ( macOS, Linux , Windows ), more features.
License: BSD 3-Clause "New" or "Revised" License
Can't Find App Folder! /tmp/zsign_folder_1583398065327202[0m[31m>>> Signed Failed! (0.000s, 113us)[0m[31m>>> Can't Find Payload Directory![0m
the os ver is centos 7.7 can any one help me?
thanks
zhanghaichao/zsign removed your copyright notice,replaced with his own QR code.
I have an app with extensions, I want to re-sign with a new account.
I specified bundleid
and a .mobileprovision
, but we can't be allowed to install.
The reason I found out was that the extended .mobileprovision
was not modified.
Therefore, I would like to ask how to specify multiple (two) .mobileprovision
(similar to the function of fastlane sigh resign
)?
Thank you for your efficient and useful tools!
SystemExec: "unzip -qq -d '/tmp/zsign_folder_1588942879368078' '/home/ipa/in/app.ipa'", Failed! Exit-Status: 2
Unzip Failed!
Signing: /xxxx/zsign/testbuld/xxxxx/Payload/Runner.app ...
AppName: xxxxx
BundleId: com.xxxx.xxxx
TeamId: xxxxxx
SubjectCN: iPhone Developer: xxx xxx xxx (TWxxxVFxxxxx)
ReadCache: YES
SignFolder: Frameworks/Reachability.framework, (Reachability)
SignFolder: Frameworks/install_plugin.framework, (install_plugin)
SignFolder: Frameworks/video_player.framework, (video_player)
SignFolder: Frameworks/Flutter.framework, (Flutter)
SignFolder: Frameworks/connectivity.framework, (connectivity)
SignFolder: Frameworks/sqflite.framework, (sqflite)
SignFolder: Frameworks/webview_flutter.framework, (webview_flutter)
SignFolder: Frameworks/App.framework, (App)
SignFolder: Frameworks/device_info.framework, (device_info)
SignFolder: Frameworks/FMDB.framework, (FMDB)
SignFolder: Frameworks/shared_preferences.framework, (shared_preferences)
SignFolder: Frameworks/screen.framework, (screen)
SignFolder: Frameworks/url_launcher.framework, (url_launcher)
SignFolder: Frameworks/package_info.framework, (package_info)
SignFolder: Frameworks/path_provider.framework, (path_provider)
SignFile: Frameworks/libswiftObjectiveC.dylib
SignFile: Frameworks/libswiftCore.dylib
SignFile: Frameworks/libswiftCoreGraphics.dylib
SignFile: Frameworks/libswiftDispatch.dylib
SignFile: Frameworks/libswiftCoreFoundation.dylib
SignFile: Frameworks/libswiftDarwin.dylib
SignFile: Frameworks/libswiftFoundation.dylib
SignFolder: Runner.app, (Runner)
Signed OK! (0.309s, 309239us)
Archiving: /www/xxxx/xxxxxx/output.ipa ...
Archive OK! (58.17 MB) (0.259s, 259127us)
zsign -k distribution.p12 -p xxxx -m kingfir_app_product.mobileprovision -z 9 -o output.ipa gort/Payload/original.app
使用该命令签名的包都无法在手机上安装,下载完成之后图标变灰,然后提示“无法安装,请稍后再试”.
我的机型是 iphone sx max. 版本是13.1.2
When I resigned, I registered a new certificate and appid, opened the APNs function of the appid, and added a new APNs certificate. Then I created mobileprovision and signed the original ipa with the new appid, new mobileprovision, and new certificate. However, ipa cannot receive push notification after resignature.
I use other people's tools to achieve this function, but I don't know if zsign can achieve this function, please enlighten me.
thank you very much!
我不清楚这个工具是否针对高并发的场景做处理?我这边用CentOS跑这个工具,并发量高的话会报错。
zsign -c /data/cert/test.cer -m /data/cert/test.prov -o /data/a_signed.ipa -z 9 /data/a.ipa
Can't Load P12 or PrivateKey File! Please Input The Correct File And Password!
[root@test9527 zsign]# g++ .cpp common/.cpp -lcrypto -O3 -o zsign
/tmp/cc5mnqm7.o: In function GenerateCMS(x509_st*, evp_pkey_st*, std::string const&, std::string const&, std::string&)': openssl.cpp:(.text+0xe7): undefined reference to
OPENSSL_sk_new_null'
openssl.cpp:(.text+0xfe): undefined reference to OPENSSL_sk_push' openssl.cpp:(.text+0x113): undefined reference to
OPENSSL_sk_push'
/tmp/cc5mnqm7.o: In function GetCMSContent(std::string const&, std::string&)': openssl.cpp:(.text+0x431): undefined reference to
OPENSSL_die'
/tmp/cc5mnqm7.o: In function ZSignAsset::GenerateCMS(std::string const&, std::string const&, std::string&)': openssl.cpp:(.text+0xcd9): undefined reference to
OPENSSL_sk_new_null'
openssl.cpp:(.text+0xcf0): undefined reference to OPENSSL_sk_push' openssl.cpp:(.text+0xd05): undefined reference to
OPENSSL_sk_push'
/tmp/cc5mnqm7.o: In function GetCertInfo(x509_st*, JValue&)': openssl.cpp:(.text+0x1268): undefined reference to
X509_get_version'
openssl.cpp:(.text+0x138a): undefined reference to X509_getm_notBefore' openssl.cpp:(.text+0x13f5): undefined reference to
X509_getm_notAfter'
/tmp/cc5mnqm7.o: In function GetCMSInfo(unsigned char*, unsigned int, JValue&)': openssl.cpp:(.text+0x189b): undefined reference to
OPENSSL_sk_value'
openssl.cpp:(.text+0x18db): undefined reference to OPENSSL_sk_num' openssl.cpp:(.text+0x1901): undefined reference to
OPENSSL_sk_num'
openssl.cpp:(.text+0x1919): undefined reference to OPENSSL_sk_value' openssl.cpp:(.text+0x1c29): undefined reference to
OPENSSL_sk_num'
openssl.cpp:(.text+0x25fa): undefined reference to `OPENSSL_die'
i have yum install openssl-devel
but build error
./zsign -k sign.p12 -p xxx -m meoneAllAdHocProfile.mobileprovision -o output.ipa -b 'com.zoaosoft.xxx' -n 'NewWinBet' doubleH3lix-RC8.ipa
Invalid Macho File (2)!
result is this?
I don't know?
can you help me?
I found a problem when the _CodeSignature directory is missing , Debug output like this
>>> SignFolder: Frameworks/DTCoreText.framework, (DTCoreText)
>>> SignFolder: Frameworks/EGUSDK.framework, (EGUSDK)
>>> Can't Find CodeSignature Segment!
>>> Realloc CodeSignature Space...
>>> Success!
>>> SignFolder: Frameworks/DTFoundation.framework, (DTFoundation)
>>> SignFolder: Frameworks/EGameSDK.framework, (EGameSDK)
>>> SignFolder: arpg.app, (arpg)
>>> Signed OK! (0.713s, 713356us)
I can provide a test ipa package url, http://suo.im/5KpUAM
can you fix this problem? thank you!
这个工具非常不错,可如何去掉ipa里的各种dylib或者framework呢
For centos7 xfs support, please ask when the author will be compatible @zhlynn
-----------zsing result---------------
Signed OK! (1.017s, 1016688us)
Archiving: /tmp/test.ipa ...
Archive OK! (74.32 MB) (0.594s, 593972us)
Done. (2.928s, 2927543us)
-----run install ipa result-----------
ideviceinstaller -i /tmp/test.ipa
WARNING: could not locate iTunesMetadata.plist in archive!
WARNING: could not locate Payload/Nebula.app/SC_Info/Nebula.sinf in archive!
Copying '/tmp/test.ipa' to device... DONE.
Installing 'com.tipok.www.nativeapp.super1'
Old ipa file is 18M,The singed ipa file is 51M,
And not work to from install
command:
./zsign -k 111.p12 -p 12345 -m dd.mobileprovision -o output.ipa install.ipa
I can singed by fastlane this profile
下面是我的运行输出结果,请帮我看一下是什么原因
Unzip: /root/a.ipa (17.11 MB) -> /tmp/zsign_folder_1570777007673393 ...
Unzip OK! (0.143s, 142911us)
Can't Find App Folder! /tmp/zsign_folder_1570777007673393
Signed Failed! (0.000s, 97us)
Can't Find Payload Directory!
i want to use zsign for change my version no or build no in my ipa file ,is there any suggestion? @zhlynn
Hi @zhlynn ,
Thanks for this amazing tool , you saved my life
I wanna inject for example 4 dylibs each has it's own ".bundle" ..
Could you please make it possible ..
Please and thank you
Application there are special types of files, such as dat or other types of files, this signature after the completion of the installation fails, because this type of file is not signed in
Can I execute it in multiple threads?
请问有那位朋友了解最新的 Info.plist 是用什么加密算法加密的吗?怎么解密?
To be clearer, do you have a licensing for this tool ?
Honestly, it is a great improvement compared to isign we were using before, so it would be good if we could use it :)
Ok
It is not working if the ipa is a xctest, as your missing the ".xctext" suffix check in bundle.cpp (line 96).
After adding the additional check, it is now working.
I would recommend to add this support.
FIXED
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
clang: error: no such file or directory: '.cpp'
clang: error: no such file or directory: 'common/.cpp'
重新签名的时候,预解压的包路径名称,以下这种
ningmengxiaoshuo_1.0.0/payload/ninmeng.app
会签名失败
改成下面这种,签名可以成功
ningmengxiaoshuo/payload/ninmeng.app
Excited to see this tool exists!
Would you mind adding a formal LICENSE file to your repo?
Your README says "zsign is completely free. Please mark the source of zsign in your commercial product if possible." Sounds like the MIT license would be a good candidate.
Looks like GitHub has a nice flow for adding licenses — https://help.github.com/en/articles/adding-a-license-to-a-repository
Hi, what command do I need to run to load all the IPAS from X, sign them and save them to Y
I am using a cert.p12 password and 1.mobileprovision
很多ipa包签了会闪退
I would like to know, if I sign the same app folder twice with different apple developer account, will the cache break the signing?
就说我看缓存加速应该就是把很多细碎文件的计算只算一次,记了下来,但我从代码看起来,这个缓存文件没有记录帐号信息,也就是说如果这时候我换一个帐号来,或者应该说是我换一个p12文件,用了缓存应该会导致签名出来的文件是坏的吧。
那cache的文件名里能不能包含下签名帐号或者key的信息呢,这样多帐号时候就不会混
openssl 1.0.1e on Centos6.8
openssl.cpp: In function ‘bool GenerateCMS(X509*, EVP_PKEY*, const std::string&, const std::string&, std::string&)’:
openssl.cpp:93: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:93: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp:94: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:94: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp:123: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:123: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp: In function ‘bool GenerateCMS(const std::string&, const std::string&, const std::string&, const std::string&, std::string&)’:
openssl.cpp:185: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:185: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp:186: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:186: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp: In function ‘bool GetCertSubjectCN(const std::string&, std::string&)’:
openssl.cpp:273: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:273: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
openssl.cpp: In function ‘bool GetCertInfo(X509*, JValue&)’:
openssl.cpp:344: error: ‘X509_get_signature_nid’ was not declared in this scope
openssl.cpp: In member function ‘bool ZSignAsset::Init(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)’:
openssl.cpp:676: error: invalid conversion from ‘const void*’ to ‘void*’
openssl.cpp:676: error: initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’
I try to install openssl 1.1.0e,but also error
/tmp/ccrCfUin.o: In function global constructors keyed to g_OpenSSLInit': openssl.cpp:(.text+0x5a): undefined reference to
OPENSSL_init_crypto'
/tmp/ccrCfUin.o: In function GetCMSContent(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': openssl.cpp:(.text+0x187): undefined reference to
OPENSSL_die'
/tmp/ccrCfUin.o: In function GenerateCMS(x509_st*, evp_pkey_st*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': openssl.cpp:(.text+0x256): undefined reference to
OPENSSL_sk_new_null'
openssl.cpp:(.text+0x26d): undefined reference to OPENSSL_sk_push' openssl.cpp:(.text+0x282): undefined reference to
OPENSSL_sk_push'
/tmp/ccrCfUin.o: In function GetCertInfo(x509_st*, JValue&)': openssl.cpp:(.text+0x1054): undefined reference to
X509_get_version'
openssl.cpp:(.text+0x10df): undefined reference to X509_get_signature_nid' openssl.cpp:(.text+0x117a): undefined reference to
X509_getm_notBefore'
openssl.cpp:(.text+0x11ed): undefined reference to X509_getm_notAfter' /tmp/ccrCfUin.o: In function
GetCMSInfo(unsigned char*, unsigned int, JValue&)':
openssl.cpp:(.text+0x166b): undefined reference to OPENSSL_sk_value' openssl.cpp:(.text+0x16a7): undefined reference to
OPENSSL_sk_num'
openssl.cpp:(.text+0x16c8): undefined reference to OPENSSL_sk_num' openssl.cpp:(.text+0x16e0): undefined reference to
OPENSSL_sk_value'
openssl.cpp:(.text+0x19ac): undefined reference to OPENSSL_sk_num' openssl.cpp:(.text+0x2228): undefined reference to
OPENSSL_die'
/tmp/ccrCfUin.o: In function global constructors keyed to g_OpenSSLInit': openssl.cpp:(.text+0x6a): undefined reference to
OPENSSL_init_crypto'
collect2: ld returned 1 exit status
can you have ideal to check certificate is die
目前部分打过企业签的ipa会被加锁,重签名后打开就会闪退
openssl.cpp: In function ‘bool GenerateCMS(X509*, EVP_PKEY*, const string&, const string&, std::string&)’:
openssl.cpp:92:71: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
BIO bother1 = BIO_new_mem_buf(appleDevCACert, strlen(appleDevCACert));
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp:93:73: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive]
BIO bother2 = BIO_new_mem_buf(appleRootCACert, strlen(appleRootCACert));
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp:122:48: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive]
BIO in = BIO_new_mem_buf(strCDHashData.c_str(), strCDHashData.size());
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp: In function ‘bool GenerateCMS(const string&, const string&, const string&, const string&, std::string&)’:
openssl.cpp:184:55: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive]
BIO bcert = BIO_new_mem_buf(strSignerCertData.c_str(), strSignerCertData.size());
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp:185:55: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive]
BIO bpkey = BIO_new_mem_buf(strSignerPKeyData.c_str(), strSignerPKeyData.size());
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp: In function ‘bool GetCertSubjectCN(const string&, std::string&)’:
openssl.cpp:272:49: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive]
BIO bcert = BIO_new_mem_buf(strCertData.c_str(), strCertData.size());
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO BIO_new_mem_buf(void buf, int len);
^
openssl.cpp: In function ‘bool GetCertInfo(X509, JValue&)’:
openssl.cpp:343:75: error: ‘X509_get_signature_nid’ was not declared in this scope
jvCertInfo["SignatureAlgorithm"] = OBJ_nid2ln(X509_get_signature_nid(cert));
^
openssl.cpp: In member function ‘bool ZSignAsset::Init(const string&, const string&, const string&, const string&, const string&)’:
openssl.cpp:675:53: error: invalid conversion from ‘const void’ to ‘void*’ [-fpermissive]
BIO bioCert = BIO_new_mem_buf(strCertData.c_str(), strCertData.size());
^
In file included from /usr/include/openssl/pem.h:64:0,
from openssl.cpp:5:
/usr/include/openssl/bio.h:691:6: error: initializing argument 1 of ‘BIO BIO_new_mem_buf(void*, int)’ [-fpermissive]
BIO *BIO_new_mem_buf(void *buf, int len);
^
Please explain a bit about supporting range, iOS versions, Build Targets, CPU types and etc...
issue里有一个问题说了高并发问题,作者说copy more folders to sign simultaneously,请问这个folders指的是多个zsign解压编译后的文件夹吗?还是说把要签名的包放在不同的文件里?
gcc版本:
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
操作系统版本:
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
SignFolder: Frameworks
[1] 26942 segmentation fault
please hava a look
1
Hello I used this feature to open the IPA to see the verification signature information, and it appeared test.dylib: invalid signature (code or signature have been modified) .
Hello, this project is very good. Want to make changes to your own needs
Want to know how to redevelop and debug this project
Can you explain what systems and tools are needed to develop
install failed
I found codesign add this attrs in der
object: undefined (1.2.840.113635.100.9.2)
value.set:
SEQUENCE:
0:d=0 hl=2 l= 45 cons: SEQUENCE
2:d=1 hl=2 l= 9 prim: OBJECT :sha256
13:d=1 hl=2 l= 32 prim: OCTET STRING [HEX DUMP]:2DFDDB4F882B71B4D25D04A5D7093EBF31D56B125CC5DEB088D63A750502E3A8
SEQUENCE:
0:d=0 hl=2 l= 29 cons: SEQUENCE
2:d=1 hl=2 l= 5 prim: OBJECT :sha1
9:d=1 hl=2 l= 20 prim: OCTET STRING [HEX DUMP]:60B7FCD16B82F8B3B1EB731801B89C6FE73990D6
object: undefined (1.2.840.113635.100.9.1)
value.set:
OCTET STRING:
0000 - 3c 3f 78 6d 6c 20 76 65-72 73 69 6f 6e <?xml version
just before cdHashesPlist.
how did you think about it?
thank your for the great job 👏
I know there are something like WSL/Cygwin, i'm wondering if there is any possibility to add Windows support natively?
Can't use zsign to resign ipa with Framwork.
Install: VerifyingApplication (40%)ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008019: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.JWwyXF/extracted/Payload/xgame-mobile.app/Frameworks/GDTActionSDK.framework
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.