override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
val response = httpClient.newCall(request).execute() if (!response.isSuccessful) throw LicenseException("Server error ($response.code)")
private const val LICENSE_ENDPOINT = "https://license.apeaksoft.com/validate" private val httpClient = OkHttpClient()
/** * 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
// 2️⃣ Build request body val payload = JSONObject().apply put("key", key) put("machineId", machineId) .toString()
// Kotlin DSL tasks.register<JavaExec>("validateApeaksoftLicense") group = "verification" description = "Validates the APEAKSOFT Toolkit license."
return LicenseInfo( key = key, machineId = machineId, expires = expires, features = featureSet )
dependencies // Core (free) components implementation "com.apeaksoft:android-toolkit-ui:1.4.2"
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
val response = httpClient.newCall(request).execute() if (!response.isSuccessful) throw LicenseException("Server error ($response.code)")
private const val LICENSE_ENDPOINT = "https://license.apeaksoft.com/validate" private val httpClient = OkHttpClient()
/** * 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
// 2️⃣ Build request body val payload = JSONObject().apply put("key", key) put("machineId", machineId) .toString()
// Kotlin DSL tasks.register<JavaExec>("validateApeaksoftLicense") group = "verification" description = "Validates the APEAKSOFT Toolkit license."
return LicenseInfo( key = key, machineId = machineId, expires = expires, features = featureSet )
dependencies // Core (free) components implementation "com.apeaksoft:android-toolkit-ui:1.4.2"
QR Code