Merge "Make sure Proguard keeps zygote preload class."
This commit is contained in:
committed by
Android (Google) Code Review
commit
835d528dba
@@ -281,6 +281,15 @@ class ManifestVisitor : public BaseVisitor {
|
||||
AddClass(node->line_number, result.value(), "");
|
||||
}
|
||||
}
|
||||
|
||||
attr = node->FindAttribute(xml::kSchemaAndroid, "zygotePreloadName");
|
||||
if (attr) {
|
||||
Maybe<std::string> result = util::GetFullyQualifiedClassName(package_, attr->value);
|
||||
if (result) {
|
||||
AddClass(node->line_number, result.value(), "");
|
||||
}
|
||||
}
|
||||
|
||||
if (main_dex_only_) {
|
||||
xml::Attribute* default_process = node->FindAttribute(xml::kSchemaAndroid, "process");
|
||||
if (default_process) {
|
||||
|
||||
@@ -42,6 +42,7 @@ TEST(ProguardRulesTest, ManifestRuleDefaultConstructorOnly) {
|
||||
android:appComponentFactory="com.foo.BarAppComponentFactory"
|
||||
android:backupAgent="com.foo.BarBackupAgent"
|
||||
android:name="com.foo.BarApplication"
|
||||
android:zygotePreloadName="com.foo.BarZygotePreload"
|
||||
>
|
||||
<activity android:name="com.foo.BarActivity"/>
|
||||
<service android:name="com.foo.BarService"/>
|
||||
@@ -63,6 +64,7 @@ TEST(ProguardRulesTest, ManifestRuleDefaultConstructorOnly) {
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarReceiver { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarProvider { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarInstrumentation { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarZygotePreload { <init>(); }"));
|
||||
|
||||
actual = GetKeepSetString(set, /** minimal_rules */ true);
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarAppComponentFactory { <init>(); }"));
|
||||
@@ -73,6 +75,7 @@ TEST(ProguardRulesTest, ManifestRuleDefaultConstructorOnly) {
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarReceiver { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarProvider { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarInstrumentation { <init>(); }"));
|
||||
EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarZygotePreload { <init>(); }"));
|
||||
}
|
||||
|
||||
TEST(ProguardRulesTest, FragmentNameRuleIsEmitted) {
|
||||
|
||||
Reference in New Issue
Block a user