8000 Use inside app without adb · Issue #30 · openstf/minicap · GitHub
[go: up one dir, main page]

Skip to content
8000

Use inside app without adb #30

Closed
Closed

Description

@RPallas92

Is it possible to include minicap in an .apk and use it without adb?
Maybe creating a websocket server inside de apk with nanohttpd? Any suggestions?
Thank you

Activity

  1. sorccu commented on May 26, 2016

    @sorccu
    Member

    No, normal applications don't have access to the necessary permissions. I
    would look into using the official VirtualDisplay API instead.

    On Thu, May 26, 2016 at 6:34 PM, Ricardo Pallas notifications@github.com
    wrote:

    Is it possible to include minicap in an .apk and use it without adb?
    Maybe creating a websocket server inside de apk with nanohttpd? Any
    suggestions?
    Thank you

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly or view it on GitHub
    #30

  2. RPallas92 commented on May 26, 2016

    @RPallas92
    Author

    And if the device is rooted?

    Now I'm taking screenshots with screencap command

    private static void takeScreenshot(){
        try {
            Process sh = Runtime.getRuntime().exec("su", null,null);
            OutputStream os = sh.getOutputStream();
            os.write(("/system/bin/screencap -p " + "/sdcard/img.png").getBytes("ASCII"));
            os.flush();
            os.close();
            sh.waitFor();
        } catch (Exception ex){
            ex.printStackTrace();
        }
    
    }
    

    reading it, converting to base64, and send to the client via websockets every 200ms

    But it's very very slow

  3. sorccu commented on May 26, 2016

    @sorccu
    Member

    If it's rooted you can do whatever you want.

    On Thursday, 26 May 2016, Ricardo Pallas notifications@github.com wrote:

    And if the device is rooted?

    Now I'm taking screenshots with screencap command

    private static void takeScreenshot(){
    try {
    Process sh = Runtime.getRuntime().exec("su", null,null);
    OutputStream os = sh.getOutputStream();
    os.write(("/system/bin/screencap -p " + "/sdcard/img.png").getBytes("ASCII"));
    os.flush();
    os.close();
    sh.waitFor();
    } catch (Exception ex){
    ex.printStackTrace();
    }

    }

    reading it, converting to base64, and send to the client via websockets
    every 200ms

    But it's very very slow

    —
    You are receiving this because you commented.
    Reply to this email directly or view it on GitHub
    #30 (comment)

  4. RPallas92 commented on May 26, 2016

    @RPallas92
    Author

    I ended up using MediaRecorder, and sending the images as bytes arrays through websockets to the web app. It works smoothly. Thanks

  5. txchen commented on Sep 2, 2016

    @txchen

    @RPallas92 do you mind sharing more details about your final solution? Is mediaRecorder working on api 19 or api 18? If you can share some key source code, that will be wonderful. Thanks a lot!

  6. added a commit that references this issue on Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0