[Soot-list] Using Soot to Process Android Source Code Files

Mingyi Zhao rvlfly at gmail.com
Wed Oct 15 12:09:33 EDT 2014


Hi All,

I just started using Soot. And I am trying to use it to process Android
source code files.

To get started, I downloaded a sample program called RepeatingAlarm from
Google:
http://developer.android.com/samples/RepeatingAlarm/index.html

Then I have downloaded the nightly build version of Soot and put android.jar
and android-17-api.jar in the current folder.

Then I tried using both the command line mode and the driver class provided
at:
http://www.bodden.de/2013/01/08/soot-android-instrumentation/

For the command line mode, I use the following command:

java -cp soot-trunk.jar soot.Main -cp . -pp -process-dir RepeatingAlarm

For the driver class, I use the following argument:

-android-jars . -process-dir RepeatingAlarm

I also changed the "src_prec_apk" to "src_prec_java" in the code.



However, they both give me the following error:

Soot started on Tue Oct 14 11:40:39 EDT 2014
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:19,8:
  Semantic Error: no visible type named android.os.Bundle
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:20,8:
  Semantic Error: no visible type named
android.support.v4.app.FragmentActivity
soot.CompilationDeathException: there were errors during parsing and/or
type checking (JastAdd frontend)
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:22,8:
  Semantic Error: no visible type named
com.example.android.common.logger.Log
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:23,8:
  Semantic Error: no visible type named
com.example.android.common.logger.LogWrapper
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:28,41:
  Semantic Error: no visible type named FragmentActivity
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:32:
  Semantic Error: method does not override a method from a supertype
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:33,29:
  Semantic Error: no visible type named Bundle
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:37:
  Semantic Error: method does not override a method from a supertype
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:47,9:
  Semantic Error: no visible type named LogWrapper
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:47,37:
  Semantic Error: no visible type named LogWrapper
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:48,9:
  Semantic Error: Log not found
J:\Android\AndroidInstrument\RepeatingAlarm\RepeatingAlarmSample\src\main\java\com\example\android\common\activities\SampleActivityBase.java:50,9:
  Semantic Error: Log not found
at soot.JastAddInitialResolver.formAst(JastAddInitialResolver.java:63)
at soot.JavaClassSource.resolve(JavaClassSource.java:54)
at soot.SootResolver.bringToHierarchy(SootResolver.java:230)
at soot.SootResolver.bringToSignatures(SootResolver.java:255)
at soot.SootResolver.processResolveWorklist(SootResolver.java:169)
at soot.SootResolver.resolveClass(SootResolver.java:130)
at soot.Scene.loadClass(Scene.java:673)
at soot.Scene.loadClassAndSupport(Scene.java:658)
at soot.Scene.loadNecessaryClasses(Scene.java:1319)
at soot.Main.run(Main.java:214)
at soot.Main.main(Main.java:152)
at AndroidInstrument.main(AndroidInstrument.java:84)




Could you please tell me where I could possibly go wrong?

Thank you very much!

Mingyi

-- 
Mingyi ZHAO
Pennsylvania State University
College of Information Science and Technology
Email:         rvlfly at gmail.com
Mobile:       814-777-8165
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141015/a3dd9576/attachment.html 


More information about the Soot-list mailing list