InsDal: A safe and extensible instrumentation tool on Dalvik byte-code for Android applications

Program instrumentation is a widely used technique in dynamic analysis and testing, which makes use of probe code inserted to the target program to monitor its behaviors, or log runtime information for off-line analysis. There are a number of automatic tools for instrumentation on the source or byte code of Java programs. However, few works address this issue on the register-based Dalvik byte-code of ever-increasing Android apps. This paper presents a lightweight tool, InsDal, for inserting instructions to specific points of the Dalvik byte-code according to the requirements of users. It carefully manages the registers to protect the behavior of original code from illegal manipulation, and optimizes the inserted code to avoid memory waste and unnecessary overhead. This tool is easy to use and has been applied to several scenarios (e.g. energy analysis, code coverage analysis). A demo video of our tool can be found at the website: https://www.youtube.com/watch?v=Fpw-aygZ3kE.

[1]  Li Li Boosting Static Analysis of Android Apps through Code Instrumentation , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering Companion (ICSE-C).

[2]  Michael R. Lyu,et al.  SpyAware: Investigating the privacy leakage signatures in app execution traces , 2015, 2015 IEEE 26th International Symposium on Software Reliability Engineering (ISSRE).

[3]  Marco Pistoia,et al.  Dynamic detection of inter-application communication vulnerabilities in Android , 2015, ISSTA.

[4]  Fan Zhang,et al.  Lightweight Method-Level Energy Consumption Estimation for Android Applications , 2016, 2016 10th International Symposium on Theoretical Aspects of Software Engineering (TASE).

[5]  A. Jefferson Offutt,et al.  Is bytecode instrumentation as good as source code instrumentation: An empirical study with industrial tools (Experience Report) , 2013, 2013 IEEE 24th International Symposium on Software Reliability Engineering (ISSRE).

[6]  Jun Yan,et al.  Target Directed Event Sequence Generation for Android Applications , 2016, ArXiv.

[7]  Eric Bodden,et al.  Instrumenting Android and Java Applications as Easy as abc , 2013, RV.

[8]  Jun Yan,et al.  Light-Weight, Inter-Procedural and Callback-Aware Resource Leak Detection for Android Apps , 2016, IEEE Transactions on Software Engineering.

[9]  Rongxin Wu,et al.  Casper: an efficient approach to call trace collection , 2016, POPL.