Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck creating generators: Found 0 issues #127

Open
serrapa opened this issue May 4, 2023 · 0 comments
Open

Stuck creating generators: Found 0 issues #127

serrapa opened this issue May 4, 2023 · 0 comments

Comments

@serrapa
Copy link

serrapa commented May 4, 2023

Hello everyone, I need some help because I cannot detect a simple data flow.

I have this piece of source code:

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Intent intent = this.getIntent();
        Uri uri_data = intent.getData();
        Log.d("TEST", uri_data.toString());
    }

I am trying to catch the data flow that should have the return value of the getData method as a source and every argument of the d method as sinks. Below the json generators:

// Source.json:

{
  "model_generators": [
    {
        "find": "methods",
        "where": [
          { 
            "constraint": "any_of", 
            "inners": [
              {
                "constraint": "parent",
                "inner": { "constraint": "name", "pattern": "Landroid/content/Intent;" }
              },
              {
                "constraint": "parent",
                "inner": {
                  "constraint": "extends",
                  "inner": { "constraint": "name", "pattern": "Landroid/content/Intent;" }
                }
              }
            ]
          },
          { 
            "constraint": "any_of", 
            "inners": [
              { "constraint": "name", "pattern": "get.*Extra" },
              { "constraint": "name", "pattern": "getData" }
            ]
          }
          
        ],
        "model": {
          "sources": [ 
            { 
              "kind": "IntentData", 
              "port": "Return"
            } 
          ]
        },
        "verbosity": 1
    }]
}
// Sink.json

{
    "model_generators": [
        {
            "find": "methods",
            "where": [
                {
                    "constraint": "parent",
                    "inner": { "constraint": "name", "pattern": "Landroid/util/Log;" }
                }
            ],
            "model": {
                "for_all_parameters": [
                    {
                        "variable": "x",
                        "sinks": [
                            { "kind": "Logging", "port": "Argument(x)" }
                        ]
                    }
                ]
            },
            "verbosity" : 1
        }
    ]
}

Here the rule added to the rules.json file:

{
    "name": "Rule X",
    "code": 10,
    "description":"xxxx",
    "sources": [
      "IntentData"
    ],
    "sinks": [
      "Logging"
    ]
  }

Mariana found 0 issues, but I cannot understand what's wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant