From adb78853afbe9f50843b13e071cf24c062dd813b Mon Sep 17 00:00:00 2001 From: zgf Date: Wed, 19 Feb 2025 17:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E6=A0=B7=E4=BE=8B=E8=AE=BE=E7=BD=AE=E6=B7=B7=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgf --- README.md | 8 ++++++++ README_zh.md | 8 ++++++++ entry/obfuscation-rules.txt | 5 ++++- entry/src/main/module.json5 | 6 +++++- entry/src/ohosTest/module.json5 | 6 +++++- library/src/main/module.json5 | 6 +++++- sharedlibrary/obfuscation-rules.txt | 5 ++++- sharedlibrary/src/main/module.json5 | 6 +++++- 8 files changed, 44 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d33085..1a8fb88 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,14 @@ This project has been verified in the following version: DevEco Studio: NEXT Beta1-5.0.3.806, SDK: API12 Release(5.0.0.66) +## About obfuscation +- Code obfuscation, please see[Code Obfuscation](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/arkts-utils/source-obfuscation.md) +- If you want the imageknife library not to be obfuscated during code obfuscation, you need to add corresponding exclusion rules in the obfuscation rule configuration file obfuscation-rules.txt: +``` +-keep +./oh_modules/@ohos/imageknife +``` + ## How to Contribute If you find any problem during the use, submit an [Issue](https://gitee.com/openharmony-tpc/ImageKnife/issues) or a [PR](https://gitee.com/openharmony-tpc/ImageKnife/issues) to us. diff --git a/README_zh.md b/README_zh.md index a15d2bd..205c49f 100644 --- a/README_zh.md +++ b/README_zh.md @@ -457,6 +457,14 @@ async function custom(context: Context, src: string | PixelMap | Resource,header 在下述版本验证通过: DevEco Studio: NEXT Beta1-5.0.3.806, SDK: API12 Release(5.0.0.66) +## 关于混淆 +- 代码混淆,请查看[代码混淆简介](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/arkts-utils/source-obfuscation.md) +- 如果希望imageknife库在代码混淆过程中不会被混淆,需要在混淆规则配置文件obfuscation-rules.txt中添加相应的排除规则: + +``` +-keep +./oh_modules/@ohos/imageknife +``` ## 贡献代码 使用过程中发现任何问题都可以提 [issue](https://gitee.com/openharmony-tpc/ImageKnife/issues) diff --git a/entry/obfuscation-rules.txt b/entry/obfuscation-rules.txt index 985b2ae..6bd2ef3 100644 --- a/entry/obfuscation-rules.txt +++ b/entry/obfuscation-rules.txt @@ -15,4 +15,7 @@ # 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 +./oh_modules/@ohos/imageknife \ No newline at end of file diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index a493443..5e5c2ba 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -6,7 +6,11 @@ "mainElement": "EntryAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "tv", + "wearable", + "car", + "2in1" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 index 4fc9701..fb8cec4 100644 --- a/entry/src/ohosTest/module.json5 +++ b/entry/src/ohosTest/module.json5 @@ -6,7 +6,11 @@ "mainElement": "TestAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "tv", + "wearable", + "car", + "2in1" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/library/src/main/module.json5 b/library/src/main/module.json5 index 2ccdcbf..af4e4b8 100644 --- a/library/src/main/module.json5 +++ b/library/src/main/module.json5 @@ -4,7 +4,11 @@ "type": "har", "deviceTypes": [ "default", - "tablet" + "tablet", + "tv", + "wearable", + "car", + "2in1" ] } } diff --git a/sharedlibrary/obfuscation-rules.txt b/sharedlibrary/obfuscation-rules.txt index 985b2ae..6bd2ef3 100644 --- a/sharedlibrary/obfuscation-rules.txt +++ b/sharedlibrary/obfuscation-rules.txt @@ -15,4 +15,7 @@ # 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 +./oh_modules/@ohos/imageknife \ No newline at end of file diff --git a/sharedlibrary/src/main/module.json5 b/sharedlibrary/src/main/module.json5 index 7e37699..bfccedc 100644 --- a/sharedlibrary/src/main/module.json5 +++ b/sharedlibrary/src/main/module.json5 @@ -5,7 +5,11 @@ "description": "$string:shared_desc", "deviceTypes": [ "default", - "tablet" + "tablet", + "tv", + "wearable", + "car", + "2in1" ], "deliveryWithInstall": true, "pages": "$profile:main_pages"