Skip to content

Commit

Permalink
[WIP] Minor cleanup committed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander "Tarh committed Apr 13, 2024
1 parent 4d10e4d commit 0bfd4ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def md5key(string: str, model: str, device_mac: str):

tempKey = pjstr + tempModel
aeskey = aesEncrypted(string, tempKey)
#aeskey = string

temp = MD5.new(aeskey.encode('utf-8')).hexdigest()
if isEncryptKeyTypeHex:
Expand All @@ -59,8 +58,5 @@ def genMD5key(wifi_info_sn: str, owner_id: str, device_id: str, model: str, devi


def unGzipCommon(data: str, wifi_info_sn: str, owner_id: str, device_id: str, model: str, device_mac: str) -> bytes:
#base64map = base64.b64encode(data)
# with open("0.encrypted.map", 'wb') as file:
# file.write(data)
return aesDecrypted(data, genMD5key(wifi_info_sn, owner_id, device_id, model, device_mac))

Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@ def parse(raw: bytes, colors: Colors, drawables: Drawables, texts: Texts, sizes:
_LOGGER.debug(f"Skipping {offset1} bytes, value: {buf._data[buf._offs]:#x}")

feature_flags = MapDataParserIjai.FEATURE_IMAGE
#feature_flags = buf.get_uint32('feature_flags')
map_id = buf.peek_uint32('map_id')
#_LOGGER.debug('feature_flags: 0x%x, map_id: %d, some_hash: %s', feature_flags, map_id, some_hash)

if feature_flags & MapDataParserIjai.FEATURE_ROBOT_STATUS != 0:
MapDataParserIjai.parse_section(buf, 'robot_status', map_id)
buf.skip('unknown1', 0x28)

if feature_flags & MapDataParserIjai.FEATURE_IMAGE != 0:
#MapDataParserIjai.parse_section(buf, 'image', map_id)
buf.set_name('image')
map_data.image, map_data.rooms, map_data.cleaned_rooms = \
MapDataParserIjai.parse_image(buf, colors, image_config, DRAWABLE_CLEANED_AREA in drawables)
Expand Down

0 comments on commit 0bfd4ac

Please sign in to comment.