Android项目代码混淆


   
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">[size=small; font-family: Calibri;]</span>[/size]

<p class="MsoListParagraph" style=""><span style="" lang="EN-US"><span style="">[size=small; font-family: Calibri;]1.[/size]<span style='font: 7pt "Times New Roman";'> </span></span></span>[size=small;]<span style="">在[/size]<span lang="EN-US"><span style="font-family: Calibri;">default.properties</span></span><span style="">文件中增加一句</span><span lang="EN-US"><span style="font-family: Calibri;">proguard.config=proguard.cfg</span></span></span>

<p class="MsoListParagraph" style=""><span style="" lang="EN-US"><span style="">[size=small; font-family: Calibri;]3.[/size]<span style='font: 7pt "Times New Roman";'> </span></span></span>[size=small;]<span style="">导出[/size]<span lang="EN-US"><span style="font-family: Calibri;">apk</span></span><span style="">文件,即可得到混淆后的文件了。</span></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">[size=small; font-family: Calibri;]</span>[/size]

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">[size=small; font-family: Calibri;]</span>[/size]

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;">[size=small;]<span style="">比如项目中用到了映射,这时就要用到[/size]<span lang="EN-US"><span style="font-family: Calibri;">-keep</span></span><span style="">参数,对于映射用到的类保持原状,不让这些类被混淆,否则混淆后就找不到这些类了。</span></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US">[size=small; font-family: Calibri;]</span>[/size]

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;">[size=small;]<span lang="EN-US"><span style="font-family: Calibri;">Proguard[/size]</span><span style="">的参数非常复杂,有时候无法有一个很直观的理解。这时可以使用</span><span lang="EN-US"><span style="font-family: Calibri;">Proguard</span></span><span style="">提供的</span><span lang="EN-US"><span style="font-family: Calibri;">GUI</span></span><span style="">程序,在</span><span lang="EN-US"><span style="font-family: Calibri;">GUI</span></span><span style="">界面中配置各个参数后,导出为配置文件。然后以文本的方式打开该文件,即可看到各个参数的写法了。</span></span>
[/size]
 

你可能感兴趣的:(java,工作,android项目代码混淆)