Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itznotabug/checkoutverifier
Verify your In-App Purchase receipts & protect your Apps from hacking, patching used by Piracy Apps like Lucky Patcher.
https://github.com/itznotabug/checkoutverifier
android android-iap android-in-app-billing android-in-app-purchase android-protect-apps android-protection android-security
Last synced: 25 days ago
JSON representation
Verify your In-App Purchase receipts & protect your Apps from hacking, patching used by Piracy Apps like Lucky Patcher.
- Host: GitHub
- URL: https://github.com/itznotabug/checkoutverifier
- Owner: ItzNotABug
- License: apache-2.0
- Created: 2019-01-31T17:02:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T08:46:49.000Z (over 3 years ago)
- Last Synced: 2024-10-08T16:00:20.690Z (about 1 month ago)
- Topics: android, android-iap, android-in-app-billing, android-in-app-purchase, android-protect-apps, android-protection, android-security
- Language: Kotlin
- Size: 729 KB
- Stars: 61
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CheckoutVerifier
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bb126216417b45668b81e08090d2d081)](https://www.codacy.com/gh/ItzNotABug/CheckoutVerifier/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ItzNotABug/CheckoutVerifier&utm_campaign=Badge_Grade)
CheckoutVerifier helps you Verify your In-App Purchase receipts & protect your Apps from hacking, patching used by Piracy Apps like Lucky Patcher.
Since I was using these classes in every project, the copy / pasting of classes was annoying so thought of releasing it as a library which might be of help to others too!## How does it work?
Well, the library sends the Signed Json Response & Signature that you receive after a purchase is completed on a specified server url where it checks the signature of that response data with your BASE64 Key provided to you in your Developer Console.## Set Up
#### * Get Licensing API Key
Navigate to Developer Console & Select your App.
Go to Development Tools > Services & API.
Copy the BASE64 Licensing Key#### * Creating a Verifying PHP File
Just a create a File & name it as `verify.php` or anything you want.
Paste the following code in it & Upload it to your server.```php
```
#### * Implementing Library (Gradle)
Note: Add `mavenCentral()` in `repositories` block.```gradle
dependencies {
// CheckoutVerifier now internally uses Kotlin Coroutines.
implementation 'com.lazygeniouz:checkout-verifier:$library_version'
}
```#### * CheckoutVerifier
Just pass on the required `PurchaseBundle` in the Constructor & call `authenticate();`
The `authenticate()` returns a `Result` object.
If the connection to the server was successful & a result was returned,
`CompletionResult(isVerified: Boolean)` is returned,
`ErrorResult(exception: Exception)` otherwise.
Example:
```kotlin
yourScope.launch {
val purchaseBundle = PurchaseBundle(url, jsonResponse, signature)
when (val result = CheckoutVerifier(purchaseBundle).authenticate()) {
is CompletionResult -> {
val verified = result.isVerified
// Do something
}
is ErrorResult -> Log.d(TAG, result.exception.message)
}
}
```