What does macOS use to determine a program has changed?

I’ve written two programs using some of the basic framework and just changing the program name (and programming of course). Each program will ask for access to “documents” folder, which is fine and I permit it.

If I then run the other program it will ask for its document folder permission, which also is fine. However if I run the first program again, having run the second program it asks for document folder permission again.

What are the parameters macOS uses to determine something has changed? I’m running the latest Catalina. It seems as if there are similarities between the programs that makes it think the program has changed, rather than its being a different program.

Thanks.

Just a wild guess, because I’m not an macOS expert, but do both of your apps have the same Bundle Identifier?

Because if they do both have the same ID, but both apps have maybe a different checksum value of some kind (because the code in each is slightly different), that might be confusing macOS into thinking that the same app keeps changing, each time you launch one - therefore keeps prompting you for permissions?

I suggest it, because as far as I understand, I think every macOS app should be using a unique Bundle Identifier.

I hope that helps.

Personally, I would assume (because Apple use security through obscurity) that it’s using the UUID of the application, which is kinda like a checksum of the main executable.

Duplicate the first application, ^lace the duplicate in another folder / change its name to be the same and do the test back with these two…

What are the results ?

You can even run both at the same time.