darvincisec / DetectFrida

Detect Frida for Android
MIT License
665 stars 138 forks source link

cmake_build_type does not include flavors #13

Closed DartNyan4 closed 3 years ago

DartNyan4 commented 3 years ago

In cmake you have the following command: add_custom_command( TARGET native-lib POST_BUILD COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -R .comment -g -S -d --strip-unneeded ${CMAKE_HOME_DIRECTORY}/../../../build/intermediates/cmake/${CMAKE_BUILD_TYPE}/obj/${ANDROID_ABI}/libnative-lib.so COMMENT "Stripped native library")

And it uses ${CMAKE_BUILD_TYPE} to locate .so, but if project has flavors this will not be valid path Is there any modification to include flavors?

darvincisec commented 3 years ago

${ANDROID_ABI} points to the right flavor right?

DartNyan4 commented 3 years ago

yes, the problem was in ${CMAKE_BUILD_TYPE} to use with flavors we had to add arguments:

flavorDimensions "version" productFlavors { free { dimension "version" externalNativeBuild.cmake { arguments "-DFLAVOR=FREE" } } full { dimension "version" externalNativeBuild.cmake { arguments "-DFLAVOR=FULL" } } }

and then modify the path .../cmake/${FLAVOR}${CMAKE_BUILD_TYPE}/...