Skip to content

Commit

Permalink
Merge pull request #6 from ItzNotABug/revert-5-dev
Browse files Browse the repository at this point in the history
Revert "Dev"
  • Loading branch information
ItzNotABug committed Jul 26, 2021
2 parents 5a89624 + 4ddcc6d commit 6a5455e
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<img src="logo/horizontal.png" width=60%>
</h1>

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!
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bb126216417b45668b81e08090d2d081)](https://www.codacy.com/gh/ItzNotABug/CheckoutVerifier/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ItzNotABug/CheckoutVerifier&amp;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.
Expand All @@ -16,31 +14,37 @@ the copy / pasting of classes was annoying so thought of releasing it as a libra
## 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.

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**
#### * Get Licensing API Key
Navigate to Developer Console & Select your App.
<br/>Go to <b>Development Tools</b> > <b>Services & API.</b>
<br/>Copy the <b>BASE64 Licensing Key</b>


* **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.
#### * Creating a Verifying PHP File
Just a create a File & name it as `verify.php` or anything you want.
<br/>Paste the following code in it & Upload it to your server.

```php
<?php
// get jsonResponse
$data = $_GET['jsonResponse'];

// get signature
$signature = $_GET['signature'];

// get key
$key_64 = "YOUR BASE64 KEY THAT YOU GOT FROM DEVELOPER CONSOLE, THERE SHOULD BE NO SPACES!";


$key = "-----BEGIN PUBLIC KEY-----\n".
chunk_split($key_64, 64,"\n").
'-----END PUBLIC KEY-----';

//using PHP to create an RSA key
$key = openssl_get_publickey($key);


// state whether signature is okay or not
$ok = openssl_verify($data, base64_decode($signature), $key, OPENSSL_ALGO_SHA1);
if ($ok == 1) {
Expand All @@ -51,12 +55,12 @@ if ($ok == 1) {
die ("fault, error checking signature");
}

// free the key from memory
openssl_free_key($key);

?>
```

### Implementing Library (Gradle)
library_version: [![Download](https://api.bintray.com/packages/itznotabug/Maven/CheckoutVerifier/images/download.svg)](https://bintray.com/itznotabug/Maven/CheckoutVerifier/_latestVersion)
#### * Implementing Library (Gradle)
library_version: [![Download](https://api.bintray.com/packages/itznotabug/Maven/CheckoutVerifier/images/download.svg)](https://bintray.com/itznotabug/Maven/CheckoutVerifier/_latestVersion)
<br/>
Expand All @@ -67,12 +71,6 @@ dependencies {
}
```

### Using 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:
#### * CheckoutVerifier
Just pass on the required `PurchaseBundle` in the Constructor & call `authenticate();`
<br/>The `authenticate()` returns a `Result` object.
Expand Down

0 comments on commit 6a5455e

Please sign in to comment.