Why does proguard process AndroidManifest.xml

I see some inexplicable behavior of Proguard.

AFAIK proguard does not pay attention to the android manifest. Also, in my proguard.cfg I do not mention classes related to BroadcastReceiver. Therefore, I suggest that they should be removed.

However, I see something strange in bin / proguard.txt:

# view AndroidManifest.xml #generated:784 -keep class com.fiksu.asotracking.InstallTracking { <init>(...); } 

and this class (descendand of BroadcastReceiver) is not deleted. The mind does not tell me anything meaningful:

 [proguard] com.fiksu.asotracking.InstallTracking [proguard] is kept by a directive in the configuration. 

If the class is not specified in the manifest, it loses.

It would be great to know why.

+7
java optimization android proguard broadcastreceiver
source share
1 answer

The build process launches the aapt tool to automatically create the bin/proguard.txt configuration file based on AndroidManifest.xml and other xml files. The build process then transfers the configuration file to ProGuard. Therefore, ProGuard itself does not really consider AndroidManifest.xml , but aapt + ProGuard do.

+9
source share

All Articles