fix: repair decompiled sources and add exhaustive documentation
- restore generic signatures, scoped variables and missing code from original bytecode - remove decompiler artifacts and document classes, methods, fields and packages - restore resources, add Batik/BouncyCastle dependencies and build/runtime docs
This commit is contained in:
1 parent
9d7e42eda8
commit
10aa1829f5
346 files changed
+42404
-622
No files matched your search
@@ -80,7 +80,7 @@ public class Device extends GeneralProfile {
|
||||
|
||||
/** 临时字段:设备当前生效的策略清单缓存 */
|
||||
@Transient
|
||||
private List deviceProfiles;
|
||||
private List<Document> deviceProfiles;
|
||||
|
||||
/** 许可激活时间点索引 */
|
||||
@Indexed
|
||||
@@ -107,40 +107,82 @@ public class Device extends GeneralProfile {
|
||||
private Date lastDisconnected;
|
||||
|
||||
/** 终端已安装的应用程序包信息清单快照 */
|
||||
private List installedApps;
|
||||
private List<AppInfo> installedApps;
|
||||
|
||||
/**
|
||||
* 获取 {@code rsa}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getRsa() {
|
||||
return this.rsa;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code rsa}。
|
||||
*
|
||||
* @param rsa 参数 {@code rsa}({@code String})
|
||||
*/
|
||||
public void setRsa(String rsa) {
|
||||
this.rsa = rsa;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code siteUuid}。
|
||||
* @return UUID
|
||||
*/
|
||||
public UUID getSiteUuid() {
|
||||
return this.siteUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code siteUuid}。
|
||||
*
|
||||
* @param siteUuid 站点 UUID({@code UUID})
|
||||
*/
|
||||
public void setSiteUuid(UUID siteUuid) {
|
||||
this.siteUuid = siteUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code groupUuid}。
|
||||
* @return UUID
|
||||
*/
|
||||
public UUID getGroupUuid() {
|
||||
return this.groupUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code groupPath}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getGroupPath() {
|
||||
return this.groupPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code groupPath}。
|
||||
*
|
||||
* @param groupPath 参数 {@code groupPath}({@code String})
|
||||
*/
|
||||
public void setGroupPath(String groupPath) {
|
||||
this.groupPath = groupPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code owner}。
|
||||
* @return 用户对象;未找到时返回 {@code null}
|
||||
*/
|
||||
public User getOwner() {
|
||||
return this.owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code owner}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
*
|
||||
* @param owner 参数 {@code owner}({@code User})
|
||||
*/
|
||||
public void setOwner(User owner) {
|
||||
this.owner = owner;
|
||||
if (owner != null) {
|
||||
@@ -149,18 +191,40 @@ public class Device extends GeneralProfile {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code ownerUuid}。
|
||||
* @return UUID
|
||||
*/
|
||||
public UUID getOwnerUuid() {
|
||||
return this.ownerUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code ownerUuid}。
|
||||
*
|
||||
* @param ownerUuid 所有者用户 UUID({@code UUID})
|
||||
*/
|
||||
public void setOwnerUuid(UUID ownerUuid) {
|
||||
this.ownerUuid = ownerUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code owner}。
|
||||
* @return 字段/派生属性 {@code owner} 的值
|
||||
*/
|
||||
public boolean hasOwner() {
|
||||
return this.getOwner() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有者信息。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
*
|
||||
* @param key 键/配置项({@code String})
|
||||
* @param defaultValue 参数 {@code defaultValue}({@code String})
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getOwnerInfo(String key, String defaultValue) {
|
||||
if (this.owner == null) {
|
||||
DbObject owner = this.getProfileCategory(new String[]{"owner"});
|
||||
@@ -170,18 +234,37 @@ public class Device extends GeneralProfile {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code associated}。
|
||||
* @return 字段/派生属性 {@code associated} 的值
|
||||
*/
|
||||
public boolean isAssociated() {
|
||||
return this.getDeviceGroup() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code register}。
|
||||
* @return 字段/派生属性 {@code register} 的值
|
||||
*/
|
||||
public boolean canRegister() {
|
||||
return !Strings.isNullOrEmpty(this.getSerialNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code deviceGroup}。
|
||||
* @return 设备分组;未找到时返回 {@code null}
|
||||
*/
|
||||
public DeviceGroup getDeviceGroup() {
|
||||
return this.deviceGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code deviceGroup}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
*
|
||||
* @param deviceGroup 设备分组对象({@code DeviceGroup})
|
||||
*/
|
||||
public void setDeviceGroup(DeviceGroup deviceGroup) {
|
||||
if (deviceGroup != null && deviceGroup.getSiteUuid().equals(this.getSiteUuid())) {
|
||||
this.deviceGroup = deviceGroup;
|
||||
@@ -192,6 +275,12 @@ public class Device extends GeneralProfile {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code states}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环;主要调用:new DbObject。
|
||||
* @return MongoDB 文档扩展对象
|
||||
*/
|
||||
public DbObject getStates() {
|
||||
if (this.states == null) {
|
||||
this.states = new DbObject();
|
||||
@@ -200,132 +289,276 @@ public class Device extends GeneralProfile {
|
||||
return this.states;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code states}。
|
||||
*
|
||||
* @param states 参数 {@code states}({@code DbObject})
|
||||
*/
|
||||
public void setStates(DbObject states) {
|
||||
this.states = states;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code state}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getState() {
|
||||
return this.getStates().getString("state", "unknown");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code state}。
|
||||
*
|
||||
* @param state 参数 {@code state}({@code String})
|
||||
*/
|
||||
public void setState(String state) {
|
||||
this.setState("state", state);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code online}。
|
||||
* @return 字段/派生属性 {@code online} 的值
|
||||
*/
|
||||
public boolean isOnline() {
|
||||
return this.getStates().getBoolean("isOnline", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code online}。
|
||||
*
|
||||
* @param online 参数 {@code online}({@code boolean})
|
||||
*/
|
||||
public void setOnline(boolean online) {
|
||||
this.setState("isOnline", online);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code blocked}。
|
||||
* @return 字段/派生属性 {@code blocked} 的值
|
||||
*/
|
||||
public boolean isBlocked() {
|
||||
return this.getStates().containsKey("blocked");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态。
|
||||
*
|
||||
* @param key 键/配置项({@code String})
|
||||
* @param value 值({@code Object})
|
||||
*/
|
||||
public void setState(String key, Object value) {
|
||||
this.getStates().append(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code clientVersion}。
|
||||
*
|
||||
* @param version 参数 {@code version}({@code int})
|
||||
*/
|
||||
public void setClientVersion(int version) {
|
||||
this.getStates().put("clientVersion", version);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code clientVersion}。
|
||||
* @return 数量/长度
|
||||
*/
|
||||
public int getClientVersion() {
|
||||
return this.getStates().getInteger("clientVersion", -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code batteryCondition}。
|
||||
* @return 字段/派生属性 {@code batteryCondition} 的值
|
||||
*/
|
||||
public Battery.BATTERY_CONDITION getBatteryCondition() {
|
||||
return Battery.BATTERY_CONDITION.forValue(this.getStates().getInteger("batteryCondition", -1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code oldClient}。
|
||||
* @return 字段/派生属性 {@code oldClient} 的值
|
||||
*/
|
||||
public boolean hasOldClient() {
|
||||
return this.getClientVersion() < 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code enrolled}。
|
||||
* @return 字段/派生属性 {@code enrolled} 的值
|
||||
*/
|
||||
public Date getEnrolled() {
|
||||
return this.enrolled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code enrolled}。
|
||||
* @return 字段/派生属性 {@code enrolled} 的值
|
||||
*/
|
||||
public boolean isEnrolled() {
|
||||
return this.enrolled != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code enrolled}。
|
||||
*
|
||||
* @param enrolled 参数 {@code enrolled}({@code Date})
|
||||
*/
|
||||
public void setEnrolled(Date enrolled) {
|
||||
this.enrolled = enrolled;
|
||||
this.setState("enrolled");
|
||||
this.setLicenseExpiry();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code retired}。
|
||||
* @return 字段/派生属性 {@code retired} 的值
|
||||
*/
|
||||
public boolean isRetired() {
|
||||
return this.getState().equals("retired");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code lastCheckedIn}。
|
||||
* @return 字段/派生属性 {@code lastCheckedIn} 的值
|
||||
*/
|
||||
public Date getLastCheckedIn() {
|
||||
return this.lastCheckedIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置最后Checked在。
|
||||
*
|
||||
* 实现要点:主要调用:new Date。
|
||||
*/
|
||||
public void setLastCheckedIn() {
|
||||
this.setLastCheckedIn(new Date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code lastCheckedIn}。
|
||||
*
|
||||
* @param lastCheckedIn 参数 {@code lastCheckedIn}({@code Date})
|
||||
*/
|
||||
public void setLastCheckedIn(Date lastCheckedIn) {
|
||||
this.lastCheckedIn = lastCheckedIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code lastDisconnected}。
|
||||
* @return 字段/派生属性 {@code lastDisconnected} 的值
|
||||
*/
|
||||
public Date getLastDisconnected() {
|
||||
return this.lastDisconnected;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置最后Disconnected。
|
||||
*
|
||||
* 实现要点:主要调用:new Date。
|
||||
*/
|
||||
public void setLastDisconnected() {
|
||||
this.lastDisconnected = new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code lastDisconnected}。
|
||||
*
|
||||
* @param disconnected 参数 {@code disconnected}({@code Date})
|
||||
*/
|
||||
public void setLastDisconnected(Date disconnected) {
|
||||
this.lastDisconnected = disconnected;
|
||||
}
|
||||
|
||||
public List getInstalledApps() {
|
||||
/**
|
||||
* 获取 {@code installedApps}。
|
||||
* @return 应用信息列表,可能为空
|
||||
*/
|
||||
public List<AppInfo> getInstalledApps() {
|
||||
return this.installedApps;
|
||||
}
|
||||
|
||||
public void setInstalledApps(List installedApps) {
|
||||
/**
|
||||
* 设置 {@code installedApps}。
|
||||
*
|
||||
* @param installedApps 参数 {@code installedApps}({@code List<AppInfo>})
|
||||
*/
|
||||
public void setInstalledApps(List<AppInfo> installedApps) {
|
||||
this.installedApps = installedApps;
|
||||
}
|
||||
|
||||
public void setDeviceProfiles(List deviceProfiles) {
|
||||
/**
|
||||
* 设置 {@code deviceProfiles}。
|
||||
*
|
||||
* @param deviceProfiles 参数 {@code deviceProfiles}({@code List<Document>})
|
||||
*/
|
||||
public void setDeviceProfiles(List<Document> deviceProfiles) {
|
||||
this.deviceProfiles = deviceProfiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code serialNo}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getSerialNo() {
|
||||
return (String)this.getCategoryProfile("hardware_info", "serial_no");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code serialNo}。
|
||||
*
|
||||
* @param serialNo 设备序列号({@code String})
|
||||
*/
|
||||
public void setSerialNo(String serialNo) {
|
||||
this.setProfile("hardware_info", "serial_no", serialNo.trim());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code modelId}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getModelId() {
|
||||
return (String)this.getCategoryProfile("hardware_info", "product_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code buildNo}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getBuildNo() {
|
||||
return this.getProfileCategory(new String[]{"software_info"}).getString("build_no");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code displayId}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getDisplayId() {
|
||||
return this.getProfileCategory(new String[]{"software_info"}).getString("display_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code productDisplayId}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getProductDisplayId() {
|
||||
return this.getProfileCategory(new String[]{"software_info"}).getString("product_display_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code buildDate}。
|
||||
* @return 数量/长度
|
||||
*/
|
||||
public long getBuildDate() {
|
||||
return this.getProfileCategory(new String[]{"software_info"}).getLong("build_date", -1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code sdkVersion}。
|
||||
*
|
||||
* 实现要点:包含 8 个条件分支、0 个循环。
|
||||
* @return 数量/长度
|
||||
*/
|
||||
public int getSdkVersion() {
|
||||
if (this.isEnrolled()) {
|
||||
int version = this.getProfileCategory(new String[]{"software_info"}).getInteger("sdk_version", -1);
|
||||
@@ -352,26 +585,52 @@ public class Device extends GeneralProfile {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code customerId}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getCustomerId() {
|
||||
return (String)this.getCategoryProfile("software_info", "customer_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code regionImgVersion}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getRegionImgVersion() {
|
||||
return this.getProfile().getDbObject(new String[]{"software_info"}).getString("region_version");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code scriptVersion}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getScriptVersion() {
|
||||
return (String)this.getCategoryProfile("software_info", "script_version");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code regionBuildDate}。
|
||||
* @return 数量/长度
|
||||
*/
|
||||
public long getRegionBuildDate() {
|
||||
return this.getProfile().getDbObject(new String[]{"software_info"}).getLong("region_build_date");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code gmsAvailable}。
|
||||
* @return 字段/派生属性 {@code gmsAvailable} 的值
|
||||
*/
|
||||
public boolean isGmsAvailable() {
|
||||
return this.getProfile().getDbObject(new String[]{"software_info"}).getBoolean("gms_available");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code skuId}。
|
||||
*
|
||||
* 实现要点:包含 7 个条件分支、0 个循环。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getSkuId() {
|
||||
String skuId = (String)this.getCategoryProfile("hardware_info", "sku_id");
|
||||
if (skuId == null) {
|
||||
@@ -404,27 +663,54 @@ public class Device extends GeneralProfile {
|
||||
return skuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code deviceId}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getDeviceId() {
|
||||
return (String)this.getCategoryProfile("hardware_info", "device_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code buildFingerPrint}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getBuildFingerPrint() {
|
||||
return (String)this.getCategoryProfile("software_info", "build_fingerprint");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code mobileConnected}。
|
||||
* @return 字段/派生属性 {@code mobileConnected} 的值
|
||||
*/
|
||||
public boolean isMobileConnected() {
|
||||
String type = this.getProfileCategory(new String[]{"network", "active"}).getString("type");
|
||||
return "MOBILE".equalsIgnoreCase(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code wifiMacAddr}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getWifiMacAddr() {
|
||||
return this.getProfileCategory(new String[]{"network", "wifi"}).getString("mac_address");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code license}。
|
||||
* @return 字段/派生属性 {@code license} 的值
|
||||
*/
|
||||
public DeviceLicense getLicense() {
|
||||
return this.license;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code license}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环;主要调用:new Date。
|
||||
*
|
||||
* @param license 参数 {@code license}({@code DeviceLicense})
|
||||
*/
|
||||
public void setLicense(DeviceLicense license) {
|
||||
this.license = license;
|
||||
if (license != null) {
|
||||
@@ -434,14 +720,28 @@ public class Device extends GeneralProfile {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code licensed}。
|
||||
* @return 字段/派生属性 {@code licensed} 的值
|
||||
*/
|
||||
public Date getLicensed() {
|
||||
return this.licensed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code licensed}。
|
||||
*
|
||||
* @param licensed 参数 {@code licensed}({@code Date})
|
||||
*/
|
||||
public void setLicensed(Date licensed) {
|
||||
this.licensed = licensed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置许可证Expiry。
|
||||
*
|
||||
* 实现要点:包含 2 个条件分支、0 个循环。
|
||||
*/
|
||||
private void setLicenseExpiry() {
|
||||
if (this.hasLicense()) {
|
||||
if (!this.license.isActivated() && this.isEnrolled()) {
|
||||
@@ -452,6 +752,12 @@ public class Device extends GeneralProfile {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code licenseExpiry}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
* @return 字段/派生属性 {@code licenseExpiry} 的值
|
||||
*/
|
||||
public Date getLicenseExpiry() {
|
||||
if (this.licenseExpiry == null && this.hasLicense()) {
|
||||
this.licenseExpiry = this.license.getExpiry();
|
||||
@@ -460,35 +766,66 @@ public class Device extends GeneralProfile {
|
||||
return this.licenseExpiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code licenseExpired}。
|
||||
* @return 字段/派生属性 {@code licenseExpired} 的值
|
||||
*/
|
||||
public boolean isLicenseExpired() {
|
||||
return this.license != null && !this.license.isPerpetual() && this.license.isExpired();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code licenseExpiry}。
|
||||
*
|
||||
* @param expiry 参数 {@code expiry}({@code Date})
|
||||
*/
|
||||
public void setLicenseExpiry(Date expiry) {
|
||||
this.licenseExpiry = expiry;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code license}。
|
||||
* @return 字段/派生属性 {@code license} 的值
|
||||
*/
|
||||
public boolean hasLicense() {
|
||||
return this.license != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code trial}。
|
||||
* @return 字段/派生属性 {@code trial} 的值
|
||||
*/
|
||||
public boolean isTrial() {
|
||||
return !this.hasLicense() || this.license.isTrial();
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除许可证。
|
||||
*/
|
||||
public void removeLicense() {
|
||||
this.setLicense((DeviceLicense)null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code plan}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getPlan() {
|
||||
return this.license.getPlan();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理重置。
|
||||
*/
|
||||
public void reset() {
|
||||
this.setEnrolled((Date)null);
|
||||
this.getStates().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理clone。
|
||||
* @return 匹配的设备对象;未找到时返回 {@code null}
|
||||
*/
|
||||
public Device clone() {
|
||||
return (Device)McJsonUtils.clone(this);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user