DeviceFarmer / minicap

Stream real-time screen capture data out of Android devices.
Other
294 stars 76 forks source link

Fix library call for android 12 (sdk 31) #29

Closed antoine-carat closed 3 years ago

antoine-carat commented 3 years ago

The cpp libs would need to be rebuilt and verified

koral-- commented 3 years ago

Thanks for the PR, but it does not pass checks. You have to add a sign-off and fix compilation errors.

varundtsfi commented 3 years ago

@antoine-carat

I guess you have to add few more changes in minicap_31.cpp. Like Header files references which got changed in Android 12. and functions names. Changed header files.

include <ui/DisplayId.h>

include <ui/DisplayMode.h>

include <ui/StaticDisplayInfo.h>

Changed in functions:- Android 11 1:- android::DisplayInfo dinfo; err = android::SurfaceComposerClient::getDisplayInfo(dpy, &dinfo);

2:- android::DisplayConfig dconfig; 3:-const android::ui::Size& viewport = dstate.viewport;

Android 12 1:- android::ui::StaticDisplayInfo dinfo; err = android::SurfaceComposerClient::getStaticDisplayInfo(dpy, &dinfo);

2:- android::ui::DisplayMode dconfig; 3:-const android::ui::Size& viewport = dstate.layerStackSpaceRect;

then you will not get compilation errors.

pcrepieux commented 3 years ago

Out of curiosity, what is the need behind using the shared library rather than the apk. Not saying the apk is bullet proof (it's rather new) but it's been made precisely to avoid having to sync with AOSP. I'd like to know, just to be sure where to put the effort.

varundtsfi commented 3 years ago

Hi @pcrepieux I am completely agree what you said but as I convey to you that few users who are using minicap around the world haven't migrated their projects from .so to apk approach.

As if now I guess we have to give the .so solution to users but with statement that in future mincap team will not entertain any update on.so approach. By that time users will migrate their projects to new approach.

Rest is your decision. I can just request☺️.

pcrepieux commented 3 years ago

Unfortunately, compilation errors is a blocker for this PR and https://github.com/DeviceFarmer/minicap/pull/30 comes with a working solution. In any case, thanks a lot @antoine-carat for your suggestion.

antoine-carat commented 3 years ago

@pcrepieux - We also ended up using the APK for our needs, but as we scratched the surface of what the issue was we wanted to give it to the community in case anyone wanted to use the shared libs instead 👍

pcrepieux commented 3 years ago

That's clearly appreciated 👍 I'll just close that one as https://github.com/DeviceFarmer/minicap/pull/30 is now merged.

hyeongminju commented 2 years ago

Anybody change this code about secure flag? /jni/minicap-shared/aosp/src/minicap_31.cpp

// Create virtual display. MCINFO("Creating virtual display"); mVirtualDisplay = android::SurfaceComposerClient::createDisplay( / const String8& displayName / android::String8("minicap"), / bool secure / false // i think the secure flag that have to change true. ); but i could not build for aosp part.

here is my logs

mkdir -p libs/android-31/armeabi-v7a docker run --rm -a stdout -a stderr -v /media/aosp/android-12.0.0_r2:/aosp -v /Users/1004676/stf/minicap/jni/minicap-shared/aosp/:/app -v /Users/1004676/stf/minicap/jni/minicap-shared/aosp/libs/android-31/armeabi-v7a:/artifacts openstf/aosp:jdk8 /aosp.sh build aosp_arm-eng minicap /aosp.sh: line 110: build/envsetup.sh: No such file or directory make: *** [libs/android-31/armeabi-v7a/minicap.so] Error 1

i need help.