diff --git a/OpenHarmony/MMKV/BuildProfile.ets b/OpenHarmony/MMKV/BuildProfile.ets index e4dd3f18..80fffec9 100644 --- a/OpenHarmony/MMKV/BuildProfile.ets +++ b/OpenHarmony/MMKV/BuildProfile.ets @@ -14,4 +14,4 @@ export default class BuildProfile { static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; static readonly DEBUG = DEBUG; static readonly TARGET_NAME = TARGET_NAME; -} +} \ No newline at end of file diff --git a/OpenHarmony/MMKV/build-profile.json5 b/OpenHarmony/MMKV/build-profile.json5 index dcd231b0..459a4515 100644 --- a/OpenHarmony/MMKV/build-profile.json5 +++ b/OpenHarmony/MMKV/build-profile.json5 @@ -14,12 +14,13 @@ "arkOptions": { "obfuscation": { "ruleOptions": { - "enable": false, // looks like we don't gain much from this + "enable": true, "files": [ "./obfuscation-rules.txt" ] - } - } + }, + "consumerFiles": "./consumer-rules.txt" + }, }, "nativeLib": { "debugSymbol": { diff --git a/OpenHarmony/MMKV/consumer-rules.txt b/OpenHarmony/MMKV/consumer-rules.txt new file mode 100644 index 00000000..b70754ae --- /dev/null +++ b/OpenHarmony/MMKV/consumer-rules.txt @@ -0,0 +1,30 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-keep +./src/main/ets/utils/MMKV.ets +./src/main/ets/utils/MMKVLogLevel.ets +./src/main/ets/utils/NativeBuffer.ets +./src/main/ets/utils/Util.ts + +-keep-file-name +MMKV +MMKVLogLevel +NativeBuffer +Util \ No newline at end of file diff --git a/OpenHarmony/MMKV/obfuscation-rules.txt b/OpenHarmony/MMKV/obfuscation-rules.txt index 985b2aeb..b70754ae 100644 --- a/OpenHarmony/MMKV/obfuscation-rules.txt +++ b/OpenHarmony/MMKV/obfuscation-rules.txt @@ -15,4 +15,16 @@ # Keep options: # -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file +# -keep-global-name: specifies names that you want to keep in the global scope + +-keep +./src/main/ets/utils/MMKV.ets +./src/main/ets/utils/MMKVLogLevel.ets +./src/main/ets/utils/NativeBuffer.ets +./src/main/ets/utils/Util.ts + +-keep-file-name +MMKV +MMKVLogLevel +NativeBuffer +Util \ No newline at end of file diff --git a/OpenHarmony/entry/obfuscation-rules.txt b/OpenHarmony/entry/obfuscation-rules.txt index 985b2aeb..a1dfa0bd 100644 --- a/OpenHarmony/entry/obfuscation-rules.txt +++ b/OpenHarmony/entry/obfuscation-rules.txt @@ -15,4 +15,8 @@ # Keep options: # -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file +# -keep-global-name: specifies names that you want to keep in the global scope +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file