diff --git a/arkguard/src/common/ApiExtractor.ts b/arkguard/src/common/ApiExtractor.ts index 4d7043df8a6ffa98f452d86d8fb63467b61d17b6..e2b9ee0599080766a7a93a74c115840f955c3694 100644 --- a/arkguard/src/common/ApiExtractor.ts +++ b/arkguard/src/common/ApiExtractor.ts @@ -444,8 +444,9 @@ export namespace ApiExtractor { if (nodeName && mCurrentExportNameSet.has(nodeName)) { addElement(currentPropsSet); + } else if (isEnumDeclaration(astNode) && scanProjectConfig.isHarCompiled) { + addElement(currentPropsSet); } - forEachChild(astNode, visitProjectNode); }; diff --git a/arkguard/src/common/ApiReader.ts b/arkguard/src/common/ApiReader.ts index c9d5c8828c4fb1c9da5c29ab71df9e4a9fabb410..96a92b1e735467d91ad22fcab457f161b290447c 100644 --- a/arkguard/src/common/ApiReader.ts +++ b/arkguard/src/common/ApiReader.ts @@ -22,7 +22,7 @@ import type {IOptions} from '../configs/IOptions'; import { stringPropsSet, structPropsSet } from '../utils/OhsUtil'; import { sys } from 'typescript'; -export const scanProjectConfig: {mKeepStringProperty?: boolean, mExportObfuscation?: boolean} = {}; +export const scanProjectConfig: {mKeepStringProperty?: boolean, mExportObfuscation?: boolean, isHarCompiled?: boolean} = {}; /** * if rename property is not open, api read and extract can be skipped @@ -127,7 +127,7 @@ export function readProjectProperties(projectPaths: string[], customProfiles: IO * @param filesForCompilation set collection of files * @param customProfiles */ -export function readProjectPropertiesByCollectedPaths(filesForCompilation: Set, customProfiles: IOptions): +export function readProjectPropertiesByCollectedPaths(filesForCompilation: Set, customProfiles: IOptions, isHarCompiled: boolean): {projectAndLibsReservedProperties: string[]; libExportNames: string[]} { const ApiType = ApiExtractor.ApiType; let scanningCommonType = undefined; @@ -144,6 +144,7 @@ export function readProjectPropertiesByCollectedPaths(filesForCompilation: Set