Mercurial > paraspace
comparison paraspace/dex_deptracker.py @ 127:650244dcdd82
Sort arrays in rules requested by dalvik
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 08 Aug 2011 22:34:11 +0800 |
parents | ff6f869273b7 |
children | 52749d91cc22 |
comparison
equal
deleted
inserted
replaced
126:ff6f869273b7 | 127:650244dcdd82 |
---|---|
783 depon_dep_lst = chain(*depon_dep_lsts) | 783 depon_dep_lst = chain(*depon_dep_lsts) |
784 depon_dep_map = dict(depon_dep_lst) | 784 depon_dep_map = dict(depon_dep_lst) |
785 return depon_dep_map | 785 return depon_dep_map |
786 | 786 |
787 | 787 |
788 ## \brief Make sorted arrays being sorted. | |
789 # | |
790 # Some array in a DEXFile must be sorted in some kind of rule. They | |
791 # are typed by \ref array_sorted, the type of a sorted array. Child | |
792 # type of a sorted array must implement __cmp__ method to define the | |
793 # rule. | |
794 # | |
795 # This function must be applied on a DEXFile_linked before calling | |
796 # restore_dependencies(). | |
797 # | |
798 def dex_sort_sorted_arrays(dex): | |
799 assert isinstance(dex, dexfile.DEXFile_linked) | |
800 | |
801 for obj, parents, name_path in _travel_dex_relocatable(dex): | |
802 if isinstance(obj, dexfile.array_sorted): | |
803 obj.items.sort() | |
804 pass | |
805 pass | |
806 pass | |
807 | |
808 | |
788 ## \brief Update offset for all relocatable of a DEXFile. | 809 ## \brief Update offset for all relocatable of a DEXFile. |
789 # | 810 # |
790 # Update offset of instances of \ref _dex_type. | 811 # Update offset of instances of \ref _dex_type. |
791 # | 812 # |
792 # \param dexroot is a linked (called build_dependencies()) \ref DEXFile. | 813 # \param dexroot is a linked (called build_dependencies()) \ref DEXFile. |