Commit Graph

253 Commits

Author SHA1 Message Date
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
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 55dadb2de1 visibility change to setUpAnalysisScope 2013-02-06 08:21:53 +01:00
Martin Mohr 114e911005 helper class for commit db5f4d0ad837a5ae529c6b74fdd80eb9bada4d87 2013-02-01 11:14:09 +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 3e9751539c new project: WALA frontend for dalvik bytecode (based on SCanDroid) 2013-01-31 16:54:35 +01:00