diff --git a/arkguard/src/common/ApiExtractor.ts b/arkguard/src/common/ApiExtractor.ts index d3f919218482fa2744aa1dcc83809a748f7148a5..1d75a04481a0e0bcca4b9c4c4e9aec65c88ada7f 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 71289122982d124fb84756e57ea6c7d6353b929e..90bc599dd361a418943058c4368c83e37913936a 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