Code signing macOS app with Electron - electron

I cannot seem to get code signing to work with electron-builder. When I run security find-identity -v I get back 3 certs, all of which look good. They also show up when running electron-builder. However, it says that cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate and directs me to the electron-builder docs (which are not helpful at all).
Can anyone point me in the right direction?

Before running electron builder, set the environment variables like this -
export DEBUG=electron-builder
export CSC_LINK=~/Desktop/mac_certs.p12 (change path according to your location)
export CSC_KEY_PASSWORD={your cert password}
Then try running with electron builder.
If this does not work, please paste the output of electron-builder

Related

Error Could not connect to server; are you sure it's running? In appium

I am getting this error. How to solve this.
Just tick the below checkbox "Allow Unauthorized Certificates" for appium versions 1.6.*
and make sure you are under "Automatic Server" tab
Go to automatic server option and start session . and give the right path of apk file. it is work for me
(appium server 1.7)
After searching and applying lots of solutions finally i did following settings for Successful Android appium app testing on windows machine.
Software:
As of now they have released appium-server and appium-inspector as two seperate softwares. I'm using latest version of repositories.
Appium server 1.22.0
Appium Inspector 2021.9.2
Appium Server Settings
Make sure you have the same settings shown in the images below.
Appium Inspector settings
Steps to start appium:
Start appium server first
Then Start appium Inspector (make sure you add desired capabilities manually otherwise below error msg will arrive if you pasted Json representation manually)
Failed to create session. An unknown server-side error occurred while
processing the command. Original error: You must include a
platformName capability.
After adding Representation it will look like below
{
"platformName": "android",
"deviceName": "emulator-5554",
"appPackage": "com.coswarden",
"appActivity": "ActivityHome"
}
Hope this will solve your error.
You can use UI AutomatorViewer to find the element in the application.
just install jdk8 because appium and uiautomator are compatible with java8 only problem will be solved. And follow below steps:
Right Click on the My Computer and Select the properties
Click on advanced system settings
Click on Environment Variables
Click on new Button of User variables
Type PATH in the Variable name.
Copy the path of bin folder which is installed in JDK folder.
Paste Path of bin folder in Variable value and click on OK Button.
You can follow a similar process to set CLASSPATH.
and restart your PC
Go to command prompt and type javac command and check java8 is installed properly or not.
And see whether android sdk has tools folder in it, In which uiautomator is present
For those who are still struggling to get started, I will add several screenshots to show the complete setup I have for Appium Server GUI, and Appium Inspector.

How to fix Xcode's code sign issues on Jenkins?

I have done the usual steps of making the xcodebuild work on jenkins, which would be installing "keychain & provisioning profiles" plugin, uploading the right keychain+profiles in the plugin's configuration, and using security -v unlock-keychain, and PROVISIONING_PROFILE in the xcodebuild command.
the build goes forward O.K., even runs the defined postbuild scripts defined in the Xcode project, and creates the .app folder with all the necessary content, but fails here...
/Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: User interaction is not allowed.
*** error: Couldn't codesign /Users/Shared/Jenkins/Home/jobs/iOS_feature/workspace/build/Applications/MyApp.app/Frameworks/libswiftUIKit.dylib: codesign failed with exit code 1
Any ideas what could cause this? from what I understand, the Keychain+ProvisioningProfiles are in place since the build doesn't fail here.
firstly, are you passing your keychain password to the security -v unlock-keychain command (using -p)? it's definitely not an ideal solution, because it probably requires exposing your password in clear text on your build server.
our workaround for this problem is to login to the actual machine (remote screen sharing or locally sitting at the machine). run a single build from the desktop, whether it be command line or in Xcode. (you might be asked to "always allow" but i'm not 100% sure under which scenarios this will happen).
from then on, all your remote CI builds should pass through code signing successfully.
It's not due to reverse DNS failing or self signed certs on the Jenkins box is it?
We had similar issues though not on Jenkins but Xcode 7 does these extra two checks we found.
Does CodeSign have permission to use the private key?
Whenever I see this error, this is usually the solution:
https://stackoverflow.com/a/22637896/78496

Some questions of automate the process of iOS builds

Recently,I try to automate the process of iOS builds using bash scripts.
I'm building the app,code signing the file using xcodebuild, and then pack the project using xcrun.
In xcode,we can set some information easily,(Summary->iOS Application Target->...)
but,how can I set the information without Xcode,I want to do that using bash scripts,like modify info-plist or other configuration files,does it works? how can I solve this question?
The second question:
Because I want to automate iOS builds in server, I need to import certificates(.p12) which clients give me into keychain automatically,the question is how can I export .p12 file automatically from keychain when clients give me the name of code signing.
Can you provide me some information of automating the process of iOS builds using bash scripts? Or do you have realize the function? Please give me some clues about that, or the program.
You can inject custom build settings by passing KEY=VALUE arguments to xcodebuild. You can then put these into Info.plist values with ${MY_BUILD_SETTING}.
I found that we can use plistbuddy to set values about info.plist,like that /usr/libexec/PlistBuddy -c "set:CFBundleShortVersionString ${version_version}" ${plist_path}
plistbuddy is a tool which can modify plist file well,using /usr/libexec/PlistBuddy -h to find help.
Hope that can help other people!

how can I add my publisher name into my delphi exe program?

I do develop delphi programs that people do download.
Problem is when downloading them, they receieve an alert
"The publisher cannot be verified."
How can I add my publisher name into my delphi programs ?
You need a code-signing certificate, and need to digitally sign your executable using that certificate.
Search for [windows] code signing here at StackOverflow. There are tons of questions here on the topic; any and all of them (regardless of language used) for Windows applications apply to Delphi as well. Here is a start for you., and here's another one with links to resources. (Both links are here at StackOverflow, and not external sites.)
This is how I created a test certificate for my setup executable (produced by Inno Setup).
I used:
makecert -r -pe -ss MyCertStore -n "CN=MyTestCert" MyTestCert.cer
signtool sign /s MyCertStore /n MyTestCert MyApplication.exe
I could find these tools under:
"c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\"
Dont forget to install MyTestCert.cer under trusted providers, otherwise the MyApplication.exe will still show unknown publisher. Check with certmgr.exe which I could find in the same folder.
Worked for me on Win7x64.
For final signing you need a commercial code signing certificate, the cheapest I could find was from Comodo (about $70 a year).

How can I fix user dir permissions for my Cydia app?

I am having an issue with my application hosted on Cydia.
Users are complaining that the app crashes on startup.
The app uses CoreData, I thought it had something to do with this.
Weird thing is that it works fine using simulator or on my device when testing.
But as soon as it is installed through Cydia it crashes.
Turns out that using "Fix User Dir Permissions" from SBSettings fixes this issue.
Now what can I do about this?
I just had a discussion with the repository guys at BigBoss about this.
I never really got a clear answer, but it looks to me like when Cydia installs your application, it doesn't necessarily set the ownership (explicitly) for your application. That seems bizarre to me. In my case, they were test-installing my app, and seeing that it was owned by user/group = { 1000 / 100 }, which was the linux user id and group id from the machine I was preparing my .deb package on!
I can also see this same behavior if I build a .deb package, deploy it to my own local test repository, and install it with Cydia (pointing at my own repo).
In any case, I explained this to them, and they did something to fix it (without anything more from me).
However, one other option is to manually fix permissions in your post install script. In your .deb package, you would have this folder and file structure:
DEBIAN/control
DEBIAN/postrm
DEBIAN/postinst
DEBIAN/preinst
If you put this in your postinst script, I think it should fix this immediately, without having to go into SBSettings afterwards:
#!/bin/bash
chown -R root.wheel /Applications/MyAppName.app/
exit 0
You can do more than that in the script, if you need other directories created, for example. But, the above will at least suffice to change ownership on the .app directory itself.
This BigBoss link recommends creating additional directories in your app's code, and points out that the installer runs as root, while your app normally runs as user mobile. Depending on what you're doing, it may be better to fix ownership/permissions in postinst (root) or in the app (mobile).

Resources