ZDK
Public Member Functions | List of all members
ZDK::IActivation Class Referenceabstract

Handles the Activation process of the ZDK. More...

#include <IActivation.h>

Inheritance diagram for ZDK::IActivation:
ZDK::IZHandle

Public Member Functions

virtual ZDK::Shared::Result Start (ZDK::Shared::String certCacheFile, ZDK::Shared::String moduleName, int opFlags, ZDK::Shared::String username, ZDK::Shared::String password, ZDK::Shared::String version, ZDK::Shared::String certPem)=0
 Starts activation process. More...
 
virtual ZDK::Shared::Result StartSDK (ZDK::Shared::String certCacheFile, ZDK::Shared::String username, ZDK::Shared::String password)=0
 Starts activation for an SDK product. More...
 
virtual ZDK::Shared::Result Stop ()=0
 Stops the activation process. More...
 
virtual bool Activated () const =0
 Gets the activation status. More...
 
virtual bool CheckPermission (ZDK::PermissionType value) const =0
 Gets whether a given ZDK functionality is enabled and can be used. More...
 
virtual bool CheckCodecPermission (ZDK::AudioVideoCodecs value) const =0
 Gets whether a given media (audio/video) codec is enabled and can be used. More...
 
virtual bool CheckHostname (const ZDK::Shared::String value) const =0
 Gets whether a given hostname (domain) is allowed to be used. More...
 
virtual ZDK::Shared::Result SetDeviceId (const ZDK::Shared::String value)=0
 Sets the current device ID. More...
 
virtual ZDK::Shared::Result SetPackageName (const ZDK::Shared::String value)=0
 Sets the current package name. More...
 
virtual ZDK::Shared::Result CreateOfflineActivationFile (ZDK::Shared::String activationFile, ZDK::Shared::String username, ZDK::Shared::String password, ZDK::Shared::String hddSerial, ZDK::Shared::String version, ZDK::Shared::String pcUser, ZDK::Shared::String pcName)=0
 Creates a file required for offline activation. More...
 
virtual ZDK::Shared::Result CreateOfflineActivationFileSDK (ZDK::Shared::String activationFile, ZDK::Shared::String username, ZDK::Shared::String password)=0
 Creates a file required for offline activation. More...
 
- Public Member Functions inherited from ZDK::IZHandle
virtual ZDK::ZDKHandle Handle () const =0
 
virtual operator ZDK::ZDKHandle () const =0
 
virtual void Initialize ()=0
 
virtual void ReleaseReference ()=0
 

Detailed Description

Handles the Activation process of the ZDK.

Member Function Documentation

◆ Activated()

virtual bool ZDK::IActivation::Activated ( ) const
pure virtual

Gets the activation status.

Returns
  • 0 - not activated
  • 1 - activated

◆ CheckCodecPermission()

virtual bool ZDK::IActivation::CheckCodecPermission ( ZDK::AudioVideoCodecs  value) const
pure virtual

Gets whether a given media (audio/video) codec is enabled and can be used.

Parameters
[in]valueCodec to be checked
Returns
  • 0 - not available
  • 1 - available
See also
AudioVideoCodecs

◆ CheckHostname()

virtual bool ZDK::IActivation::CheckHostname ( const ZDK::Shared::String  value) const
pure virtual

Gets whether a given hostname (domain) is allowed to be used.

Parameters
[in]valueHostname (domain) to be checked
Returns
  • 0 - not allowed
  • 1 - allowed

◆ CheckPermission()

virtual bool ZDK::IActivation::CheckPermission ( ZDK::PermissionType  value) const
pure virtual

Gets whether a given ZDK functionality is enabled and can be used.

Parameters
[in]valueFunctionality to be checked
Returns
  • 0 - not available
  • 1 - available
See also
PermissionType

◆ CreateOfflineActivationFile()

virtual ZDK::Shared::Result ZDK::IActivation::CreateOfflineActivationFile ( ZDK::Shared::String  activationFile,
ZDK::Shared::String  username,
ZDK::Shared::String  password,
ZDK::Shared::String  hddSerial,
ZDK::Shared::String  version,
ZDK::Shared::String  pcUser,
ZDK::Shared::String  pcName 
)
pure virtual

Creates a file required for offline activation.

For Zoiper internal use only! For SDK builds see CreateOfflineActivationFileSDK()! Creates a file required for offline activation

  1. Create a file with the CreateOfflineActivationFile().
  2. Send the file to "register5@shop.zoiper.com" attached in email.
  3. An email will be send to you with the new certificate file needed for offline activation.
  4. Use the received file (from the received email from the CERT server) as "certCacheFile" input parameter of Start().
Parameters
[in]activationFileFile name (including full path to it!)
[in]usernameThe username for the account to be activated
[in]passwordThe password for the activation of the account
[in]hddSerialThe HDD serial number
[in]versionThe build version as configured on the cert site. This is the "version" URL parameter
[in]pcUserThe user name
[in]pcNameThe device name
Returns
Result of the creating of the file
See also
IResult, Start()

◆ CreateOfflineActivationFileSDK()

virtual ZDK::Shared::Result ZDK::IActivation::CreateOfflineActivationFileSDK ( ZDK::Shared::String  activationFile,
ZDK::Shared::String  username,
ZDK::Shared::String  password 
)
pure virtual

Creates a file required for offline activation.

For SDK products only! For Zoiper internal use see CreateOfflineActivationFile()! Creates a file required for offline activation

  1. Create a file with the CreateOfflineActivationFileSDK().
  2. Send the file to "register5@shop.zoiper.com" attached in email.
  3. An email will be send to you with the new certificate file needed for offline activation.
  4. Use the received file (from the received email from the CERT server) as "certCacheFile" input parameter of StartSDK().
Parameters
[in]activationFileFile name (including full path to it!)
[in]usernamethe Username for the account to be activated
[in]passwordthe Password for the activation of the account
Returns
Result of the creating of the file
See also
IResult, StartSDK()

◆ SetDeviceId()

virtual ZDK::Shared::Result ZDK::IActivation::SetDeviceId ( const ZDK::Shared::String  value)
pure virtual

Sets the current device ID.

Android specific! Set automatically by the Context's constructor in the generated JNI!

Parameters
[in]valueCurrent device's ID
Returns
Result of the invocation
See also
IResult

◆ SetPackageName()

virtual ZDK::Shared::Result ZDK::IActivation::SetPackageName ( const ZDK::Shared::String  value)
pure virtual

Sets the current package name.

Android specific! Set automatically by the Context's constructor in the generated JNI!

Parameters
[in]valueApplication's package name
Returns
Result of the invocation
See also
IResult

◆ Start()

virtual ZDK::Shared::Result ZDK::IActivation::Start ( ZDK::Shared::String  certCacheFile,
ZDK::Shared::String  moduleName,
int  opFlags,
ZDK::Shared::String  username,
ZDK::Shared::String  password,
ZDK::Shared::String  version,
ZDK::Shared::String  certPem 
)
pure virtual

Starts activation process.

For Zoiper internal use only! For SDK builds see StartSDK()!

Starts activation process of the product. Without activation, much of the functionality is not allowed. Activation first tries to use data from a certificate cache file, the path to which is supplied by the user. If the file is available and valid for the current device, it's contents will be used to set the allowed functionalities. If file is invalid OR not present, the SDK will make an HTTP request to a licensing server. On valid response the results from the server will be used to configure functionality availability and, if the location supplied by the user in certCacheFile is valid and writable, the results will be stored there so that the cache file can be used on next invocation.

The activation process is doing a GET request constructed from the arguments of the function. The base URL of the GET request can be changed if the baseUrl parameter is not NULL.

All of the parameter values will be properly URL escaped by the library and MUST NOT be already URL escaped when being passed to this function.

The password parameter will be scrambled using MD5 and the result will be converted to a hex string before passing it to the web server. It MUST NOT be pre-processed in any way before passing it to this function.

Parameters
[in]certCacheFileIf non-zero, it is a UTF-8 file name which is used to cache the certificate received from the server. If such file does not exist, the usual HTTP (online) activation is initiated, if possible. After a successful online activation, the resulting certificate will be stored in the file.
[in]moduleNameProvides support for DLL products using this ZDK as a static library. This is not for the case where ZDK is used as a DLL. In that case the moduleName is ignored. In the case where ZDK is a static library used to link a DLL project, and that DLL project is used by an external application, the checksum must be calculated from the DLL, not the main application. In this case moduleName is needed to hint the Activation object when it tries to discover the file from which we're loaded.
[in]opFlagsA bit field flag controlling the activation options - ActivationFlags enum
[in]usernameClient's username ("username" URL parameter)
[in]passwordClient's password ("password" URL parameter)
[in]versionThe phone build version as configured on the cert site. This is the "version" URL parameter
[in]certPemThe certificate issued by the cert server for this specific phone build. Must match the certificate on the server.
Returns
Result of the invocation
See also
StartSDK(), Stop(), OnContextActivationCompleted(), IResult, ActivationFlags

◆ StartSDK()

virtual ZDK::Shared::Result ZDK::IActivation::StartSDK ( ZDK::Shared::String  certCacheFile,
ZDK::Shared::String  username,
ZDK::Shared::String  password 
)
pure virtual

Starts activation for an SDK product.

For SDK products only! For Zoiper internal use see Start()!

Starts activation process of the SDK product. Without activation, much of the functionality is not allowed. Activation first tries to use data from a certificate cache file, the path to which is supplied by the user. If the file is available and valid for the current device, it's contents will be used to set the allowed functionalities. If file is invalid OR not present, the SDK will make an HTTP request to a licensing server. On valid response the results from the server will be used to configure functionality availability and, if the location supplied by the user in certCacheFile is valid and writable, the results will be stored there so that the cache file can be used on next invocation.

The activation process is doing a GET request constructed from the arguments of the function. The base URL of the GET request can be changed if the baseUrl parameter is not NULL.

All of the parameter values will be properly URL escaped by the library and MUST NOT be already URL escaped when being passed to this function.

The password parameter will be scrambled using MD5 and the result will be converted to a hex string before passing it to the web server. It MUST NOT be pre-processed in any way before passing it to this function.

Parameters
[in]certCacheFileIf non-zero, it is a UTF-8 file name which is used to cache the certificate received from the server. If such file does not exist, the usual HTTP (online) activation is initiated, if possible. After a successful online activation, the resulting certificate will be stored in the file.
[in]usernameUsername to use for authentication to the cert server
[in]passwordPassword to use for authentication to the cert server
Returns
Result of the invocation
See also
Start(), Stop(), OnContextActivationCompleted(), IResult

◆ Stop()

virtual ZDK::Shared::Result ZDK::IActivation::Stop ( )
pure virtual

Stops the activation process.

Cancels any activation in progress.

Returns
Result of the invocation
See also
IResult

The documentation for this class was generated from the following file: