Proguard 6 新的“-android”选项

Proguard 6 new "-android" option

Proguard 6 2 月推出,提供 some new features,其中 -android 选项

"A new option -android, to tune the optimizations for Android"

我想了解更多关于此选项的信息,以了解它在优化(以及可能的混淆)方面的真正作用。

我在 guardsquare.com 上搜索并用 Google 搜索:我只能在 [=14= 上找到 死亡 link 关于 android ].这是 link:

> android <- dead link
Target the processed class files at Android.

在哪里我可以找到关于这个新选项的清晰详细的解释?

谢谢

I search on guardsquare.com and Googled for it: I could only find a dead link

我们可以随时查看源代码!

首先,我从 Sourceforge repository page 下载了快照 6.3.3 源。

解压后:

grep -R android core/src/ | wc -l
27

只有 27 次提到 'android'。让我们浏览一下列表:

    对于 Android,
  1. maximum.inlined.code.length 设置为 32 — 是 JVM 默认
  2. 的 4 倍
  3. 在某些优化阶段进行额外的内联(以前在 Android 上不起作用,因为它不使用预验证)
  4. 将对 FloatMath 的引用替换为 Math(优化并不是那么重要...)
  5. 资源字符集设置为 UTF-8(而不是系统默认字符集)
  6. 一些与 Android Gradle 插件兼容的遗留代码
  7. ConfigurationLogger — 如文档中所述,"This class can be injected in applications to log information about reflection being used in the application code"。 class 支持 Android-特定的日志框架(又名 android.util.Log

5 和 6 甚至与命令行 -android 选项无关,— 只是一些额外的代码,与 Android 用户相关。