Skip to content

Commit

Permalink
Clean up hacks in TaintInTaintThisGenerator
Browse files Browse the repository at this point in the history
Summary: Same reasoning as

Reviewed By: yuhshin-oss

Differential Revision: D68414710

fbshipit-source-id: c9089897a7a66f2b7ee61431a72617aeef95fc2c
  • Loading branch information
Gerben Janssen van Doorn authored and facebook-github-bot committed Jan 22, 2025
1 parent 5e2fc52 commit 18a59b6
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions source/model-generator/TaintInTaintThisGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
namespace marianatrench {

namespace {
const std::vector<std::string> k_skip_setter_class_suffixes{
"Activity;",
"Service;",
"Context;",
"ContextWrapper;"
"Webview;",
"Fragment;",
"WebViewClient;",
"ContentProvider;",
"BroadcastReceiver;"};
const std::vector<std::string> k_allowlist_setter_method_prefixes{
"<init>",
"add",
Expand Down Expand Up @@ -57,16 +47,6 @@ std::vector<Model> TaintInTaintThisGenerator::visit_method(
}

const auto class_name = generator::get_class_name(method);
if (boost::starts_with(class_name, "Landroid") &&
std::any_of(
k_skip_setter_class_suffixes.begin(),
k_skip_setter_class_suffixes.end(),
[class_name](const auto& denied_class) {
return boost::ends_with(class_name, denied_class);
})) {
return {};
}

const auto method_name = generator::get_method_name(method);
if (boost::ends_with(class_name, "$Builder;") ||
std::any_of(
Expand All @@ -79,11 +59,6 @@ std::vector<Model> TaintInTaintThisGenerator::visit_method(
for (ParameterPosition parameter_position = 1;
parameter_position < method->number_of_parameters();
parameter_position++) {
auto parameter_type = method->parameter_type(parameter_position);
if (parameter_type != nullptr &&
parameter_type->str() == "Landroid/content/Context;") {
continue;
}
generator::add_propagation_to_self(
context_,
model,
Expand Down

0 comments on commit 18a59b6

Please sign in to comment.