MAS: app rejected because of faulty receipt-validation

See How to build OpenSSL (libcrypto) and include it in a Xojo built app for libcrypto.

What is the result of receipt validation not working?

When you fail to validate the receipt you are supposed to exit the application with exitCode 173. This informs the macOS that receipt validation failed and it should then force a refresh of the receipt.

What I am seeing is that it is NOT refreshing the receipt, but App Store frameworks are writing a message to the console with a NIL parameter.

I can’t be sure with customers code, but in my own tests it is failing because there is no receipt file. Requesting the OS to refresh the receipt simply results in a onscreen message from the macOS that the application is corrupted and must be re-downloaded.

My code doesn’t even get to the point where it tries to read the receipt as it doesn’t even exist. :frowning:

Edit: It will be at least tomorrow before I hear back from Cupertino and I don’t expect to get a result that day.

Thank you for supplying the link.

Unfortunatelly the link does not work.

Jürg Otter, please…

Works fine for me: https://www.jo-tools.ch/xojo/openssl-byo/

Hi Sam,

did you know when these problems started? My last (successful) submission to the MAS was on Dec., 3rd (and yet no complaints from customers about crashes), but at the end of November some customers had problems with corrupted receipt files (not missing, but corrupted). A re-download from MAS solved their problem.

At that time local testing a MAS App before submission to Apple started to fail (see: Unable to pre-test app for MAS)

Maybe the whole process at Apple is undergoing some significant changes under the hood…

1 Like

I don’t know the exact date sorry. What I do know if that 3 or 4 weeks ago, I submitted two apps to the App Store and had no problem testing the receipt, as it’s part of my process before I submit for review.

Back in spring 2020 I bought a 16" MBP and couldn’t use it to test my App Store apps. After about two weeks, DTS confirmed there was a bug but not sure if it was within the macOS or the machine, so I sent it back and gave it a few months before buying again.

You can simply exchange

"/usr/lib/libcrypto.dylib"

with

"/usr/lib/libcrypto.35.dylib"

in AppStoreReceipt constructor. “/usr/lib/libcrypto.35.dylib” is fine for all current systems (from macOS 10.11 up to macOS 12).

No, this doesn’t work. There is no libcrypto in the folder on Monterey:

1 Like

A lot of the libraries are there in the system, but for “security” they’re concleaded from prying eyes. I think it was Jeff Johnson who figured out how to see 'em.

I am still hopeful that Xojo will expose the functions we need from their own library, so we don’t need yet another copy of libcrypto in our apps.

Even if you don’t see the library, it is working fine - I am working on Monterey :wink:

Well, the library didn’t work for me. I don’t remember the exact error. It was like “don’t talk to me”.

2 Likes

I am using it in all of my apps, MAS and non-MAS, supporting macOS 10.11 up to macOS 12 without any problems.
Maybe you use functions not present in this version - .35 is not really “up-to-date” :wink:

Hi Thomas,
I made the changes in constructor (5 instances), but unfortunatelly I still get the funcky message (app corrupted etc.).
Using BugSur.

I solved the same problem… See Thread Codesign for mac app store error - #6 by Sergio_Tamborini

I solved (after months) dropping all certificates and generates again. @Sam_Rowlands helped me with the Apple authority certificate and he’s near to release the new AppWrapper version that fix a privileges certificates on the newer MacOs.

Anyway keep in mind that the appstore validation code must be executed before all in the open event in the app…

Hope this is helpful.

1 Like

Yes, I generated my certificates and wrapped the app with v4.4.
Problem persists.

Ciao Sergio,
I believe what (I at least) am seeing is different to the issue you experienced, which we solved together as I wouldn’t have gotten there without your help.

The “App corrupted” message is another problem - it has IMO nothing to do with the “libcrypto.dylib” changes. These are neccesary to prevent a rejection of the app in review process - due to a crash.

In summary I just want to clarify what the problem I am experiencing is.

  1. App tries to read the receipt at the path given by NSBundle_appStoreReceiptURL( NSBundle_mainBundle( NSBundleClass ) )
  2. Because there’s no file there, the app exits with code 173 (as it should).
  3. The system is supposed to then generate the receipt at the location and re-launch the application.
    but it doesn’t. It writes some error messages to the console, then displays the error message that the application is corrupted.
  4. Re-launch the application and go to 1.

The application is already on the Mac App Store with the same bundle id, I have logged out and back in the sandbox user, I have validated that the application is in the "Applications’ folder. I have validated that the Sandbox tester is using the same locale as my main account. I have rebooted.

Sorry for the delay in answering.

But here the link still doesn’t work.