Implementation of dexguard

眉间皱痕 提交于 2019-12-02 03:55:00
Eric Lafortune

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.

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