Skip to content

Commit

Permalink
GitBook: [#363] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
adnan-kamili authored and gitbook-bot committed Apr 26, 2022
1 parent 7379e72 commit f870f48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
6 changes: 6 additions & 0 deletions changelog/lexactivator.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# LexActivator

## 3.18.2 (2021-04-25)

### Fixed

* Issues related to device fingerprinting on Android.

## 3.18.1 (2022-04-05)

### Updated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using LexActivator with Android

## Adding licensing to your app <a href="#adding-licensing-to-your-app" id="adding-licensing-to-your-app"></a>
## Adding licensing to your app <a href="adding-licensing-to-your-app" id="adding-licensing-to-your-app"></a>

After you've added a product for your app in the dashboard, go to the product page of the product you will be adding licensing to. You will need to do two things:

Expand All @@ -10,29 +10,20 @@ After you've added a product for your app in the dashboard, go to the product pa

Product.dat contains product data that is used by LexActivator. The product id is the identifier of your product that is to be used in the code.

### Adding the library to your app <a href="#adding-library-to-your-app" id="adding-library-to-your-app"></a>
### Adding the library to your app <a href="adding-library-to-your-app" id="adding-library-to-your-app"></a>

LexActivator wrapper for Android is available on the [central maven repository](https://search.maven.org/artifact/com.cryptlex.android.lexactivator/lexactivator) and can be easily installed using Gradle by adding the following dependency in your build.gradle file:

```markup
dependencies {
implementation 'com.cryptlex.android.lexactivator:lexactivator:3.18.2'
implementation 'com.cryptlex.android.lexactivator:lexactivator:3.15.0'
}
```

Alternatively, you can also download the [AAR](https://repo1.maven.org/maven2/com/cryptlex/android/lexactivator/lexactivator/) file and add it to your project.

The minimum supported Android API level is 23 and the minimum supported Android NDK version is r21e.

### Adding permissions

LexActivator library requires two permissions to be set in the Android manifest.

```
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
```

### Setting product.dat file and product id

The first thing you need to do is either embed the Product.dat file in your app using `SetProductData()` function or set the absolute path of the file using `SetProductFile()` function.
Expand All @@ -48,7 +39,7 @@ LexActivator.SetProductId("PASTE_PRODUCT_ID", LexActivator.LA_USER);
In case your app doesn't have write access to the disk, you can use `LA_IN_MEMORY` flag instead, which causes all the data to be stored in the memory. But this would require you to activate the license every time you restart the app.
{% endhint %}

### License activation <a href="#license-activation" id="license-activation"></a>
### License activation <a href="license-activation" id="license-activation"></a>

To activate the license in your app using the license key, you will use `ActivateLicense()` LexActivator API function. It invokes the `/v3/activations` Cryptlex Web API endpoint, verifies the encrypted and digitally signed response to validate the license.

Expand All @@ -68,7 +59,7 @@ try {

The above code should be executed at the time of registration, ideally on a button click.

### Verifying license activation <a href="#verifying-license-activation" id="verifying-license-activation"></a>
### Verifying license activation <a href="verifying-license-activation" id="verifying-license-activation"></a>

Each time, your app starts, you need to verify whether your license is already activated or not. This verification should occur locally by verifying the cryptographic digital signature of activation. Ideally, it should also asynchronously contact Cryptlex servers to validate and sync the license activation periodically. For this, you need to use `IsLicenseGenuine()` LexActivator API function.

Expand All @@ -95,6 +86,6 @@ try {

The above code should be executed every time user starts the app. After verifying locally, it schedules a periodic server check in a separate thread.

## Need more help <a href="#need-more-help" id="need-more-help"></a>
## Need more help <a href="need-more-help" id="need-more-help"></a>

In case you need more help with adding LexActivator to your app, we'll be glad to help you make the integration. You can either post your questions on our [support forum](https://forums.cryptlex.com) or can contact us through [email](mailto:[email protected]?Subject=Using%20LexActivator).

0 comments on commit f870f48

Please sign in to comment.