针对png资源图片进行校验

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2023-07-10 09:35:26 +00:00
parent bd07eefc8f
commit de7fd9f728
13 changed files with 320 additions and 10 deletions
+18 -1
View File
@@ -22,7 +22,7 @@
#include "increment_manager.h"
#include "resource_merge.h"
#include "resource_table.h"
#include "resource_append.h"
#include "resource_check.h"
#include "preview_manager.h"
namespace OHOS {
@@ -315,6 +315,12 @@ uint32_t ResourcePack::GenerateConfigJson()
return configJson_.Save(outputPath);
}
void ResourcePack::CheckConfigJson()
{
ResourceCheck resourceCheck(configJson_);
resourceCheck.CheckConfigJson();
}
uint32_t ResourcePack::ScanResources(const vector<string> &inputs, const string &output)
{
auto &fileManager = FileManager::GetInstance();
@@ -364,6 +370,8 @@ uint32_t ResourcePack::PackNormal()
return RESTOOL_ERROR;
}
CheckConfigJson();
ResourceTable resourceTable;
if (!packageParser_.GetDependEntry().empty()) {
if (HandleFeature() != RESTOOL_SUCCESS) {
@@ -588,11 +596,20 @@ uint32_t ResourcePack::PackCombine()
return RESTOOL_ERROR;
}
CheckConfigJsonForCombine(resourceAppend);
if (GenerateHeader() != RESTOOL_SUCCESS) {
return RESTOOL_ERROR;
}
return RESTOOL_SUCCESS;
}
void ResourcePack::CheckConfigJsonForCombine(ResourceAppend &resourceAppend)
{
ResourceCheck resourceCheck(configJson_, make_shared<ResourceAppend>(resourceAppend));
resourceCheck.CheckConfigJsonForCombine();
}
}
}
}