Implementation of dexguard

不羁的心 提交于 2019-12-02 09:17:29

问题


i have put com.saikoa.dexguard.eclipse.adt_*.jar file in dropin folders of eclipse.And modified the Proguard-Project and Project-Properties Files in android Project.And i build the release version of .apk.The thing my apk is obfustcated,shrinked.but i also want my assets to be obfuscated.This is not happening.So,how to obfuscate the assets of your android project with the help of dexguard.


回答1:


DexGuard provides the option -encryptassetfiles to encrypt assets. It is documented in the DexGuard manual > Settings > -encryptassetfiles. The samples directory also contains a sample project that illustrates the feature.




回答2:


I experienced this same problem and found the solution in the docs.

This means that your code must invoke the AsssetManager as follows: open("MyAssetFile").

If you are not loading your asset in that manner then Dexguard does not encrypt the asset.

For example, you must open your asset like this:

InputStream stream = context.getAssets().open("myAssetFile.html");

rather than

mWebView.loadUrl("file:///android_asset/myAssetFile.html");

You also need to ensure that you have set your dexguard config to encrypt your assets:

-encryptassetfiles assets/myAssetFile.html,assets/myOtherAssetFile.txt


来源:https://stackoverflow.com/questions/20755671/implementation-of-dexguard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!