浏览代码

doc: add obfuscation configuration guidance for game service

/doc-game-service/proguard
Coffey Miao 3 年前
当前提交
039d8c22
共有 1 个文件被更改,包括 28 次插入1 次删除
  1. 29
      Documentation/gameservices.md

29
Documentation/gameservices.md


...
**DEPS**}
```
5. Configuring Obfuscation Scripts
Before building the APK, configure the obfuscation configuration file to prevent the HMS Core SDK from being obfuscated.
- Open the proguard file in your Unity project and add configurations to exclude the HMS Core SDK from obfuscation.
```
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep interface com.huawei.hms.analytics.type.HAEventType{*;}
-keep interface com.huawei.hms.analytics.type.HAParamType{*;}
-keep class com.huawei.hms.analytics.HiAnalyticsInstance{*;}
-keep class com.huawei.hms.analytics.HiAnalytics{*;}
```
- (Optional) Configure the keep.xml file as follows to keep layout resources if you have enabled R8 resource shrinking (with shrinkResources being set to true in the project-level build.gradle file) and strict reference checks (with shrinkMode being set to strict in the res/raw/keep.xml file). Not keeping layout resources will lead to app rejection during release to HUAWEI AppGallery.
```
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@layout/hms_download_progress,@drawable/screen_off,@layout/upsdk*,@drawable/c_buoycircle*,@drawable/hms_game*,@layout/c_buoycircle*,@layout/hms_game*,@strings/hms_game*,@strings/c_buoycircle*"
tools:shrinkMode="strict" />
```
### 3. Huawei API reference link & integration guide

- Fix: interfaces that are not working properly.
正在加载...
取消
保存