GitXplorerGitXplorer
p

Android-NoSleep

public
4 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
764326682e4f5aef1e4e3680fc959e0c081f8012

Update README.md

ppanagosg7 committed 10 years ago
Unverified
ea0dbf4695affa98dc2157c8ec76072e3575f1ce

Update README.md

ppanagosg7 committed 10 years ago
Unverified
df8a14640dc075e4caeee6a6a40f83f91e533ba9

Update README.md

ppanagosg7 committed 10 years ago
Unverified
8d469a920e30c900817b0ca422ff3a2d8ac8fc8e

Update README.md

ppanagosg7 committed 10 years ago
Unverified
8fa595555a35a73a43444e8efc894b46654df884

Update README.md

ppanagosg7 committed 10 years ago
Unverified
c58bad0741daa67dc3d5f28f4276e821fa54e769

Update README.md

ppanagosg7 committed 10 years ago

README

The README file for this repository.

No Sleep Energy Bug Finder

This is the accompanying implementation for the tool described here

This tool is based on WALA, now also maintained in GitHub.

Acknowledgements

Thanks to John C. McCullough for sharing some of the code that managed the benchmarking reported in the paper.

How to use

Dependencies

This projects depends on:

  • Java
  • Maven (recommended)

Retarget Dalvik into Java Bytecode

The input to our tool needs to be in Java Bytecode (JAR form).

To retarget a target APK into a Java JAR I suggest using Dare: Dalvik Retargetting

I have only tried the version for Linux.

After installing Dare, using the instructions here, do the following:

$ dare -o -d <dare-output> <apk-file>

This will create a directory structure withing <dare-output> that looks like the following:

├── optimized
├── optimized-decompiled
├── retargeted
└── stats.csv

To create the JAR for the application:

$ cd <dare-output>/optimized
$ cd <app-name>
$ jar cf target-name.jar *

This JAR will be used as input to our tool.

Configure

Make sure the WALA properties in file edu.ucsd.energy/wala.properties are valid.

In particular, java_runtime_dir needs to point to a valid Java runtime installation.

Build

First import the whole project into Eclipse using the Maven plugin (preinstalled in latest version), by clicking on: File -> Import..., then select Existing Maven Projects and navigate to the top-level of the current project. Once the workspace is built, in a terminal, navigate to the same project folder and issue the following:

$ cd edu.ucsd.energy
$ bin/build.sh

Run

To run (while still at edu.ucsd.energy directory):

$ ./nosleep -i app.jar -r

More options:

$ ./nosleep -h                           
usage: ./nosleep [-h] [-i <arg>] [-r] [-u] [-w]                           
No-sleep energy bug finder for android applications                       
                                                                          
 -h,--help            prints help message                                 
 -i,--input <arg>     input JAR file                                      
 -r,--verify          verify                                              
 -u,--usage           print components that leave a callback (un)locked   
 -w,--wakelock-info   gather info about wakelock creation                 
                                                                               
Please report issues to Panagiotis Vekris (pvekris@cs.ucsd.edu)           

Folder results/android will be populated with a number of DOT graphs of call-graphs and control-flow graphs.