GithubHelp home page GithubHelp logo

cuplv / historia Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 1.0 112.48 MB

Application only analysis of event-driven Android applications using message history logics.

Jupyter Notebook 29.93% Shell 0.39% Dockerfile 0.43% Scala 60.51% Java 7.08% HTML 0.08% SMT 1.03% Kotlin 0.48% Python 0.08%

historia's Introduction

Historia Overview

Historia is a static analysis tool for event-driven applciations. Specificially, this tool addresses the pproblem of analyzing an Android application absent of the specific implementation of the framework. In order to capture the behavior of the framework, Historia uses a domain specific language called Callback Control Flow Temporal Logic (CBCFTL for short). The full paper with details behind the theory may be found here.

Running Unit Tests

  • Install Android Studio and SDK (level 26 and 29 are needed for unit tests)
    • Make sure that ANDROID_HOME is set (e.g. [user home]/Library/Android/sdk)
  • Install java 8 (I recommend using JEnv and OpenJDK. (As I recall this is currently a SOOT limitation)
  • install z3 from here: https://github.com/Z3Prover/z3
    • when building, use python3 scripts/mk_make.py --java to compile the java bindings.
  • set sbt heap size with export SBT_OPTS="-Xmx2036M"
  • Run sbt test
  • Note that some tests may take a while.
  • It is recommended to develop in Intellij (community edition is fine)
  • If using a non-default version of java and jenv, set the JENV_VERSION environment variable to the jenv version you want to use (e.g. export JENV_VERSION=1.8). You can list available versions using the command jenv versions.
  • For jupyter notebooks, install nbdev hooks: https://nbdev.fast.ai/tutorials/git_friendly_jupyter.html

A step by step guide on using Historia

This guide may be found in the jupyter notebook: https://github.com/cuplv/Historia/blob/master/notebooks/HistoriaExampleAndExplanation.ipynb

historia's People

Contributors

ftc avatar chfont avatar klinvill avatar smover avatar

Stargazers

Kwanghoon Choi avatar  avatar DravenLu avatar B.B. avatar NWMonster avatar

Watchers

Gowtham Kaki avatar  avatar Sriram S avatar Fabio Somenzi avatar  avatar DravenLu avatar

Forkers

midsorbet

historia's Issues

Handle case where <init> callback does not capture null assignemnt

In the benchmark from commit f8a1fca25a9ed015fb75cc4bb2f1810088cd945d directory Historia/notebooks/reachExpGPT/FragmentLF.

When a field is declared on a class, it sometimes doesn't handle a field pointing to null initially.

e.g. For the field field a vc requiring f.field -> null cannot be satisfied for some reason. This looks like an encoding issue.

class Foo extends Fragment{
Object field; 
...
}

Workaround is to just set field to null.

class Foo extends Fragment{
Object field = null;  // explicit null set.
...
}

There are still corner cases where we don't handle boxed integers properly.

In commit hash 7c4bc50

Run the jupyter notebook at Historia/notebooks/reachExpGPT/ReachExpGPT.ipynb. The bitmap example shows a case where a boxed integer prevents a witness. A unit test titled "How to handle pure val that is equal to a constant?" shows the specific state generated that should be feasible but isn't.

I am going to work around this for now by adding a fake library class specializing ArrayList to the primitive int type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.