-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Add option to install the server as an APK #3517
Conversation
This will allow to install it.
Use "pm list package -f" to find where the APK is actually installed on the device.
Use "dumpsys package com.genymobile.scrcpy" to get the APK version.
This will allow to uninstall the server when necessary.
When this flag is set, the scrcpy is installed rather than pushed to /data/local/tmp.
With --install, the server is installed only if the current version is not already installed. Passing --reinstall force reinstallation is all cases.
The cleanup process will need to know the APK path to execute the CleanUp java executable.
The cleanup process is slightly different when the server is installed rather than pushed.
@yangfl This might impact Debian packaging: with this PR, the APK is signed. I updated |
It's ok, since we can ask users to download and install apk from android side, or just sign it with a random key. |
I am a bit worried about security implications though. If someone manage to make you install a malicious app having package Maybe the server (executed by When the app is pushed to |
I think we can check signature of preinstalled apk and stop (or at least warn users and let them choose) running of unknown apk. Maybe checking hash of apk file is a better choice, but I can't find how to do it... |
Sorry for asking but is there any progress of this PR? |
Due to #3517 (comment), I think it would be better to use a companion app instead. This PR is a good base but it is not intended to be merged as is. |
Thank you for explaining. |
HID keyboard (over USB) should work pretty well. |
Actually this feature doesn't fit my need. I would like a faster switch for mouse and keyboard. |
Now, there is audio, camera and HID without the need for an app. Closing. |
To get shell permissions, the server must execute a java main() executable from
adb shell
.The jar/apk containing the executable can be either pushed to any location (
/data/local/tmp
), or installed on the device.Since the beginning of the project, scrcpy just pushed the server to
/data/local/tmp
, because it's faster and simpler.However, scrcpy might benefit from a companion Android app for supporting new features:
Instead of building a separate Android app to manage (install/reinstall), this PR makes possible to install the server directly as an APK (and execute the server from there):
This paves the way to easily integrate Android component and start activities or services embedded in the server.
As a consequence, the server is now named
scrcpy-server.apk
(which is a drawback IMO, since people will want to install it manually instead of letting the client manage it) and is apk-signed so that it can be installed.Refs #1722
Refs #1880 (comment)