Registration Code - Apeaksoft Android Toolkit

val response = httpClient.newCall(request).execute() if (!response.isSuccessful) throw LicenseException("Server error ($response.code)")

// 3️⃣ Send POST request (blocking – called from Gradle task) val request = Request.Builder() .url(LICENSE_ENDPOINT) .post(payload.toRequestBody()) .header("User-Agent", "Apeaksoft-Toolkit/1.4.2") .build()

dependencies // Core (free) components implementation "com.apeaksoft:android-toolkit-ui:1.4.2"

// 2️⃣ Build request body val payload = JSONObject().apply put("key", key) put("machineId", machineId) .toString() apeaksoft android toolkit registration code

classpath = configurations["runtimeClasspath"] mainClass.set("com.apeaksoft.toolkit.license.LicenseVerifierMain") // tiny wrapper class

/** * Validate the key. Returns a [LicenseInfo] on success, * throws a [LicenseException] otherwise. */ @Throws(LicenseException::class) fun verify(key: String, machineId: String = ""): LicenseInfo // 1️⃣ Basic sanity checks require(key.matches(Regex("^[A-Z0-9]32$"))) "License key must be a 32‑character alphanumeric string."

/** * Handles verification of the license key against the remote server. * * The server expects a POST payload: * * "key": "<LICENSE_KEY>", * "machineId": "<MACHINE_ID>" // optional, may be empty string * * * Response (JSON): * false, * "expires": "2027-12-31", * "features": ["ui", "network", "analytics"] * */ object LicenseVerifier val response = httpClient

private lateinit var api: ApiClient

package com.apeaksoft.toolkit.license

private const val LICENSE_ENDPOINT = "https://license.apeaksoft.com/validate" private val httpClient = OkHttpClient() * * The server expects a POST payload:

Now you can run:

Create a file apeaksoft_license.properties at the project root (same folder as settings.gradle ). Example content: