FlowDroid icon indicating copy to clipboard operation
FlowDroid copied to clipboard

Issue in running CLI

Open vaibhavantil1 opened this issue 3 years ago • 7 comments

Hi, thanks for this amazing tool. I am trying to run the CLI and followed the following steps.

  1. Download the soot-infoflow-cmd-2.9.0-jar-with-dependencies.jar file
  2. Run command ; java -jar FlowDroid/soot-infoflow-cmd-jar-with-dependencies.jar
    -a FlowDroid/FlowDroidAliasActivity.apk
    -p /Users/username/Library/Android/sdk/platforms
    -s /Users/username/Documents/GitHub/FlowDroid/SourcesAndSinks.txt

I am getting the error: The data flow analysis has failed. Error message: ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name java.util.zip.ZipException: ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1579) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.(ZipFileSystem.java:179) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:106) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:339) at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288) at soot.jimple.infoflow.methodSummary.data.provider.XMLSummaryProvider.getPathInJar(XMLSummaryProvider.java:189) at soot.jimple.infoflow.methodSummary.data.provider.XMLSummaryProvider.loadSummariesFromJAR(XMLSummaryProvider.java:141) at soot.jimple.infoflow.methodSummary.data.provider.XMLSummaryProvider.(XMLSummaryProvider.java:135) at soot.jimple.infoflow.methodSummary.data.provider.XMLSummaryProvider.(XMLSummaryProvider.java:71) at soot.jimple.infoflow.methodSummary.data.provider.LazySummaryProvider.(LazySummaryProvider.java:23) at soot.jimple.infoflow.cmd.MainClass.initializeTaintWrapper(MainClass.java:406) at soot.jimple.infoflow.cmd.MainClass.run(MainClass.java:309) at soot.jimple.infoflow.cmd.MainClass.main(MainClass.java:239)

How do I fix this?

vaibhavantil1 avatar Feb 27 '22 06:02 vaibhavantil1

I lost 30 minutes of my life solving this error. Let me guess, you are using some Linux with openJDK? Simply download and run the jar with the latest Oracle JRE. It will work.

giudasg avatar Mar 05 '22 10:03 giudasg

Damn! I will try and revert.

vaibhavantil1 avatar Mar 05 '22 10:03 vaibhavantil1

Facing same issue on Mac M1

khemrajrathore avatar Mar 08 '22 06:03 khemrajrathore

when I set Jdk to 1.8,it works

newxiaochenzheng avatar Mar 31 '22 07:03 newxiaochenzheng

I can't reproduce the issue. It would be great if someone who has this problem could debug it and propose a fix as a merge request.

StevenArzt avatar Mar 31 '22 10:03 StevenArzt

The release jar with dependencies seems to have a "./" entry, which shouldn't be there. Unzipping and rezipping worked for me, but a version compiled straight from the current repository state does not have the problem either.

MarcMil avatar May 02 '22 12:05 MarcMil

The "." directory (that somehow was included in previous versions) is not included in 2.10.0. 2.9.0 (https://github.com/secure-software-engineering/FlowDroid/releases/download/v2.9/soot-infoflow-cmd-2.9.0-jar-with-dependencies.jar): grafik

2.10.0 (https://github.com/secure-software-engineering/FlowDroid/releases/download/v2.10/soot-infoflow-cmd-jar-with-dependencies.jar): grafik

The issues seems to be fixed.

BTW: 2.9.0 works with Java up to version

java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

However, for any more recent version the error occurs.

FoelliX avatar May 04 '22 12:05 FoelliX