B4J Question MacStore - How do you upload binary in "Build" section?

gregchao

Member
Licensed User
Longtime User
I have successfully used the MacSigner to create notorized .app and .dmg files that can be run on Macs from B4j. Very nice tool.

I am interested in getting my app on to the MacStore. I created a new App in "App Store Connect" but I am unsure how to upload my binary on to the store. For B4i, there is an Uploader as part of the IDE. Apple seems to have three tools: Xcode, Altool, and Transport. This is in the "Build" area of the App information. See picture below.

Screenshot 2022-06-11 225717.jpg
 

gregchao

Member
Licensed User
Longtime User
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
ipa files are for iOS only.

Instructions to create a pkg file:
1. Create a Mac Installer Distribution certificate using the certSigningRequest from the SignerKeys folder.

1655186988412.png


2. Open Keychain Access on your Mac, choose b4j2-db keychain and add the mac_installer.cer file.
It should then appear in the My Certificates section:

1655187462961.png


3. Right click on the installer certificate - Get Info - copy the Common Name (starts with 3rd Party).
4. Run productbuild command line tool to build the package:

productbuild --component appname.app /Applications appname.pkg --sign "3rd Party Mac ..." --keychain b4j2

I haven't tried uploading the package to the app store. Please post your results.
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
ipa files are for iOS only.

Instructions to create a pkg file:
1. Create a Mac Installer Distribution certificate using the certSigningRequest from the SignerKeys folder.

View attachment 130374

2. Open Keychain Access on your Mac, choose b4j2-db keychain and add the mac_installer.cer file.
It should then appear in the My Certificates section:

View attachment 130375

3. Right click on the installer certificate - Get Info - copy the Common Name (starts with 3rd Party).
4. Run productbuild command line tool to build the package:

productbuild --component appname.app /Applications appname.pkg --sign "3rd Party Mac ..." --keychain b4j2

I haven't tried uploading the package to the app store. Please post your results.
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
I got pretty far but I created more than one entry of "3rd Party Mac.." with the wrong signing key in the keychain area. When I tried to delete them, it asked for the password to b4j2-db. I tried the login to the computer without success. Does B4j have a different password?
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
Try: 123456
that password worked.

Step 1 (OK): When I do step 1, it asks for me to point to certSigningRequest.csr. I passed through this task fine. It creates the file mac_installer.cer fine.

Step 2 (Issue):When I do step 2, I double click on the Mac_installer.cer file and it loads to the keychain but not in the "my certification" but in the "certifications" area. I also tried opening keychain access and loading from there. I tried recreating the certSigningRequest.csr file from B4i with no success. I notice there is no private signing key. The common name is correct. see picture below.

Step 4 (Error) When I run step 4, the script gives me the following error:

productbuild: error: Cannot write product to "BridgeTeachTool.pkg". (Could not find appropriate signing identity for “3rd Party Mac Developer Installer: ...” in keychain at “b4j”.). I replaced my name and id with "..." for privacy reasons.



Screen Shot 2022-06-16 at 11.08.36 PM.png
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
When I do step 2, I double click on the Mac_installer.cer file and it loads to the keychain but not in the "my certification" but in the "certifications" area. I also tried opening keychain access and loading from there. I tried recreating the certSigningRequest.csr file from B4i with no success. I notice there is no private signing key. The common name is correct. see picture below.
This means that the CSR is wrong. You need to use the one that is in the SignerKeys folder. The CSR file is the reference to the private key.
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
This means that the CSR is wrong. You need to use the one that is in the SignerKeys folder. The CSR file is the reference to the private key.
Thanks Erel, I finally got it working. Script is good. I will post progress as I continue on.
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
(Ereil, I originally put this in the wrong place so I moved it)
Got the Transporter to import the .pkg file. When I hit the "deliver" button, the following errors 3 errors occur. Any help would be welcome. I am not sure what 1) the sandbox is, 2) nor how to upload the icon, 3) nor why the product archive is invalid.

Asset validation failed (90296)

App sandbox not enabled. The following executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true in the entitlements property list: [( "fdp.btt.macrelease.pkg/Payload/BridgeTeachTool.app/Contents/MacOS/BridgeTeachTool", "fdp.btt.macrelease.pkg/Payload/BridgeTeachTool.app/Contents/runtime/Contents/Home/bin/java", "fdp.btt.macrelease.pkg/Payload/BridgeTeachTool.app/Contents/runtime/Contents/Home/bin/jrunscript", "fdp.btt.macrelease.pkg/Payload/BridgeTeachTool.app/Contents/runtime/Contents/Home/bin/keytool", "fdp.btt.macrelease.pkg/Payload/BridgeTeachTool.app/Contents/runtime/Contents/Home/lib/jspawnhelper" )] Refer to App Sandbox page at https://developer.apple.com/documentation/security/app_sandbox for more information on sandboxing your app. (ID: 0a81060f-ed8f-4bda-8d1a-5b288b0c2e97)

Asset validation failed (90236)

Missing required icon. The application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image. For further assistance, see the Apple Human Interface Guidelines at https://developer.apple.com/macos/human-interface-guidelines/icons-and-images/app-icon (ID: 74c8c01b-2a46-484a-b388-9e5b5b62d14f)

Asset validation failed (90249)

The product archive is invalid. The value of the LSApplicationCategoryType key in the Info.plist is Unknown, which is not a UTI for a valid category. For more details, see "Submitting your Mac apps to the App Store". (ID: 75fbf993-4a5e-4228-a073-7e08d1f6f136)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm sorry to say but this will require some work to get it accepted. If you are adventurous then you can try to fill the missing pieces.

The MacSigner tool was built to prepare apps for Mac deployments. There are several more steps required to publish to the store. I hope to implement them but it will take some time.
 
Upvote 0

gregchao

Member
Licensed User
Longtime User
I'm sorry to say but this will require some work to get it accepted. If you are adventurous then you can try to fill the missing pieces.

The MacSigner tool was built to prepare apps for Mac deployments. There are several more steps required to publish to the store. I hope to implement them but it will take some time.
Where would I find the documentation of the file structure of the Mac .pkg file in order to understand how I should modify the MacSigner? I know that you already posted the source code for the MacSigner. If I cannot figure it out, I will wait for you to modify.
 
Last edited:
Upvote 0
Top