debug
빌드를 사용하는 경우에도 프로 가드를 호출하도록 Android 개미 구축 시스템을 구성하려면 두 변수 (proguard.enabled
및 out.dex.jar.input.ref
)를 설정해야합니다.
다음은 구성 예입니다. custom_rules.xml
파일을 프로젝트 루트에 직접 저장하십시오.
custom_rules.xml
<project name="android_rules" default="debug">
<!-- Zap debug-obfuscation-check from SDK's build.xml so that it
can't set proguard.enabled to false !-->
<target name="-debug-obfuscation-check"/>
<target name="-pre-build">
<condition property="proguard.enabled" value="true" else="false">
<isset property="proguard.config" />
</condition>
<if condition="${proguard.enabled}">
<then>
<echo level="info">Proguard.config is enabled</echo>
<!-- Secondary dx input (jar files) is empty since all the
jar files will be in the obfuscated jar -->
<path id="out.dex.jar.input.ref" />
</then>
<else>
<echo level="info">Proguard.config is disabled</echo>
</else>
</if>
</target>
</project>