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
@@ -15,45 +15,126 @@ import java.util.stream.Collectors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
* 【领域模型】{@code ProfileApps}
|
||||
*
|
||||
* 类职责:
|
||||
* <ul>
|
||||
* <li>表达领域对象的数据结构、字段约束与派生属性。</li>
|
||||
* <li>通过字段/依赖注入持有运行期状态,字段含义见下方“核心字段”。</li>
|
||||
* </ul>
|
||||
*
|
||||
* 核心字段(按声明顺序):
|
||||
* <ul>
|
||||
* <li>{@code install}(List<?>):?集合</li>
|
||||
* <li>{@code installApp}(List<InstallApp>):install应用</li>
|
||||
* <li>{@code uninstall}(List<DbObject>):数据库Object集合</li>
|
||||
* <li>{@code appWidget}(List<DbObject>):应用Widget</li>
|
||||
* <li>{@code widget}(List<DbObject>):数据库Object集合</li>
|
||||
* <li>{@code grantAll}(List<DbObject>):grant全部</li>
|
||||
* </ul>
|
||||
*
|
||||
* 学习提示:先看类注释和 public 方法,再结合调用方理解它在整体流程中的位置。
|
||||
*/
|
||||
public class ProfileApps {
|
||||
private List install;
|
||||
/**
|
||||
* ?集合。
|
||||
*/
|
||||
private List<?> install;
|
||||
/**
|
||||
* install应用;不持久化到 MongoDB,仅运行时使用;Gson 序列化控制。
|
||||
*
|
||||
* 注解:{@code @Transient @Expose(serialize = false)}。
|
||||
*/
|
||||
@Transient
|
||||
@Expose(
|
||||
serialize = false
|
||||
)
|
||||
private List installApp;
|
||||
private List uninstall;
|
||||
private List<InstallApp> installApp;
|
||||
/**
|
||||
* 数据库Object集合。
|
||||
*/
|
||||
private List<DbObject> uninstall;
|
||||
/**
|
||||
* 应用Widget;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("add_appwidget") @Field("add_appwidget")}。
|
||||
*/
|
||||
@SerializedName("add_appwidget")
|
||||
@Field("add_appwidget")
|
||||
private List appWidget;
|
||||
private List widget;
|
||||
private List<DbObject> appWidget;
|
||||
/**
|
||||
* 数据库Object集合。
|
||||
*/
|
||||
private List<DbObject> widget;
|
||||
/**
|
||||
* grant全部;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("grant_all") @Field("grant_all")}。
|
||||
*/
|
||||
@SerializedName("grant_all")
|
||||
@Field("grant_all")
|
||||
private List grantAll;
|
||||
private List disabled;
|
||||
private List<DbObject> grantAll;
|
||||
/**
|
||||
* 数据库Object集合。
|
||||
*/
|
||||
private List<DbObject> disabled;
|
||||
/**
|
||||
* Wi-FiOnly;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("wifi_only") @Field("wifi_only")}。
|
||||
*/
|
||||
@SerializedName("wifi_only")
|
||||
@Field("wifi_only")
|
||||
private List wifiOnly;
|
||||
private List<DbObject> wifiOnly;
|
||||
/**
|
||||
* white列出;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("white_list") @Field("white_list")}。
|
||||
*/
|
||||
@SerializedName("white_list")
|
||||
@Field("white_list")
|
||||
private List whiteList;
|
||||
private List<DbObject> whiteList;
|
||||
/**
|
||||
* black列出;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("black_list") @Field("black_list")}。
|
||||
*/
|
||||
@SerializedName("black_list")
|
||||
@Field("black_list")
|
||||
private List blackList;
|
||||
private List<DbObject> blackList;
|
||||
|
||||
public List getInstall() {
|
||||
/**
|
||||
* 获取 {@code install}。
|
||||
* @return ?列表,可能为空
|
||||
*/
|
||||
public List<?> getInstall() {
|
||||
return this.install;
|
||||
}
|
||||
|
||||
public void setInstall(List install) {
|
||||
/**
|
||||
* 设置 {@code install}。
|
||||
*
|
||||
* @param install 参数 {@code install}({@code List<?>})
|
||||
*/
|
||||
public void setInstall(List<?> install) {
|
||||
this.install = install;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置转换为旧格式化。
|
||||
*/
|
||||
public void setToOldFormat() {
|
||||
this.install = this.getInstallUuids();
|
||||
}
|
||||
|
||||
public List getInstallApp() {
|
||||
/**
|
||||
* 获取 {@code installApp}。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
* @return Install应用列表,可能为空
|
||||
*/
|
||||
public List<InstallApp> getInstallApp() {
|
||||
if (this.installApp == null && this.install != null) {
|
||||
this.initInstallApp();
|
||||
}
|
||||
@@ -61,10 +142,15 @@ public class ProfileApps {
|
||||
return this.installApp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Install应用。
|
||||
*
|
||||
* 实现要点:包含 2 个条件分支、0 个循环;主要调用:new TypeToken。
|
||||
*/
|
||||
public void initInstallApp() {
|
||||
if (this.install != null && !this.install.isEmpty()) {
|
||||
if (this.install.get(0) instanceof InstallApp) {
|
||||
this.installApp = this.install;
|
||||
this.installApp = (List<InstallApp>)this.install;
|
||||
} else {
|
||||
this.installApp = (List)McJsonUtils.toObject(McJsonUtils.toJsonElement(this.install), (new TypeToken() {
|
||||
}).getType());
|
||||
@@ -74,15 +160,32 @@ public class ProfileApps {
|
||||
|
||||
}
|
||||
|
||||
public void setInstallApp(List installApp) {
|
||||
/**
|
||||
* 设置 {@code installApp}。
|
||||
*
|
||||
* @param installApp 参数 {@code installApp}({@code List<InstallApp>})
|
||||
*/
|
||||
public void setInstallApp(List<InstallApp> installApp) {
|
||||
this.installApp = installApp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code installApps}。
|
||||
* @return 字段/派生属性 {@code installApps} 的值
|
||||
*/
|
||||
public boolean hasInstallApps() {
|
||||
this.getInstallApp();
|
||||
return this.installApp != null && !this.installApp.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Install应用。
|
||||
*
|
||||
* 实现要点:包含 2 个条件分支、1 个循环。
|
||||
*
|
||||
* @param packageName 参数 {@code packageName}({@code String})
|
||||
* @return 字段/派生属性 {@code installApp} 的值
|
||||
*/
|
||||
public InstallApp getInstallApp(String packageName) {
|
||||
if (!this.hasInstallApps()) {
|
||||
return null;
|
||||
@@ -97,6 +200,14 @@ public class ProfileApps {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除Install应用。
|
||||
*
|
||||
* 实现要点:包含 2 个条件分支、1 个循环;主要调用:remove。
|
||||
*
|
||||
* @param appUuid 参数 {@code appUuid}({@code UUID})
|
||||
* @return 条件成立返回 {@code true},否则返回 {@code false}
|
||||
*/
|
||||
public boolean removeInstallApp(UUID appUuid) {
|
||||
if (this.hasInstallApps()) {
|
||||
Iterator<InstallApp> it = this.installApp.iterator();
|
||||
@@ -112,83 +223,177 @@ public class ProfileApps {
|
||||
return false;
|
||||
}
|
||||
|
||||
public List getInstallUuids() {
|
||||
/**
|
||||
* 获取 {@code installUuids}。
|
||||
* @return UUID列表,可能为空
|
||||
*/
|
||||
public List<UUID> getInstallUuids() {
|
||||
return this.installApp != null ? (List)this.installApp.stream().map((app) -> app.getUuid()).collect(Collectors.toList()) : null;
|
||||
}
|
||||
|
||||
public List getUninstall() {
|
||||
/**
|
||||
* 获取 {@code uninstall}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getUninstall() {
|
||||
return this.toDbList(this.uninstall);
|
||||
}
|
||||
|
||||
public void setUninstall(List uninstall) {
|
||||
/**
|
||||
* 设置 {@code uninstall}。
|
||||
*
|
||||
* @param uninstall 参数 {@code uninstall}({@code List<DbObject>})
|
||||
*/
|
||||
public void setUninstall(List<DbObject> uninstall) {
|
||||
this.uninstall = uninstall;
|
||||
}
|
||||
|
||||
public List getAppWidget() {
|
||||
/**
|
||||
* 获取 {@code appWidget}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getAppWidget() {
|
||||
return this.appWidget;
|
||||
}
|
||||
|
||||
public void setAppWidget(List addAppWidget) {
|
||||
/**
|
||||
* 设置 {@code appWidget}。
|
||||
*
|
||||
* @param addAppWidget 参数 {@code addAppWidget}({@code List<DbObject>})
|
||||
*/
|
||||
public void setAppWidget(List<DbObject> addAppWidget) {
|
||||
this.appWidget = addAppWidget;
|
||||
}
|
||||
|
||||
public List getWidget() {
|
||||
/**
|
||||
* 获取 {@code widget}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getWidget() {
|
||||
return this.widget;
|
||||
}
|
||||
|
||||
public void setWidget(List widget) {
|
||||
/**
|
||||
* 设置 {@code widget}。
|
||||
*
|
||||
* @param widget 参数 {@code widget}({@code List<DbObject>})
|
||||
*/
|
||||
public void setWidget(List<DbObject> widget) {
|
||||
this.widget = widget;
|
||||
}
|
||||
|
||||
public List getGrantAll() {
|
||||
/**
|
||||
* 获取 {@code grantAll}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getGrantAll() {
|
||||
return this.toDbList(this.grantAll);
|
||||
}
|
||||
|
||||
public void setGrantAll(List grantAll) {
|
||||
/**
|
||||
* 设置 {@code grantAll}。
|
||||
*
|
||||
* @param grantAll 参数 {@code grantAll}({@code List<DbObject>})
|
||||
*/
|
||||
public void setGrantAll(List<DbObject> grantAll) {
|
||||
this.grantAll = grantAll;
|
||||
}
|
||||
|
||||
public List getDisabled() {
|
||||
/**
|
||||
* 获取 {@code disabled}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getDisabled() {
|
||||
return this.toDbList(this.disabled);
|
||||
}
|
||||
|
||||
public void setDisabled(List disabled) {
|
||||
/**
|
||||
* 设置 {@code disabled}。
|
||||
*
|
||||
* @param disabled 参数 {@code disabled}({@code List<DbObject>})
|
||||
*/
|
||||
public void setDisabled(List<DbObject> disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public List getWifiOnly() {
|
||||
/**
|
||||
* 获取 {@code wifiOnly}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getWifiOnly() {
|
||||
return this.toDbList(this.wifiOnly);
|
||||
}
|
||||
|
||||
public void setWifiOnly(List wifiOnly) {
|
||||
/**
|
||||
* 设置 {@code wifiOnly}。
|
||||
*
|
||||
* @param wifiOnly 参数 {@code wifiOnly}({@code List<DbObject>})
|
||||
*/
|
||||
public void setWifiOnly(List<DbObject> wifiOnly) {
|
||||
this.wifiOnly = wifiOnly;
|
||||
}
|
||||
|
||||
public List getWhiteList() {
|
||||
/**
|
||||
* 获取 {@code whiteList}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getWhiteList() {
|
||||
return this.toDbList(this.whiteList);
|
||||
}
|
||||
|
||||
public void setWhiteList(List whiteList) {
|
||||
/**
|
||||
* 设置 {@code whiteList}。
|
||||
*
|
||||
* @param whiteList 参数 {@code whiteList}({@code List<DbObject>})
|
||||
*/
|
||||
public void setWhiteList(List<DbObject> whiteList) {
|
||||
this.whiteList = whiteList;
|
||||
}
|
||||
|
||||
public List getBlackList() {
|
||||
/**
|
||||
* 获取 {@code blackList}。
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
public List<DbObject> getBlackList() {
|
||||
return this.toDbList(this.blackList);
|
||||
}
|
||||
|
||||
public void setBlackList(List blackList) {
|
||||
/**
|
||||
* 设置 {@code blackList}。
|
||||
*
|
||||
* @param blackList 参数 {@code blackList}({@code List<DbObject>})
|
||||
*/
|
||||
public void setBlackList(List<DbObject> blackList) {
|
||||
this.blackList = blackList;
|
||||
}
|
||||
|
||||
public List getPackageList(List apps) {
|
||||
/**
|
||||
* 获取Package列出。
|
||||
*
|
||||
* @param apps 参数 {@code apps}({@code List<DbObject>})
|
||||
* @return String列表,可能为空
|
||||
*/
|
||||
public List<String> getPackageList(List<DbObject> apps) {
|
||||
return apps != null ? (List)apps.stream().map((app) -> app.getString("package")).collect(Collectors.toList()) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 {@code empty}。
|
||||
* @return 字段/派生属性 {@code empty} 的值
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return (this.install == null || this.install.isEmpty()) && (this.uninstall == null || this.uninstall.isEmpty()) && (this.appWidget == null || this.appWidget.isEmpty()) && (this.widget == null || this.widget.isEmpty()) && (this.grantAll == null || this.grantAll.isEmpty()) && (this.disabled == null || this.disabled.isEmpty()) && (this.wifiOnly == null || this.wifiOnly.isEmpty()) && (this.whiteList == null || this.whiteList.isEmpty()) && (this.blackList == null || this.blackList.isEmpty());
|
||||
}
|
||||
|
||||
private List toDbList(List list) {
|
||||
/**
|
||||
* 处理转换为数据库列出。
|
||||
*
|
||||
* 实现要点:包含 3 个条件分支、0 个循环;主要调用:new ArrayList、new DbObject。
|
||||
*
|
||||
* @param list 参数 {@code list}({@code List<?>})
|
||||
* @return 数据库Object列表,可能为空
|
||||
*/
|
||||
private List<DbObject> toDbList(List<?> list) {
|
||||
if (list != null && !list.isEmpty()) {
|
||||
List<DbObject> dbList = new ArrayList();
|
||||
list.forEach((item) -> {
|
||||
@@ -205,78 +410,196 @@ public class ProfileApps {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 【领域模型】{@code InstallApp}
|
||||
*
|
||||
* 类职责:
|
||||
* <ul>
|
||||
* <li>表达领域对象的数据结构、字段约束与派生属性。</li>
|
||||
* <li>通过字段/依赖注入持有运行期状态,字段含义见下方“核心字段”。</li>
|
||||
* </ul>
|
||||
*
|
||||
* 核心字段(按声明顺序):
|
||||
* <ul>
|
||||
* <li>{@code uuid}(UUID):对象唯一标识(MongoDB 主键)</li>
|
||||
* <li>{@code packageName}(String):package名称</li>
|
||||
* <li>{@code silentInstall}(Boolean):是否silentInstall</li>
|
||||
* <li>{@code grantAll}(Boolean):grant全部</li>
|
||||
* <li>{@code startsOnUpdate}(Boolean):starts处理更新</li>
|
||||
* <li>{@code rebootsOnUpdate}(Boolean):reboots处理更新</li>
|
||||
* </ul>
|
||||
*
|
||||
* 学习提示:先看类注释和 public 方法,再结合调用方理解它在整体流程中的位置。
|
||||
*/
|
||||
public static class InstallApp {
|
||||
/**
|
||||
* 对象唯一标识(MongoDB 主键)。
|
||||
*/
|
||||
private UUID uuid;
|
||||
/**
|
||||
* package名称。
|
||||
*/
|
||||
private String packageName;
|
||||
/**
|
||||
* 是否silentInstall;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("silent_install") @Field("silent_install")}。
|
||||
*/
|
||||
@SerializedName("silent_install")
|
||||
@Field("silent_install")
|
||||
private Boolean silentInstall = true;
|
||||
/**
|
||||
* grant全部;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("grant_all") @Field("grant_all")}。
|
||||
*/
|
||||
@SerializedName("grant_all")
|
||||
@Field("grant_all")
|
||||
private Boolean grantAll = false;
|
||||
/**
|
||||
* starts处理更新;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("starts_on_update") @Field("starts_on_update")}。
|
||||
*/
|
||||
@SerializedName("starts_on_update")
|
||||
@Field("starts_on_update")
|
||||
private Boolean startsOnUpdate = false;
|
||||
/**
|
||||
* reboots处理更新;通过 @Field 映射到 MongoDB 字段。
|
||||
*
|
||||
* 注解:{@code @SerializedName("reboots_on_update") @Field("reboots_on_update")}。
|
||||
*/
|
||||
@SerializedName("reboots_on_update")
|
||||
@Field("reboots_on_update")
|
||||
private Boolean rebootsOnUpdate = false;
|
||||
|
||||
/**
|
||||
* 构造 {@code InstallApp} 实例。
|
||||
* 使用默认字段值,后续通常由 Spring/Mongo 或调用方填充。
|
||||
*/
|
||||
public InstallApp() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造 {@code InstallApp} 实例。
|
||||
*
|
||||
* @param appFile 参数 {@code appFile}({@code AppFile})
|
||||
*/
|
||||
public InstallApp(AppFile appFile) {
|
||||
this.uuid = appFile.getFileUuid();
|
||||
this.packageName = appFile.getPackageName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code uuid}。
|
||||
* @return UUID
|
||||
*/
|
||||
public UUID getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code uuid}。
|
||||
*
|
||||
* @param uuid 对象 UUID({@code UUID})
|
||||
*/
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code packageName}。
|
||||
* @return 字符串结果
|
||||
*/
|
||||
public String getPackageName() {
|
||||
return this.packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code packageName}。
|
||||
*
|
||||
* @param packageName 参数 {@code packageName}({@code String})
|
||||
*/
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code silentInstall}。
|
||||
* @return 字段/派生属性 {@code silentInstall} 的值
|
||||
*/
|
||||
public Boolean getSilentInstall() {
|
||||
return this.silentInstall;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code silentInstall}。
|
||||
*
|
||||
* @param silentInstall 参数 {@code silentInstall}({@code Boolean})
|
||||
*/
|
||||
public void setSilentInstall(Boolean silentInstall) {
|
||||
this.silentInstall = silentInstall;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code grantAll}。
|
||||
* @return 字段/派生属性 {@code grantAll} 的值
|
||||
*/
|
||||
public Boolean getGrantAll() {
|
||||
return this.grantAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code grantAll}。
|
||||
*
|
||||
* @param grantAll 参数 {@code grantAll}({@code Boolean})
|
||||
*/
|
||||
public void setGrantAll(Boolean grantAll) {
|
||||
this.grantAll = grantAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code startsOnUpdate}。
|
||||
* @return 字段/派生属性 {@code startsOnUpdate} 的值
|
||||
*/
|
||||
public Boolean getStartsOnUpdate() {
|
||||
return this.startsOnUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code startsOnUpdate}。
|
||||
*
|
||||
* @param startsOnUpdate 参数 {@code startsOnUpdate}({@code Boolean})
|
||||
*/
|
||||
public void setStartsOnUpdate(Boolean startsOnUpdate) {
|
||||
this.startsOnUpdate = startsOnUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 {@code rebootsOnUpdate}。
|
||||
* @return 字段/派生属性 {@code rebootsOnUpdate} 的值
|
||||
*/
|
||||
public Boolean getRebootsOnUpdate() {
|
||||
return this.rebootsOnUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 {@code rebootsOnUpdate}。
|
||||
*
|
||||
* @param rebootsOnUpdate 参数 {@code rebootsOnUpdate}({@code Boolean})
|
||||
*/
|
||||
public void setRebootsOnUpdate(Boolean rebootsOnUpdate) {
|
||||
this.rebootsOnUpdate = rebootsOnUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 比较当前对象与另一个对象是否相等。
|
||||
*
|
||||
* 实现要点:包含 1 个条件分支、0 个循环。
|
||||
*
|
||||
* @param obj 参数 {@code obj}({@code Object})
|
||||
* @return 条件成立返回 {@code true},否则返回 {@code false}
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof InstallApp)) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user