arguslab / Argus-SAF

Argus static analysis framework
Apache License 2.0
181 stars 49 forks source link

Amandroid not detecting data flows to Anonymous Inner class #60

Open mukut007 opened 5 years ago

mukut007 commented 5 years ago

Amandroid is not detecting data flows to sinks that goes to anonymous innerclass from a source defined outside the innerclass. Did somebody face the same issue or can somebody tell me what to fix? Thank you.

I am attaching a sample code for testing. The source is findViewById and sink is Log.i

    final EditText et = (EditText)findViewById(R.id.editText);
    final Button bt = (Button)findViewById(R.id.button);

    bt.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            String text = et.getText().toString();
            Log.d(text,text);

        }
    });
fgwei commented 4 years ago

You can check whether the dummy env method is generated correctly by looking at https://github.com/arguslab/Argus-SAF/blob/df2557a9654260d5dd933a15f52143bbd6da1f6d/amandroid/src/main/scala/org/argus/amandroid/core/model/ApkModel.scala#L169