How to get a CodeSignature for a Mac OS X app - cocoa

Hey! I think this is a simple question for you. Most of the system apps and also some third-party apps have integrated a CodeSignature in their bundle. I heard with such a CodeSignature the system would not ask anymore for accepting incoming network connections (if the firewall is enabled). Now the question is where to get such a CodeSignature...
Thank you for your help!

Where and how to get code signed?
See Code Signing Guide:
Code signing is a technology
introduced in Mac OS X v10.5 that
ensures the integrity of code and
allows the system to recognize updated
versions of code as the same program
as the original. Once you have signed
your code, any change in the code that
you did not intend—whether introduced
accidently or by hackers—can be
detected by the system. On the other
hand, your signature on an updated
version of your program tells the
system to treat the new version
exactly as it treated the old, so that
users are not bothered with obscure
dialogs asking them to give permission
to the keychain or some other system
component to interact with your code.
Signing code is fast, requires few
resources, and increases the size of
your deliverable by less than 1%.
Signatures do not alter how your code
runs and are ignored by Mac OS X
versions prior to Mac OS X v10.5;
therefore, there is no reason not to
sign your code. However, there are a
few things you need to know before you
begin. This document explains the
terminology and concepts you need to
know and gives you a few
straightforward procedures you can
follow to sign your code.
Because the system will expect all
code to be signed, any code that is
not signed will not behave in the same
manner as the majority of the programs
on the user’s system. In particular,
the user is likely to be bothered with
additional dialog boxes and prompts
for unsigned code that they don’t see
with signed code, and unsigned code
might not work as expected with some
system components, such as parental
controls. It is highly recommended
that you sign all code intended for
use with Mac OS X v10.5 or later.
Therefore, if you are delivering, or
intend to deliver, code that might
ever be run on Mac OS X v10.5 or
later, you should read this document.
Code Signing Guide

Related

Keychain viewers - what does DPFMate do?

Got this Digital Keychain Photo viewer thingy. Comes with DPFMate which does not run under Windows 10. Does anyone know where DPFMate places the images on the keychain, so I could possibly write my own program to do the move?
i know this thread dates back to April but i have a device that uses DPFmate and it was packaged with it in memory. the software came with a windows and a mac version. fortunately most of the code is literally available in an uncompiled form in the mac app package. i have included everything from that package in a mediafire link. https://www.mediafire.com/file/ebyxepk013k18pd/Resources.rar
from what i gathered it loads a virtual drive from the machine using a SCSI connection driver of some sorts. i hope you can make sens of it more than me since i am not familiar with the programming language used.

OSX Sandbox: Launch a different executable based on OS version

I have an application in the Mac App Store. I'm trying to support users going back to Snow Leopard but this is becoming increasingly difficult.
Recently I've hit a roadblock due to the iTunesLibrary.framework, this framework must be linked to the main executable and yet doing so will always trigger a crash on load when running in Snow Leopard.
To workaround this problem, I want to compile a version of my app that doesn't use features and frameworks from newer versions of OSX. The problem is, how can I launch the compatibility build automatically?
I'm considering trying to make the main executable point to a shell script, but I don't really like that idea. I've also thought of the main executable being a helper that simply launches the full app and then exits. I expect this would work, but I worry about it getting approved by Apple. Finally, I'm wondering if the app bundle format itself can support this kind of setup, maybe via an advanced used of CFBundleExecutable that I'm unaware of.
Has anyone been down this road, what would you suggest?
Try weak linking the frameworks, more information about Weak Linking and Apple Frameworks here. Then also check in your code for the OS version or - (BOOL)respondsToSelector:(SEL)aSelector of any NSObject to determine what you can call and what not.
To have Snow Leopard as Base SDK you'll need an old Xcode and will have troubles submitting to Mac App Store.

Where is Mac OS X Debugging Interface

I am new to UNIX and Mac OS X systems and wondering how debugging on Max OS X works. I am from Windows world and I am familiar with debugging system in Windows like attaching to a process with DebugActiveProcess, reading/writing memory with Read/WriteProcessMemory and so on...
I don't know if Mac OS X's debugging also woriking like Windows but
I want to know how a debugger in Max OS X communicates with a target process. Can anyone give me some hits of a start point or documents where I should read first?
The debugging interface on OS X and most Unixes is called ptrace.
Type man ptrace at a command prompt for information on how ptrace communicates between processes, and also have a look at the header at /usr/include/sys/ptrace.h
The typical debuggers are gbd and (recently) lldb. Many IDEs on OS X also use these. So.. "man gdb" is a good starting point.
As user1118321 mentioned, installing the Xcode toolset would be a good idea, if you've not done so already. It includes compilers, an IDE, debuggers, profilers, and graphical programs for these tools.
You didn't state which language, or tools you're using, so for the purposes of this answer I'll assume you're using Objective-C with either gcc or clang to compile your code and link it into an executable. If you're using some other language, such as java or ruby, the equivalent from windows probably exists for OS X as well.
In general, unix uses GDB for debugging, and OS X is no different. You won't always attach it to a running process, I find that's more common to start a process in the debugger, although there do exist tools (such as Instruments) that will profile a running process.
If you're using XCode, there's a whole suite of debugging tools built in that use gdb under the hood. I suggest you start reading some of the developer documentation here http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/130-Debugging_Applications/debugging_applications.html and then ask around if there's something in particular you want to know about.
If you've installed Xcode, look at all of the applications installed in /Developer/Applications, at a minimum you should find
Xcode - write and debug, design interfaces here
Instruments - profile your application, look for memory leaks
Icon Composer - create slick icons for your applications
Graphics Tools - used to help work with OpenGL and Quartz mainly

What is the state of TWAIN on the Macintosh today?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh.
On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners.
On Mac OS X, we also basically have everything working and with the main scanner we used to develop the application with works perfectly, but we're not having a ton of luck with other scanners. As a byproduct of development on this project, we have a fair number of scanners from various manufacturers on-hand to test with. The results vary wildly:
The scanner we used to develop with works perfectly on Mac OS X as it does in Windows. Ironically this scanner is the cheapest and crappiest scanner (speed-wise) we've ever encountered but it's been a dream to work with.
Another scanner works great - until the second or third scan, at which point the application crashes with no clear indication of what happened (we get an EXEC_BAD_ACCESS from the debugger)
Another scanner apparently has no TWAIN support on Mac OS X (no data sources in the "Image Capture/TWAIN Data Sources" folder), although it does have TWAIN support in Windows.
Another scanner has a generic data source that I'm thinking is supposed to cover all the possible scanners from this manufacturer but when we try to initiate a native scan (which is a requirement for all TWAIN data sources) we get no results. Also, trying to install a second scanner from this manufacturer gums everything up and requires a manual uninstall for everything from this company.
Another scanner has a TWAIN data source that appears to be specific to the manufacturer, but it also fails to initiate a native scan (but a scan using the native GUI - which is incompatible with our project - works)
So I'm not sure where to go with this. I'm still digging into the code to figure out what, if anything, we're doing wrong but in checking against the TWAIN standard it really does look like we're doing everything right, but we're getting very hit-or-miss results on most of the scanners we're testing against.
Also, as part of the new Cocoa/Carbon Events model there's this additional consideration of a "callback" function that Mac OS X TWAIN data sources are supposed to implement and I'm not seeing it called from most of these data source/drivers.
So all of this leads me to wonder - is it that we're just doing something wrong or is TWAIN just not supported properly by and large on the Macintosh?
I'm really not seeing a lot of information on TWAIN on the Macintosh online - the occasional sporadic inquiry on twainforum.org tends to go unanswered. Windows also has a thing called WIA - Windows Image Acquisition - and on the Windows side we also include this as an option. Is there something else on the Mac we should be exploring instead of or in addition to TWAIN?
You can try ImageCaptureCore.framework. But you have to verify that the company/model scanners to which you are giving solution have ImageCapture support.
If any vendor has given support then a ImageCapture module will be present in location '/Library/Image Capture/Devices'. You can also check the plists inside modules for supported models.
Hope it helps :-)

Using Time Machine for test environment rollback for Mac platform

When I'm testing software I'm going to deploy or running through tests in the Windows world, I'll use VMWare images so that I can start from a fresh, known state at the beginning of each test. This has worked really well so that I can install software on different OS flavors or with other/different apps and drivers loaded. This makes it super simple to duplicate or nearly duplicate a customer's environment when addressing issues that crop up.
Now I'm tasked with doing something similar for Mac OS X. I'm far less familiar with this OS and didn't really see the same sort of thing available. I noted that the server version of 10.5 might allow this, but I'm not running that here. I've got access to 10.5 on a Mac Book and one of those Mac Minis.
Has anyone used Time Machine to put their test Mac box into a known state? Or do you have other ideas? I'm also interested in a solution for 10.4 since some of my customers run "Tiger".
I tend to test things that don't manipulate the global computer state (i.e. a lot of well written Cocoa applications) with the "Guest" account. Since Tiger (I think), the effects of using this account are wiped at logout, so you can easily get a virgin environment again.
By default, Time Machine excludes certain paths from backup. This could be detrimental to your testing strategy, depending on the system resources that your software touches. See this article for information on the exclusions. At a bare minimum, if you are going to use Time Machine to rollback, make sure nothing you are testing depends on any of the excluded files.
But, I think there is a better alternative, if you can live with Mac OS X Server: VMWare Fusion provides support for virtualizing instances of Mac OS X Server Leopard. Then you can use the same strategy you used for Windows.
From http://www.vmware.com/products/fusion/features.html
VMware Fusion boasts the most complete
OS support, supporting more than 60
operating systems in a virtual
machine, including Windows XP, Windows
Vista, and even Mac OS X Server.
Keep in mind, you cannot virtualize Mac OS X Client due to license restrictions, though.
An alternative (perhaps more lightweight) solution that I just found recently is an app called RooSwitch. It lets you swap configurations for an application. So you could have a bunch of different prefs files, cache files, etc for your app and create a named configuration for it. You can create multiple configurations to test new user setup, or to reproduce an issue using a customer's data without losing your own config. RooSwitch then lets you switch between all these different configs.
I haven't used it myself yet, but heard about it on a podcast recently and thought it sounded useful for my own development and testing.

Resources