scrcpy
                                
                                 scrcpy copied to clipboard
                                
                                    scrcpy copied to clipboard
                            
                            
                            
                        Support Kitkat
This is another attempt at suporting API 19. We're developing for a market that's often stuck 10 years ago and seeing this work felt amazing. Maybe label it as experimental.
What this consists of:
- Rebase the original api19branch on top ofmaster.
- Polyfill android.system.Os.write(FileDescriptor, ByteBuffer).
- Backport MediaCodec.getOutputBufferAPI.
- Set ANDROID_HOME=/data/local/tmpfor server.
What doesn't work:
- Emulators. See https://issuetracker.google.com/issues/36982354
- ~Philips 10BDL3051T (no root). See https://github.com/Genymobile/scrcpy/issues/98#issuecomment-379046536~
What definitely works:
- HTC Desire 601(rooted)
- Philips 10BDL3051 (no root) with the ANDROID_DATA hack
The performance isn't amazing but it works.


I've made it so the AndroidX annotation-1.3.0.jar lives as a copy inside the repo. It's a compile-only dependency both in server/build.gradle and server/build_without_gradle.sh. That way it contributes to developer experience in Android Studio, it contributes to lint, but has no effect on the produced artifact. The annotations and their calls are not present scrcpy-server binary.
The same thing now applies to the libcore.io package. This package is part of the framework and only needs to be presetn at compile time. The binary doesn't contain any of these classes.
~The same approach should be done in the future with the system AIDL interfaces (e.g. IRotationWatcher.aidl or IClipboard) these are part of the framework and shouldn't be part of the binary.~ This only applies to gradle build.
android.system package remains shadowed for now. ~Tried doing it better but it bloated the binary.~
Removed unnecessary logic from MediaCodecCompat.
Extracted MediaCodecListCompat from ScreenEncoder to keep it clean.
- We no longer shadow android.systempackage. Instead there's newandroidx.systempackage.
- OsCompat.write(FileDescriptor, ByteBuffer)now advances buffer position on all platforms. This was fixed in Lollopop MR1. This is no longer part of- IO.writeFully.
- OsCompat.writeautomatically retries on- EINTR.
- As a side-effect, we can now use lambdas.
This wraps up API 19 support. I think devices without an encoder, like the watch, should be handled separately, by querying PackageManager features or listing media codecs and failing with better error message.
- Make the /data/local/tmp/dalvik-cachedirectory ourselves.
Why the video socket is using file descriptors, not standard Java streams? Is file descriptor faster than stream or something?
Why the video socket is using file descriptors, not standard Java streams? Is file descriptor faster than stream or something?
https://github.com/Genymobile/scrcpy/commit/66def38b734829170654647086bd76f99efdec70
I really need it. How can I download it?