Giter Site home page Giter Site logo

Comments (2)

rom1v avatar rom1v commented on May 22, 2024

Thank you for sharing your ideas.

What Andromeda does is basically launching a service

So it requires to install an APK?

that keeps the app_process instance alive, providing a continuously running interface for ADB commands. This of course poses a security risk

Indeed, it looks very dangerous to me.

This way the screen capturing can be done easily in a controlled environment

If an APK is required, why not using the MediaProjection API, instead? It requests a user permission, but it sounds safer.

And what would be the benefits?

but through a (local) wireless network connection too

For supporting wireless network connection, I think it is easier to just make it work over adb connect.

this might be a bit out-of-scope

Yes, that's a whole new project. ;-) So I'm closing the issue.

from scrcpy.

fonix232 avatar fonix232 commented on May 22, 2024

So it requires to install an APK?

Yes and no. Andromeda does use an installed app and gives it adb shell access by launching a whole new instance of the app:

pkg=$($ROOT/$ADB pm path projekt.andromeda)
am force-stop projekt.substratum
appops set projekt.andromeda RUN_IN_BACKGROUND allow
appops set projekt.substratum RUN_IN_BACKGROUND allow
CLASSPATH=$pkg app_process /system/bin --nice-name=andromeda projekt.andromeda.Andromeda

However this can be done via any dex file, including the dex file created by scrcpy. This could then keep the service alive until reboot of the device.

Indeed, it looks very dangerous to me.
If an APK is required, why not using the MediaProjection API, instead? It requests a user permission, but it sounds safer.
And what would be the benefits?

As long as you limit the functionality your running "service" can do, it should be safe enough. But yes, safety is a concern, to what the MediaProjection API would be a solution.

In my experience the MediaProjection API adds lots of overhead compared to your solution, which is not a surprise - it's a managed solution to capture screen data, usually only used for screen recording, and not for live streaming the device screen. There's a reason why Samsung's own SideSync uses a pretty similar approach for casting the screen (albeit doesn't even come close to scrcpy's performance).

Benefits would be considerably better performance, lesser battery usage (due to better performance).

For supporting wireless network connection, I think it is easier to just make it work over adb connect.

As long as you want to keep the project adb-only, yes. If this solution were to be expanded into a full-fledged solution, I think further, more user-friendly options should be added. However I understand that you might not wish to go this way with scrcpy.

from scrcpy.

Related Issues (20)

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.