Skip to content

Commit 698fcc9

Browse files
committed
[Core] Fix problem that results may be lost in special cases.
1 parent acf2317 commit 698fcc9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Core/dexkit/analyze.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ AnalyzeRet Analyze(const schema::MethodMatcher *matcher, int dex_depth) {
142142
ret.declare_class.insert(ret.declare_class.end(), result.declare_class.begin(), result.declare_class.end());
143143
}
144144
if (matcher->using_fields()) {
145-
ret.need_flags |= kMethodUsingField;
145+
// 不初始化 kRwFieldMethod 可能会导致复杂查询无法跳转至对应的 dexItem 执行
146+
ret.need_flags |= kMethodUsingField | kRwFieldMethod;
146147
for (auto i = 0; i < matcher->using_fields()->size(); ++i) {
147148
// 使用的 field 可能定义在其它 dex 中
148149
auto result = Analyze(matcher->using_fields()->Get(i)->field(), dex_depth + 1);
@@ -151,7 +152,8 @@ AnalyzeRet Analyze(const schema::MethodMatcher *matcher, int dex_depth) {
151152
}
152153
}
153154
if (matcher->invoking_methods()) {
154-
ret.need_flags |= kMethodInvoking;
155+
// 不初始化 kCallerMethod 可能会导致复杂查询无法跳转至对应的 dexItem 执行
156+
ret.need_flags |= kCallerMethod | kMethodInvoking;
155157
// invoke 的方法可能定义在其它 dex 中
156158
auto result = Analyze(matcher->invoking_methods(), dex_depth + 1);
157159
ret.need_flags |= result.need_flags;

0 commit comments

Comments
 (0)