Skip to content

Commit

Permalink
Update stringly-typed method refs to account for colon
Browse files Browse the repository at this point in the history
Summary:
We added a colon to the method descriptor string used by ProguardMap
and the canonical-name form of DexMethod::get_method.  This is why using strings
to represent complex data is bad.

This was causing remove-unreachable to go haywire, since it's driven by seeds
information, which is in turn parsed using these assumptions.

Reviewed By: satnam6502

Differential Revision: D4000864

fbshipit-source-id: 561b67794f518d534cce16dab6ee9580bfb44ff6
  • Loading branch information
bertmaher committed Oct 11, 2016
1 parent a59067d commit bef276a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libredex/DexClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ std::vector<std::string> split_args(std::string args) {
DexMethod* DexMethod::get_method(std::string canon) {
auto cls_end = canon.find('.');
auto name_start = cls_end + 1;
auto name_end = canon.find('(', name_start);
auto args_start = name_end + 1;
auto name_end = canon.find(':', name_start);
auto args_start = name_end + 2;
auto args_end = canon.find(')', args_start);
auto rtype_start = args_end + 1;
auto cls_str = canon.substr(0, cls_end);
Expand Down
2 changes: 1 addition & 1 deletion libredex/ReachableClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ struct SeedsParser {
return
convert_type(cls)
+ "." + name
+ "(" + convert_args(args) + ")"
+ ":(" + convert_args(args) + ")"
+ convert_type(type);
}

Expand Down

0 comments on commit bef276a

Please sign in to comment.