sensitive_info.py 943 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import re
  2. # from module.base.mask import Mask
  3. # from module.ui.page import *
  4. #
  5. # MASK_MAIN = Mask('./assets/mask/MASK_MAIN.png')
  6. # MASK_PLAYER = Mask('./assets/mask/MASK_PLAYER.png')
  7. def handle_sensitive_image(image):
  8. """
  9. Args:
  10. image:
  11. Returns:
  12. np.ndarray:
  13. """
  14. # if PLAYER_CHECK.match(image, offset=(30, 30)):
  15. # image = MASK_PLAYER.apply(image)
  16. # if MAIN_CHECK.match(image, offset=(30, 30)):
  17. # image = MASK_MAIN.apply(image)
  18. return image
  19. def handle_sensitive_text(text):
  20. """
  21. Args:
  22. text (str):
  23. Returns:
  24. str:
  25. """
  26. text = re.sub('File \"(.*?)AzurLaneAutoScript', 'File \"C:\\\\fakepath\\\\AzurLaneAutoScript', text)
  27. text = re.sub('\[Adb_binary\] (.*?)AzurLaneAutoScript', '[Adb_binary] C:\\\\fakepath\\\\AzurLaneAutoScript', text)
  28. return text
  29. def handle_sensitive_logs(logs):
  30. return [handle_sensitive_text(line) for line in logs]