secure-software-engineering / FlowDroid

FlowDroid Static Data Flow Tracker
GNU Lesser General Public License v2.1
1.02k stars 292 forks source link

Unable to generate the ICFG for Kotlin Composables #737

Closed Fakorede closed 1 week ago

Fakorede commented 1 month ago

Good day,

I'm currently attempting to get the icfg for Android apks. However, it seems FlowDroid is unable to do so for function composable in Kotlin.

InfoflowCFG icfg = new InfoflowCFG();
...
if (sootMethod.hasActiveBody()) {
    DirectedGraph<Unit> dg = icfg.getOrCreateUnitGraph(sootMethod);
    Iterator<Unit> uit = dg.iterator();
    while (uit.hasNext()) {...}
} else {
    System.out.println("No active body found for: " + sootMethod);
}

Example: For the Greeting composable below

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
    Text(
        text = "Hello $name!",
        modifier = modifier
    )
}

Output is No active body found for: <com.thefabdev.alarmapp.MainActivityKt: void Greeting(java.lang.String,androidx.compose.ui.Modifier,androidx.compose.runtime.Composer,int,int)>