-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
fix: fix CleanUp classpath bug #4416
Conversation
no need to fix compiled artifact's name to '/data/local/tmp/scrcpy-server.jar'
This is an idea, but the classpath will not necessary contains only the scrcpy-server jar to cleanup. For example, we might add other jars in the classpath: #3927 (comment) |
I tried to use DexClassLoader to solve the problem. |
The path can be retrieved from the classpath. PR #4416 <#4416> Co-authored-by: Romain Vimont <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
if scrcpy is not the first item in CLASSPATH, you code just doesn't work. Better not make such assumption, as CLASSPATH order is up to users. |
There are only two cases:
Therefore, running more complex code handling any order, with relative or absolute paths, opening jar files and iterating over all the classes (internally) is unnecessary: more runtime execution (probably negligible) and more risk of bugs (on any custom ROM). If the server path cannot be determined, that would make scrcpy fail.
The server is intended to work with the scrcpy client, it is not a generic library. Although there are some features which facilitate its use without the scrcpy client, its design is not constrained by other use cases. https://github.com/Genymobile/scrcpy/blob/master/doc/develop.md#standalone-server That's why hardcoding the path was ok until I added randomness to the path name. |
I merged this commit into |
The path can be retrieved from the classpath. PR #4416 <#4416> Co-authored-by: Romain Vimont <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
no need to fix compiled artifact's name to '/data/local/tmp/scrcpy-server.jar'