darvincisec / DetectFrida

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

Cannot build #14

Closed grad1e closed 3 years ago

grad1e commented 3 years ago

Hi, I cloned the repo and tried building it. But I'm facing this issue. Is there anything that I'm missing?

Executing tasks: [:app:assembleDebug] in project /Users/daryl/AndroidStudioProjects/DetectFrida

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:generateJsonModelDebug UP-TO-DATE

> Task :app:externalNativeBuildDebug FAILED
Build native-lib_armeabi-v7a
ninja: Entering directory `/Users/daryl/AndroidStudioProjects/DetectFrida/app/.cxx/cmake/debug/armeabi-v7a'
[1/2] Building C object CMakeFiles/native-lib.dir/native-lib.c.o
FAILED: CMakeFiles/native-lib.dir/native-lib.c.o 
/Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin/clang --target=armv7-none-linux-androideabi19 --gcc-toolchain=/Users/daryl/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/daryl/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -D_32_BIT -Dnative_lib_EXPORTS -I/Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/arch/armeabi-v7a -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -mllvm -sub -mllvm -bcf -mllvm -fla -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/native-lib.dir/native-lib.c.o -MF CMakeFiles/native-lib.dir/native-lib.c.o.d -o CMakeFiles/native-lib.dir/native-lib.c.o   -c /Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/native-lib.c
/bin/sh: /Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin/clang: No such file or directory
ninja: build stopped: subcommand failed.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process /Users/daryl/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /Users/daryl/AndroidStudioProjects/DetectFrida/app/.cxx/cmake/debug/armeabi-v7a native-lib}
  ninja: Entering directory `/Users/daryl/AndroidStudioProjects/DetectFrida/app/.cxx/cmake/debug/armeabi-v7a'
  [1/2] Building C object CMakeFiles/native-lib.dir/native-lib.c.o
  FAILED: CMakeFiles/native-lib.dir/native-lib.c.o 
  /Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin/clang --target=armv7-none-linux-androideabi19 --gcc-toolchain=/Users/daryl/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/daryl/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -D_32_BIT -Dnative_lib_EXPORTS -I/Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/arch/armeabi-v7a -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -mllvm -sub -mllvm -bcf -mllvm -fla -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/native-lib.dir/native-lib.c.o -MF CMakeFiles/native-lib.dir/native-lib.c.o.d -o CMakeFiles/native-lib.dir/native-lib.c.o   -c /Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/native-lib.c
  /bin/sh: /Users/daryl/AndroidStudioProjects/DetectFrida/app/src/main/c/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin/clang: No such file or directory
  ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
12 actionable tasks: 3 executed, 9 up-to-date

Screenshot 2021-06-11 at 7 27 52 PM

darvincisec commented 3 years ago

Have you cloned o-llvm binary repo. After cloning, check the path is properly set. You can also try to comment out the block mentioned in Cmakelist for generating non-obfuscated binary.

jackzhouse commented 3 years ago

i have same problem, i commented the block Cmakelist for generating non-obfuscated binary but have same error

jackzhouse commented 3 years ago

i have same problem, i commented the block Cmakelist for generating non-obfuscated binary but have same error

Now the problem is if I create cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ../ollvm-tll/

And error is CMake Error: Could not create named generator MinGW Makefiles can you help me?

darvincisec commented 3 years ago

@jackzhouse it looks like you still have references to ollvm-tll. Just to confirm you try like below.

Start - Comment this block generating non-obfuscated builds

set(OLLVM_PATH ${CMAKE_HOME_DIRECTORY}/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin)

set(OLLVM_C_COMPILER ${OLLVM_PATH}/clang)

set(OLLVM_CXX_COMPILER ${OLLVM_PATH}/clang++)

#

set(OLLVM_C_FLAGS "-mllvm -sub -mllvm -bcf -mllvm -fla")

#

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OLLVM_C_FLAGS}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OLLVM_C_FLAGS}")

set(CMAKE_C_COMPILER ${OLLVM_C_COMPILER})

set(CMAKE_CXX_COMPILER ${OLLVM_CXX_COMPILER})

End - Comment this block generating non-obfuscated builds

jackzhouse commented 3 years ago

@jackzhouse it looks like you still have references to ollvm-tll. Just to confirm you try like below.

Start - Comment this block generating non-obfuscated builds

set(OLLVM_PATH ${CMAKE_HOME_DIRECTORY}/../../../../../o-llvm-binary/ollvm-tll/build/bin_Darwin)

set(OLLVM_C_COMPILER ${OLLVM_PATH}/clang)

set(OLLVM_CXX_COMPILER ${OLLVM_PATH}/clang++)

set(OLLVM_C_FLAGS "-mllvm -sub -mllvm -bcf -mllvm -fla")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OLLVM_C_FLAGS}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OLLVM_C_FLAGS}")

set(CMAKE_C_COMPILER ${OLLVM_C_COMPILER})

set(CMAKE_CXX_COMPILER ${OLLVM_CXX_COMPILER})

End - Comment this block generating non-obfuscated builds

Thank you i havent error now, but i'm still curious about ollvm-tll, i want to implement obfuscated build but if i create like https://github.com/yazhiwang/ollvm-tll

still have error cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ../ollvm-tll/

my OS is Linux

darvincisec commented 3 years ago

I have the ollvm-tll binaries built for mac os in my other repo-> https://github.com/darvincisec/o-llvm-binary. You can try building for linux.