Merge "Add serialization methods to whitelist not light greylist" am: f7190b65ab
am: b2e9c6652e
Change-Id: I268f643293c10048cc80e33e39573c3e04c2558d
This commit is contained in:
@@ -212,8 +212,8 @@ def main(argv):
|
|||||||
move_from_files(args.input_greylists, uncategorized, light_greylist)
|
move_from_files(args.input_greylists, uncategorized, light_greylist)
|
||||||
move_from_files(args.input_blacklists, uncategorized, blacklist)
|
move_from_files(args.input_blacklists, uncategorized, blacklist)
|
||||||
|
|
||||||
# Iterate over all uncategorized members and move serialization API to light greylist.
|
# Iterate over all uncategorized members and move serialization API to whitelist.
|
||||||
move_serialization(uncategorized, light_greylist)
|
move_serialization(uncategorized, whitelist)
|
||||||
|
|
||||||
# Extract package names of members from whitelist and light greylist, which
|
# Extract package names of members from whitelist and light greylist, which
|
||||||
# are assumed to have been finalized at this point. Assign all uncategorized
|
# are assumed to have been finalized at this point. Assign all uncategorized
|
||||||
|
|||||||
@@ -85,5 +85,23 @@ class TestHiddenapiListGeneration(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
dst, set([ "Lfoo/bar/ClassA;->abc()J", "Lfoo/bar/ClassA;->def()J" ]))
|
dst, set([ "Lfoo/bar/ClassA;->abc()J", "Lfoo/bar/ClassA;->def()J" ]))
|
||||||
|
|
||||||
|
def test_move_serialization(self):
|
||||||
|
# All the entries should be moved apart from the last one
|
||||||
|
src = set([ "Lfoo/bar/ClassA;->readObject(Ljava/io/ObjectInputStream;)V",
|
||||||
|
"Lfoo/bar/ClassA;->readObjectNoData()V",
|
||||||
|
"Lfoo/bar/ClassA;->readResolve()Ljava/lang/Object;",
|
||||||
|
"Lfoo/bar/ClassA;->serialVersionUID:J",
|
||||||
|
"Lfoo/bar/ClassA;->serialPersistentFields:[Ljava/io/ObjectStreamField;",
|
||||||
|
"Lfoo/bar/ClassA;->writeObject(Ljava/io/ObjectOutputStream;)V",
|
||||||
|
"Lfoo/bar/ClassA;->writeReplace()Ljava/lang/Object;",
|
||||||
|
# Should not be moved as signature does not match
|
||||||
|
"Lfoo/bar/ClassA;->readObject(Ljava/io/ObjectInputStream;)I"])
|
||||||
|
expectedToMove = len(src) - 1
|
||||||
|
dst = set()
|
||||||
|
packages = set([ "Lfoo/bar/" ])
|
||||||
|
move_serialization(src, dst)
|
||||||
|
self.assertEqual(len(src), 1)
|
||||||
|
self.assertEqual(len(dst), expectedToMove)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user