Remove android:hasCode from AndroidManifest.xml in stubify_manifest.py.
Stubifying an app always injects the stub application, so the incremental APK will have code in it even if the original app didn't.
This came about from #595 (it wouldn't have been reported if we did this)
--
MOS_MIGRATED_REVID=107781748
diff --git a/tools/android/stubify_manifest_test.py b/tools/android/stubify_manifest_test.py
index 3c92b4d..796e199 100644
--- a/tools/android/stubify_manifest_test.py
+++ b/tools/android/stubify_manifest_test.py
@@ -33,6 +33,15 @@
</manifest>
"""
+MANIFEST_WITH_HASCODE = """
+<manifest
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.google.package">
+ <application android:name="old.application" android:hasCode="false">
+ </application>
+</manifest>
+"""
+
MANIFEST_WITHOUT_APPLICATION = """
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
@@ -84,6 +93,11 @@
self.assertEqual("android.app.Application", old_application)
self.assertEqual(STUB_APPLICATION, self.GetApplication(new_manifest))
+ def testRemovesHasCode(self):
+ new_manifest, _, _ = Stubify(MANIFEST_WITH_HASCODE)
+ application = ElementTree.fromstring(new_manifest).find("application")
+ self.assertFalse(("{%s}hasCode" % ANDROID) in application.attrib)
+
def assertHasPermission(self, manifest_string, permission):
manifest = ElementTree.fromstring(manifest_string)
nodes = manifest.findall(