siis / ic3

IC3: Inter-Component Communication Analysis in Android
http://siis.cse.psu.edu/ic3/
Apache License 2.0
36 stars 21 forks source link

Exception in thread "main" java.lang.NullPointerException #15

Open arnavbhartiya opened 8 years ago

docteau commented 8 years ago

Hi,

Thank you for reporting this. There is indeed an issue with a null pointer exception when no output is specified. In order to avoid this, either use the -protobuf or -db option (see http://siis.cse.psu.edu/ic3/installation.html for how to use these options). This should be fixed for the next version.

Thanks, Damien

arnavbhartiya commented 8 years ago

Hey Damien @docteau , Thanks for the reply. That worked ! I was wondering if there is a documentation or an example analysis on how to interpret the result which I got in the database. Excuse me for the naivety.

Thanks, Arnav

feibabeibei commented 8 years ago

Hello java -jar ic3-0.2.0-full.jar -apkormanifest 1.apk -input outputp/retargeted/1 -cp android.jar -db cc.properties cc.properties should how to write? question follow as: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:408) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1137) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:356) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2504) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2541) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2323) at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:832) at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:408) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:417) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:187) at edu.psu.cse.siis.ic3.db.Table.connect(Table.java:153) at edu.psu.cse.siis.ic3.db.Table.getConnection(Table.java:69) at edu.psu.cse.siis.ic3.db.ApplicationTable.find(ApplicationTable.java:55) at edu.psu.cse.siis.ic3.db.ApplicationTable.insert(ApplicationTable.java:29) at edu.psu.cse.siis.ic3.db.SQLConnection.insert(SQLConnection.java:79) at edu.psu.cse.siis.ic3.manifest.ManifestPullParser.writeToDb(ManifestPullParser.java:267) at edu.psu.cse.siis.ic3.Ic3Analysis.initializeAnalysis(Ic3Analysis.java:130) at edu.psu.cse.siis.ic3.Ic3Analysis.initializeAnalysis(Ic3Analysis.java:65) at edu.psu.cse.siis.coal.Analysis.performAnalysis(Analysis.java:66) at edu.psu.cse.siis.ic3.Main.main(Main.java:14) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at java.net.Socket.(Socket.java:425) at java.net.Socket.(Socket.java:241) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:258) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:306) ... 24 more Exception in thread "main" java.lang.NullPointerException at edu.psu.cse.siis.ic3.db.ApplicationTable.find(ApplicationTable.java:55) at edu.psu.cse.siis.ic3.db.ApplicationTable.insert(ApplicationTable.java:29) at edu.psu.cse.siis.ic3.db.SQLConnection.insert(SQLConnection.java:79) at edu.psu.cse.siis.ic3.manifest.ManifestPullParser.writeToDb(ManifestPullParser.java:267) at edu.psu.cse.siis.ic3.Ic3Analysis.initializeAnalysis(Ic3Analysis.java:130) at edu.psu.cse.siis.ic3.Ic3Analysis.initializeAnalysis(Ic3Analysis.java:65) at edu.psu.cse.siis.coal.Analysis.performAnalysis(Analysis.java:66) at edu.psu.cse.siis.ic3.Main.main(Main.java:14)

docteau commented 8 years ago

Hi,

For cc.properties, please follow the template from https://github.com/siis/ic3/blob/master/src/main/resources/db/cc.properties.template. You need to specify your MySQL user name and password. Note that the user you specify should have the proper permissions to perform SELECT and INSERT queries.

Regards, Damien