script.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # coding:utf8
  2. __author__ = '极无双'
  3. import os
  4. from xml.etree import ElementTree as ET
  5. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  6. fix_fake_recharge_screen_orientation_portrait(decompileDir)
  7. def fix_fake_recharge_screen_orientation_portrait(decompile_dir_path):
  8. for dirpath, dirnames, filenames in os.walk(decompile_dir_path):
  9. if r'com\youzu\gamexy' in dirpath and 'Game.smali' in filenames:
  10. smali_path = os.path.join(dirpath, 'Game.smali')
  11. print(smali_path)
  12. f = open(smali_path, 'r')
  13. smali_str_arr = f.readlines()
  14. f.close()
  15. for line in smali_str_arr:
  16. if 'invoke-static {p0}, Lcom/youzu/gamexy/Game;->Init(Landroid/content/Context;)V' in line:
  17. smali_str_arr[smali_str_arr.index(
  18. line)] = '\t#invoke-static {p0}, Lcom/youzu/gamexy/Game;->Init(Landroid/content/Context;)V\n'
  19. f = open(smali_path, 'w')
  20. f.write(''.join(smali_str_arr))
  21. f.close()
  22. developer_path = os.path.join(decompile_dir_path, 'assets', 'developer.properties')
  23. print(developer_path)
  24. f = open(developer_path, 'r')
  25. smali_str_arr = f.readlines()
  26. f.close()
  27. for line in smali_str_arr:
  28. if 'isRealname' in line:
  29. smali_str_arr[smali_str_arr.index(line)] = line.replace('1', '0')
  30. break
  31. f = open(developer_path, 'w')
  32. f.write(''.join(smali_str_arr))
  33. f.close()
  34. if __name__ == '__main__':
  35. ""