def save(self):
l = []<EOL>h = {}<EOL>s = {}<EOL>h_r = {}<EOL>idx = <NUM_LIT:0><EOL>for i in self.map_list.get_obj():<EOL><INDENT>length = <NUM_LIT:0><EOL>if isinstance(i, list):<EOL><INDENT>for j in i:<EOL><INDENT>if isinstance(j, AnnotationsDirectoryItem):<EOL><INDENT>if idx % <NUM_LIT:4> != <NUM_LIT:0>:<EOL><INDENT>idx = idx + (<NUM_LIT:4> - (idx % <NUM_LIT:4>))<EOL><DEDENT><DEDENT>l.append(j)<EOL>c_length = j.get_length()<EOL>if isinstance(j, StringDataItem):<EOL><INDENT>c_length += <NUM_LIT:1><EOL><DEDENT>h[j] = idx + length<EOL>h_r[idx + length] = j<EOL>s[idx + length] = c_length<EOL>length += c_length<EOL><DEDENT>debug("<STR_LIT>" + str(i[<NUM_LIT:0>]) + "<STR_LIT>" % (idx, length))<EOL><DEDENT>else:<EOL><INDENT>if isinstance(i, MapList):<EOL><INDENT>if idx % <NUM_LIT:4> != <NUM_LIT:0>:<EOL><INDENT>idx = idx + (<NUM_LIT:4> - (idx % <NUM_LIT:4>))<EOL><DEDENT><DEDENT>l.append(i)<EOL>h[i] = idx<EOL>h_r[idx] = i<EOL>length = i.get_length()<EOL>s[idx] = length<EOL>debug("<STR_LIT>" + str(i) + "<STR_LIT>" % (idx, length))<EOL><DEDENT>idx += length<EOL><DEDENT>self.header.file_size = idx<EOL>for i in l:<EOL><INDENT>idx = h[i]<EOL>i.set_off(idx)<EOL>if isinstance(i, CodeItem):<EOL><INDENT>last_idx = idx<EOL>for j in i.get_obj():<EOL><INDENT>j.set_off(last_idx)<EOL>last_idx += j.get_size()<EOL><DEDENT><DEDENT><DEDENT>last_idx = <NUM_LIT:0><EOL>buff = "<STR_LIT>"<EOL>for i in l:<EOL><INDENT>idx = h[i]<EOL>if idx != last_idx:<EOL><INDENT>debug("<STR_LIT>" % (idx, idx - last_idx))<EOL>buff += "<STR_LIT:\x00>" * (idx - last_idx)<EOL><DEDENT>buff += i.get_raw()<EOL>if isinstance(i, StringDataItem):<EOL><INDENT>buff += "<STR_LIT:\x00>"<EOL><DEDENT>last_idx = idx + s[idx]<EOL><DEDENT>debug("<STR_LIT>" % len(buff))<EOL>return self.fix_checksums(buff)<EOL>
Return the dex (with the modifications) into raw format (fix checksums)
(beta: do not use !)

:rtype: string