# HG changeset patch # User Thinker K.F. Li # Date 1312729328 -28800 # Node ID b9688a3badaade82f39eefcf1917bafa314594f2 # Parent 8e42b2816893a7397c43ffd1a8782c89b8e6ae7f Add compute_size() for DEX types that missed it diff -r 8e42b2816893 -r b9688a3badaa paraspace/dex_deptracker.py --- a/paraspace/dex_deptracker.py Sun Aug 07 22:07:08 2011 +0800 +++ b/paraspace/dex_deptracker.py Sun Aug 07 23:02:08 2011 +0800 @@ -816,6 +816,7 @@ obj_clazz, parent_clazz = _resolve_name_path(name_path) if isinstance(obj_clazz, dexfile.depend): + obj_clazz.compute_size(obj) moff(obj_clazz.sizeof(obj)) continue @@ -848,6 +849,7 @@ name = name_path.split('.')[-1] _dex_tree_set_child(parent, name, obj) pass + obj_clazz.compute_size(obj) moff(obj_clazz.sizeof(obj)) continue diff -r 8e42b2816893 -r b9688a3badaa paraspace/dexfile.py --- a/paraspace/dexfile.py Sun Aug 07 22:07:08 2011 +0800 +++ b/paraspace/dexfile.py Sun Aug 07 23:02:08 2011 +0800 @@ -148,6 +148,10 @@ obj.data = data[off:off + obj.data_size] return obj + def compute_size(self, v): + v.data_size = len(v.data) + pass + def sizeof(self, v): return v.data_size @@ -766,9 +770,13 @@ def parse(self, parse, data, off): return self.value + @staticmethod + def compute_size(v): + pass + def sizeof(self, v): return 0 - + @staticmethod def to_str(self): return ''