Shrink, obfuscate, and optimize your app
Android
For obfuscation and resources optimization, use
minifyEnabled true
shrinkResources true
Make sure to add the following exclusion rules to app/proguard-rules.pro:
-keep public class com.huawei.hms.mlkit.face.** { *; }
-keep public class com.huawei.hms.ml.common.**
In case the Huawei Vision dependency is used, add the following exclusion as well:
-keep public class com.regula.huaweivision.** {
public *;
}
To the resources/raw/keep.xml
resources file, add
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@raw/ml_face_isface,
@raw/ml_face_mnet,
@raw/ml_face_landmark,
@raw/ml_face_contour"
tools:shrinkMode="strict" />