Skip to content

Commit

Permalink
rm some todo
Browse files Browse the repository at this point in the history
  • Loading branch information
kokifish committed Dec 14, 2024
1 parent 1f12d64 commit 8597b0d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tag: HarmonyOS, Open HarmonyOS, HarmonyOS NEXT, 鸿蒙 OS, hap, app

## Features

OHRE is a full python3 tool to play with HarmonyOS `.app`, `.hap`,`.abc` files. You conduct a detailed investigation of a **ArkTS** file which is always end with `.abc`.
OHRE is a full python3 tool to play with HarmonyOS `.app`, `.hap`,`.abc` files. You can conduct a detailed investigation of a **ArkTS** runtime file which always ends with `.abc` (except logical code).

- .app
- .hap
Expand Down
4 changes: 0 additions & 4 deletions examples/abc_decompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@
method_region_index = MethodStringLiteralRegionIndex(
buf, region_index.headers[i].method_string_literal_region_idx_off, region_index.headers[i].method_string_literal_region_idx_size)
print(f">> {method_region_index}")
# for off in method_region_index.offsets: # TODO: it's weird! some seems like a String
# print(f"off {hex(off)}")
# foreign_method = ForeignMethod(buf, off)
# print(f">>>> {foreign_method}")

field_region_index = FieldRegionIndex(
buf, region_index.headers[i].field_idx_off, region_index.headers[i].field_idx_size)
Expand Down
4 changes: 2 additions & 2 deletions ohre/abcre/core/Class.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __str__(self):
t_v.tag == ClassTag.SOURCE_FILE):
out_class_data += f"{ClassTag.get_code_name(t_v.tag)} {hex(op._uint8_t_array_to_int(t_v.data))}; "
elif (t_v.tag == ClassTag.INTERFACES):
out_class_data += f"TODO: {ClassTag.get_code_name(t_v.tag)} {t_v.data}; "
out_class_data += f"{ClassTag.get_code_name(t_v.tag)} {t_v.data} NOT SUPPORTED in new version; "
elif (t_v.tag == ClassTag.SOURCE_LANG):
out_class_data += f"{ClassTag.get_code_name(t_v.tag)} {SourceLanguage.get_code_name(t_v.data)}; "
else:
Expand Down Expand Up @@ -78,7 +78,7 @@ def _read_class_data_TaggedValue(buf, offset) -> Tuple[list[TaggedValue], int]:
t_v = TaggedValue(ClassTag.NOTHING)
elif (tag == ClassTag.INTERFACES):
num_INTERFACES, data_INTERFACES, offset = _read_ClassTag_INTERFACES(buf, offset)
t_v = TaggedValue(ClassTag.INTERFACES) # TODO:
t_v = TaggedValue(ClassTag.INTERFACES) # NOT supported in new version
print(f"num_INTERFACES {num_INTERFACES} data_INTERFACES {data_INTERFACES} offset {offset}")
elif (tag == ClassTag.SOURCE_LANG):
SOURCE_LANG, offset = op._read_uint8_t_offset(buf, offset)
Expand Down
6 changes: 3 additions & 3 deletions ohre/abcre/core/LiteralArray.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any, Dict, Iterable, List, Tuple

import ohre.core.ohoperator as op
from ohre.abcre.enum.LiteralTag import LiteralTag
from ohre.abcre.core.Literal import Literal
from ohre.abcre.core.BaseRegion import BaseRegion
from ohre.abcre.core.Literal import Literal
from ohre.abcre.enum.LiteralTag import LiteralTag
from ohre.misc import Log


Expand All @@ -21,7 +21,7 @@ def __init__(self, buf, pos: int):
value = 0
if (tag == LiteralTag.INTEGER or tag == LiteralTag.LITERALBUFFERINDEX):
value, self.pos_end = op._read_uint32_t_offset(buf, self.pos_end)
elif (tag == LiteralTag.INTEGER_8): # TODO: not sure, check it in the future
elif (tag == LiteralTag.INTEGER_8): # NOTE: not sure, but seems right
value, self.pos_end = op._read_uint8_t_offset(buf, self.pos_end)
elif (tag == LiteralTag.DOUBLE):
value, self.pos_end = op._read_double64_t_offset(buf, self.pos_end)
Expand Down
1 change: 1 addition & 0 deletions ohre/abcre/enum/FieldTag.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def __init__(self):
NOTHING = 0x00
INT_VALUE = 0x01
VALUE = 0x02
# belows are removed
RUNTIME_ANNOTATIONS = 0x03
ANNOTATIONS = 0x04
RUNTIME_TYPE_ANNOTATION = 0x05
Expand Down
2 changes: 1 addition & 1 deletion ohre/core/oh_hap.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def compare_files_with_resources_index(self) -> Dict:
if (self.res_index is None):
self.get_resources_index()

self.get_module_json() # TODO: This might not exist if not called
self.get_module_json()

# TODO: Verify if the prefix is correct
files_prefix = "resources"
Expand Down

0 comments on commit 8597b0d

Please sign in to comment.