def obfuscate(): """ The main obfuscator function """ try: res_xml = u.load_res_repository( ) # Load the 'pulbic.xml' resource repository except e.FileNotFound: return res_root = res_xml.getroot() # The root of the XML file edited_res = set( list(change_all_res(res_root)) + list(change_meta(u.load_manifest().getroot()))) u.save_res_repository( res_xml) # Save the 'pulbic.xml' resource repository back to file change_all_res_file(u.load_xml_file(), edited_res) change_allfile(u.load_resource_file(), edited_res) try: res_xml = u.load_res_repository( ) # Load the 'pulbic.xml' resource repository except e.FileNotFound: return item_id_list = list(add_id_random_resource(res_root)) u.save_res_repository( res_xml) # Save the 'pulbic.xml' resource repository back to file ids_xml = fix_ids( u.load_res_id_repository()) # Load the 'ids.xml' resource repository ids_root = ids_xml.getroot() # The root of the XML file add_id_random_in_ids(ids_root, item_id_list) u.save_ids_repository( ids_xml) # Save the 'ids.xml' resource repository back to file append_defunct_class()
def obfuscate(): """ The main obfuscator function """ try: res_xml = u.load_res_repository() # Load the 'pulbic.xml' resource repository except e.FileNotFound: return res_root = res_xml.getroot() # The root of the XML file edited_res = set( list(change_all_res(res_root)) + list(change_meta(u.load_manifest().getroot())) ) u.save_res_repository(res_xml) # Save the 'pulbic.xml' resource repository back to file change_all_res_file(u.load_xml_file(), edited_res) change_allfile(u.load_resource_file(), edited_res) try: res_xml = u.load_res_repository() # Load the 'pulbic.xml' resource repository except e.FileNotFound: return item_id_list = list(add_id_random_resource(res_root)) u.save_res_repository(res_xml) # Save the 'pulbic.xml' resource repository back to file ids_xml = fix_ids(u.load_res_id_repository()) # Load the 'ids.xml' resource repository ids_root = ids_xml.getroot() # The root of the XML file add_id_random_in_ids(ids_root, item_id_list) u.save_ids_repository(ids_xml) # Save the 'ids.xml' resource repository back to file append_defunct_class()
def obfuscate(): """ The main obfuscator function """ raw_file_list = list(u.load_raw_file()) try: res_xml = u.load_res_repository() # Load the 'pulbic.xml' resource repository except e.FileNotFound: return res_root = res_xml.getroot() # The root of the XML file raw_id_list = list(get_all_raw_res(res_root)) u.save_res_repository(res_xml) # Save the 'pulbic.xml' resource repository back to file crypt_files(raw_file_list) append_defunct_class(raw_id_list)