Code Monkey home page Code Monkey logo

camerahook's Introduction

CameraHook

CameraHook is an Android app designed to hook and modify android camera preview data from other apps without changing the preview shown to user.

More specifically, CameraHook can modify camera data of any third-party app or system camera app which use the onPreviewFrame system callback

public void onPreviewFrame(byte[] data, Camera camera) {
  //CameraHook can hook the data here
}

For example, you can use this tool to change any third-party QR code scanner result by replacing the camera data with a picture set by yourself.

It is just a prototype and the code may be ugly.

How to try

You should use Android studio to build this project.

To use this app, devices must be root.

You need to install another app which gets camera data via onPreviewFrame to verify if CameraHook works well.

For example, CustomizedCameraPreview is another prototype of mine which renders onPreviewFrame data to the screen, it is a good verification app for CameraHook (https://github.com/vito11/CustomizedCameraPreview)

Please note that CustomizedCameraPreview is a custumized preview, so both the data and the preview shown on the screen can be changed by CameraHook, and Most third-party QR code scanners use system preview, CameraHook only change the data of these scanners and will not change the preview on the screen

Supported platform

Android 2.3 - 4.4

Tips

If you want to make any change to hook.c while libhook.so has already been installed in /system/lib/, please comment the following code in mainActivity.java:

if(result.length()<10) {

    String copySoToSystem = "cat " + so_path + " > " + "/system/lib/libhook.so \n" +
    
            "chmod 777 /system/lib/libhook.so \n";
            
    runLocalRootUserCommand(copySoToSystem);
    
}

If you have any question about this project, feel free to contact me.

Email: [email protected]

camerahook's People

Contributors

vito11 avatar

Watchers

James Cloos 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.