未知类ILicensingService在混淆Android项目时注意到

Rog*_*pid 15 ant android proguard android-lvl

我正在尝试使用Ant和ProGuard构建Android版本.我在project.properties中取消注释了以下行,尽管所述文件中的注释指出你不应该修改它;):

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
Run Code Online (Sandbox Code Playgroud)

混淆时,我得到以下注释:

[proguard] Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService'
[proguard] Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
Run Code Online (Sandbox Code Playgroud)

我明白为什么会这样.这些行可以在默认的ProGuard配置文件中找到($ {sdk.dir} /tools/proguard/proguard-android.txt):

-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
Run Code Online (Sandbox Code Playgroud)

我没有使用Google许可服务,因此这些课程确实未知.我找到了一个解决方案,通过更新proguard-project.txt来摆脱这些笔记:

-dontnote **ILicensingService
Run Code Online (Sandbox Code Playgroud)

我的问题:这是处理这个问题的正确方法吗?在我看来,无论如何都不应该保留这些类,因为对于android项目来说,lib不是必需的.我能想到实现这一目标的唯一方法是将默认配置文件复制到我的项目中,删除-keep行并完全忽略SDK中的默认配置文件.这似乎也不是正确的方法.或者我错过了什么?

Eri*_*une 17

"-dontnote com.google.vending.licensing.ILicensingService"设置没问题.实际上,它可能是默认配置文件的一部分.

  1. 使用该库的项目可能需要-keep选项.
  2. 对于不使用库的项目,-dontnote选项可能很好地抑制关于-keep选项的注释.该注释只是一个温和的提示,配置文件可能包含拼写错误,因为指定的类似乎不存在.它不会影响处理.