Coder Social home page Coder Social logo

appreceiptvalidator's People

Contributors

aquarius avatar arturgrigor avatar hannesoid avatar lightsprint09 avatar lukaskubanek avatar marcomasser avatar myell0w avatar schwmi avatar weichsel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appreceiptvalidator's Issues

Can't build with Xcode 12

Whenever I try to build my project that requires AppReceiptValidator I guess this error:

On Xcode 12 (12A7208), if I build the project using with the old command line tool from Xcode 11.7, the Carthage build works but building the project in Xcode results in this error:
Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3 compiler

If I update the Command Line tools to Xcode 12 (12A7208), and run 'carthage update --platform iOS', I get a failure with the following message:

Task failed with exit code 65. ....
This usually indicates that project itself failed to compile.

From the log file:

[....]
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld /Users/EdouardBarbier/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/AppReceiptValidator/0.7.3/Build/Intermediates.noindex/AppReceiptValidator.build/Release-iphonesimulator/AppReceiptValidator\ iOS.build/Objects-normal/arm64/Binary/AppReceiptValidator normal arm64
(1 failure)

Any idea how we can get this fixed?
Thanks in advance and let me know if I need to provide more detais.

[Resolved] Xcode build error after upgrading to 1.1.0: Unexpected duplicate tasks

This issue is not an issue to be solved, but for documentation purposes to help users of the framework when upgrading

If you have previously used AppReceiptValidator in Xcode frameworks and App Targets, you may now experience a
build error similar:

Unexpected duplicate tasks

This is due to: #86 (release https://github.com/IdeasOnCanvas/AppReceiptValidator/releases/tag/1.1.0)

If you are expecting and embedding it as a dynamic framework,

  • replace all AppReceiptValidator mentions in your pbxproj project files with AppReceiptValidatorDynamic
  • or alternatively try removing the embedding of the AppReceiptValidator from your app target(s) (linking being enough) and see if it works

The configured certificate seems to be ignored

First and foremost, thank you for creating this useful library!

I’ve started integrating it into my project for performing on-device app receipt validation. Since I’d like to utilize StoreKit Testing in Xcode, I have to differentiate the certificate used for validation (see this section). In the README, you show a snippet for this configuration step. However, I checked the source code and noticed that the configured certificate in AppReceiptValidator.Parameters isn’t used at all. While the certificate (represented as Data) is passed to checkSignatureAuthenticity(…), the certificate that gets used is the one extracted from the receipt.

func checkSignatureAuthenticity(pkcs7: ASN1Decoder.PKCS7, appleRootCertificateData: Data, rawData: Data?) throws {
guard let signature = pkcs7.signatures?.first else { throw Error.receiptNotSigned }
guard let signatureData = signature.signatureData else { throw Error.receiptNotSigned }
guard let receiptData = pkcs7.mainBlock.findOid(.pkcs7data)?.parent?.sub?.last?.sub(0)?.rawValue else { throw Error.receiptNotSigned }
let rootCert = pkcs7.certificates[0]
try self.verifyAuthenticity(x509Certificate: rootCert, receiptData: receiptData, signatureData: signatureData)
}

I was wondering whether there should be a check for the correct certificate. If I understand it correctly, it should now be possible to create a receipt using an arbitrary certificate, and as long as the fields are matching, the library would interpret it as valid. Is my understanding correct? What would be the recommended way to fix this?

Support for UIKit+Mac (Catalyst) apps

It would be great to use AppReceiptValidator for iOS13/Catalina Catalyst apps. One option would be library compiled as new Xcode 11 .xcframework.

From Xcode 11 Beta Release Notes
XCFrameworks make it possible to bundle a binary framework or library for multiple platforms —including iOS devices, iOS simulators, and UIKit for Mac — into a single distributable .xcframework bundle that your developers can use within their own applications. An .xcframework bundle can be added to an Xcode target’s Link Libraries phase and Xcode uses the right platform’s version of the included framework or library at build time. Creation of XCFrameworks is supported from the command line using xcodebuild -create-xcframework. Frameworks or libraries bundled in an XCFramework should be built with the Build Libraries for Distribution build setting set to YES.

Another option would be library as CocoaPod that compiles with the rest of code.

Does anyone have a volume purchase app receipt file for testing VPP receipt support?

Hello,

I'm considering to change the business model of my app from paid up front to freemium. I was going to use AppTransaction in StoreKit 2 to check for the originalAppVersion. Unfortunately AppTransaction doesn't support the volume purchase program and triggers an Apple ID sign in when an app was purchased through the VPP.

I was looking at this library and it looks like it should be possible to check for UnofficialReceipt.provisioningType for ProvisioningType.ProductionVPP to check if the app was purchased through the volume purchase program.

  1. Does anyone have a sample VPP app receipt file so I could check a real-world example of how this would look like?
  2. Does a VPP app receipt file contain the originalAppVersion or is it nil?
  3. AppTransaction of StoreKit 2 has a field originalPurchaseDate that contains the original purchase date of the app itself while I cannot find this in the Receipt struct - only in InAppPurchaseReceipt. Is this not available outside of StoreKit 2, or is this field just not yet added to this library? I'm asking because if a VPP receipt did not contain the originalAppVersion, we could use the originalPurchaseDate of the app receipt instead.

Thanks for your help!

AppReceiptValidator always retrieves the same receipt, with the same inApp purchases even if the sandbox user is changed

This is something I have noticed while testing AppReceiptValidator: it always retrieves the same receipt with the same inapp purchases, even if I change the sandbox user. Why is that? Very strange.

What I mean is this: I run the app, it asks me for the App Store credentials, I login with a sandbox user, let's say [email protected].

I purchase a few items.

I run the app again with another app store credentials, [email protected]

I retrieve the receipt and it shows the inapp purchases that were purchased by [email protected].

Aren't the purchases bound to a specific user?

I am testing this under macOS. I have tried to purchase something with the second sandbox user to see if the receipt would refresh. NOPE.

Also tried several exit(173) + macOS restarts. NOPE.

Receipt always comes with the purchases done by the first user who purchased inapps with the application.

I suspect this is an error from Apple, what is expected, given their lack of love for developers.

Eligible for free trial?

Hello,

I have been using this library for years now. Thank you!
Is there a way to know if the user is eligible for free trial?

Best,

Build for Mac Arm (Apple Silicon) - anyone managed?

Anyone managed to compile an app for macOS Big Sur (Xcode 12.2) with AppReceiptValidator?

carthage update fails with the following logs:

`
Build settings from configuration file '/tmp/static.xcconfig.NVALzV':
EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)_NATIVE_ARCH_64_BIT$(NATIVE_ARCH_64_BIT)_XCODE$(XCODE_VERSION_MAJOR))
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12B5044c = arm64 arm64e armv7 armv7s armv6 armv8

note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override:
note: Planning build
note: Constructing build description
error: The linked library 'libcrypto.a' is missing one or more architectures required by this target: arm64. (in target 'AppReceiptValidator macOS' from project 'AppReceiptValidator')
error: The linked library 'libssl.a' is missing one or more architectures required by this target: arm64. (in target 'AppReceiptValidator macOS' from project 'AppReceiptValidator')
`

Rename Repo and Types

Rename following final discussions…

  • Repository and project to AppReceiptValidator
  • Main type to AppReceiptValidator
  • Update Readme.md
  • Rename Targets
  • Rename Folders
  • Rename Hekate in code headers
  • Add ideas on canvas to readme … is brought to you by IdeasOnCanvas, the creator of MindNode for iOS, macOS & watchOS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.