87
|
1
|
|
2 def _deep_travel(obj, cloner, adjuster, visit_log=None):
|
|
3 from paraspace.dexfile import _dex_type
|
|
4
|
|
5 if not visit_log:
|
|
6 visit_log = {}
|
|
7 pass
|
|
8
|
|
9 if id(obj) in visit_log:
|
|
10 return visit_log[id(obj)]
|
|
11
|
|
12 attrs = [attr for attr in dir(obj)
|
|
13 if not attr.startswith('_') and \
|
|
14 isinstance(getattr(obj, attr), _dex_type)]
|
|
15
|
|
16 pass
|
|
17
|
|
18
|
|
19 def dexfile_insert_class(dex, class_def):
|
|
20 classId_orig = class_def.classIdx
|
|
21 if dex_find_type(dex, class_orig):
|
|
22 raise RuntimeError, 'duplicated type'
|
|
23 classId = dex_dup_insert_type(dex, classId_orig)
|
|
24
|
|
25 superclassId_orig = class_def.superclassId
|
|
26 superclassId = dex_find_type(dex, superclassId_orig) or \
|
|
27 dex_dup_insert_type(dex, superclassId_orig)
|
|
28
|
|
29 if dex.interfacesOffRef.is_true:
|
|
30 interfaces_orig = dex.interfacesOffRef.value
|
|
31 interfaces = dex_dup_insert_typelist(dex, interfaces_org)
|
|
32 pass
|
|
33
|
|
34 sourceFileIdx_orig = dex.sourceFileIdx
|
|
35 sourceFileIdx = dex_find_type(dex, sourceFileIdx_orig) or \
|
|
36 dex_dup_insert_type(dex, sourceFileIdx_orig)
|
|
37
|
|
38 if dex.annotationsOffRef.is_true:
|
|
39 annotations_orig = dex.annotationsOffRef.value
|
|
40 annotations = dex_dup_insert(dex, annotations_orig)
|
|
41 pass
|
|
42
|
|
43 if dex.classDataOffRef.is_true:
|
|
44 class_data_orig = dex.classDataOffRef.value
|
|
45 class_data = dex_dup_insert(dex, class_data_orig)
|
|
46 pass
|
|
47 pass
|