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

Analysis Failed when handling APK with the old Android support library . #785

Open
Jennie2hang opened this issue Dec 11, 2024 · 1 comment

Comments

@Jennie2hang
Copy link

When I use FlowDroid to analyze some older versions of APK files, it ignores all the calls within the onCreate function. The output call graph only contains some simple dummy main methods, and the Jimple file does not include the body of onCreate. Could you please explain why this happens? Below is the simple source code of this APK file.

import android.Manifest;
import android.content.Context;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Context context = getApplicationContext();

        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.SEND_SMS}, 1);

        SmsManager sms = SmsManager.getDefault();
        sms.sendTextMessage("123456", null, "message", null, null);
        Toast.makeText(context, "Test!", Toast.LENGTH_LONG).show();
     
    }
}
@StevenArzt
Copy link
Member

The body of MainActivity.onCreate should be loaded. If that is not the case, I would need the APK file to debug.

Not having any outgoing callgraph edges for the method calls inside onCreate is expected, though. The Android platform JARs only contain stubs of the Android API methods anyway, so we exclude that code entirely to impove performance. Consequently, the calls in onCreate don't have a callee. Technically they call a phantom method. Keep in mind that the callee in the platform JAR would be useless anyway.

FlowDroid applies summaries to model the effect of API methods on taints.

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

2 participants