
After modifying the .ohpmignore configuration, delete the module's build folder; alternatively, in DevEco Studio, choose Build > clean project, and then package the module.
To use code obfuscation, open the module-level build-profile.json5 file and configure the obfuscation settings in the obfuscation field.
The following is a configuration example:
{
"apiType": "stageMode",
"buildOption": {
},
"buildOptionSet": [
{
"name": "release",
"arkOptions": {
"obfuscation": {
"ruleOptions": {
"enable": true,
"files": [
"./obfuscation-rules.txt"
]
}
}
}
},
],
// ...
} For details, see Using Obfuscation for Code Hardening.