Help...Code Signing Issues Causing Unexpectedly Quitting

#1

I am getting a code signing issue that is new and progressively getting worse. The app gives this error after crash. Saving app often hangs Script Debugger too on the portion of Code Signing. Any ideas?

This is what happens now when saving: Code signing failed.

/Users/myname/myapp.app: A timestamp was expected but was not found.

In subcomponent: /myapp.app/Contents/Script Debugger.plist
(1)

When exporting app it doesnt fail but unexpectedly quits and the report shows this:
Termination Reason: Namespace CODESIGNING, Code 0x1

0 Likes

(Shane Stanley) #2

What version of the OS are you running when you sign, and when you see the error? Are you saving/exporting run-only? What version of Script Debugger (please try with 7.0.8 if you haven’t already). Do you have any other items in the app bundle?

0 Likes

#3

Osx 10.13.6 Script Debugger 7.08
I have isolated it to only doing it when I saved as Enhanced which was fine before.

I was able to have improve things by deleting all of my certificates and logging in again in Xcode.
I think the problem started when Xcode updated to the Version 10.1 (10B61) I think it updated in the past 2 days and didnt realize you were using the signing from that. But issues again anything running outside of the main thread crashes it as an enhanced app.
ie: current application’s NSApp’s delegate()'s checkForUpdates:me

I do have lots in the app bundle in scripts and one of your libraries in script libraries and the pub key for sparkle.

0 Likes

(Shane Stanley) #4

Have you tried exporting a run-only version?

0 Likes

#5

Yes. it opens but the check for updates or the example showing the about window item causes it to quit where before it ran fine if it wasn’t in the main thread. I even have an old exported version. I believe it has to do with enhanced app and the certificates issue I had.

0 Likes

#6

I can send u a stripped down app if it’s easier to test

0 Likes

(Shane Stanley) #7

Please send it to me.

0 Likes

(Shane Stanley) #8

For anyone following along, there are some important things to keep in mind:

  • Enhanced Applets run their scripts on a background thread. If you are using ASObjC, any code that deals with interface items needs to be run on the main thread, using performSelectorOnMainThread:withObject:waitUntilDone:.

  • Whenever signing code, you should always check the results before distributing your app. In Terminal:

/usr/sbin/spctl --assess --type exec -vv /path/to/Your.app

The result needs to say accepted and source=Developer ID.

It’s also worth keeping in mind that the signing done by Script Debugger and Script Editor is not adequate for notarizing.

1 Like

#9

Thanks again. Shane! I think the signing issue was related to me being behind a coporate firewall saving and the response timing out or being blocked. It locked up Script Debugger a few times. Verifying is definately key and tip helpful!

The main thread vs the background thread issue seems more sensitive in 7.08 then it was in 7.06. I tried running the older version to test my theory but it wouldnt run since the new release is on my machine…although I agree I was definately pushing the background thread UI boundaries. Can you give me an example of usage of performSelectorOnMainThread:withObject:waitUntilDone: in a subroutine? Its tough to find an example of use. I found an old reference to one on your site but the post was outdated.

As always your knowledge is appreciated.

0 Likes

(Shane Stanley) #10

The issue is not directly related to the version of Script Debugger — it’s the OS. Dealing with interface stuff on background threads has always been illegal, but some infractions used to be ignored, then they started producing console errors, and now they’re throwing full-blown exceptions.

You should find plenty of examples around here. You’re using Dialog Plus Toolkit in your app, so look at its code — it uses it extensively.

0 Likes

#11

Doh! Found it just as your responded. Perfect examples in Dialog Toolkit.

0 Likes

#12

Shane,
With the current version of any Enhanced App I save, if I view the typical About window, it shows it then unexpectedly quits after closing the window. This is the same behavior I am experiencing with any UI, although I broke the rules of background threading and main threading and have since fixed it, I still get the same behavior. Can you confirm if you experience the same issue as an enhanced app set to always keep open? It only started in the most recent release.
Thanks
Dean

0 Likes

(Shane Stanley) #13

Email me an example.

0 Likes

(Shane Stanley) #14

It looks like there’s a bug. Until it’s fixed, you can disable the About… menu item like this:

set aboutMenu to (current application's NSApp's mainMenu()'s itemAtIndex:0)'s submenu()'s itemAtIndex:0
aboutMenu's setAction:(missing value)
0 Likes

#15

Is there a way to run the older debugger version? It happens with any ui interaction even if I’m background thread or updates etc

0 Likes

(Mark Alldritt) #16

The Script Debugger 7.0.7 release announcement contains a direct download link:

0 Likes

#17

It goes to the 7.08 page. I have version 7.06 however when I try running it it says my version timed out and to run the latest version. Is there a way to over-ride that or can you send me a beta version of 7.07 that will run?

it says this if I try running any older version I have:
The build of Script Debugger has expired. Contact support@latenightsw.com if you have not already received a notification of a newer build.

Sorry the reason I need this is I use the sparkle update and I am saving out a current version of my enhanced applet and any dialog or ui call causes it to quit if I am using your last release and on client-site otherwise I would be patient until the fix is released.

0 Likes

(Mark Alldritt) #18

You can download to Script Debugger 7.0.7 here.

0 Likes

#19

Hey guys…wanted to thank you. The 7.07 version works great as enhanced applet. It helped out in a pinch. Feel free to send beta update when you have time to resolve the bug.

0 Likes