Open ncn32 opened 8 years ago
By 'running in windows' do you mean to run 'isign signed.ipa unsigned.ipa' on your shell? If you specify the question a bit I am sure I or somene else can help you.
OK. Let´s go code. Following:
`import os.path os.environ["HOME"] = "c:\iOSpub" os.environ["OPENSSL"] = "C:\OpenSSL-Win32\bin\openssl.exe"
sPathOutput = "Payload/SinapseMobile.app" sFileIPA = "sinapsemobile.ipa"
from isign import isign
if isign.view("SinapseMobile"): print("OK") else: os.environ["HOME"] = sHome print("ERROR")
isign.resign("SinapseMobile", output_path = sPathOutput)
import os import zipfile from shutil import rmtree
if os.path.exists(sFileIPA): print("Removing file " + sFileIPA); os.remove(sFileIPA) print("Zipping " + sFileIPA + "..."); zf = zipfile.ZipFile(sFileIPA, "w") for dirname, subdirs, files in os.walk("Payload"): zf.write(dirname) for filename in files: zf.write(os.path.join(dirname, filename)) zf.close()
print("---Finish---")
This is producing the following error:
OK
Traceback (most recent call last):
File "signsinapse.py", line 21, in
I´m not trying to rewrite the shell code. I´m trying to use the iSign python by itself.
The problem you have is related to the fact that isign refers to the openssl installed on the machine. As windows has no pre compiled openssl, isign is not executable on windows, only on unix systems. @saucelabs-user, please correct me if I'm wrong. If I am right, I would please you to add this information onto the project information. In my opinion, this information is crucial for people who are interested in iSign.
O yeah! I noticed it... Well, for while, it´s a good thing put the warning "Only Unix Systems". But if isn't a problem for you guys, I´d like to contribute to port the code to run in Windows environments. I need it! ;-) Every company I go here in Brazil is Windows systems network and other solutions by Microsoft. In the code, we can make changes using the function platform.system() == "Windows". I can see that the problem is chars like "/" instead of "\" and other things like the OpenSSL for Windows sintaxes.
Is there any reliable port of openssl that could be used for this project? How do you intend to replace openssl used by unix systems?
Of course pal! By themselves... [https://wiki.openssl.org/index.php/Binaries] It´s possible. Let´s keep contact. I will need some support in revising the code to not make anything "strange" for you.
I've seen this binaries too, but they are 3rd party... means there might be slight differences which can break the signing process. I don't know if it's worth investigating on that, but do as you want ;)
Well, right now it's somewhat embarassing that we have to use an external openssl at all. In theory we could use python bindings to appropriate libraries, but I think we're missing one particular binding that we need (or, I could never find it documented).
I could track down what the issue was, and maybe we can fix it that way.
Wow! This could save a lot of work... I was thinking about it too. The suggestion checking out the platform is not so good. We can try something wrote in Python or we can add a layer to do this job and so we will have a dynamic code to port and isolated module. I didn´t study your code properly yet. But correct me if I doing redundants suggestions.
Another thing for Windows... would it also perhaps be possible to compile a exe (a C++ library would be amazing but...) that doesn't require a full python install?
There are a couple different python compilers that output a exe, Nuitka is one of them
Install pyOpenssl by running pip install pyOpenSSL
so iSign should use that instead.
Any suggestions in running in Windows environment? All the scripts are in shell script... Any other limitations? I already got python with all modules needed. The only way I saw in do it is in python script calling isign as show in description.