Commit Graph

394 Commits

Author SHA1 Message Date
Martin Mohr fcb9c57e40 fix download location for dexlib 2017-01-03 18:17:34 +01:00
Martin Mohr e78e71fe71 fetch dexlib-1.3.4.jar from SCanDroid
This buys us some time to work on a proper solution, aka:
porting from dexlib to dexlib2
2017-01-03 18:09:23 +01:00
Achim D. Brucker 973ba0a7ab Merge remote-tracking branch 'upstream/master' 2016-12-17 09:46:12 +00:00
Martin Mohr 4228bac5ff If we see a call to an unknown method, conservatively add edges to all catch handlers
This is an attempt to fix issue #123
2016-12-09 16:46:01 +01:00
Martin Mohr ee22e177c5 Dalvik-Frontend: add catch-all handler at the end and not at the beginning 2016-12-09 16:40:14 +01:00
Martin Mohr 6d0ba7d371 Make a variant of TypeInference which supports dalvik bytecode
Dalvik bytecode represents 'null' as 0 which may lead to problems
in phi instructions. This variant of TypeInference fixes these
problems by

- tracking whether an SSA value is constant zero and
- ignoring constant zeros in the transfer function of phi instructions
  when meeting with non-primitive types
2016-12-07 16:34:13 +01:00
Martin Mohr 9ada546c5d Activity.onStop is part of the loop 2016-12-07 16:11:19 +01:00
Martin Mohr 9a3e869dd1 use pi nodes in dalvik frontend 2016-12-07 16:11:19 +01:00
Martin Mohr fd2d4aefbf further fixes in dalvik front-end to avoid NullPointerExceptions and other errors 2016-12-07 16:11:19 +01:00
Martin Mohr 42ae088c05 turn exception throwing into debug logging message 2016-12-07 16:11:19 +01:00
Martin Mohr a8cb767c63 allow action names starting with "."
According to [1], such action names are allowed and implicitly to be
prepended with the package name of the application.

[1] http://developer.android.com/guide/topics/manifest/activity-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr 7c657f5754 allow unqualified custom actions 2016-12-07 16:11:19 +01:00
Martin Mohr be635cf50d support for activity aliases 2016-12-07 16:11:19 +01:00
Martin Mohr 92f26a33c2 clarification 2016-12-07 16:11:19 +01:00
Martin Mohr 95031461f4 handle gracefully the case of intent-filter without action
According to [1], such intent-filters do not let any intent
pass but on the other hand do no harm

[1] http://developer.android.com/guide/topics/manifest/action-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr a1fa8a2057 update intent information instead of crashing 2016-12-07 16:11:18 +01:00
Martin Hecker 8e773fcf88 in order to look up instruction-indices from a bytecode-indices, do a binary search on the existing pcMap array (as suggested by Julian Dolby).
also see https://sourceforge.net/p/wala/mailman/message/35518796/ and answers.
2016-12-05 18:52:37 +01:00
Ben Liblit 522c382a19 Use consistent Java versions, usually 1.7
Previously, the various Eclipse projects' Java configurations used
mixtures of 1.6, 1.7, and 1.8.  Many were internally inconsistent,
such as requiring 1.7 in "MANIFEST.MF" but 1.6 in the Eclipse JDT
build preferences.  The Travis-CI configuration tests against both 1.7
and 1.8, but does not test against 1.6.

Across all projects, the most common version was 1.7.  So I'm going to
assume that 1.7 is the intended build target.  This commit makes 1.7
the selected version nearly everywhere.

"com.ibm.wala.core.testdata" is the one exception.  This specific
project uses a few features only found in 1.8, such as lambda
expressions.  Previously, "com.ibm.wala.core.testdata" used 1.7 in
some aspects of its configuration but 1.8 in others.  Now it
consistently targets 1.8.  I wish this one project didn't need to be
inconsistent with the rest of WALA, but at least now it's consistent
with itself.

(Personally, I'd be happy to target 1.8 only.  But my impression
across all of these configuration files is that the WALA developers
still want to be compatible with 1.7.  If that is no longer a
requirement, let me know and I will adjust these changes accordingly
to target 1.8 only.)

This change eliminates 11 "There is no 'jre.compilation.profile' build
entry and the project has Java compliance preferences set" warnings
and 13 "The JRE container on the classpath is not a perfect match to
the 'JavaSE-1.7' execution environment" warnings.  However, it also
adds 450 "Redundant specification of type arguments <...>" warnings
and 17 "Resource '...' should be managed by try-with-resource"
warnings.  So this seems like a net step backward in my wish to reduce
WALA warnings.  However, those new warnings concern Java 1.7 language
features that we were not previously using to good effect in projects
that targeted 1.6.  If we all agree that we can now target 1.7
instead, then we can use these helpful features as the newly-added
warnings suggest.  So I call that a step in the right direction.
2016-11-29 21:29:30 -06:00
Ben Liblit 18b79bf0f9 Merge branch 'master' into warning-fixes-xml-validation 2016-11-29 10:08:00 -06:00
Manu Sridharan 1e5dcf46f7 Merge pull request #112 from liblit/warning-fixes-html-validation
Eliminate all Eclipse HTML validation warnings
2016-11-28 21:37:46 -08:00
Ben Liblit 391210bf2d Exclude Maven-generated Ant build scripts from XML validation
When Maven generates these "*/target/antrun/build-main.xml" Any build
scripts, it does not include any DTD or XML Schema declarations.
Eclipse's XML validator warns about the lack of grammar constraints.
The warning is sensible, but we are not in a position to do anything
about it.  Better, therefore, to suppress these warnings so that we
can more-clearly see warnings we *can* address.
2016-11-28 14:57:26 -06:00
Ben Liblit 48e158f87e Add stub DOCTYPE declarations for various hand-authored XML files
Some of these might have proper DTDs or XML Schema definitions
floating around somewhere that we could use.  Presumably many do not.
Rather than hand-craft such definitions myself, I'm just giving each a
minimal stub DOCTYPE declaration.  That's enough to satisfy Eclipse's
XML validator, which otherwise complains that these files lack grammar
constraints.
2016-11-28 14:55:34 -06:00
Ben Liblit 3b1547f0a7 Exclude Maven-generated (?) files from XML validation
I think the "target/p2artifacts.xml" and "target/p2content.xml" files
are generated by Maven.  They are well-formed XML but Eclipse's XML
validator legitimately warns that they lack grammar constraints.
Since we're not maintaining the tool that creates these files, we are
not in a position to do anything about that.  Therefore, we may as
well exclude these from validation entirely.  That way we can
more-clearly recognize warnings that we *can* do something about.
2016-11-28 14:55:25 -06:00
Ben Liblit 80e8ea3c4e Add stub DOCTYPE declarations for Ant build scripts
Ant "build.xml" files don't have a standard DTD or XML Schema; the
contents are simply too flexible for that.  But we can at least
give each a stub DOCTYPE declaration.  That's enough to satisfy
Eclipse's XML validator, which otherwise complains that these files
lack grammar constraints.
2016-11-28 12:50:56 -06:00
Ben Liblit 2a5503b9aa Exclude Maven-generated HTML pages from validation
Eclipse validation warns about invalid HTML content in all
Maven-generated "target/site/dependency-convergence.html" files.  The
warnings are legitimate: these HTML files are indeed invalid.
However, we don't maintain the tool that generates these files, so we
are not in a position to fix them.  Better, therefore, to suppress
these warnings so that we can notice and fix other problems over which
we do have control.
2016-11-27 21:24:03 -06:00
Ben Liblit b3293ecc3e Enforce restrictions on the model behavior class statically
If a client violates these restrictions, I prefer that their code fail
at compile time instead of run time.  Changing a few key types from
`Class` to `Class<? extends AbstractAndroidModel>` gives us precisely
the static enforcement we need and lets us remove an
`AbstractAndroidModel.class.isAssignableFrom` run-time check.

However, this does change the public API of `AndroidEntryPointManager`
in two ways.  The `getModelBehavior` and `setModelBehavior` methods now
respectively accept and return `Class<?  extends AbstractAndroidModel>`
instead of `Class`.  Is tightening up a public API in this manner
considered OK?
2016-11-26 22:39:37 -06:00
Ben Liblit d4a0a5ddd4 Delist a JAR that is not actually present
This resolves one Eclipse "'...' build entry is missing" warning.

Also update the project configuration to treat this warning as an
error.  This should discourage commits that create new instances of
this sort of problem in the future.
2016-11-26 20:39:26 -06:00
Ben Liblit 8b7a163110 The "lib" subdirectory contains no Java sources
This resolves one "'...' is not a source folder" Eclipse warning.

Also update the project configuration to treat this warning as an
error.  This should discourage commits that create new instances of
this sort of problem in the future.
2016-11-26 20:39:26 -06:00
Ben Liblit dace7b709f Ignore missing non-null-by-default annotations in Eclipse
In general, the WALA code base is not really ready for nullness
checking.  It would be nice if we got there some day, but I'm not
planning to take that on now or any time soon.  Until then, it's not
useful to warn about missing @NonNullByDefault declarations on WALA
packages.

See also older commit 7b6811b.
2016-11-26 18:47:35 -06:00
Achim D. Brucker e8ea3615d1 Merged latest updates from upstream. 2016-08-06 21:02:35 +01:00
Julian Dolby 7d7dd17a47 minor fix to getting method annotations for dalvik 2016-07-28 16:11:16 -04:00
Julian Dolby f5f75c7c66 find slf4j from maven 2016-07-05 20:01:04 -04:00
Ben Liblit 7b6811b2dd Ignore potential null accesses in Eclipse
Eclipse Mars Service Release 2 finds 45 potential null pointer accesses
across WALA's various Eclipse projects. Eclipse ignores these by
default, but any individual user may have changed their personal Eclipse
configuration to treat them as warnings or errors. Thus, some people
will find that the code builds while others find that it fails. Better
to explicitly use a known-good configuration.

In the long run someone should inspect these cases one-by-one and fix
them where appropriate. But that is probably better managed as part of a
larger effort to tidy up nulls in WALA. I'm not planning to take that on
now or any time soon, though, so this is a better setup for now.
2016-06-27 13:11:42 -05:00
Julian Dolby 76286a330c make Android entrypoint locator work for source code 2016-06-10 21:21:08 -04:00
Manu Sridharan cd560b3b2b switch version to 1.3.10-SNAPSHOT 2016-05-10 22:53:28 +09:00
Manu Sridharan 158a5deeb0 Version 1.3.9 2016-05-10 21:59:26 +09:00
Julian Dolby 2b2543cfbb fixed bugs with switch bytecodes in Dalvik.
ignore exceptions in callgraph construction when they are ignored in
bytecode from Dalvik.
2015-11-13 19:25:23 -05:00
Julian Dolby d010e36923 fix for NOP instructions 2015-11-13 09:57:02 -05:00
Julian Dolby 876e52c3f8 fixes for dalvik maven packaging 2015-11-06 18:36:03 -05:00
Julian Dolby 9c55f01d99 fixes to creation of jar file by maven 2015-11-06 18:26:01 -05:00
Manu Sridharan ce10710125 Avoid repeatedly initializing possibleEntryPoints
Added while investigating #88, but this does not fix the problem
2015-10-11 16:12:13 -07:00
Manu Sridharan e46bb81081 Update version to 1.3.9-SNAPSHOT 2015-10-09 12:55:49 -07:00
Manu Sridharan ed5093d6db Properly update version to 1.3.8
Other changes were accidentally committed last time.
2015-10-09 11:06:03 -07:00
Manu Sridharan 077cabc4eb Revert "update version to 1.3.8"
This reverts commit 4aac703ee5.
2015-10-09 11:03:46 -07:00
Manu Sridharan 4aac703ee5 update version to 1.3.8 2015-10-09 10:45:57 -07:00
Michael Herzberg 8227286b38 Implemented method to retrieve line numbers. 2015-10-06 22:44:16 +02:00
Julian Dolby 5517371a9b adapt to IField changes 2015-09-16 13:25:53 -04:00
Julian Dolby 3ddaa9eaf7 restore EPL headers 2015-08-13 12:34:34 -04:00
Julian Dolby 045537274f merge 2015-08-13 11:26:48 -04:00
Julian Dolby 671bd98977 Java 8 suport enhancements, mostly to model lambdas compiled to
invokedynamic
2015-08-12 15:20:21 -04:00
Martin Mohr 8d143dbf20 remove 'Custom Change' markers 2015-06-25 09:12:37 +02:00
Martin Mohr 53852ef2a3 fix dalvik eclipse project build path 2015-06-22 15:54:00 +02:00
Martin Mohr b727348af4 fix plugin build path for dalvik project 2015-06-22 14:20:57 +02:00
Martin Mohr 0583450884 fix whitespace 2015-06-22 10:45:26 +02:00
Martin Mohr f4cef8db7a dalvik frontend: set target for SSAGotoInstructions 2015-06-22 10:45:26 +02:00
Martin Mohr cecd2c950f support multiple intent actions and urls in manifest parser 2015-06-14 23:34:33 -07:00
Martin Mohr a56eeae51a kill deprecated method together with the last call of it 2015-06-14 23:33:43 -07:00
Martin Mohr 4bc25d3ddf also model outer loops as indefinite instead of infinite 2015-06-14 23:33:18 -07:00
Martin Mohr 441cc6f279 bugfix in model: close inner loop using a *conditional* goto
This way, the rest of the outer loop (including the jump to the
beginning) is also reached in the control-flow which means that
the outer loop is modelled as a proper loop
2015-06-14 23:31:35 -07:00
Martin Mohr ccb5b02abd do not add self-loops 2015-06-14 23:31:35 -07:00
Martin Mohr cfadf0104c substitute call to deprecated method 2015-06-14 23:31:35 -07:00
Martin Mohr b1c10b642f finish all sections only if a section was entered 2015-06-14 23:31:00 -07:00
Martin Mohr cfa005203a cover corner case of intent or intent's action being null 2015-06-14 23:31:00 -07:00
Martin Mohr 9c4c3507c4 cover corner case of method being null 2015-06-14 23:31:00 -07:00
Martin Mohr 3e4af27112 allow resetting the AndroidEntryPointManager - this is rudimentary support for running the android front-end *multiple times within the same VM* 2015-06-14 23:30:41 -07:00
Martin Mohr b5092637c8 improve recognition of intent action 2015-06-14 23:29:27 -07:00
Martin Mohr 8610ac29c7 allow to retrieve Android Model Class with different cha 2015-06-14 23:29:27 -07:00
Martin Mohr 7e3fb18fc0 BUGFIX: when reusing ssa value numbers, consider the case that an instruction may not have a def 2015-06-14 23:29:10 -07:00
Martin Mohr b03cd18ada handle case when exclusions are null 2015-06-14 23:29:10 -07:00
Martin Mohr 9e5be48138 only generate return statement if caller and callee are compatible 2015-06-14 23:27:57 -07:00
Martin Mohr 0af274a1f9 use class hierarchy for preflight-checking 2015-06-14 23:27:57 -07:00
Martin Mohr 86c65f0578 fix some issues of the IntentContextSelector 2015-06-14 23:27:57 -07:00
Martin Mohr 485b02a8e0 instantiate SpecializedInstanstiator only if given class is really special 2015-06-14 23:27:15 -07:00
Manu Sridharan 052023581d update version to 1.3.8-SNAPSHOT 2015-05-31 13:53:07 -07:00
Manu Sridharan f2f65bfbc5 oops, version should be 1.3.7 2015-05-29 13:20:25 -07:00
Manu Sridharan 894f010ff9 version 1.3.8 2015-05-29 12:20:53 -07:00
Manu Sridharan 7ad8700064 update version numbers to 1.3.7-SNAPSHOT everywhere 2015-05-28 10:37:01 -07:00
Julian Dolby 63ec46f67d 1) changes for mobile
a) serializable added for use by Android services
  b) test classes refactored to allow Android variants to use JUnit 3
2) shrike instrumentation now uses java.lang.instrument
  a) refactoring
  b) online variants of call graph tracing
2015-05-25 19:00:51 -04:00
Julian Dolby 125c8fa684 fix dexlib 2015-04-11 10:11:47 -04:00
Julian Dolby c330657fd4 fix dexlib 2015-04-11 10:05:03 -04:00
Julian Dolby 8cd400df6f fix dexlib 2015-04-11 10:01:41 -04:00
Julian Dolby fd98fec401 export dexlib again 2015-04-11 09:59:51 -04:00
Julian Dolby f92450a7d2 new source for dexlib 2015-04-11 09:46:52 -04:00
Julian Dolby 22ad339fd9 dalvik test infrastructure 2015-04-05 21:22:55 -04:00
Julian Dolby 43c37d6d0e fixes to regression tests:
now, for me, code works using e44 with maven
  dalvik tests refactored for mobile version with android dev tools
  IDE tests Eclipse metadata fixed to make e44 work for me
  new android entrypoint to fix failure in new droidbench tests
2015-03-24 21:51:35 -04:00
Julian Dolby de26484098 java annotations support for dalvik 2015-03-04 13:49:58 -05:00
Julian Dolby fe02f7341b experiment: make Android tools available 2015-03-04 12:08:45 -05:00
Julian Dolby 57ac9646c0 handler type 2015-02-27 21:19:43 -05:00
Julian Dolby 6a8b2bb1f9 catch handler entry points 2015-02-27 21:04:45 -05:00
Julian Dolby 00afd2d63a substitute Android libs when needed 2015-02-26 22:12:02 -05:00
Julian Dolby da5ddee139 (try to) fix runtime path 2015-02-26 15:51:03 -05:00
Julian Dolby c78cd7006b make sure lib dir exists 2015-02-26 11:39:54 -05:00
Julian Dolby b2c2a2d9e3 getch commons stuff from maven 2015-02-26 11:24:47 -05:00
Julian Dolby 5cc870dd77 fixes to Dalvik support, and work on running Dalvik tests on Travis 2015-02-26 09:34:03 -05:00
Julian Dolby 096e2f796f 1) new support for function.prototype.apply in field-based CGs
2) fixes to Dalvik bytecode reader
3) fixes to Shrike writing Java 7 byte code
2014-12-11 21:48:23 -05:00
Manu Sridharan b461107837 Fix compile error, and compile scandroid in Maven build 2014-11-24 14:37:46 -08:00
Julian Dolby 97920a4ab9 fixes for reading core libraries from dex 2014-11-18 22:34:42 -05:00
Julian Dolby c9ad359d65 new test to remind me that prototype no longer works with correlation tracking:
com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShapeRhino.java
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/pages/prototype.html

work (not yet finished) on fixes to property accesses for JavaScript:
com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ipa/callgraph/AstJavaSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/JSSSAPropagationCallGraphBuilder.java

currently unused tests to remind me to fix bugs:
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/tests/loops.js
com.ibm.wala.cast.js.test.data/examples-src/tests/primitive_strings.js

fixes to exception handler code generation in JavaScript:
com.ibm.wala.cast.js.rhino/source/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java
com.ibm.wala.cast.js.test.data/examples-src/tests/try.js
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java

fixes to make the system build on both juno and luna
com.ibm.wala.cast.js.test.data/pom.xml
pom.xml
targets/e42/e42.target
targets/e44/e44.target
targets/pom.xml
com.ibm.wala.core.tests/META-INF/MANIFEST.MF
com.ibm.wala.dalvik.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt/source/com/ibm/wala/cast/java/translator/jdt/FakeExceptionTypeBinding.java
com.ibm.wala.ide.jdt/source/com/ibm/wala/ide/util/JavaEclipseProjectPath.java
com.ibm.wala.ide.jsdt.tests/META-INF/MANIFEST.MF
com.ibm.wala.ide.jsdt.tests/src/com/ibm/wala/ide/jsdt/tests/AbstractJSProjectScopeTest.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/EclipseProjectPath.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java

beginnings of "pointer analysis" on top of field-based analysis
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/FlowGraph.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/PropVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/RetVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VarVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VertexFactory.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ExceptionReturnValueKey.java

fixes for crashes in correlartion tracking
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/extraction/ClosureExtractor.java

fixes for Dalvik IR generation
com.ibm.wala.core/src/com/ibm/wala/cfg/BytecodeCFG.java
com.ibm.wala.core/src/com/ibm/wala/cfg/ShrikeCFG.java
com.ibm.wala.core/src/com/ibm/wala/ssa/SSACFG.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/test/callGraph/JVMLDalvikComparison.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/classLoader/DexCFG.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/dex/instructions/UnaryOperation.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/DexSSABuilder.java

fixes to stack map generation when instrumenting for Java 7
com.ibm.wala.shrike/src/com/ibm/wala/shrike/cg/DynamicCallGraph.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/ConstantInstruction.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Analyzer.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/ClassHierarchy.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Verifier.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/shrikeCT/ClassInstrumenter.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapConstants.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableReader.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableWriter.java
2014-10-15 16:01:38 +09:00
Julian Dolby dea583108a Merge branch 'master' of https://github.com/wala/WALA 2014-10-10 17:49:47 -04:00
Julian Dolby e3dfc5afe5 fixes for ir generation 2014-10-10 17:48:37 -04:00
Manu Sridharan 74d5225e16 update maven scripts to build com.ibm.wala.dalvik 2014-10-10 11:56:47 -07:00
Julian Dolby 14c9c96515 merge of java 7 changes.
fixes for Dalvik commit.
2014-10-06 17:41:58 -04:00
Julian Dolby a1bc84356d scandriod merge 2014-10-01 21:32:36 -04:00
Juergen Graf b8df435af2 fix type parameters of node decorator in dalvik frontend 2014-08-01 18:13:44 +02:00
Juergen Graf a13c0df9bd cleanup in dalvik frontend related files 2014-08-01 12:32:22 +02:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Martin Mohr e6e6fc4159 bugfix (provided by E.Derr): left-shift literal of *HIGH_16 constants 2014-06-02 17:06:07 +02:00
Juergen Graf fad9e87654 cleanup - organize imports and remove unused code 2014-05-20 19:56:59 +02:00
Juergen Graf 9c41990d73 adapt android part to new pointer analysis interface 2014-05-20 19:56:31 +02:00
Juergen Graf ef4513d377 revert PointerAnalysis hack that makes containsAny() and contains() methods in OrdinalSet unusable 2014-05-20 19:52:01 +02:00
Juergen Graf 428a3975ed Merge branch 'wala' into master
Conflicts:
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInstructionFactory.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInvokeInstruction.java
	com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/html/WebPageLoaderFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/loader/JavaScriptLoader.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JSInstructionFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JavaScriptInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AbstractLexicalInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstInstructionFactory.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalRead.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalWrite.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/FixedParametersInvokeInstruction.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/translator/AstTranslator.java
	com.ibm.wala.core/.classpath
	com.ibm.wala.core/.settings/org.eclipse.jdt.core.prefs
	com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java
	com.ibm.wala.util/src/com/ibm/wala/util/NullProgressMonitor.java
	com.ibm.wala.util/src/com/ibm/wala/util/ProgressMaster.java
2014-05-20 17:59:16 +02:00
Juergen Graf 42702aba15 export android model classes to other projects 2014-05-19 15:42:35 +02:00
Juergen Graf cf9d623b40 change to compile in eclipse - move files from util to core due to dependencies 2014-05-19 13:24:47 +02:00
Tobias Blaschke 71060b7348 Document Android-Stuff (II) 2014-04-11 17:59:10 +02:00
Tobias Blaschke f83ee59d8d Add UnknownIntent to AndroidSettingFactory 2014-04-11 17:59:09 +02:00
Tobias Blaschke 92ee930865 Document Android stuff (I)
I'm going through all "my" classes and add documentation where missing.
2014-04-11 17:59:09 +02:00
Tobias Blaschke 5f51dac201 Additional structural Models for Android
Now there are four structural models:
* SequentialAndroidModel:   No loops
* SingleStartAndroidModel:  User Interaction on a single component
* LoopAndroidModel:         Stuff goes into background and comes back
* LoopKillAndroidModel:     Restart of components due to low memory
2014-04-11 17:59:09 +02:00
Tobias Blaschke 1857121a44 Add "Custom Change" where applicable
Added the lines
BEGIN Custom Change
END Custom Change
2014-04-11 17:58:33 +02:00
Tobias Blaschke 3751366295 Bail out more information on failed assertion 2014-04-11 17:56:48 +02:00
Tobias Blaschke dc2522f937 Add debugging info
Output the method and stackTrace for my new "most favourite" assertion
and continue.
2014-04-11 17:56:48 +02:00
Tobias Blaschke e1fd417627 Extend DefaultInstantiationBehavior 2014-04-11 17:56:47 +02:00
Tobias Blaschke 2818ad33ad Document settings
Add more documentation on the settings for generationg a Livecycle-model
2014-04-11 17:56:47 +02:00
Tobias Blaschke 851594cff5 Make Intents immutable when attached to Context
Oops.
Fixes in intent-Resolution
2014-04-11 17:56:47 +02:00
Tobias Blaschke 8e7d44f6dc Better checks no system-components are included.
Before Activitys defined in the API could be pulled into the
entriepoints.

TODO: How can these get "Application" as loader?
2014-04-11 17:56:47 +02:00
Tobias Blaschke 042b1d6a01 Add some checks and output more info
AndroidPreFlightChecks now warns about entrypoints having a parameter
of type Object.
2014-04-11 17:56:47 +02:00
Tobias Blaschke 34b5c7284a Allow changing the target of an Intent.
Code oftain sets the action of an Intent after it's constructor. Until
now a call to such a setter caused the Intent to become "unbound"
(conservative).

This approch allows setting the target once for each Intent - only on
the second call the Intent gets unbound.
This new variant could be dangerous: Setting the target in a branch of
execution may be invalid. This should be detected - no guarantees so!

Methods in question are:
* Intent.setAction
* Intent.setComponent
* Intent.setClass
* Intent.setClassName
2014-04-11 17:56:47 +02:00
Tobias Blaschke b27bd944dc IntentModel also calls Application and Provider EPs.
As the IntentModel should only be used on the start of an Analysis this
is the correct approach here.
2014-04-11 17:56:47 +02:00
Tobias Blaschke cbfca1df4e Call setIntent when starting a Component.
Before the Intent would only have been set by calling .attach (if
doBootSequence is enabled). Attach is only called when the modell is
filled with instructions.

This new variant calls setIntent when creating the wrapper for the model
(getMethodAs). This is much better!
2014-04-11 17:56:47 +02:00
Tobias Blaschke eb4e3e4b58 Use setExplicit in androids Intent-Constructor 2014-04-11 17:56:46 +02:00
Tobias Blaschke 5a8c676a76 Disable extraction of AndroidContext
The AndroidContext was not used anyways.
2014-04-11 17:56:46 +02:00
Tobias Blaschke abcd578a61 Use getters and setters for Intents, add explicit-attribute
These Changes are necessary to make the target of an Intent changeable.
Additionaly some preparing changes in the IntentMap
2014-04-11 17:56:46 +02:00
Tobias Blaschke 3533156542 More info on AndroidEntryPoints selected by heuristic 2014-04-11 17:56:46 +02:00
Tobias Blaschke bf0e1a6347 Extend handling of IntentContext
* Create IntentContext even if no info available.
  This is necessary to also track the start of unknown targets.

* Invalidate the target of an Inten upon a call to Intent.setAction
  or Intent.fillIn

Additionally tidied up the classes a bit.
2014-04-11 17:56:46 +02:00
Tobias Blaschke c4eb253721 Fixes in the UnknownTarget model.
Before the model went by the wrong Name, it failed if no app-internal
implementations of the targetType existed.

Also tidied up the code.
2014-04-11 17:56:46 +02:00
Tobias Blaschke bd8f793135 Add a model for SystemServices
The SystemServiceModel creates and returns a new Instance of the
requested Service (if known).

TODO: We should use a single "global" instance per service instead.
2014-04-11 17:56:46 +02:00
Tobias Blaschke 224077d344 Fix Phi-Problem in SpecializedInstantiator
Under some curcumstances there was a hick-up when Phi-ing together some
newly generated instances.
2014-04-11 17:56:46 +02:00
Tobias Blaschke 1121b59b3b Handling getSystemService.
Code to resolve a call to getSystemService to an actual Object based on
the String given to getSystemService.

Currently there's only TelephonyManager.
2014-04-11 17:53:14 +02:00
Tobias Blaschke f561f1213d Make flat components optional 2014-04-11 17:53:14 +02:00
Tobias Blaschke d7f0d07122 Create Conponent instances in clinit 2014-04-11 17:53:14 +02:00
Tobias Blaschke a9864a5dab Added specialized instantiators.
Creating an instance of e.g. Context would pull in all compontents
yielding a ununsable result.
2014-04-11 17:53:13 +02:00
Tobias Blaschke ece84ddf76 Fix field-handling for Intent-Wrappers
The IntentContextInterpreter always returned an empty set of fields
2014-04-11 17:53:13 +02:00
Tobias Blaschke 64749b91fe Decrease some log-levels
Output was a bit to verbose.
2014-04-11 17:53:13 +02:00
Tobias Blaschke b963cc72bb Flatten Android-Component instances
Throw instances of android components into AndroidModelClass and reuse
them. This resembles Android a bit more.
2014-04-11 17:53:13 +02:00
Tobias Blaschke 594447c18f Add AndroidModel.getMethodEncap
Using getMethodEncap a new set of REUSE-Parameters will be generated
using the new Instantiator. Then the model will be called.
2014-04-11 17:53:13 +02:00
Tobias Blaschke add83148a5 Add default Overrides for Intents
Added DEFAULT_INTENT_OVERRIDES to AndroidEntryPointManager. These have
to be added manually.

Added posibility to deliberatly ignore intents
2014-04-11 17:53:13 +02:00
Tobias Blaschke 7aed4b5095 Add IntentModel for starting the analysis at an Intent 2014-04-11 17:53:13 +02:00
Tobias Blaschke 00d711dd64 InducedCFG/GoTo: Handle basic block boundarys
Building the CFG with a SSAGotoInstuction was buggy: Oftain the wrong
jump-target was selected. This has bin fixed.

Additionally InducedCFG now automaticly breaks the basic-block at the
jump-target.

Jumping to Phi-Instructions however is still unsupported (as they are
not part of the cfg-instructions)
2014-04-11 17:53:13 +02:00
Tobias Blaschke 154634dfb4 Fix resolution of Intents
There was (and is) the posibility of an endless-loop when looking up the
targets of Intents. Added an evil hack to at least prevent the most
obvious one.
2014-04-11 17:53:13 +02:00
Tobias Blaschke 14a9382ac6 Enable components in v4 2014-04-11 17:53:12 +02:00
Tobias Blaschke c8b60ef9dd BUG: Invalid def/Use of IntentSender.<init>
The Analysis has problems with the IntentSender class: Invalid DefUse an
an Init-Call.
The Intent-Starters, that use IntentSender have been made optional.
However disabling them does not help.

Currently the only solution to this problem is adding IntentSender to
the exclusions.txt
2014-04-11 17:53:12 +02:00
Tobias Blaschke 51d25116d9 BUG: Endless Recursion based on RESUE-Settings
Setting the Instantiation-Behavior of Package:
Landroid/support/v4/view
To REUSE causes the following Endless-Recursion in JoDroid:

interproc: computing local killing defintions...       done
Building utility edges  Exception in thread "main" java.lang.StackOverflowError
        at java.util.HashMap.put(HashMap.java:389)
        at org.jgrapht.graph.AbstractBaseGraph.addEdge(Unknown Source)
        at edu.kit.joana.util.graph.AbstractJoanaGraph.addEdge(AbstractJoanaGraph.java:50)
        at edu.kit.joana.wala.core.DependenceGraph.addEdge(DependenceGraph.java:76)
        at edu.kit.joana.wala.core.joana.JoanaConverter$UtilityEdgeWalker.discover(JoanaConverter.java:344)
        at edu.kit.joana.wala.core.joana.JoanaConverter$UtilityEdgeWalker.discover(JoanaConverter.java:325)
        at edu.kit.joana.wala.core.graphs.GraphWalker.dfs(GraphWalker.java:55)
        at edu.kit.joana.wala.core.graphs.GraphWalker.dfs(GraphWalker.java:63)
        at edu.kit.joana.wala.core.graphs.GraphWalker.dfs(GraphWalker.java:63)
        at edu.kit.joana.wala.core.graphs.GraphWalker.dfs(GraphWalker.java:63)
        ...

As this package contains System-provided android-components it should however be marked REUSE in order to be able to read back values when these types are used.
2014-04-11 17:53:12 +02:00
Tobias Blaschke 329e55990e Lower log-level on stub-induced warnings
The Log-Level for types and unimplemented interfaces from the stubs used
to be WARN and ERROR. This was reduced to DEBUG.
2014-04-11 17:53:12 +02:00
Tobias Blaschke 326404ff53 Fix: Instantiator - Array of Interface caused endless recursion
When creating an instance of an array whose payload-type is an interface
the Instantiator would get stuck in an endless recursion.
2014-04-11 17:53:12 +02:00
Tobias Blaschke f261d2e9ab Dalvik: Mark files for deletion
Classes not needed any longer have been marked as @deprecated
2014-04-11 17:53:12 +02:00
Tobias Blaschke 80c022f525 AndroidContext: Explicitly hand through on Intent-Start (coarse)
PARTIALLY:
Android-Context is explicitly assigned when Intents are started.

Not all types of Context are handled correctly yet.
2014-04-11 17:53:12 +02:00
Tobias Blaschke 9c8e2e7c00 Provide additional checks before building Androids Livecycle.
AndroidPreFlightChecks provides some checkups on the settings before
bulding the Livecycle.
The checks have to be invoked explicitly and issue warnings in the log.
2014-04-11 17:53:12 +02:00
Tobias Blaschke 9c7a2eb975 Build coarse Android Environment
Governed by AndroidEntryPointManager.setDoBootSequence generate some
coarse Android-environment before starting the LiveCycle-Model.

Some action is taken to attach the Android-Context to Components - much
is still missing there though.
Thin context is mainly useful when starting Intents of an external App.
2014-04-11 17:53:11 +02:00
Tobias Blaschke 0543761699 Read AndroidManifest.xml
Reading in this file is needed for determining targets of Intents.
2014-04-11 17:53:11 +02:00
Tobias Blaschke 5ba668c8ae Android Intents: add special context
Whenever an Intent is encountered while building the CallGraph a
WALA-Context is generated for it. If a new Android-Component is started
and the Context is sufficient the start-function will call a new type of
model, the MicroModel.

The MicroModel resemples the livecycle of a single Android-Component.
2014-04-11 17:53:11 +02:00
Tobias Blaschke c33207d793 Android-Intents: context-free overrides
Whenever the start of an intent is encountered the start-function is
replaced by a call to UnknownTargetModel.

UnknownTargetModel will call a restricted android-model (i.e. one that calls only all
Activities). This restricted model is known as MiniModel.
It will also call ExternalModel which does nothing special.
2014-04-11 17:53:11 +02:00
Tobias Blaschke beb97a59e9 Add structure to Android Livecycle
The added structure is governed by an AbstractAndroidModel. When
"labels" are stepped over it may insert special handling code.
2014-04-11 17:53:11 +02:00
Tobias Blaschke 63616da3d2 Implement CB_HEURISTIC for locating EntryPoints
CB_HEURISTIC searches for all methods overwriting or implementing
methods of android that have not been covered by EP_HEURISTIC
2014-04-11 17:53:11 +02:00
Tobias Blaschke 64a1eb0a60 Build basic Android-Livecycle (sequential)
Generate a synthetic AndroidModel in AndroidModelClass.
The model will contain Android EntryPoints in a sorted manner. However
no special handling (loops) are inserted yet.

Intents are not processed at all - thus have to be marked insecure.
2014-04-11 17:53:11 +02:00
Tobias Blaschke a05c823724 Add structures for parameters to Androids entrypoints
Parameters to Androids EntryPoint-Functions may be either marked CREATE
or REUSE. Added these markers and made them availabel through
AndroidEntryPointManager.
2014-04-11 17:53:11 +02:00
Tobias Blaschke b840b55600 AndroidModel: Add central config class
The class AndroidEntryPointManager will contain all configuration data
for building the Android Livecycle Model
2014-04-11 17:53:10 +02:00
Tobias Blaschke 1d527a607b Add hardcoded Android EntryPoints
Added a good bunch of specifications which functions to considder as
EntryPoints for Android Apps. These will be evaluated by
AndroidEntryPointLocator
2014-04-11 17:53:10 +02:00
Tobias Blaschke 1e9298f3d7 Locate Androids EntryPoints
Locating them will be based on a set of hardcoded specifications (next
commit) or by using heuristics.
2014-04-11 17:53:10 +02:00
Tobias Blaschke b8b1fca292 Constants for Android-Types
Added Android-Specific types as TypeName and TypeReference
2014-04-11 17:53:10 +02:00
Tobias Blaschke f8970f92b7 Enable variable-names in Synth. Methods
Using a SummarizedMethodWithNames instead of a normal one enables human
readable variable names in WALA-Synthetic methods. This should help
when debugging.
2014-04-11 17:53:10 +02:00
Tobias Blaschke 34faac169d Fixes on AndroidAnalysisScope
Depending on the method used generating an AnalysisScope failed for
Android-Apps. Especially depending on wheater data was used from a
jar-resource or depending on exclusions.txt
2014-04-11 17:51:59 +02:00
Martin Mohr 54ec3410e7 don't add jdk libs to android analysis scope
CAUTION: Now you have to make sure that the provided android lib actually contains all standard
java classes (e.g. java.lang.Object); WALA will complain and crash if this is not the case
2014-03-31 11:20:17 +02:00
Martin Mohr a01d1a969f change default for logging 2014-03-31 11:20:00 +02:00
Martin Mohr 0235ea847a bugfix: handle the case that there is a series of array-register moving instructions between a new-array and a fill-array-data 2013-08-30 17:19:54 +02:00
Martin Mohr d8c7ce0c51 kill useless class 2013-08-27 11:32:24 +02:00
Martin Mohr 2812a6ed52 do not use the synthetic bit of the dalvik bytcode to implement IMethod.isSynthetic in DexIMethod (the shrike frontend also ignores the respective bit in java bytecode) - in WALA, 'synthetic' means 'does not originate from bytecode' and not 'the compiler generated this method' 2013-08-21 13:43:16 +02:00
Juergen Graf afaebe81a9 fix compile errors in dalvik frontend 2013-07-02 16:03:13 +02:00
Martin Mohr c2909efdbe make logging of com.ibm.wala.dalvik configurable (to switch off, just edit new config file 'logback.xml') 2013-03-28 13:07:28 +01:00
Martin Mohr a80e63093e remove unused dependency of com.ibm.wala.dalvik on com.ibm.wala.cast.java 2013-03-26 15:52:22 +01:00
Juergen Graf 5a06c07ca7 remove warnings from com.ibm.wala.dalvik 2013-03-12 01:24:38 +01:00
Juergen Graf 6401269da1 fix some warnings and remove absolute path in build configuration for com.ibm.wala.dalvik 2013-03-12 01:05:15 +01:00
Martin Mohr 123c1b9d18 do not check for activities while loading classes... 2013-02-07 17:25:06 +01:00
Martin Mohr 095caeebff also add standard scope so that standard java classes are correctly resolved 2013-02-06 20:52:37 +01:00
Martin Mohr d0d2609bf3 cleanup in com.ibm.wala.dalvik project 2013-02-06 14:29:28 +01:00
Martin Mohr 77275aad73 fix compilation problems, remove dependency on wala test project, transform eclipse project dependencies into plugin dependencies 2014-04-09 02:43:32 +02:00
Martin Mohr 09f82ecec1 Copyright notice 2013-02-06 09:03:20 +01:00
Martin Mohr 55dadb2de1 visibility change to setUpAnalysisScope 2013-02-06 08:21:53 +01:00
Martin Mohr 0c6f0849cd make com.ibm.wala.dalvik a plugin project 2013-02-01 11:17:27 +01:00
Martin Mohr 114e911005 helper class for commit db5f4d0ad837a5ae529c6b74fdd80eb9bada4d87 2013-02-01 11:14:09 +01:00
Martin Mohr 8eb6567e94 add android lib, model and example app to make test run possible (only temporary) 2013-02-01 11:13:03 +01:00
Martin Mohr cc239d5803 add some variants of existing methods to be independent of scandroid specific stuff 2013-02-01 11:11:41 +01:00
Martin Mohr e82155e27b delete spurious classes 2013-02-01 11:10:38 +01:00
Martin Mohr 2e8d1a9adf remove spurious com.ibm.wala.ssa classes and package (from dalvik project) 2013-01-31 17:02:51 +01:00
Martin Mohr d2288201cf fix classpath of dalvik eclipse project 2013-01-31 17:01:59 +01:00
Martin Mohr 3e9751539c new project: WALA frontend for dalvik bytecode (based on SCanDroid) 2013-01-31 16:54:35 +01:00