Please forgive me, but I’m tearing my hair out with this.
I have an old project that was on the Mac App Store. For a variety of reasons, that project was not updated for a number of years. However, I have finally been able to spend some time on the project to update for Big Sur/M1 compatibility and am working on getting it resubmitted to the App Store.
The project builds and code-signs correctly (using App Wrapper 4.2.1). Awesome! However, when I test my installer package, my receipt-checking code is failing with a NilObjectException. I have not touched this code since 2017, at least and it worked fine then. I have to assume that something has changed since then that my code is not accounting for. I am using code to test the App Store receipt that uses MBS.
I’ve done many searches—both of this forum—and with Google and I can’t find anything in recent years that doesn’t refer to MacOSLib, MBS (which I was using) or Sam Rowlands’ ReceiptTester, which doesn’t seem to be publicly available anymore.
Here is the code I was using to test the receipt:
dim a as new AppReceiptVerificatorMBS dim f as FolderItem = app.ExecutableFile.Parent.Parent.Child( "_MASReceipt" ).Child( "receipt" ) if f = Nil then Valid = False declare sub exit_ lib "System" alias "exit" ( code as Integer ) exit_ ( 173 ) else dim r as AppReceiptMBS = AppReceiptMBS.receiptForFile(f) a.bundleIdentifier = kBundleIdentifierAppStore a.bundleVersion = App.ShortVersion if a.verifyReceipt(r) then // <-- NilObjectException is happening here. // App Store receipt is valid. Valid = True else // App Store receipt is invalid. Valid = False declare sub exit_ lib "System" alias "exit" ( code as Integer ) exit_ ( 173 ) end if end if
Any thoughts as to what I’m doing wrong?