Can I have my MAS and my "Indie" app share the same credentials for TCC (GateKeeper)?

I release my app both in the MAS and on my website. I use the same signing credentials, but necessarily different certs (Apple Development vs. Developer ID).

When I run the MAS app and then run the other version, or vice versa, I need to re-authenticate the many privacy permissions each time (Finder AppleScript, Network browse, Full Disk Access), which is tedious and keeps causing trouble for other users because some of these require a tcc reset (which my app currently invokes manually, which I consider a hack, though).

So, am I doing something wrong or is it really no possible to have both signed apps use the same identity with TCC?

Answered by DTS Engineer in 914252022

It depends on what you mean by “identity”. macOS generally tracks your code’s identity via its designated requirement (DR). App Store apps and Developer ID apps have mutually compatible DRs, as explained in TN3127 Inside Code Signing: Requirements. So, this stuff typically Just Works™.

There are, however, two gotchas:

  • Not all privileges are tracked by the app’s DR.
  • A development-signed app’s DR is not mutually compatible with the other two.

The latter explains the majority of the misbehaviour you’re reporting. Fortunately, it only affects folks running development signed code.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

It depends on what you mean by “identity”. macOS generally tracks your code’s identity via its designated requirement (DR). App Store apps and Developer ID apps have mutually compatible DRs, as explained in TN3127 Inside Code Signing: Requirements. So, this stuff typically Just Works™.

There are, however, two gotchas:

  • Not all privileges are tracked by the app’s DR.
  • A development-signed app’s DR is not mutually compatible with the other two.

The latter explains the majority of the misbehaviour you’re reporting. Fortunately, it only affects folks running development signed code.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

If you want to release two different versions of the same app, make sure to use a different bundle ID for each.

Should a TestFlight app be using compatible DRs with one from
the App Store, too?

It seems that you’ve tested this and discovered that the answer is “Yes”. Cool.

But just as a historical curiosity, there was a bug that caused problems with this back in the day. See this thread.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Quinn,

While I can confirm that my notarized Indie app is compatible with the MAS version, the TestFlight build is not: It causes the same incompatibility for Full Disk Access permissions as the Dev ID builds are causing.

But you suggested that a TestFlight build should have a compatible DR as well, right?

I just tried this on both 15.8.4 and 27.2.1, and the TestFlight builds are not compatible with the MAS and Indie builds regarding TCC.

Even worse - the System Setting's FDA panel shows that the app does have Full Disk Access even though it doesn't actually have it, which makes this so much worse for the customer (in previous versions I worked around this by invoking "tcc reset" to clear all permissions so that the user is getting less confused - I removed it after your previous reply that suggested to me that this won't be an issue any more but that was wrong, it appears).

If you believe it should work, what things can I do to help analyze this? Or would you like to take a look? Both latest Indie and Testflight versions are available through findanyfile.app/beta

Update

I did glance over TN3127 (it's a lot) and used codesign --display -r - to check on my 3 versions:

Indie:
designated => identifier "org.tempel.findanyfile" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "25856V4B4X"

MAS:
designated => (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "25856V4B4X") and identifier "org.tempel.findanyfile"

TestFlight:
designated => anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.25.1] /* exists */ and identifier "org.tempel.findanyfile"

So, the TF version doesn't even have the Team ID, it appears.

From the TN3127 I also got the impression that I might be able to get my TestFlight build to create a compatible DR – is that so? If so, can you give me some guideance, because that's the part where I gave up reading.

I don't know anything about TestFlight, but it is primarily the bundle ID that differentiates one app from the next. If you have two or more apps with the same bundle ID, then the operating system may get confused.

Don't use comments. It looks like they do generate notifications now and they aren't hidden when I click on the e-mailed notification link, but a regular reply is so much better, and has a 7000 character limit.

Just because you did something 15 years ago doesn't mean it will continue to work in the future.

The bundle ID is not the only unique identifier, but you don't want to dupe the other one.

The way you originally described the problem is how I would expect the system to work. An app downloaded from outside the Mac App Store should not automatically assume all the credentials and privileges of a Mac App Store app that has been through Apple's App Review. You're complaining because you built both apps. But what's to stop someone else from using your bundle ID and releasing their own version? Would you want their app to just "take over" all of your privileges?

My recommendation isn't based on any low-level detail of how the system works. That's quite often irrelevant. Make them two different apps. If you want to share data, use an app group. Then a whole lot of problems, current and future, go away.

And another thing - comments can jump around. There's a new comment? Where? I don't see it. Oh, it was on the old post!

I remain unconvinced. A MAS app and a Developer ID app are different apps, at really fundamental levels, going beyond app review.

I understand you've got two existing apps with the same bundle ID. Well, that's unfortunate. If TestFlight is your only problem, consider yourself blessed and don't use TestFlight. I'm pretty sure you wouldn't be able to change the MAS bundle ID. But you could change the Developer ID one easily enough.

What you're describing as a "bug" sure seems to me to be a core security feature. As such, it probably isn't going to change. The burden is always on the 3rd party developer to adapt.