proguard warning: the configuration keeps the entr

2019-04-18 07:40发布

I've configured:

-keep ,allowoptimization,allowobfuscation,allowshrinking public class     org.jf.dexlib2.dexbacked.** {
    *;
}

but still getting the warning:

 Note: the configuration keeps the entry point 'com.trusteer.trf.dex_parser { int get_strings_count(org.jf.dexlib2.dexbacked.DexBackedDexFile); }', but not the descriptor class 'org.jf.dexlib2.dexbacked.DexBackedDexFile'

I am using proguard version 4.7 (in Android SDK)

What should I do?

5条回答
ゆ 、 Hurt°
2楼-- · 2019-04-18 08:19

From the docuemnts:

allowshrinking Specifies that the entry points specified in the -keep option may be shrunk, even if they have to be preserved otherwise. That is, the entry points may be removed in the shrinking step, but if they are necessary after all, they may not be optimized or obfuscated

So it appears that you need to remove the allowshrinking modifier.

查看更多
SAY GOODBYE
3楼-- · 2019-04-18 08:24

I did some digging in the docs. You have not supplied your whole configuration file, but I'm guessing that that com.trusteer.trf.dex_parser is set to both keep and not to obfuscate.

This means that there is a refrence from com.trusteer.trf.dex_parser to a class called org.jf.dexlib2.dexbacked.DexBackedDexFile that was either shrunk or obfuscated. This means that the link is now broken - dex_parser can't import DexBackedDexFile.

So either disable shrinking and obfuscation for DexBackedDexFile, or allow optimization and obfuscation on dex_parser.

查看更多
smile是对你的礼貌
4楼-- · 2019-04-18 08:28

You have told Proguard to keep a certain method void foo(Bar bar); but to obfuscate the descriptor class Bar.

This is only a problem if you are going to invoke the method from an external source as the signature will be changed by the obfuscation (if you use Proguard to obfuscate a library and then use that library in another app).

So have the following choices:

  • Configure Proguard to also keep Bar.

  • Use the -dontnote directive to tell Proguard not to print notes like this.

查看更多
贪生不怕死
5楼-- · 2019-04-18 08:38

Note: the configuration keeps the entry point '...', but not the descriptor class '...' Your configuration contains a -keep option to preserve the given method (or field), but no -keep option for the given class that is an argument type or return type in the method's descriptor. You may then want to keep the class too. Otherwise, ProGuard will obfuscate its name, thus changing the method's signature. The method might then become unfindable as an entry point, e.g. if it is part of a public API. You can automatically keep such descriptor classes with the -keep option modifier includedescriptorclasses (-keep,includedescriptorclasses ...). You can switch off these notes by specifying the -dontnote option.

查看更多
爱情/是我丢掉的垃圾
6楼-- · 2019-04-18 08:40

Add this line in your 'proguard-rules.pro' file to fix this problem .

-ignorewarnings
查看更多
登录 后发表回答