ExecutedAndroidByteCode is a tool helping to get executed Android byte code. It uses the debugger AndBug.
-
git clone git@github.com:msayagh/ExecutedAndroidByteCode.git
-
Make sure you have python 2 installed, and go to AndBug folder, and compile it:
make
- Go back to the root folder.
Open script.sh, and modify the variables "programName" and "androidSDK".
-
Open your Android emulator and install your app.
-
Make sure that no debugger is connected to the emulator (like eclipse).
-
Get your dex file and put it in the dexInput folder.
-
Execute your tests in order to load the classes where the script.sh is going to add debug breakpoints.
-
From command line go to ExecutedAndroidByteCode folder and execute script.sh.
-
The program is going to generate some commands in the commandsToInsertBreakPoints.txt file. Open it and copy paste these commands in the command line.
-
Copy paste the commands result in data/BreakPointsHook.txt.
-
Execute your tests again (what you executed in step 4), some results will be generated in the command line.
-
Copy paste them in the data/traces.txt.
-
Type "exit" in the command line, and get the executed byte code.
- Open your Android emulator and install your app.
I installed the app "test". It is an application that generates a random number after a click on a button.
- Make sure that no debugger is connected to the emulator (like eclipse).
I closed eclipse.
- Copy past your dex file in dexInput folder:
- Execute your tests in order to load the classes where the script.sh is going to add debug breakpoints.
Open the application:
Execute your tests: I click on the button:
- From command line go to ExecutedAndroidByteCode folder and execute script.sh.
It is going to take few seconds to minutes depending on the dex file size, until you get a result like :
- The program is going to generate some commands in the commandsToInsertBreakPoints.txt file. Open it and copy paste these commands in the command line.
Once you get the previous screen, you will find some commands generated in the file "commandsToInsertBreakPoints.txt". Copy paste them like the following:
-
Copy paste the commands result in data/BreakPointsHook.txt. From the line "## AndBug (C) 2011 Scott W. Dunlop swdunlop@gmail.com" to the last line, like the example you have in the file data/BreakPointsHook.txt.
-
Execute your tests again (what you executed in step 4), some results will be generated in the command line, like :
-
Copy paste these results in the data/traces.txt file, from the first "## Breakpoint hit in ....." without copying ">>", to the last line.
-
Click enter, and type "exit" in the command line, and get the executed byte code, after a short while, like the following :








