A lightweight approach to component-level exception mechanism for robust android apps. (December 2015) - Choi, Kwanghoon; Chang, Byeong-Mo
Abstract: Recent researches have reported that Android programs are vulnerable to unexpected exceptions. One reason is that the current design of Android platform solely depends on Java exception mechanism, which is unaware of the component-based structure of Android programs. This paper proposes a component-level exception mechanism for programmers to build robust Android programs with. With the mechanism, they can define an intra-component handler for each component to recover from exceptions, and they can propagate uncaught exceptions to caller component along the reverse of component activation flow. Theoretically, we have formalized an Android semantics with exceptions to prove the robustness property of the mechanism. In practice, we have implemented the mechanism with a domain-specific library that extends existing Android components. This lightweight approach does not demand the change of the Android platform. In our experiment with Android benchmark programs, the library is found to catch a number of runtime exceptions that would otherwise get the programs terminated abnormally. We also measure the overhead of using the library to show that it is very small. Our proposal is a new mechanism for defending Android programs from unexpected exceptions. Abstract : Highlights: We design a component-level exception mechanism for Android program to improve its robustness. We design a formal semantics for Android-Java with exceptions to prove the robustness theoretically. Our experiment with nine Android source benchmarks shows that six programs become more robust with the mechanism. Our approach is lightweight, not demanding any change of Android platform for use of the mechanism. Our proposal is a new mechanism for defending Android programs from unexpected exceptions.