From ddba8f6f011418fc4cb891d193a8d8941a6a7138 Mon Sep 17 00:00:00 2001 From: zhrenqiang Date: Sat, 11 May 2024 20:47:53 +0800 Subject: [PATCH 1/2] fixed bf59c79 from https://gitee.com/zhrenqiang/developtools_packing_tool/pulls/826 catch JSONException Signed-off-by: zhrenqiang --- adapter/ohos/JsonUtil.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/adapter/ohos/JsonUtil.java b/adapter/ohos/JsonUtil.java index 1ad3360a..5dce29cf 100644 --- a/adapter/ohos/JsonUtil.java +++ b/adapter/ohos/JsonUtil.java @@ -1530,12 +1530,16 @@ public class JsonUtil { if (jsonStr.isEmpty()) { continue; } - JSONObject jsonObj = JSON.parseObject(jsonStr); - if (jsonObj.containsKey("shortcuts")) { - JSONArray shortcutObjs = jsonObj.getJSONArray("shortcuts"); - for (int j = 0; j < shortcutObjs.size(); ++j) { - shortcuts.add(parseModuleShortcutObj(shortcutObjs.getJSONObject(j), data)); + try { + JSONObject jsonObj = JSON.parseObject(jsonStr); + if (jsonObj.containsKey("shortcuts")) { + JSONArray shortcutObjs = jsonObj.getJSONArray("shortcuts"); + for (int j = 0; j < shortcutObjs.size(); ++j) { + shortcuts.add(parseModuleShortcutObj(shortcutObjs.getJSONObject(j), data)); + } } + } catch (JSONException ignore) { + LOG.warning("ignored metadata: " + moduleMetadataInfo.name); } } return shortcuts; -- Gitee From 34b49c80aebd071843204001841615e10494bc62 Mon Sep 17 00:00:00 2001 From: zhaogan Date: Sat, 1 Jun 2024 10:03:55 +0800 Subject: [PATCH 2/2] revert data Signed-off-by: zhaogan --- modulecheck/routerMap.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modulecheck/routerMap.json b/modulecheck/routerMap.json index a40a25cd..ac656c71 100644 --- a/modulecheck/routerMap.json +++ b/modulecheck/routerMap.json @@ -36,7 +36,12 @@ }, "data": { "description": "Indicates the custom data", - "type": "object" + "type": "object", + "maxProperties": 128, + "additionalProperties": { + "type": "string" + } + } } }, "additionalProperties": false, -- Gitee