E-APK: Energy pattern detection in decompiled android applications

Nelson Gregório, João Bispo, João Paulo Fernandes, Sérgio Queiroz de Medeiros

Research output: Contribution to journalArticlepeer-review


Energy efficiency is a non-functional requirement that developers must consider, particularly when building software for battery-operated devices like mobile ones: a long-lasting battery is an essential requirement for an enjoyable user experience. In previous studies, it has been shown that many mobile applications include inefficiencies that cause battery to be drained faster than necessary. Some of these inefficiencies result from software patterns that have been catalogued, and for which more energy-efficient alternatives are also known. The existing catalogues, however, assume as a fundamental requirement that one has access to the source code of an application in order to be able to analyse it. This requirement makes independent energy analysis challenging, or even impossible, e.g. for a mobile user or, most significantly, an App Store trying to provide information on how efficient an application being submitted for publication is. We study the viability of looking for known energy patterns in applications by decompiling them and analysing the resulting code. For this, we decompiled and analysed 420 open-source applications by extending an existing tool, which is now capable of transparently decompiling and analysing android applications. With the collected data, we performed a comparative study of the presence of four energy patterns between the source code and the decompiled code. We performed two types of analysis: (i) comparing the total number of energy pattern detections; (ii) comparing the similarity between energy pattern detections. When comparing the total number of detections in source code against decompiled code, we found that 79.29% of the applications reported the same number of energy pattern detections. To test the similarity between source code and APKs, we calculated, for each application, a similarity score based on our four implemented detectors. Of all applications, 35.76% achieved a perfect similarity score of 4, and 89.40% got a score of 3 or more out of 4. Furthermore, only two applications got a score of 0. When viewed in tandem, the results of the two analyses we performed point in a promising direction. They provide initial evidence that static analysis techniques, typically used in source code, can be a viable method to inspect APKs when access to source code is restricted, and further research in this area is worthwhile.

Original languageEnglish (US)
Article number101220
JournalJournal of Computer Languages
StatePublished - Aug 2023


  • Android
  • Code patterns
  • Compilers
  • Decompiler
  • Energy efficiency
  • Metaprogramming
  • Mobile
  • Static analysis

ASJC Scopus subject areas

  • Software
  • Human-Computer Interaction
  • Computer Networks and Communications


Dive into the research topics of 'E-APK: Energy pattern detection in decompiled android applications'. Together they form a unique fingerprint.

Cite this