Receigen Not Working

My Receigen has stopped working. I have used this for a long time and had no problems but then it started generating code that wouldn't work. With a valid receipt installed, the app quits on launch. The Console reports the app "Exited with exit code: 173. This indicates that reciept validation is not working.


Then after I "upgraded" to XCode 7.1 I can't build my project. The compiler can't locate some of the #included headers needed by the reciegen.h file:


#import <openssl/bio.h>

#import <openssl/err.h>

#import <openssl/objects.h>

#import <openssl/pkcs7.h>

#import <openssl/sha.h>

#import <openssl/x509.h>


I read the instructions carefully and spent a long time being sure that everything is configured as per the instructions. But it won't work.

I installed the newest version of openssl.


No matter what I put in the text field for user header search paths, even an absolute path to the folder, XCode can't find them. It looks like this feature is broken in XCode 7.


The FAQs at the Receigen site don't mention these problems and the developer won't respond to E-mails.


Does anyone have the same problems and/or any suggestions as to how I could resolve this?

Accepted Reply

Work Around:

1. Xcode 7 changed the Bundle identifier in the app’s info.plist to ($)BUNDLE_IDENTIFIER. Change it to whatever it was, i.e. com.appname or whatever it is at iTunes Connect and use this for the Receigen code generator.


2. Download a copy of the ssl libraries here: http://receigen.etiemble.com/guides-openssl.html


3. Add the openssl-versionname folder to your project. Link against the supplied libraries.


4. Use the code assistant to generate the receipt validation code header file using the bundle identifier and version and #include it in main.h. Instead of calling return NSApplicationMain(argc, (const char **) argv); use return CheckReceiptAndRun(argc, (const char **) argv); This is the same as before.


5. Open the .h file created by the Receigen code assistant. Using the openssl in Xcode you used to had to #define RECEIGEN_USE_PRE_1_0_0_OPENSSL. Now be sure it’s not defined.


6. When you try to build your project you will get a lot of errors like this: header not found: #import <openssl/headername.h>. Each time you get this error use the Find->Find And Replace in Project... function to change these to #import “headername.h”. This will import the version of the header in the openssl-versionname/include/openss folder you got from the receigen site, instead of the Apple-supplied headers that are deprecated now. Your project should build when this is done.


7. Test receipt validation:

A. Archive your app. Validate it as a Developer-signed Application. Export it to your computer as a development-signed application.

B. Create a test user at iTunes Connect. Team admin must sign on. Click on Users and Roles. Click on Sandbox Testers. Create a new sandbox tester. The Code signing guide says that for a small development team the team administrator can be the tester. This is wrong - iTunes connect won’t let you do this. You must create a tester with a different username and password than the admin.

C. Launch the app from the Finder. It will exit with error 173. Then you will be asked for the Apple ID of the test user. Enter this in the dialog. If you enter the test user’s apple ID correctly, Apple will add a valid receipt to the app and relaunch it. If it’s validating the receipt correctly it will run. If not it will exit with error 173.

Replies

I've worked on this a lot more. It looks like this is because XCode deprecated open ssl with XCode 7. It is possible to link against the ssl .lib Also the needed headers are in the include folder. You can get the project to build by replacing all of the 222 occurrences of #import <openssl/headername> with #import "headername" to #include the ssl headers in the openssl-version/include/openssl folder you get from the Reciegen site. You have to be sure RECEIGEN_USE_PRE_1_0_0_OPENSSL is undefined in the header generated by Receigen validate receipts using openssl.


The problem is that the Mac application built with this proceedure won't correctly validate Mac App Store receipts. It will exit with an error code of 173.


Since Receigen is now broken and the developer isn't addressing this problem or responding to E-mails about it, in the short term it looks like one alternative would be to go back to XCode 6. Can anyone tell me how to do this?


To test my app before submitting it again I have tried to create a test user at iTunes Connect, export the archive and get the store to sign it with a valid certificate to see if it will work, as described on the reciegen site. The proceedure described (poorly) on the site Reciegen support site doesn't work. Can anyone direct me to a description of how to test my App to see if it's validating receipts correctly before resubmitting?


Is there some Cocoa API I can use to add receipt validation to my App?

> XCode 6. Can anyone tell me how to do this?


Well, Xcode 6.x is still available via https://developer.apple.com/downloads/


I'd guess the path of least pain would be if you have some sort of backup of that project that hadn't been moved too far forward, otherwise dealing with whatever cruft may be involved would most likely depend on that project, of course. But at least you can hands on to find out what you're facing and then come back here with specific questions/errors, etc.

Work Around:

1. Xcode 7 changed the Bundle identifier in the app’s info.plist to ($)BUNDLE_IDENTIFIER. Change it to whatever it was, i.e. com.appname or whatever it is at iTunes Connect and use this for the Receigen code generator.


2. Download a copy of the ssl libraries here: http://receigen.etiemble.com/guides-openssl.html


3. Add the openssl-versionname folder to your project. Link against the supplied libraries.


4. Use the code assistant to generate the receipt validation code header file using the bundle identifier and version and #include it in main.h. Instead of calling return NSApplicationMain(argc, (const char **) argv); use return CheckReceiptAndRun(argc, (const char **) argv); This is the same as before.


5. Open the .h file created by the Receigen code assistant. Using the openssl in Xcode you used to had to #define RECEIGEN_USE_PRE_1_0_0_OPENSSL. Now be sure it’s not defined.


6. When you try to build your project you will get a lot of errors like this: header not found: #import <openssl/headername.h>. Each time you get this error use the Find->Find And Replace in Project... function to change these to #import “headername.h”. This will import the version of the header in the openssl-versionname/include/openss folder you got from the receigen site, instead of the Apple-supplied headers that are deprecated now. Your project should build when this is done.


7. Test receipt validation:

A. Archive your app. Validate it as a Developer-signed Application. Export it to your computer as a development-signed application.

B. Create a test user at iTunes Connect. Team admin must sign on. Click on Users and Roles. Click on Sandbox Testers. Create a new sandbox tester. The Code signing guide says that for a small development team the team administrator can be the tester. This is wrong - iTunes connect won’t let you do this. You must create a tester with a different username and password than the admin.

C. Launch the app from the Finder. It will exit with error 173. Then you will be asked for the Apple ID of the test user. Enter this in the dialog. If you enter the test user’s apple ID correctly, Apple will add a valid receipt to the app and relaunch it. If it’s validating the receipt correctly it will run. If not it will exit with error 173.