pelock/radio-code-calculator

Radio Code Calculator 是一个在线服务,同时还提供 Web API 和 SDK,用于生成常见汽车品牌的汽车收音机解锁码。

1.1.6 2024-09-13 20:15 UTC

This package is auto-updated.

Last update: 2024-09-13 20:18:52 UTC


README

Radio Code Calculator 是一个在线服务,同时还提供 Web API & SDK,用于生成常见汽车品牌的汽车收音机解锁码。

在汽车电池损坏或断电后,大多数汽车收音机和导航单元都会要求输入解锁码。这是标准的防盗保护措施。

我们的汽车收音机解锁码计算器可以生成 100% 有效 的收音机解锁码,无需使用授权经销商的昂贵服务即可解锁汽车收音机和导航。

Radio Code Calculator

该服务通过简单的在线界面和 Web API 提供,并提供多种流行编程语言的 SDK 开发库。

借助我们的解决方案,您可以创建例如移动或Web应用程序,这些应用程序可以轻松生成收音机解锁码。

支持的汽车型号和收音机

我们的服务正在不断发展,并为新的汽车型号及其收音机逐渐添加新算法。

如果添加了新算法,您将自动免费获得它,作为您当前许可证的一部分。

我们的网站上提供个人计算器作为针对最终用户的付费服务。您可以在相关子页面上验证它们并查看支持的收音机列表

收音机解锁码计算器的使用

谁可以使用收音机解锁码生成服务并从中赚钱?

Android 应用开发者

我们的软件的主要受众是开发者和程序员,无论是移动还是桌面应用程序。

Shoping cart 在线商店

如果您经营在线电子商务商店,您可以使用我们的软件解决方案通过它销售收音机解锁码。

Car 汽车修理店

我们也鼓励那些客户经常使用汽车防盗器解锁服务的汽车维修店。

Person 个人用户

个人用户也可以通过生成代码并在汽车论坛或eBay、Craigslist等拍卖网站上出售来从我们的解决方案中获利。

无限制!

您可以使用购买的一年许可证无限制地生成代码。

自行设定单个代码的生成价格,并通过使用您熟悉的编程语言中的经过测试和验证的算法开始赚钱。

如果您不是程序员 - 别担心。只需使用我们的在线计算器

安装

首选的WebApi接口安装方式是通过composer

运行

php composer.phar require --prefer-dist pelock/radio-code-calculator "*"

或将此条目

"pelock/radio-code-calculator": "*"

直接添加到您的composer.json文件的require部分。

安装包可在https://packagist.org.cn/packages/pelock/radio-code-calculator获取

其他编程语言的包

安装包已上传到几个流行编程语言的存储库,其源代码已在GitHub上发布

使用示例

汽车防盗器代码生成

此示例演示了为选定的汽车防盗器型号生成代码。所有输入参数验证都在服务器端完成,如果汽车防盗器序列号长度或模式无效,则服务将返回错误。

<?php declare(strict_types=1);

/******************************************************************************
 *
 * Radio Code Calculator API - WebApi interface usage example
 *
 * In this example, we will demonstrate how to generate a code for a specific
 * type of car radio.
 *
 * Version      : v1.1.6
 * PHP          : >= 7
 * Dependencies : cURL
 * Author       : Bartosz Wójcik (support@pelock.com)
 * Project      : https://www.pelock.com/products/radio-code-calculator
 * Homepage     : https://www.pelock.com
 *
 * @link https://www.pelock.com/products/radio-code-calculator
 * @copyright Copyright (c) 2021-2024 PELock LLC
 * @license Apache-2.0
 *
/*****************************************************************************/

//
// include Radio Code Calculator API module
//
use PELock\RadioCodeCalculator\RadioCodeCalculator;
use PELock\RadioCodeCalculator\RadioErrors;
use PELock\RadioCodeCalculator\RadioModels;

//
// create Radio Code Calculator API class instance (we are using our activation key)
//
$myRadioCodeCalculator = new RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD");

//
// generate radio code (using Web API)
//
list($error, $result) = $myRadioCodeCalculator->calc(RadioModels::get(RadioModels::FORD_M_SERIES), "123456");

switch($error)
{
	case RadioErrors::SUCCESS: echo "Radio code is " . $result["code"]; break;
	case RadioErrors::INVALID_RADIO_MODEL: echo "Invalid radio model (not supported)"; break;
	case RadioErrors::INVALID_SERIAL_LENGTH: echo "Invalid serial number length (expected " . $result["serialMaxLen"] . " characters)"; break;
	case RadioErrors::INVALID_SERIAL_PATTERN: echo "Invalid serial number regular expression pattern (expected " . $result["serialRegexPattern"]["php"] . " regex pattern)"; break;
	case RadioErrors::INVALID_SERIAL_NOT_SUPPORTED: echo "This serial number is not supported"; break;
	case RadioErrors::INVALID_EXTRA_LENGTH: echo "Invalid extra data length (expected " . $result["extraMaxLen"] . " characters)"; break;
	case RadioErrors::INVALID_EXTRA_PATTERN: echo "Invalid extra data regular expression pattern (expected " . $result["extraRegexPattern"]["php"] . " regex pattern"; break;
	case RadioErrors::INVALID_INPUT: echo "Invalid input data"; break;
	case RadioErrors::INVALID_COMMAND: echo "Invalid command sent to the Web API interface"; break;
	case RadioErrors::INVALID_LICENSE: echo "Invalid license key!"; break;
	default: echo "Something unexpected happen while trying to login to the service (error code {error})."; break;
}

带有附加离线验证的汽车防盗器代码生成

汽车防盗器代码基于输入参数生成,如汽车防盗器的序列号等。

不同汽车防盗器的序列号不同,它们具有不同的长度和模式,有些可能仅由数字组成,例如1234,而有些可能由数字和字母组成,例如AB1234XYZ

此数据的验证在服务器端完成。然而,为了提高效率,我们可以使用有关特定序列号可用限制和模式的信息,例如,在我们的应用程序中设置这些限制,而无需对Web API进行不必要的调用。

<?php declare(strict_types=1);

/******************************************************************************
 *
 * Radio Code Calculator API - WebApi interface usage example
 *
 * In this example, we will demonstrate how to generate a code for a specific
 * type of car radio. This example shows how to use an extended offline
 * validation.
 *
 * Version      : v1.1.6
 * PHP          : >= 7
 * Dependencies : cURL
 * Author       : Bartosz Wójcik (support@pelock.com)
 * Project      : https://www.pelock.com/products/radio-code-calculator
 * Homepage     : https://www.pelock.com
 *
 * @link https://www.pelock.com/products/radio-code-calculator
 * @copyright Copyright (c) 2021-2024 PELock LLC
 * @license Apache-2.0
 *
/*****************************************************************************/

//
// include Radio Code Calculator API module
//
use PELock\RadioCodeCalculator\RadioCodeCalculator;
use PELock\RadioCodeCalculator\RadioErrors;
use PELock\RadioCodeCalculator\RadioModel;
use PELock\RadioCodeCalculator\RadioModels;

//
// create Radio Code Calculator API class instance (we are using our activation key)
//
$myRadioCodeCalculator = new RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD");

//
// generate a single radio unlocking code
//
$serial = "123456";
$extra = "";

//
// select a radio model
//
$radioModel = RadioModels::get(RadioModels::FORD_M_SERIES);

//
// display radio model information, you can use it to set limits in your controls e.g.
//
// textFieldRadioSerial.maxLength = radioModel->serial_max_len
// textFieldRadioSerial.regEx = radioModel->serial_regex_pattern()
//
// (if allowed by your controls)
//
echo "Radio model $radioModel->name expects a serial number of $radioModel->serial_max_len length and {$radioModel->serial_regex_pattern()} regex pattern<br>";

// additional information
if ($radioModel->extra_max_len > 0)
{
	echo "Additionally an extra field is required with $radioModel->extra_max_len and {$radioModel->extra_regex_pattern()} regex pattern<br>";
}

//
// validate the serial number (offline) before sending the Web API request
//
$error = $radioModel->validate($serial, $extra);

if ($error !== RadioErrors::SUCCESS)
{
    if ($error === RadioErrors::INVALID_SERIAL_LENGTH)
        echo "Invalid serial number length (expected $radioModel->serial_max_len characters<br>";
    else if ($error == RadioErrors::INVALID_SERIAL_PATTERN)
        echo "Invalid serial number regular expression pattern (expected $radioModel->serial_regex_pattern() regex pattern)<br>";
    else if ($error == RadioErrors::INVALID_SERIAL_NOT_SUPPORTED)
        echo "This serial number is not supported";
    else if ($error == RadioErrors::INVALID_EXTRA_LENGTH)
        echo "Invalid extra data length (expected $radioModel->extra_max_len characters)<br>";
    else if ($error == RadioErrors::INVALID_EXTRA_PATTERN)
        echo "Invalid extra data regular expression pattern (expected $radioModel->extra_regex_pattern() regex pattern)<br>";
        
    exit(1);
}

//
// generate radio code (using Web API)
//
list($error, $result) = $myRadioCodeCalculator->calc($radioModel, $serial);

switch($error)
{
	case RadioErrors::SUCCESS: echo "Radio code is " . $result["code"]; break;
	case RadioErrors::INVALID_RADIO_MODEL: echo "Invalid radio model (not supported)"; break;
	case RadioErrors::INVALID_SERIAL_LENGTH: echo "Invalid serial number length (expected " . $result["serialMaxLen"] . " characters)"; break;
	case RadioErrors::INVALID_SERIAL_PATTERN: echo "Invalid serial number regular expression pattern (expected " . $result["serialRegexPattern"]["php"] . " regex pattern)"; break;
	case RadioErrors::INVALID_SERIAL_NOT_SUPPORTED: echo "This serial number is not supported"; break;
	case RadioErrors::INVALID_EXTRA_LENGTH: echo "Invalid extra data length (expected " . $result["extraMaxLen"] . " characters)"; break;
	case RadioErrors::INVALID_EXTRA_PATTERN: echo "Invalid extra data regular expression pattern (expected " . $result["extraRegexPattern"]["php"] . " regex pattern"; break;
	case RadioErrors::INVALID_INPUT: echo "Invalid input data"; break;
	case RadioErrors::INVALID_COMMAND: echo "Invalid command sent to the Web API interface"; break;
	case RadioErrors::INVALID_LICENSE: echo "Invalid license key!"; break;
	default: echo "Something unexpected happen while trying to login to the service (error code {error})."; break;
}

下载支持的汽车防盗器代码计算器列表

如果您想下载有关所有支持的汽车防盗器型号及其参数(如序列号长度和模式)的信息,您可以这样做。

<?php declare(strict_types=1);

/******************************************************************************
 *
 * Radio Code Calculator API - WebApi interface usage example
 *
 * In this example we will list all the available calculators and, their
 * parameters like name, maximum length of the radio serial number and its
 * regex pattern.
 *
 * Version      : v1.1.6
 * PHP          : >= 7
 * Dependencies : cURL
 * Author       : Bartosz Wójcik (support@pelock.com)
 * Project      : https://www.pelock.com/products/radio-code-calculator
 * Homepage     : https://www.pelock.com
 *
 * @link https://www.pelock.com/products/radio-code-calculator
 * @copyright Copyright (c) 2021-2024 PELock LLC
 * @license Apache-2.0
 *
/*****************************************************************************/

//
// include Radio Code Calculator API module
//
use PELock\RadioCodeCalculator\RadioCodeCalculator;
use PELock\RadioCodeCalculator\RadioErrors;

//
// create Radio Code Calculator API class instance (we are using our activation key)
//
$myRadioCodeCalculator = new RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD");

//
// get the list of the supported radio calculators and their parameters (max. length, regex pattern)
//
list($error, $radio_models) = $myRadioCodeCalculator->list();

if ($error == RadioErrors::SUCCESS)
{
	echo "Supported radio models " . count($radio_models) . "<br>";

	foreach ($radio_models as $radio_model)
	{
		echo "Radio model name - $radio_model->name<br>";

		echo "Max. length of the radio serial number - " . $radio_model->serial_max_len . "<br>";
		echo "Regex pattern for the radio serial number - " . $radio_model->serial_regex_pattern() . "<br>";

		// is extra field specified?
		if ($radio_model->extra_max_len > 0)
		{
			echo "Max. length of the radio extra data - " . $radio_model->extra_max_len . "<br>";
			echo "Regex pattern for the radio extra data - " . $radio_model->extra_regex_pattern() . "<br>";
			echo "<br>";
		}
	}
}
else if ($error == RadioErrors::INVALID_LICENSE)
	echo "Invalid license key!";
else
	echo "Something unexpected happen while trying to login to the service (error code {error}).";

下载选定的计算器参数

您可以下载选定计算器的参数。

<?php declare(strict_types=1);

/******************************************************************************
 *
 * Radio Code Calculator API - WebApi interface usage example
 *
 * In this example, we will demonstrate how to get information about the
 * specific radio calculator and its parameters (max. length & regex pattern).
 *
 * Version      : v1.1.6
 * PHP          : >= 7
 * Dependencies : cURL
 * Author       : Bartosz Wójcik (support@pelock.com)
 * Project      : https://www.pelock.com/products/radio-code-calculator
 * Homepage     : https://www.pelock.com
 *
 * @link https://www.pelock.com/products/radio-code-calculator
 * @copyright Copyright (c) 2021-2024 PELock LLC
 * @license Apache-2.0
 *
/*****************************************************************************/

//
// include Radio Code Calculator API module
//
use PELock\RadioCodeCalculator\RadioCodeCalculator;
use PELock\RadioCodeCalculator\RadioErrors;

//
// create Radio Code Calculator API class instance (we are using our activation key)
//
$myRadioCodeCalculator = new RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD");

//
// query information about the radio model
//
list($error, $radio_model) = $myRadioCodeCalculator->info("ford-m-series");

if ($error === RadioErrors::SUCCESS)
{
	echo "Radio model name - " . $radio_model->name . "<br>";

	echo "Max. length of the radio serial number - " . $radio_model->serial_max_len . "<br>";
	echo "Regex pattern for the radio serial number - " . $radio_model->serial_regex_pattern() . "<br>";

	// is extra field specified?
	if ($radio_model->extra_max_len > 0)
	{
		echo "Max. length of the radio extra data - " . $radio_model->extra_max_len . "<br>";
		echo "Regex pattern for the radio extra data - " . $radio_model->extra_regex_pattern() . "<br>";
		echo "<br>";
	}
}
elseif ($error == RadioErrors::INVALID_LICENSE)
    echo "Invalid license key!";
else
    echo "Something unexpected happen while trying to login to the service (error code {error}).";

检查激活密钥

通过检查激活密钥状态,我们将获得有关许可证所有者、许可证类型和许可证到期日期的信息。

<?php declare(strict_types=1);

/******************************************************************************
 *
 * Radio Code Calculator API - WebApi interface usage example
 *
 * In this example we will verify our activation key status.
 *
 * Version      : v1.1.6
 * PHP          : >= 7
 * Dependencies : cURL
 * Author       : Bartosz Wójcik (support@pelock.com)
 * Project      : https://www.pelock.com/products/radio-code-calculator
 * Homepage     : https://www.pelock.com
 *
 * @link https://www.pelock.com/products/radio-code-calculator
 * @copyright Copyright (c) 2021-2024 PELock LLC
 * @license Apache-2.0
 *
/*****************************************************************************/

//
// include Radio Code Calculator API module
//
use PELock\RadioCodeCalculator\RadioCodeCalculator;
use PELock\RadioCodeCalculator\RadioErrors;

//
// create Radio Code Calculator API class instance (we are using our activation key)
//
$myRadioCodeCalculator = new RadioCodeCalculator("ABCD-ABCD-ABCD-ABCD");

//
// login to the service
//
list($error, $result) = $myRadioCodeCalculator->login();

//
// result[] array holds the information about the license
//
// result["license"]["activationStatus"] - True if license is active, False on invalid/expired keys
// result["license"]["userName"] - user name/company name of the license owner
// result["license"]["type"] - license type (0 - Personal License, 1 - Company License)
// result["license"]["expirationDate"] - license expiration date (in YYYY-MM-DD format)
//
if ($error == RadioErrors::SUCCESS)
{
    echo "License activation status - " . ($result["license"]["activationStatus"] ? "True" : "False") . "<br>";
    echo "License owner - " . $result["license"]["userName"];
    echo "License type - " . ($result["license"]["type"] == 0 ? "Personal" : "Company") . "<br>";
    echo "Expiration date - " . $result["license"]["expirationDate"] . "<br>";
}
else if ($error == RadioErrors::INVALID_LICENSE)
    echo "Invalid license key!";
else
    echo "Something unexpected happen while trying to login to the service (error code {error}).";

有问题吗?

如果您对汽车防盗器代码计算器Web API感兴趣,或对汽车代码生成器SDK包有任何问题,无论是技术问题、法律问题还是某些内容不清楚,请联系我。我很乐意回答您所有的问题。

Bartosz Wójcik