public final class Auth
extends java.lang.Object
Auth的接口应该仅在主线程中调用| 限定符和类型 | 类和说明 |
|---|---|
class |
Auth.AuthDisable
授权不验证项,只在Debug模式下有效,即
JNaviCoreConfig.DEBUG为true时有效 |
class |
Auth.Error
授权验证错误码
|
class |
Auth.Limitations |
static interface |
Auth.Listener
更新授权文件的回调接口
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
checkLicense()
|
void |
cleanup()
清理所有授权模块使用的资源
|
boolean |
dataIsAvailable(java.lang.String id)
根据Id返回数据是否有权限,仅是简单地返回当前数据权限的可用状态,如果不可用,不会返回错误原因。
|
void |
enable(int enabled)
开启/关闭授权验证模块
|
DataInfo[] |
getAllDataInfo()
返回所有已经存在授权信息的数据信息
|
int |
getDataInfo(java.lang.String id,
DataInfo info)
获取制定Id的数据相关信息
|
int |
getDataPermissionState(java.lang.String id)
获取给定Id的数据的权限状态
Auth.Error |
static Auth |
getInstance()
获取单例类的实例
|
java.lang.String |
getLicenseUpdateTime()
获取授权文件更新时间
|
Auth.Limitations |
getLimitations()
获取数据授权中版本限制信息
Auth.Limitations |
int |
init(java.lang.String deviceId,
java.lang.String model)
|
int |
isEnabled()
判断授权验证模块当前是否开启
|
boolean |
isInited()
该单例类是否已被初始化
|
boolean |
reloadLicense(java.lang.String path)
设置授权文件保存路径
|
void |
setListener(Auth.Listener listener)
设置更新授权文件的回调函数
|
void |
setServerUrlBase(java.lang.String url)
设置更新license.dat文件的服务器地址
|
void |
updateLicense()
更新授权文件
如果在调用此方法之前调用了 setListener(Auth.Listener),那么更新之后将通过
Auth.Listener.onCompletion(int, int)返回调用结果。 |
void |
updateLicenseWithParamString(java.lang.String params)
根据用户输入的参数来请求授权文件
此API是 updateLicense()的高级版本,支持自定义请求参数。 |
public boolean isInited()
public int init(java.lang.String deviceId,
java.lang.String model)
throws java.lang.Exception
Auth.Error.noneAuth.Error.deviceIdReaderErrorAuth.Error.licenseIoErrorAuth.Error.licenseFormatErrorAuth.Error.licenseMissingAuth.Error.licenseIncompatibleAuth.Error.licenseDeviceIdMismatchAuth.Error.otherErrordeviceId - 设备的IMEImodel - 设备型号或渠道号Auth.Errorjava.lang.ExceptionAuth.Errorpublic void cleanup()
public void setListener(Auth.Listener listener)
listener - 回调接口对象Auth.ListenerAuth.Listenerpublic void updateLicense()
setListener(Auth.Listener),那么更新之后将通过
Auth.Listener.onCompletion(int, int)返回调用结果。public void updateLicenseWithParamString(java.lang.String params)
updateLicense()的高级版本,支持自定义请求参数。params - 需要拼接的字符串参数updateLicense()public void setServerUrlBase(java.lang.String url)
url - 服务器地址public boolean dataIsAvailable(java.lang.String id)
id - 数据Idpublic int getDataPermissionState(java.lang.String id)
Auth.ErrorAuth.Errorpublic int getDataInfo(java.lang.String id,
DataInfo info)
id - 数据Idinfo - 数据授权信息(输出参数)Auth.Errorpublic DataInfo[] getAllDataInfo()
public int checkLicense()
Auth.Error信息Auth.Error.noneAuth.Error.deviceIdReaderErrorAuth.Error.licenseIoErrorAuth.Error.licenseFormatErrorAuth.Error.licenseMissingAuth.Error.licenseIncompatibleAuth.Error.licenseDeviceIdMismatchAuth.Error.otherErrorAuth.Errorpublic boolean reloadLicense(java.lang.String path)
path - 授权文件保存路径checkLicense()重新检查授权文件状态 public java.lang.String getLicenseUpdateTime()
public void enable(int enabled)
enabled - 不验证部分,见Auth.AuthDisableisEnabled()JNaviCoreConfig.DEBUG为true的情况下可用 public int isEnabled()
Auth.AuthDisableenable(int)JNaviCoreConfig.DEBUG为true的情况下可用 public Auth.Limitations getLimitations()
Auth.LimitationsAuth.Limitations对象实例,否则返回null©Mapbar Engine Team;All Rights Reserved