Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why proguard processes AndroidManifest.xml

I see some unexplained Proguard behaviour.

AFAIK proguard does not pay attention to android manifest. Also, in my proguard.cfg I have no mention of BroadcastReceiver related classes. So I assume that those should be stripped out.

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

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

and that class (descendand of BroadcastReceiver) does not get stripped. Reason does not say anything meaningful to me:

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

If class is not mentioned in manifest, it gets stripped.

Would be great to know why.

like image 456
lstipakov Avatar asked Oct 04 '13 11:10

lstipakov


1 Answers

The build process runs the tool aapt to automatically create the configuration file bin/proguard.txt, based on AndroidManifest.xml and other xml files. The build process then passes the configuration file to ProGuard. So ProGuard itself indeed doesn't consider AndroidManifest.xml, but aapt+ProGuard do.

like image 101
Eric Lafortune Avatar answered Oct 19 '22 02:10

Eric Lafortune