Post

Replies

Boosts

Views

Activity

codesign fails with Segmentation fault: 11
I'm developing a C sharp application in Visual Studio for Mac. I have set up code signing in the IDE, but now it fails with the following error even though I have not made any changes to the code. A timestamp was expected but was not found. Also, when I run the codesign command in the CLI, I get the following results. $ codesign -v --force --timestamp --sign [sign_id] path/to/target_file Segmentation fault: 11 How can I solve this? I've already tried the following: Rebuild the certificate. Add --timestamp=none(Signing works, but error when getting Apple notarization.)
0
0
575
Dec ’20
AXIsProcessTrustedWithOptions doesn't work
I'm developing in Visual Studio for mac using C sharp. I'm using AXIsProcessTrustedWithOptions() to get accessibility permissions, but sometimes the behavior is strange. var key = new NSObject[] { FromObject("AXTrustedCheckOptionPrompt") }; var obj = new NSObject[] { FromObject((NSNumber)1) }; var options = NSDictionary.FromObjectsAndKeys(obj, key); AXIsProcessTrustedWithOptions(options.Handle); Specifically, it looks like this: "Accessibility Access" dialog will appear. Click "Open System Preferences". There isn't my app in the list and can't turn on Some users of macOS Mojave are experiencing this issue. Does anyone have any solutions?
1
0
600
Nov ’20
Unable to determine if accessibility permissions were granted for a notarized app.
I develop apps using C sharp in Visual Studio for Mac. The app was originally granted accessibility permissions, but after it was notarized by Apple, it failed to determine if it was granted permissions. This is how it is determined in the code. var key = new NSObject[] { FromObject("AXTrustedCheckOptionPrompt") }; var obj = new NSObject[] { FromObject((NSNumber)0) }; var options = NSDictionary.FromObjectsAndKeys(obj, key); if (!AXIsProcessTrustedWithOptions(options.Handle)) { //some codes } This may or may not occur on different devices. When I compared the console logs of the devices that this occurred and those that didn't, I noticed the following differences. tccd handle_TCCAccessCopyInformation(): failed to find an Application URL for bundle ID: old.bundle.id. I recently changed the bundle ID, but the devices seems to refer to the old bundle ID. By the way, this problem no longer occurs when I reboot the device. However, I don't want to force users to go through this procedure, so I'm looking for someone who has a solution to this problem.
3
0
565
Sep ’20
can't codesign the .app file using Visual Studio for Mac
I'm developing a C sharp application in Visual Studio for Mac. I have it set up to be signed with a developer ID signature to get it notarized by Apple. But it's not working. Here are the steps. (1). Sign the code using Visual Studio for Mac. (2). However, this .app file will crash. (3). When I create a dmg and request notarization with the xcrun altool command, I get the following error. { &#9;"logFormatVersion": 1, &#9;"jobId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", &#9;"status": "Invalid", &#9;"statusSummary": "Archive contains critical validation errors", &#9;"statusCode": 4000, &#9;"archiveFilename": "MyApp.dmg", &#9;"uploadDate": "2020-08-18T08:29:55Z", &#9;"sha256": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", &#9;"ticketContents": null, &#9;"issues": [ &#9;&#9;{ &#9;&#9;&#9;"severity": "error", &#9;&#9;&#9;"code": null, &#9;&#9;&#9;"path": "MyApp.dmg/MyApp.app/Contents/MonoBundle/SQLite.Interop.dll", &#9;&#9;&#9;"message": "The signature of the binary is invalid.", &#9;&#9;&#9;"docUrl": null, &#9;&#9;&#9;"architecture": "x86_64" &#9;&#9;} &#9;] } Even if this succeeds, it won't matter because it will crash... Thinking that SQLite.Interop.dll was the cause, I signed the code directly after step (1) and it started successfully. $ codesign --force --verify --verbose \ &#9;&#9;--sign "Developer ID Application: MyCompany (XXXXXXXXX)" \ &#9;&#9;"SQLite.Interop.dll" \ &#9;&#9;--deep \ &#9;&#9;--options runtime \ &#9;&#9;--timestamp However, requesting a notarization with the xcrun altool command returns an error like this: { &#9;"logFormatVersion": 1, &#9;"jobId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", &#9;"status": "Invalid", &#9;"statusSummary": "Archive contains critical validation errors", &#9;"statusCode": 4000, &#9;"archiveFilename": "MyApp.dmg", &#9;"uploadDate": "2020-08-18T08:29:55Z", &#9;"sha256": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", &#9;"ticketContents": null, &#9;"issues": [ &#9;&#9;{ &#9;&#9;&#9;"severity": "error", &#9;&#9;&#9;"code": null, &#9;&#9;&#9;"path": "MyApp.dmg/MyApp.app/Contents/MacOS/MyApp", &#9;&#9;&#9;"message": "The signature of the binary is invalid.", &#9;&#9;&#9;"docUrl": null, &#9;&#9;&#9;"architecture": "x86_64" &#9;&#9;} &#9;] } I thins this is due to a change in the signature of the dependency SQLite.Interop.dll, which has resulted in an incorrect signature in MyApp. How can I solve this? Here's what I've already tried. Manually sign MyApp.dmg/MyApp.app/Contents/MacOS/MyApp again. Sign SQLite.Interop.dll manually before the procedure (1). Here is some information that will assist Settings for signing .csproj files &#9;<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> &#9;&#9;<Optimize>true</Optimize> &#9;&#9;<OutputPath>bin\Release</OutputPath> &#9;&#9;<ErrorReport>prompt</ErrorReport> &#9;&#9;<WarningLevel>4</WarningLevel> &#9;&#9;<EnableCodeSigning>true</EnableCodeSigning> &#9;&#9;<CreatePackage>false</CreatePackage> &#9;&#9;<EnablePackageSigning>false</EnablePackageSigning> &#9;&#9;<IncludeMonoRuntime>true</IncludeMonoRuntime> &#9;&#9;<UseSGen>true</UseSGen> &#9;&#9;<UseRefCounting>true</UseRefCounting> &#9;&#9;<LinkMode>SdkOnly</LinkMode> &#9;&#9;<AOTMode>None</AOTMode> &#9;&#9;<CodeSigningKey>Developer ID Application: MyCompany (XXXXXXXXXXX)</CodeSigningKey> &#9;&#9;<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey> &#9;&#9;<UseHardenedRuntime>true</UseHardenedRuntime> &#9;&#9;<CodeSignEntitlements>Entitlements.plist</CodeSignEntitlements> &#9;&#9;<CodeSignExtraArgs>--deep</CodeSignExtraArgs> &#9;</PropertyGroup> Entitlements.plist <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> &#9;<key>com.apple.security.cs.allow-jit</key> <true/> </dict> </plist> I'm using SQLite.Interop.dll in System.Data.SQLite.Core, which I got from NuGet. packages/System.Data.SQLite.Core.1.0.111.0/runtimes/osx-x64/native/netstandard2.0/SQLite.Interop.dll
8
0
1.7k
Sep ’20