Giter Site home page Giter Site logo

absidibe / disabler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miktam/disabler

0.0 1.0 0.0 940 KB

Code injection in Android, presented on Devoxx conference

Home Page: http://www.devoxx.com/display/DV12/Code+injection+in++Android

Java 23.84% AspectJ 76.16%

disabler's Introduction

Devoxx 2012

App was presented on Devoxx 2012 during Code Injection in Android talk

Disabler allows to optimize, trace and modify Android project on the fly using code injection into existing project. Code is injected on the fly, no need to modify old functionality to add logging/profiling or disable portion of the flow.

Main functionality of the tool:

  • trace: entering/exiting to/from method, collecting parameters and exiting value)
  • profile: measuring the frequency and duration of method calls
  • disable: disabling/skipping part of the program flow by overriding returning value from methods defined by the user.

Running Disabler project hosted on Github

  1. Clone Disabler project
  2. Remove abstract keyword from any of existing aspects to make it work
  • Logger - logs name of the entered method and parameters, and exit from the method
  • Profiler - collects time of execution of the methods in ms
  • Sorter - sorts by length of entry array in any method returning array of strings
  • Delayer - delays call of given method for 10s
  • Disabler - removes data from method returning non empty array of strings

Setup from the scratch

  1. Create Android project
  2. Add aspectjrt.jar as dependency
  • Project -> Java Build Path -> Libraries -> Add Jar
  1. Modify .project file as displayed below
  • Note new build command - org.eclipse.ajdt.core.ajbuilder
  • New nature - org.eclipse.ajdt.ui.ajnature
  1. Add aspect (check examples in Disabler project)
  2. Run app on emulator or hardware

Dependencies:


Customized .project file for Eclipse

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>Disabler</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.ajdt.core.ajbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ApkBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.ajdt.ui.ajnature</nature>
        <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

disabler's People

Contributors

miktam avatar

Watchers

absidibe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.