Comments (2)
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.
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)
- NoSuchMethodException: android.view.SurfaceControl.createDisplay (Google Pixel 6 Pro Android 15 Beta 1) HOT 2
- i cant control my phone from pc HOT 2
- How can capture screen when scrcpy window is working HOT 1
- Audio forwarding can still work when open mic on Gaming (Pubg mobile) HOT 1
- Connected to phone but disconnects all network locations HOT 5
- Performance Optimization Needed for Modified scrcpy Project HOT 1
- USB Debugging HOT 5
- Password
- ERROR: Could not find any ADB device...ERROR: Server connection failed HOT 1
- Samsung mobile phone screen mirroring cannot zoom in when opening the camera
- Switch control shortcut option for pc to android or android to pc HOT 5
- server version HOT 2
- encoding error,exception on thread HOT 12
- ERROR: Exception on thread Thread[video,5,main] HOT 5
- ERROR: audio demuxer and video decoder problems HOT 5
- Hvchgdfg
- Pointer up event is ignored when screen rotating, causing touch pointer to stay HOT 1
- Source code debugging issues
- getDeviceName change HOT 2
- DecodeFrame failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrcpy.