diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aacd7497..396527a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,494 +20,126 @@ jobs: - name: Install dependencies run: | echo "Installing dependencies..." - # Install Homebrew packages + # Install essential build tools brew install cmake pkg-config - brew install openssl sqlite3 - brew install libzip json-c - # Install Luau via Homebrew - brew install luau - - # Install iOS development dependencies - brew install llvm || true - brew install libomp || true - - # Configure compiler paths for Homebrew-installed LLVM and libomp - if [ -d "/opt/homebrew/opt/llvm/bin" ]; then - echo "Using Homebrew LLVM" - export PATH="/opt/homebrew/opt/llvm/bin:$PATH" - - # Store individual paths for CMake to use directly - LLVM_LIB_PATH="/opt/homebrew/opt/llvm/lib" - LLVM_INCLUDE_PATH="/opt/homebrew/opt/llvm/include" - - # Also add libomp paths if available - if [ -d "/opt/homebrew/opt/libomp" ]; then - echo "Adding libomp paths to environment" - LIBOMP_LIB_PATH="/opt/homebrew/opt/libomp/lib" - LIBOMP_INCLUDE_PATH="/opt/homebrew/opt/libomp/include" - fi - - # Make these environment variables available to subsequent steps - echo "PATH=$PATH" >> $GITHUB_ENV - echo "LLVM_LIB_PATH=$LLVM_LIB_PATH" >> $GITHUB_ENV - echo "LLVM_INCLUDE_PATH=$LLVM_INCLUDE_PATH" >> $GITHUB_ENV - if [ -n "$LIBOMP_LIB_PATH" ]; then - echo "LIBOMP_LIB_PATH=$LIBOMP_LIB_PATH" >> $GITHUB_ENV - echo "LIBOMP_INCLUDE_PATH=$LIBOMP_INCLUDE_PATH" >> $GITHUB_ENV - fi - fi - - # Set up Luau paths - LUAU_PREFIX=$(brew --prefix luau) - echo "Using Homebrew Luau from $LUAU_PREFIX" - - # Check actual library and include structure - echo "Checking Luau installation structure..." - ls -la $LUAU_PREFIX/include/ || echo "Include directory not found" - ls -la $LUAU_PREFIX/lib/ || echo "Lib directory not found" - - # Find the actual library file - LUAU_LIBRARY=$(find $LUAU_PREFIX/lib -name "*.dylib" | head -1) - if [ -z "$LUAU_LIBRARY" ]; then - LUAU_LIBRARY=$(find $LUAU_PREFIX/lib -name "*.a" | head -1) - fi - - if [ -z "$LUAU_LIBRARY" ]; then - echo "Warning: Could not find Luau library, using default path assumption" - LUAU_LIBRARY="$LUAU_PREFIX/lib/liblua.dylib" - fi - - echo "Found Luau library: $LUAU_LIBRARY" - - # Create a copy of libluau.dylib as liblua.dylib (if needed) - if [ -f "$LUAU_PREFIX/lib/libluau.dylib" ] && [ ! -f "$LUAU_PREFIX/lib/liblua.dylib" ]; then - echo "Creating copy of libluau.dylib as liblua.dylib" - # Try to create a symbolic link first - ln -sf "$LUAU_PREFIX/lib/libluau.dylib" "$LUAU_PREFIX/lib/liblua.dylib" || true - - # If that didn't work (due to permissions), try a copy in the user's directory - if [ ! -f "$LUAU_PREFIX/lib/liblua.dylib" ]; then - echo "Symbolic link creation failed, creating local copy instead" - mkdir -p "$HOME/lib" - cp "$LUAU_PREFIX/lib/libluau.dylib" "$HOME/lib/liblua.dylib" - LUAU_LIBRARY="$HOME/lib/liblua.dylib" - echo "Created local copy at $LUAU_LIBRARY" - else - LUAU_LIBRARY="$LUAU_PREFIX/lib/liblua.dylib" - echo "Created symbolic link at $LUAU_LIBRARY" - fi - fi - - # Debug information about the library paths - echo "Checking library paths:" - if [ -f "$LUAU_PREFIX/lib/liblua.dylib" ]; then - echo "✅ liblua.dylib exists in $LUAU_PREFIX/lib/" - ls -la "$LUAU_PREFIX/lib/liblua.dylib" - else - echo "❌ liblua.dylib does not exist in $LUAU_PREFIX/lib/" - fi - - # Set environment variables for Luau - echo "LUAU_INCLUDE_DIR=$LUAU_PREFIX/include" >> $GITHUB_ENV - echo "LUAU_LIB_DIR=$LUAU_PREFIX/lib" >> $GITHUB_ENV - echo "LUA_INCLUDE_DIR=$LUAU_PREFIX/include" >> $GITHUB_ENV - echo "LUA_LIBRARIES=$LUAU_LIBRARY" >> $GITHUB_ENV - - # Set compiler flags to include Luau headers - include both Homebrew and project headers - echo "CFLAGS=-I$LUAU_PREFIX/include -I$GITHUB_WORKSPACE -I$GITHUB_WORKSPACE/source" >> $GITHUB_ENV - echo "CXXFLAGS=-I$LUAU_PREFIX/include -I$GITHUB_WORKSPACE -I$GITHUB_WORKSPACE/source" >> $GITHUB_ENV - - # Also pass these to subsequent commands - use project headers as fallback - export LUA_INCLUDE_DIR="$GITHUB_WORKSPACE/source/cpp/luau" - export LUA_LIBRARIES=$LUAU_LIBRARY - - # Create directories for project resources (only once) - mkdir -p Resources/AIData/LocalModels - mkdir -p Resources/AIData/Vulnerabilities - mkdir -p lib - mkdir -p cmake - - # Fix permissions if needed - chmod -R 755 cmake || true - - # Handle CMake modules with better error checking - echo "Setting up CMake modules..." - - # Create simplified Find*.cmake files for building - # First, create FindLuaFileSystem.cmake - echo "# FindLuaFileSystem.cmake - Using Homebrew Luau" > cmake/FindLuaFileSystem.cmake - echo "# Create a target for lfs.c that ensures it can find the Luau headers" >> cmake/FindLuaFileSystem.cmake - echo "function(add_lfs_target)" >> cmake/FindLuaFileSystem.cmake - echo " if(TARGET lfs_obj)" >> cmake/FindLuaFileSystem.cmake - echo " return()" >> cmake/FindLuaFileSystem.cmake - echo " endif()" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " message(STATUS \"Setting up LuaFileSystem with Homebrew Luau headers\")" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " add_library(lfs_obj OBJECT \${CMAKE_SOURCE_DIR}/source/lfs.c)" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " # Get Luau include directory from environment or find it" >> cmake/FindLuaFileSystem.cmake - echo " if(DEFINED ENV{LUAU_INCLUDE_DIR})" >> cmake/FindLuaFileSystem.cmake - echo " set(LUAU_INCLUDE_DIR \$ENV{LUAU_INCLUDE_DIR})" >> cmake/FindLuaFileSystem.cmake - echo " else()" >> cmake/FindLuaFileSystem.cmake - echo " # Try to find it using brew" >> cmake/FindLuaFileSystem.cmake - echo " execute_process(" >> cmake/FindLuaFileSystem.cmake - echo " COMMAND brew --prefix luau" >> cmake/FindLuaFileSystem.cmake - echo " OUTPUT_VARIABLE LUAU_PREFIX" >> cmake/FindLuaFileSystem.cmake - echo " OUTPUT_STRIP_TRAILING_WHITESPACE" >> cmake/FindLuaFileSystem.cmake - echo " )" >> cmake/FindLuaFileSystem.cmake - echo " set(LUAU_INCLUDE_DIR \"\${LUAU_PREFIX}/include\")" >> cmake/FindLuaFileSystem.cmake - echo " endif()" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " target_include_directories(lfs_obj PRIVATE" >> cmake/FindLuaFileSystem.cmake - echo " \${LUAU_INCLUDE_DIR}" >> cmake/FindLuaFileSystem.cmake - echo " \${CMAKE_SOURCE_DIR}/source" >> cmake/FindLuaFileSystem.cmake - echo " )" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " # No need for special compile definitions with Homebrew Luau" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " set_target_properties(lfs_obj PROPERTIES" >> cmake/FindLuaFileSystem.cmake - echo " C_STANDARD 99" >> cmake/FindLuaFileSystem.cmake - echo " POSITION_INDEPENDENT_CODE ON" >> cmake/FindLuaFileSystem.cmake - echo " )" >> cmake/FindLuaFileSystem.cmake - echo "" >> cmake/FindLuaFileSystem.cmake - echo " message(STATUS \"Using Homebrew Luau headers from \${LUAU_INCLUDE_DIR}\")" >> cmake/FindLuaFileSystem.cmake - echo "endfunction()" >> cmake/FindLuaFileSystem.cmake - - # Then create FindLua.cmake - echo "# FindLua.cmake - Using Homebrew Luau" > cmake/FindLua.cmake - echo "# This is a minimal finder that points to Homebrew Luau" >> cmake/FindLua.cmake - echo "" >> cmake/FindLua.cmake - echo "# Try to get from environment first" >> cmake/FindLua.cmake - echo "if(DEFINED ENV{LUAU_INCLUDE_DIR} AND DEFINED ENV{LUA_LIBRARIES})" >> cmake/FindLua.cmake - echo " set(LUA_INCLUDE_DIR \$ENV{LUAU_INCLUDE_DIR})" >> cmake/FindLua.cmake - echo " set(LUA_LIBRARIES \$ENV{LUA_LIBRARIES})" >> cmake/FindLua.cmake - echo " set(LUA_FOUND TRUE)" >> cmake/FindLua.cmake - echo "else()" >> cmake/FindLua.cmake - echo " # Try to find it using brew" >> cmake/FindLua.cmake - echo " execute_process(" >> cmake/FindLua.cmake - echo " COMMAND brew --prefix luau" >> cmake/FindLua.cmake - echo " OUTPUT_VARIABLE LUAU_PREFIX" >> cmake/FindLua.cmake - echo " OUTPUT_STRIP_TRAILING_WHITESPACE" >> cmake/FindLua.cmake - echo " )" >> cmake/FindLua.cmake - echo "" >> cmake/FindLua.cmake - echo " if(LUAU_PREFIX)" >> cmake/FindLua.cmake - echo " set(LUA_INCLUDE_DIR \"\${LUAU_PREFIX}/include\")" >> cmake/FindLua.cmake - echo " # First check for liblua.dylib (our symlink)" >> cmake/FindLua.cmake - echo " if(EXISTS \"\${LUAU_PREFIX}/lib/liblua.dylib\")" >> cmake/FindLua.cmake - echo " set(LUA_LIBRARIES \"\${LUAU_PREFIX}/lib/liblua.dylib\")" >> cmake/FindLua.cmake - echo " # Then try libluau.dylib (the original library name)" >> cmake/FindLua.cmake - echo " elseif(EXISTS \"\${LUAU_PREFIX}/lib/libluau.dylib\")" >> cmake/FindLua.cmake - echo " set(LUA_LIBRARIES \"\${LUAU_PREFIX}/lib/libluau.dylib\")" >> cmake/FindLua.cmake - echo " # Finally try any dylib in the lib directory" >> cmake/FindLua.cmake - echo " else()" >> cmake/FindLua.cmake - echo " file(GLOB LUAU_LIBS \"\${LUAU_PREFIX}/lib/*.dylib\")" >> cmake/FindLua.cmake - echo " if(LUAU_LIBS)" >> cmake/FindLua.cmake - echo " list(GET LUAU_LIBS 0 LUA_LIBRARIES)" >> cmake/FindLua.cmake - echo " else()" >> cmake/FindLua.cmake - echo " # Fallback to a default path" >> cmake/FindLua.cmake - echo " set(LUA_LIBRARIES \"\${LUAU_PREFIX}/lib/liblua.dylib\")" >> cmake/FindLua.cmake - echo " message(WARNING \"Could not find Luau library, using default path\")" >> cmake/FindLua.cmake - echo " endif()" >> cmake/FindLua.cmake - echo " endif()" >> cmake/FindLua.cmake - echo "" >> cmake/FindLua.cmake - echo " set(LUA_FOUND TRUE)" >> cmake/FindLua.cmake - echo " endif()" >> cmake/FindLua.cmake - echo "endif()" >> cmake/FindLua.cmake - echo "" >> cmake/FindLua.cmake - echo "message(STATUS \"Using Homebrew Luau headers from \${LUA_INCLUDE_DIR}\")" >> cmake/FindLua.cmake - echo "message(STATUS \"Using Homebrew Luau libraries: \${LUA_LIBRARIES}\")" >> cmake/FindLua.cmake - - echo "Created CMake module files" - - # For debugging - show what we've created - echo "CMake directory contents:" - ls -la cmake/ + # Create required directories + mkdir -p external/dobby/include + mkdir -p external/dobby/lib + mkdir -p output/Resources/AIData + mkdir -p build - # Show Luau version and paths - echo "Luau location in PATH:" - which luau || echo "Luau not found in PATH (this is unexpected)" - echo "Luau include directory: $LUAU_INCLUDE_DIR" - echo "Luau library directory: $LUAU_LIB_DIR" + # Remove any CI_BUILD definitions from source files + echo "Removing CI_BUILD definitions from source files..." + find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i '' 's/#define CI_BUILD//g' 2>/dev/null || true - - name: Install Dobby (Optional) + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Dobby (Required) id: install-dobby - continue-on-error: true run: | - echo "Building Dobby from source..." - # Clone with error handling - git clone --depth=1 https://github.com/jmpews/Dobby.git || { echo "Failed to clone Dobby repo, continuing without it"; exit 0; } + echo "Building Dobby from source (required dependency)..." + git clone --depth=1 https://github.com/jmpews/Dobby.git cd Dobby mkdir -p build && cd build - # Configure for iOS + # Configure and build Dobby cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DDOBBY_BUILD_SHARED_LIBRARY=OFF \ - -DDOBBY_BUILD_STATIC_LIBRARY=ON || { echo "Failed to configure Dobby, continuing without it"; cd $GITHUB_WORKSPACE; exit 0; } + -DDOBBY_BUILD_STATIC_LIBRARY=ON - # Build Dobby - cmake --build . --config Release || { echo "Failed to build Dobby, continuing without it"; cd $GITHUB_WORKSPACE; exit 0; } + cmake --build . --config Release - # Create directory structure for CMake to find Dobby + # Copy Dobby files to expected location mkdir -p $GITHUB_WORKSPACE/external/dobby/lib mkdir -p $GITHUB_WORKSPACE/external/dobby/include - # Copy the library and header files with error handling - if [ -f "libdobby.a" ]; then - cp libdobby.a $GITHUB_WORKSPACE/external/dobby/lib/ - cp -r ../include/* $GITHUB_WORKSPACE/external/dobby/include/ - - # Set env variable for CMake to find Dobby - echo "DOBBY_DIR=$GITHUB_WORKSPACE/external/dobby" >> $GITHUB_ENV - echo "Dobby installation completed successfully" - else - echo "Dobby build didn't produce expected files, continuing without Dobby" - cd $GITHUB_WORKSPACE - fi - - - name: Setup Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable + cp libdobby.a $GITHUB_WORKSPACE/external/dobby/lib/ + cp -r ../include/* $GITHUB_WORKSPACE/external/dobby/include/ + + echo "Dobby successfully built and installed to external/dobby" + cd $GITHUB_WORKSPACE - name: Build Dynamic Library - id: build run: | echo "Building the iOS dynamic library..." - # Create build directory - mkdir -p build - - # Set additional CMake args for dependencies - EXTRA_CMAKE_ARGS="" - - # Add Dobby args if available - if [ -d "$DOBBY_DIR" ]; then - echo "Dobby found at $DOBBY_DIR, enabling Dobby support" - EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DDobby_DIR=$DOBBY_DIR -DUSE_DOBBY=ON" - else - echo "Dobby not found, building without hooking functionality" - EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DNO_DOBBY_HOOKS=ON" - fi - - # We're now using the internal Luau headers instead of external Lua - echo "Using internal Luau headers from source/cpp/luau" - EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DCMAKE_MODULE_PATH=$PWD/cmake -DUSE_BUNDLED_LUA=ON" - - # Apply compiler and linker flags - going back to simpler approach - echo "Setting up compiler and linker flags for LLVM and libomp" - - # Create a direct copy of the library file in the expected location - if [ ! -d "/opt/homebrew/opt/luau/lib" ]; then - echo "Creating /opt/homebrew/opt/luau/lib directory" - mkdir -p $HOME/homebrew_luau/lib - if [ -f "$LUAU_LIBRARY" ]; then - echo "Copying $LUAU_LIBRARY to $HOME/homebrew_luau/lib/liblua.dylib" - cp "$LUAU_LIBRARY" "$HOME/homebrew_luau/lib/liblua.dylib" - echo "HOMEBREW_LUAU_PATH=$HOME/homebrew_luau" >> $GITHUB_ENV - fi - fi - - # We'll use a simpler approach without trying to modify compiler flags - # This should be enough to find the module files without quoting issues - - # Always enable Dobby as requested - echo "Enabling Dobby support as requested by user" - EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DDobby_DIR=$DOBBY_DIR -DUSE_DOBBY=ON" - - # Check if real Dobby library exists for information - if [ -d "$DOBBY_DIR" ] && [ -d "$DOBBY_DIR/lib" ] && [ -f "$DOBBY_DIR/lib/libdobby.a" ]; then - echo "✅ Found real Dobby library at $DOBBY_DIR/lib/libdobby.a" - elif [ -d "$DOBBY_DIR" ] && [ -f "$DOBBY_DIR/libdobby.a" ]; then - echo "✅ Found real Dobby library at $DOBBY_DIR/libdobby.a" - else - echo "⚠️ Real Dobby library not found, will use stub implementation" - # Create directories to make CMake happy - mkdir -p $DOBBY_DIR/include - mkdir -p $DOBBY_DIR/lib - fi - - # Configure CMake for iOS build with standard options - echo "CMake args: $EXTRA_CMAKE_ARGS" - - # Create a direct symlink to fix the exact path CMake is expecting - EXPECTED_LUA_PATH="/opt/homebrew/opt/luau/lib/liblua.dylib" - EXPECTED_LUA_DIR=$(dirname "$EXPECTED_LUA_PATH") - if [ ! -f "$EXPECTED_LUA_PATH" ] && [ -f "$LUAU_LIBRARY" ]; then - echo "Creating directory for expected Lua library path" - sudo mkdir -p "$EXPECTED_LUA_DIR" || mkdir -p "$EXPECTED_LUA_DIR" || true - echo "Attempting to copy $LUAU_LIBRARY to $EXPECTED_LUA_PATH" - sudo cp "$LUAU_LIBRARY" "$EXPECTED_LUA_PATH" || cp "$LUAU_LIBRARY" "$EXPECTED_LUA_PATH" || true - - if [ -f "$EXPECTED_LUA_PATH" ]; then - echo "✅ Successfully created expected Lua library at $EXPECTED_LUA_PATH" - else - echo "❌ Failed to create expected Lua library at $EXPECTED_LUA_PATH" - - # Try a different approach with a mock - echo "Creating mock library file for CMake to find" - echo "file(WRITE \"/opt/homebrew/opt/luau/lib/liblua.dylib\" \"mock\")" > mock_library.cmake - cmake -P mock_library.cmake || true - fi - fi - - set -x # Echo commands + # Configure CMake directly cmake -S . -B build \ -DCMAKE_OSX_ARCHITECTURES="arm64" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \ - -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SYSTEM_NAME=iOS \ -DENABLE_AI_FEATURES=ON \ - -DENABLE_LOCAL_TRAINING=ON \ - -DCMAKE_CXX_FLAGS="-ferror-limit=0 -fcolor-diagnostics -fdiagnostics-show-category=name" \ - ${EXTRA_CMAKE_ARGS} - - # Print config and diagnostics with expanded debugging + -DUSE_DOBBY=ON + + # Show CMake configuration for debugging echo "CMake configuration from cache:" - cat build/CMakeCache.txt | grep -E "AI_FEATURES|LOCAL_TRAINING|DOBBY|NO_DOBBY|LUA|FLAGS|MODULE_PATH" - - # Show key variables for debugging - echo "== CMake Module Path ==" - grep CMAKE_MODULE_PATH build/CMakeCache.txt || echo "CMAKE_MODULE_PATH not found in cache" - - echo "== Lua Variables ==" - grep -E "LUA_|Lua_" build/CMakeCache.txt || echo "No Lua variables found in cache" + cat build/CMakeCache.txt | grep -E "DOBBY|LUA|FLAGS|MODULE_PATH" - echo "== Linker and Compiler Flags ==" - grep -E "LINKER_FLAGS|C_FLAGS|CXX_FLAGS" build/CMakeCache.txt || echo "No flag variables found in cache" - - # List key directories - echo "== Source directory structure ==" - find $GITHUB_WORKSPACE/source/cpp/luau -name "*.h" | head -5 - - echo "== CMake directory ==" - ls -la cmake/ - - # Build the dynamic library with better error handling + # Build the dynamic library echo "Building the dynamic library now..." - cmake --build build --config Release -j4 || { - echo "======== CMAKE BUILD ERROR ANALYSIS ========" - if [ -f "build/CMakeFiles/CMakeError.log" ]; then - echo "CMakeError.log contents:" - cat build/CMakeFiles/CMakeError.log - fi - - echo "======== CMAKE COMPILER TEST LOG ========" - for f in build/CMakeFiles/CMakeTmp/*.log; do - if [ -f "$f" ]; then - echo "Log file: $f" - cat "$f" - fi - done || echo "No compiler test logs found" + cmake --build build --config Release -j4 + + # Check the build result + if [ -f "build/lib/libmylibrary.dylib" ]; then + echo "✅ Successfully built libmylibrary.dylib" + ls -la build/lib/libmylibrary.dylib - echo "======== SOURCE FILE CHECK ========" - echo "Looking for source/lfs.c" - ls -la source/lfs.c || echo "lfs.c not found" + # Copy to output directory + mkdir -p output + cp build/lib/libmylibrary.dylib output/ - echo "Looking for internal Lua headers in source/cpp/luau" - ls -la source/cpp/luau/*lua*.h || echo "Lua headers not found" + # Copy any resources + if [ -d "Resources" ]; then + mkdir -p output/Resources + cp -r Resources/* output/Resources/ 2>/dev/null || true + fi - echo "======== BUILD DIRECTORY STRUCTURE ========" - find build -name "CMakeCache.txt" | xargs dirname | xargs ls -la + # Create config if it doesn't exist + mkdir -p output/Resources/AIData + if [ ! -f "output/Resources/AIData/config.json" ]; then + echo '{"version":"1.0.0","led_effects":true,"ai_features":true,"memory_optimization":true}' > output/Resources/AIData/config.json + fi - echo "Failed to build dynamic library" - exit 1 - } - - # Set the built library path - echo "OUTPUT_LIB_PATH=${PWD}/lib/libmylibrary.dylib" >> $GITHUB_ENV - - - name: Export built library - run: | - echo "Exporting the built library..." - mkdir -p output - - # Enhanced export with better error handling and diagnostic info - echo "===== POST-BUILD FILE LOCATION CHECK =====" - echo "Checking lib directory:" - ls -la lib/ || echo "lib directory not found or empty" - - echo "Checking build directory for library files:" - find build -name "*.dylib" -o -name "*.a" || echo "No libraries found in build directory" - - # Try both paths since the build output might be in different locations - if [ -f "${PWD}/lib/libmylibrary.dylib" ]; then - echo "Found library in lib directory" - cp "${PWD}/lib/libmylibrary.dylib" output/ - elif [ -f "build/libmylibrary.dylib" ]; then - echo "Found library in build root directory" - cp "build/libmylibrary.dylib" output/ + echo "== Built files ==" + ls -la output/ else - # Search for the dylib with more verbose output - echo "Searching for libmylibrary.dylib in entire repository..." - find ${PWD} -name "libmylibrary.dylib" | tee found_libraries.txt - - if [ -s found_libraries.txt ]; then - echo "Found libraries, copying to output" - cat found_libraries.txt | xargs -I{} cp {} output/ - else - echo "WARNING: No libraries found, build may have failed" - echo "Checking for partial build artifacts:" - find ${PWD} -name "*.o" | head -5 || echo "No object files found" - fi + echo "❌ Failed to build libmylibrary.dylib" + echo "== Build directory contents ==" + find build -name "*.dylib" -o -name "*.a" + exit 1 fi - - # Create and copy AI data directories with enhanced logging - echo "Creating AI data directories in output" - mkdir -p output/Resources/AIData - mkdir -p output/Resources/AIData/LocalModels - mkdir -p output/Resources/AIData/Vulnerabilities - - # Create some sample data - echo "{\"version\":\"1.0.0\",\"created\":\"$(date -u '+%Y-%m-%dT%H:%M:%SZ')\"}" > output/Resources/AIData/config.json - - name: Check Build Output + - name: Verify Library run: | - echo "Checking the build output..." + echo "Verifying built dylib..." + if [ -f "output/libmylibrary.dylib" ]; then - echo "✅ libmylibrary.dylib exists." - # Show file info + echo "✅ libmylibrary.dylib exists" + + # Check for exported symbols + echo "Exported symbols:" + nm -g output/libmylibrary.dylib | grep -E "luaopen_|ExecuteScript" || echo "No key symbols found!" + + # Check library type file output/libmylibrary.dylib - # Show architecture info - lipo -info output/libmylibrary.dylib - # Show symbols (filtering for AI-related functions) - nm -g output/libmylibrary.dylib | grep -i "AI" || echo "No AI symbols found" + + # Check library dependencies + otool -L output/libmylibrary.dylib || true else - echo "❌ libmylibrary.dylib does not exist." - echo "Files in output directory:" - ls -la output/ - echo "Build directory contents:" - find build -name "*.dylib" -o -name "*.a" - exit 1 # Exit with error if the library does not exist - fi - - - name: Generate debug symbols - run: | - echo "Generating debug symbols..." - if [ -f "output/libmylibrary.dylib" ]; then - dsymutil output/libmylibrary.dylib -o output/libmylibrary.dSYM - zip -r output/libmylibrary.dSYM.zip output/libmylibrary.dSYM + echo "❌ libmylibrary.dylib not found in output directory" + exit 1 fi - - name: Upload dynamic library - uses: actions/upload-artifact@v4 - with: - name: roblox-executor-ios - path: output/libmylibrary.dylib - if-no-files-found: error - - - name: Upload debug symbols - uses: actions/upload-artifact@v4 - with: - name: debug-symbols - path: output/libmylibrary.dSYM.zip - if-no-files-found: warn - - - name: Upload resources - uses: actions/upload-artifact@v4 + - name: Upload Artifact + uses: actions/upload-artifact@v3 with: - name: resources - path: output/Resources/ - if-no-files-found: warn + name: ios-dylib + path: | + output/libmylibrary.dylib + output/Resources/** diff --git a/CMakeLists.txt b/CMakeLists.txt index 526e399e..a583b3f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,29 +5,222 @@ project(RobloxExecutor VERSION 1.0.0 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# Set iOS specific flags +if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR APPLE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "15.0" CACHE STRING "iOS deployment target" FORCE) + set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "15.0" CACHE STRING "iOS deployment target" FORCE) + set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for iOS" FORCE) +endif() + # Output directories set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +# Create directories for dependencies +file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external) +file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby) +file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby/include) +file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby/lib) + +# Remove CI_BUILD defines from source files +execute_process( + COMMAND find ${CMAKE_SOURCE_DIR}/source -type f -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" | xargs sed -i -e "s/#define CI_BUILD//g" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +) + +# Set CMake module path +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) + +# Download and Build Dobby (Required) if not already present +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/dobby/lib/libdobby.a) + message(STATUS "Downloading and building Dobby (required dependency)...") + + # Clone Dobby repository + execute_process( + COMMAND git clone --depth=1 https://github.com/jmpews/Dobby.git ${CMAKE_BINARY_DIR}/dobby-src + RESULT_VARIABLE DOBBY_CLONE_RESULT + ) + + if(NOT DOBBY_CLONE_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to clone Dobby repository. This dependency is required.") + endif() + + # Build Dobby + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/dobby-src/build) + + execute_process( + COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release -DDOBBY_BUILD_SHARED_LIBRARY=OFF -DDOBBY_BUILD_STATIC_LIBRARY=ON .. + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dobby-src/build + RESULT_VARIABLE DOBBY_CONFIGURE_RESULT + ) + + if(NOT DOBBY_CONFIGURE_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to configure Dobby. This dependency is required.") + endif() + + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config Release + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dobby-src/build + RESULT_VARIABLE DOBBY_BUILD_RESULT + ) + + if(NOT DOBBY_BUILD_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to build Dobby. This dependency is required.") + endif() + + # Copy Dobby headers and library + file(COPY ${CMAKE_BINARY_DIR}/dobby-src/include/ DESTINATION ${CMAKE_SOURCE_DIR}/external/dobby/include) + file(GLOB DOBBY_LIBS ${CMAKE_BINARY_DIR}/dobby-src/build/libdobby.a) + + foreach(LIB_FILE ${DOBBY_LIBS}) + file(COPY ${LIB_FILE} DESTINATION ${CMAKE_SOURCE_DIR}/external/dobby/lib) + endforeach() + + message(STATUS "Dobby successfully built and installed to external/dobby") +else() + message(STATUS "Using existing Dobby installation in external/dobby") +endif() + +# Set Dobby paths explicitly +set(DOBBY_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external/dobby/include) +set(DOBBY_LIBRARY ${CMAKE_SOURCE_DIR}/external/dobby/lib/libdobby.a) + # Include directories include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/source ${CMAKE_SOURCE_DIR}/source/cpp ${CMAKE_SOURCE_DIR}/source/cpp/luau + ${DOBBY_INCLUDE_DIR} ) # Find required packages -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) find_package(Lua QUIET) find_package(LuaFileSystem QUIET) +# Add LuaFileSystem if not found +if(NOT TARGET lfs_obj AND EXISTS ${CMAKE_SOURCE_DIR}/source/lfs.c) + message(STATUS "Using bundled LuaFileSystem implementation") + add_library(lfs_obj OBJECT ${CMAKE_SOURCE_DIR}/source/lfs.c) + target_include_directories(lfs_obj PRIVATE + ${CMAKE_SOURCE_DIR}/source/cpp/luau + ${CMAKE_SOURCE_DIR}/source + ) + target_compile_definitions(lfs_obj PRIVATE LUA_COMPAT_5_1=1) +endif() + +# Dobby wrapper implementation +set(CMAKE_DOBBY_WRAPPER ${CMAKE_SOURCE_DIR}/source/cpp/dobby_wrapper.cpp) +if(NOT EXISTS ${CMAKE_DOBBY_WRAPPER}) + file(WRITE ${CMAKE_DOBBY_WRAPPER} [[ +#include "../hooks/hooks.hpp" +#include +#include +#include +#include +#include "dobby.h" + +// Tracking for hooked functions +namespace { + std::mutex g_hookMutex; + std::unordered_map g_hookedFunctions; +} + +namespace Hooks { + // Implementation of HookEngine using Dobby + bool HookEngine::Initialize() { + std::cout << "Initializing Dobby hook engine..." << std::endl; + return true; + } + + bool HookEngine::RegisterHook(void* targetAddr, void* hookAddr, void** originalAddr) { + std::lock_guard lock(g_hookMutex); + + // Check if already hooked + if (g_hookedFunctions.find(targetAddr) != g_hookedFunctions.end()) { + std::cout << "Function at " << targetAddr << " is already hooked" << std::endl; + if (originalAddr) { + *originalAddr = g_hookedFunctions[targetAddr]; + } + return true; + } + + // Apply the hook using Dobby + int result = DobbyHook(targetAddr, hookAddr, originalAddr); + if (result == 0) { + // Successful hook + std::cout << "Successfully hooked function at " << targetAddr << std::endl; + + // Store the original function pointer for reference + if (originalAddr) { + g_hookedFunctions[targetAddr] = *originalAddr; + } + return true; + } else { + std::cerr << "Failed to hook function at " << targetAddr << ", error code: " << result << std::endl; + return false; + } + } + + bool HookEngine::UnregisterHook(void* targetAddr) { + std::lock_guard lock(g_hookMutex); + + // Check if the function is hooked + if (g_hookedFunctions.find(targetAddr) == g_hookedFunctions.end()) { + std::cout << "Function at " << targetAddr << " is not hooked" << std::endl; + return false; + } + + // Unhook using Dobby + int result = DobbyUnHook(targetAddr); + if (result == 0) { + // Successful unhook + std::cout << "Successfully unhooked function at " << targetAddr << std::endl; + g_hookedFunctions.erase(targetAddr); + return true; + } else { + std::cerr << "Failed to unhook function at " << targetAddr << ", error code: " << result << std::endl; + return false; + } + } + + void HookEngine::ClearAllHooks() { + std::lock_guard lock(g_hookMutex); + + std::cout << "Clearing all hooks..." << std::endl; + + // Unhook all functions + for (const auto& pair : g_hookedFunctions) { + DobbyUnHook(pair.first); + } + + // Clear the map + g_hookedFunctions.clear(); + + std::cout << "All hooks cleared" << std::endl; + } + + namespace Implementation { + // Direct implementation for hooks + bool HookFunction(void* target, void* replacement, void** original) { + return HookEngine::RegisterHook(target, replacement, original); + } + + bool UnhookFunction(void* target) { + return HookEngine::UnregisterHook(target); + } + } +} +]]) +endif() + # Define source files by component # Core files set(CORE_SOURCES source/library.cpp source/lfs.c + ${CMAKE_DOBBY_WRAPPER} ) # Memory management @@ -103,17 +296,21 @@ set(SOURCES # Create the dynamic library add_library(roblox_executor SHARED ${SOURCES}) -# Set library properties +# Set library properties for iOS set_target_properties(roblox_executor PROPERTIES - OUTPUT_NAME "libmylibrary" - PREFIX "" + OUTPUT_NAME "mylibrary" + PREFIX "lib" + SUFFIX ".dylib" ) -# Define preprocessor macros +# Define preprocessor macros - always enable features, no stubs target_compile_definitions(roblox_executor PRIVATE ENABLE_AI_FEATURES=1 ENABLE_LED_EFFECTS=1 ENABLE_ANTI_DETECTION=1 + USE_DOBBY=1 # Always use Dobby now + $<$:IOS_TARGET> + $<$:__APPLE__> ) # Set include directories for the target @@ -127,6 +324,7 @@ target_include_directories(roblox_executor PRIVATE ${CMAKE_SOURCE_DIR}/source/cpp/ios/ai_features ${CMAKE_SOURCE_DIR}/source/cpp/ios/advanced_bypass ${CMAKE_SOURCE_DIR}/source/cpp/anti_detection + ${DOBBY_INCLUDE_DIR} ) # Add LuaFileSystem @@ -134,29 +332,26 @@ if(TARGET lfs_obj) target_sources(roblox_executor PRIVATE $) endif() -# Find Dobby for hooking -find_package(Dobby QUIET) -if(Dobby_FOUND) - target_link_libraries(roblox_executor PRIVATE Dobby::dobby) - target_compile_definitions(roblox_executor PRIVATE USE_DOBBY=1) - message(STATUS "Using Dobby for function hooking") -else() - message(STATUS "Dobby not found, building without hooking functionality") - target_compile_definitions(roblox_executor PRIVATE NO_DOBBY_HOOKS=1) -endif() +# Link against Dobby - now required +target_link_libraries(roblox_executor PRIVATE ${DOBBY_LIBRARY}) +message(STATUS "Using Dobby for function hooking (required): ${DOBBY_LIBRARY}") # Link against system frameworks for iOS if(APPLE) - find_library(UIKIT UIKit) - find_library(FOUNDATION Foundation) - find_library(WEBKIT WebKit) - find_library(COREGRAPHICS CoreGraphics) + find_library(UIKIT UIKit REQUIRED) + find_library(FOUNDATION Foundation REQUIRED) + find_library(WEBKIT WebKit REQUIRED) + find_library(COREGRAPHICS CoreGraphics REQUIRED) + find_library(SECURITY Security) + find_library(SYSTEMCONFIGURATION SystemConfiguration) target_link_libraries(roblox_executor PRIVATE ${UIKIT} ${FOUNDATION} ${WEBKIT} ${COREGRAPHICS} + ${SECURITY} + ${SYSTEMCONFIGURATION} ) endif() @@ -178,4 +373,12 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/output/Resources/AIData/config.json) file(WRITE ${CMAKE_SOURCE_DIR}/output/Resources/AIData/config.json "{\"version\":\"1.0.0\",\"led_effects\":true,\"ai_features\":true,\"memory_optimization\":true}") endif() -message(STATUS "Building iOS Roblox Executor with enhanced features") +# Copy Resources to output directory +if(EXISTS ${CMAKE_SOURCE_DIR}/Resources) + add_custom_command(TARGET roblox_executor POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Resources ${CMAKE_SOURCE_DIR}/output/Resources + COMMENT "Copying Resources to output directory" + ) +endif() + +message(STATUS "Building iOS Roblox Executor with real implementations (no stubs)") diff --git a/build_dylib.sh b/build_dylib.sh new file mode 100755 index 00000000..b0ca403c --- /dev/null +++ b/build_dylib.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Build script for Roblox Executor dylib with real implementations + +# Ensure we have the necessary directories +mkdir -p build output/Resources/AIData output/Resources/Models +mkdir -p external/dobby/include external/dobby/lib + +# Clone Dobby if not present +if [ ! -d "external/dobby/dobby_source" ]; then + echo "Downloading Dobby..." + git clone --depth=1 https://github.com/jmpews/Dobby.git external/dobby/dobby_source + + # Build Dobby + echo "Building Dobby..." + cd external/dobby/dobby_source + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DDOBBY_BUILD_SHARED_LIBRARY=OFF + make -j4 + + # Copy the results + cp libdobby.a ../../lib/ + cp -r ../include/* ../../include/ + cd ../../../../ +fi + +# Configure and build our project +echo "Configuring project..." +cmake -S . -B build \ + -DCMAKE_OSX_ARCHITECTURES="arm64" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \ + -DCMAKE_BUILD_TYPE=Release + +echo "Building dylib..." +cmake --build build --config Release + +# Copy the output +cp build/lib/libmylibrary.dylib output/ 2>/dev/null || echo "Build didn't complete successfully" + +echo "Build process completed." diff --git a/build_ios_dylib.sh b/build_ios_dylib.sh new file mode 100755 index 00000000..e36f4da5 --- /dev/null +++ b/build_ios_dylib.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# Build script for the Roblox Executor iOS Dynamic Library +# This script automatically downloads and builds Dobby if needed, +# then builds the executor dylib with real implementations. + +# Stop on any error +set -e + +# Define colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +echo -e "${BLUE}=====================================================${NC}" +echo -e "${BLUE} Roblox Executor iOS Dynamic Library Builder ${NC}" +echo -e "${BLUE}=====================================================${NC}" + +# Create necessary directories +mkdir -p build external/dobby/include external/dobby/lib output/Resources/AIData + +# Remove any CI_BUILD definitions from source files +echo -e "${YELLOW}Removing CI_BUILD definitions from source files...${NC}" +find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i -e "s/#define CI_BUILD//g" 2>/dev/null || true + +# Check if Dobby is already built +if [ ! -f "external/dobby/lib/libdobby.a" ]; then + echo -e "${YELLOW}Dobby not found, downloading and building...${NC}" + + # Clone Dobby repository + mkdir -p build/dobby-src + git clone --depth=1 https://github.com/jmpews/Dobby.git build/dobby-src || { + echo -e "${RED}Failed to clone Dobby repository${NC}" + exit 1 + } + + # Build Dobby + cd build/dobby-src + mkdir -p build + cd build + + echo -e "${YELLOW}Configuring Dobby...${NC}" + cmake .. -DCMAKE_BUILD_TYPE=Release -DDOBBY_BUILD_SHARED_LIBRARY=OFF -DDOBBY_BUILD_STATIC_LIBRARY=ON || { + echo -e "${RED}Failed to configure Dobby${NC}" + cd ../../../ + exit 1 + } + + echo -e "${YELLOW}Building Dobby...${NC}" + cmake --build . --config Release || { + echo -e "${RED}Failed to build Dobby${NC}" + cd ../../../ + exit 1 + } + + # Copy the Dobby files + echo -e "${YELLOW}Installing Dobby...${NC}" + cp -r ../include/* ../../../external/dobby/include/ + cp libdobby.a ../../../external/dobby/lib/ + + cd ../../../ + echo -e "${GREEN}Dobby successfully built and installed${NC}" +else + echo -e "${GREEN}Found existing Dobby installation${NC}" +fi + +# Create a basic AIData config if it doesn't exist +if [ ! -f "output/Resources/AIData/config.json" ]; then + echo -e "${YELLOW}Creating default config.json...${NC}" + echo '{ + "version": "1.0.0", + "led_effects": true, + "ai_features": true, + "memory_optimization": true + }' > output/Resources/AIData/config.json +fi + +# Configure and build the project +echo -e "${YELLOW}Configuring project...${NC}" +cmake -S . -B build \ + -DCMAKE_OSX_ARCHITECTURES="arm64" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \ + -DCMAKE_BUILD_TYPE=Release || { + echo -e "${RED}Failed to configure the project${NC}" + exit 1 +} + +echo -e "${YELLOW}Building project...${NC}" +cmake --build build --config Release -j4 || { + echo -e "${RED}Failed to build the project${NC}" + exit 1 +} + +# Copy output files +echo -e "${YELLOW}Copying output files...${NC}" +mkdir -p output + +# Copy the dylib to the output directory +if [ -f "build/lib/libmylibrary.dylib" ]; then + cp build/lib/libmylibrary.dylib output/ + echo -e "${GREEN}Successfully built and copied libmylibrary.dylib to output directory${NC}" +else + echo -e "${RED}Failed to find the built library${NC}" + exit 1 +fi + +# Copy Resources if they exist +if [ -d "Resources" ]; then + cp -r Resources/* output/Resources/ +fi + +echo -e "${GREEN}=====================================================${NC}" +echo -e "${GREEN} Build completed successfully! ${NC}" +echo -e "${GREEN}=====================================================${NC}" +echo -e "The dynamic library is available at: ${BLUE}output/libmylibrary.dylib${NC}" +echo -e "You can now use this library with your iOS application." diff --git a/cmake/FindDobby.cmake b/cmake/FindDobby.cmake new file mode 100644 index 00000000..032a5e51 --- /dev/null +++ b/cmake/FindDobby.cmake @@ -0,0 +1,122 @@ +# FindDobby.cmake for iOS Roblox Executor +# This module finds the Dobby library or builds it if not found +# The following variables will be defined: +# Dobby_FOUND - True if Dobby was found +# DOBBY_INCLUDE_DIR - The Dobby include directory +# DOBBY_LIBRARY - The Dobby library + +# Try to find dobby in standard locations +find_path(DOBBY_INCLUDE_DIR + NAMES dobby.h + PATHS + ${CMAKE_SOURCE_DIR}/external/dobby/include + ${CMAKE_SOURCE_DIR}/external/include + ${CMAKE_SOURCE_DIR}/dobby/include + /usr/local/include/dobby + /usr/local/include + /usr/include/dobby + /usr/include + /opt/homebrew/include/dobby + /opt/homebrew/include + DOC "Dobby include directory" +) + +find_library(DOBBY_LIBRARY + NAMES dobby libdobby + PATHS + ${CMAKE_SOURCE_DIR}/external/dobby/lib + ${CMAKE_SOURCE_DIR}/external/lib + ${CMAKE_SOURCE_DIR}/dobby/lib + ${CMAKE_SOURCE_DIR}/lib + /usr/local/lib + /usr/lib + /opt/homebrew/lib + DOC "Dobby library" +) + +# If Dobby wasn't found, we'll build it from source (no stubs) +if(NOT DOBBY_INCLUDE_DIR OR NOT DOBBY_LIBRARY) + message(STATUS "Dobby not found, building from source...") + + # Ensure the external directory exists + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/dobby) + file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby) + endif() + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/dobby/include) + file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby/include) + endif() + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/external/dobby/lib) + file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/external/dobby/lib) + endif() + + # Clone and build Dobby from the repository + include(ExternalProject) + + set(DOBBY_BUILD_DIR ${CMAKE_BINARY_DIR}/dobby-build) + + # Configure the external project + ExternalProject_Add( + dobby_external + GIT_REPOSITORY https://github.com/jmpews/Dobby.git + GIT_TAG master + PREFIX ${DOBBY_BUILD_DIR} + CMAKE_ARGS + -DCMAKE_BUILD_TYPE=Release + -DDOBBY_BUILD_SHARED_LIBRARY=OFF + -DDOBBY_BUILD_STATIC_LIBRARY=ON + -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/external/dobby + BUILD_ALWAYS ON + # Custom command to copy the built library and headers + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory + /include + ${CMAKE_SOURCE_DIR}/external/dobby/include + COMMAND ${CMAKE_COMMAND} -E copy + /libdobby.a + ${CMAKE_SOURCE_DIR}/external/dobby/lib/libdobby.a + ) + + # Set locations after build + set(DOBBY_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external/dobby/include) + set(DOBBY_LIBRARY ${CMAKE_SOURCE_DIR}/external/dobby/lib/libdobby.a) + + # Make directory for include files + file(MAKE_DIRECTORY ${DOBBY_INCLUDE_DIR}) + + # Set found flag after build + set(Dobby_FOUND TRUE) + + # Create imported target for Dobby + add_library(dobby_imported STATIC IMPORTED GLOBAL) + add_dependencies(dobby_imported dobby_external) + set_target_properties(dobby_imported PROPERTIES + IMPORTED_LOCATION ${DOBBY_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${DOBBY_INCLUDE_DIR} + ) + + # Create an alias for the imported target + add_library(Dobby::dobby ALIAS dobby_imported) + + message(STATUS "Dobby will be built from source at: ${DOBBY_BUILD_DIR}") + message(STATUS "Dobby headers will be installed to: ${DOBBY_INCLUDE_DIR}") + message(STATUS "Dobby library will be installed to: ${DOBBY_LIBRARY}") +else() + # If Dobby was found, set the found flag + set(Dobby_FOUND TRUE) + message(STATUS "Found existing Dobby installation") + message(STATUS "Dobby include directory: ${DOBBY_INCLUDE_DIR}") + message(STATUS "Dobby library: ${DOBBY_LIBRARY}") + + # Create imported target for existing Dobby + if(NOT TARGET Dobby::dobby) + add_library(Dobby::dobby UNKNOWN IMPORTED GLOBAL) + set_target_properties(Dobby::dobby PROPERTIES + IMPORTED_LOCATION "${DOBBY_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${DOBBY_INCLUDE_DIR}" + ) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Dobby DEFAULT_MSG DOBBY_INCLUDE_DIR DOBBY_LIBRARY) + +mark_as_advanced(DOBBY_INCLUDE_DIR DOBBY_LIBRARY) diff --git a/external/dobby/include/dobby.h b/external/dobby/include/dobby.h new file mode 100644 index 00000000..ca325cd2 --- /dev/null +++ b/external/dobby/include/dobby.h @@ -0,0 +1,38 @@ +#pragma once +/** + * Dobby - A lightweight, multi-platform function hook framework + * Implementation sourced from the full Dobby library + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Hook a function at the given address with a replacement function + * + * @param function_address Address of the function to hook + * @param replace_function Address of the replacement function + * @param origin_function Pointer to store the original function address + * @return int 0 on success, non-zero on failure + */ +int DobbyHook(void *function_address, void *replace_function, void **origin_function); + +/** + * @brief Unhook a previously hooked function + * + * @param function_address Address of the function to unhook + * @return int 0 on success, non-zero on failure + */ +int DobbyUnHook(void *function_address); + +/** + * @brief Initialize the Dobby hooking engine + * + * @return int 0 on success, non-zero on failure + */ +int DobbyInit(); + +#ifdef __cplusplus +} +#endif diff --git a/fix_ci_build.sh b/fix_ci_build.sh new file mode 100755 index 00000000..4fb92a90 --- /dev/null +++ b/fix_ci_build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Find all files with #define CI_BUILD +grep -l -r "#define CI_BUILD" --include="*.h" --include="*.hpp" source/ | while read file; do + echo "Fixing $file..." + # Use sed to remove the #define CI_BUILD line (macOS and Linux compatible) + sed -i.bak 's/#define CI_BUILD//g' "$file" + # Remove backup files + rm -f "$file.bak" +done diff --git a/ios_integration_guide.sh b/ios_integration_guide.sh new file mode 100755 index 00000000..e755340a --- /dev/null +++ b/ios_integration_guide.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# iOS Integration Guide for Roblox Executor dylib +# This script explains how to integrate the dylib with your iOS app + +# Create colorful output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +echo -e "${BLUE}=====================================================${NC}" +echo -e "${BLUE} Roblox Executor iOS Integration Guide ${NC}" +echo -e "${BLUE}=====================================================${NC}" +echo "" + +echo -e "${GREEN}Step 1: Build the Executor dylib${NC}" +echo "First, build the executor dylib using the build script:" +echo -e " ${YELLOW}./build_ios_dylib.sh${NC}" +echo "This will create libmylibrary.dylib in the output directory." +echo "" + +echo -e "${GREEN}Step 2: Create or open your iOS project in Xcode${NC}" +echo "1. Open your iOS application project in Xcode" +echo "2. Select your project in the Navigator panel" +echo "3. Select your app target" +echo "" + +echo -e "${GREEN}Step 3: Add the dylib to your Xcode project${NC}" +echo "1. Drag libmylibrary.dylib from Finder into your Xcode project" +echo "2. When prompted, check 'Copy items if needed'" +echo "3. Make sure your app target is selected" +echo "4. Go to 'Build Phases' tab" +echo "5. Expand 'Link Binary with Libraries'" +echo "6. Verify libmylibrary.dylib is listed (add it if not)" +echo "7. Add a new 'Copy Files' phase if you don't have one:" +echo " - Click '+' -> 'New Copy Files Phase'" +echo " - Set Destination to 'Frameworks'" +echo " - Add libmylibrary.dylib to this phase" +echo "" + +echo -e "${GREEN}Step 4: Update Entitlements and Info.plist${NC}" +echo "1. Go to the 'Signing & Capabilities' tab" +echo "2. Add the following entitlements:" +echo " - App Sandbox (uncheck all)" +echo " - Disable Library Validation" +echo "" +echo "3. Open your Info.plist and add:" +echo -e " ${YELLOW}NSAppleMusicUsageDescription${NC}" +echo -e " ${YELLOW}Required for loading scripts${NC}" +echo "" + +echo -e "${GREEN}Step 5: Load the dylib in your code${NC}" +echo "Add the following code to your app to load the dylib:" +echo -e "${YELLOW}// Objective-C${NC}" +echo -e "${YELLOW}#import ${NC}" +echo -e "${YELLOW}NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@\"Frameworks/libmylibrary.dylib\"];${NC}" +echo -e "${YELLOW}void *handle = dlopen([path UTF8String], RTLD_NOW);${NC}" +echo -e "${YELLOW}if (handle == NULL) {${NC}" +echo -e "${YELLOW} NSLog(@\"Failed to load library: %s\", dlerror());${NC}" +echo -e "${YELLOW}} else {${NC}" +echo -e "${YELLOW} NSLog(@\"Library loaded successfully\");${NC}" +echo -e "${YELLOW} // Get function pointers${NC}" +echo -e "${YELLOW} bool (*ExecuteScript)(const char*) = dlsym(handle, \"ExecuteScript\");${NC}" +echo -e "${YELLOW} if (ExecuteScript) {${NC}" +echo -e "${YELLOW} ExecuteScript(\"print('Hello from Roblox Executor!')\");${NC}" +echo -e "${YELLOW} }${NC}" +echo -e "${YELLOW}}${NC}" +echo "" +echo -e "${YELLOW}// Swift${NC}" +echo -e "${YELLOW}import Foundation${NC}" +echo -e "${YELLOW}func loadExecutor() {${NC}" +echo -e "${YELLOW} let bundlePath = Bundle.main.bundlePath${NC}" +echo -e "${YELLOW} let path = bundlePath + \"/Frameworks/libmylibrary.dylib\"${NC}" +echo -e "${YELLOW} let handle = dlopen(path, RTLD_NOW)${NC}" +echo -e "${YELLOW} if handle == nil {${NC}" +echo -e "${YELLOW} print(\"Failed to load library: \(String(cString: dlerror()))\")${NC}" +echo -e "${YELLOW} } else {${NC}" +echo -e "${YELLOW} print(\"Library loaded successfully\")${NC}" +echo -e "${YELLOW} // Get function pointers${NC}" +echo -e "${YELLOW} let ExecuteScript = unsafeBitCast(dlsym(handle, \"ExecuteScript\"), to: (@convention(c) (UnsafePointer) -> Bool).self)${NC}" +echo -e "${YELLOW} ExecuteScript(\"print('Hello from Roblox Executor!')\"})${NC}" +echo -e "${YELLOW} }${NC}" +echo -e "${YELLOW}}${NC}" +echo "" + +echo -e "${GREEN}Step 6: Troubleshooting${NC}" +echo "Common issues and solutions:" +echo "" +echo "1. Library not loading (dlopen error):" +echo " - Check that the dylib is correctly copied to the app bundle" +echo " - Verify code signing and entitlements" +echo " - Check console logs for detailed error messages" +echo "" +echo "2. Symbols not found when calling functions:" +echo " - Make sure you're using the correct function names" +echo " - Try using nm tool to verify exported symbols: nm -g libmylibrary.dylib" +echo "" +echo "3. App crashing when using the library:" +echo " - Check that all required frameworks are linked" +echo " - Ensure you have the latest version of the dylib" +echo " - Look for compatibility issues with iOS version" +echo "" +echo "4. App rejected by App Store:" +echo " - This library is for development/research purposes only" +echo " - Consider using it only in debug builds or Ad-Hoc distribution" +echo "" + +echo -e "${BLUE}=====================================================${NC}" +echo -e "${GREEN}That's it! Your iOS app should now be able to use the Roblox Executor functionality.${NC}" +echo -e "${BLUE}=====================================================${NC}" diff --git a/new_build_workflow.yml b/new_build_workflow.yml new file mode 100644 index 00000000..396527a2 --- /dev/null +++ b/new_build_workflow.yml @@ -0,0 +1,145 @@ +name: Build Roblox Executor iOS Dynamic Library + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest # Use macOS for iOS compatible builds + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install dependencies + run: | + echo "Installing dependencies..." + # Install essential build tools + brew install cmake pkg-config + + # Create required directories + mkdir -p external/dobby/include + mkdir -p external/dobby/lib + mkdir -p output/Resources/AIData + mkdir -p build + + # Remove any CI_BUILD definitions from source files + echo "Removing CI_BUILD definitions from source files..." + find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i '' 's/#define CI_BUILD//g' 2>/dev/null || true + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Dobby (Required) + id: install-dobby + run: | + echo "Building Dobby from source (required dependency)..." + git clone --depth=1 https://github.com/jmpews/Dobby.git + cd Dobby + mkdir -p build && cd build + + # Configure and build Dobby + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DDOBBY_BUILD_SHARED_LIBRARY=OFF \ + -DDOBBY_BUILD_STATIC_LIBRARY=ON + + cmake --build . --config Release + + # Copy Dobby files to expected location + mkdir -p $GITHUB_WORKSPACE/external/dobby/lib + mkdir -p $GITHUB_WORKSPACE/external/dobby/include + + cp libdobby.a $GITHUB_WORKSPACE/external/dobby/lib/ + cp -r ../include/* $GITHUB_WORKSPACE/external/dobby/include/ + + echo "Dobby successfully built and installed to external/dobby" + cd $GITHUB_WORKSPACE + + - name: Build Dynamic Library + run: | + echo "Building the iOS dynamic library..." + + # Configure CMake directly + cmake -S . -B build \ + -DCMAKE_OSX_ARCHITECTURES="arm64" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SYSTEM_NAME=iOS \ + -DENABLE_AI_FEATURES=ON \ + -DUSE_DOBBY=ON + + # Show CMake configuration for debugging + echo "CMake configuration from cache:" + cat build/CMakeCache.txt | grep -E "DOBBY|LUA|FLAGS|MODULE_PATH" + + # Build the dynamic library + echo "Building the dynamic library now..." + cmake --build build --config Release -j4 + + # Check the build result + if [ -f "build/lib/libmylibrary.dylib" ]; then + echo "✅ Successfully built libmylibrary.dylib" + ls -la build/lib/libmylibrary.dylib + + # Copy to output directory + mkdir -p output + cp build/lib/libmylibrary.dylib output/ + + # Copy any resources + if [ -d "Resources" ]; then + mkdir -p output/Resources + cp -r Resources/* output/Resources/ 2>/dev/null || true + fi + + # Create config if it doesn't exist + mkdir -p output/Resources/AIData + if [ ! -f "output/Resources/AIData/config.json" ]; then + echo '{"version":"1.0.0","led_effects":true,"ai_features":true,"memory_optimization":true}' > output/Resources/AIData/config.json + fi + + echo "== Built files ==" + ls -la output/ + else + echo "❌ Failed to build libmylibrary.dylib" + echo "== Build directory contents ==" + find build -name "*.dylib" -o -name "*.a" + exit 1 + fi + + - name: Verify Library + run: | + echo "Verifying built dylib..." + + if [ -f "output/libmylibrary.dylib" ]; then + echo "✅ libmylibrary.dylib exists" + + # Check for exported symbols + echo "Exported symbols:" + nm -g output/libmylibrary.dylib | grep -E "luaopen_|ExecuteScript" || echo "No key symbols found!" + + # Check library type + file output/libmylibrary.dylib + + # Check library dependencies + otool -L output/libmylibrary.dylib || true + else + echo "❌ libmylibrary.dylib not found in output directory" + exit 1 + fi + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ios-dylib + path: | + output/libmylibrary.dylib + output/Resources/** diff --git a/remove_ci_build.sh b/remove_ci_build.sh new file mode 100755 index 00000000..6b183bb8 --- /dev/null +++ b/remove_ci_build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Script to remove standalone CI_BUILD definitions from header files +# This ensures CI_BUILD is only defined in CMakeLists.txt + +# Find all .h, .hpp files that define CI_BUILD without checking +find source -name "*.h" -o -name "*.hpp" | xargs grep -l " +^ +#define CI_BUILD" | while read file; do + echo "Removing standalone CI_BUILD from $file" + # Use sed to remove the #define CI_BUILD line that appears at the beginning of a line + sed -i 's/ +^ +#define CI_BUILD//g' "$file" +done diff --git a/remove_stubs.sh b/remove_stubs.sh new file mode 100755 index 00000000..9cacd28b --- /dev/null +++ b/remove_stubs.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Script to remove CI_BUILD definitions and replace stub implementations +# with real code + +echo "Removing CI_BUILD defines and stub implementations..." + +# Remove CI_BUILD definitions from all source files +find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i 's/#define CI_BUILD//g' + +# Create real implementation directories if they don't exist +mkdir -p external/dobby/include +mkdir -p external/dobby/lib + +echo "Done removing CI_BUILD definitions." diff --git a/source/cpp/dobby_wrapper.cpp b/source/cpp/dobby_wrapper.cpp new file mode 100644 index 00000000..954a84b8 --- /dev/null +++ b/source/cpp/dobby_wrapper.cpp @@ -0,0 +1,104 @@ +// Real implementation of Dobby hook functionality +#include "../hooks/hooks.hpp" +#include +#include +#include +#include + +// Include Dobby API +#include "dobby.h" + +// Track hooked functions +namespace { + std::mutex g_hookMutex; + std::unordered_map g_hookedFunctions; +} + +namespace Hooks { + + // Implementation of HookEngine using Dobby + bool HookEngine::Initialize() { + std::cout << "Initializing Dobby hook engine..." << std::endl; + + // Dobby doesn't need explicit initialization + return true; + } + + bool HookEngine::RegisterHook(void* targetAddr, void* hookAddr, void** originalAddr) { + std::lock_guard lock(g_hookMutex); + + // Check if already hooked + if (g_hookedFunctions.find(targetAddr) != g_hookedFunctions.end()) { + std::cout << "Function at " << targetAddr << " is already hooked" << std::endl; + if (originalAddr) { + *originalAddr = g_hookedFunctions[targetAddr]; + } + return true; + } + + // Apply the hook using Dobby + int result = DobbyHook(targetAddr, hookAddr, originalAddr); + if (result == 0) { + // Successful hook + std::cout << "Successfully hooked function at " << targetAddr << std::endl; + + // Store the original function pointer + if (originalAddr) { + g_hookedFunctions[targetAddr] = *originalAddr; + } + return true; + } else { + std::cerr << "Failed to hook function at " << targetAddr << ", error code: " << result << std::endl; + return false; + } + } + + bool HookEngine::UnregisterHook(void* targetAddr) { + std::lock_guard lock(g_hookMutex); + + // Check if the function is hooked + if (g_hookedFunctions.find(targetAddr) == g_hookedFunctions.end()) { + std::cout << "Function at " << targetAddr << " is not hooked" << std::endl; + return false; + } + + // Unhook using Dobby + int result = DobbyUnHook(targetAddr); + if (result == 0) { + // Successful unhook + std::cout << "Successfully unhooked function at " << targetAddr << std::endl; + g_hookedFunctions.erase(targetAddr); + return true; + } else { + std::cerr << "Failed to unhook function at " << targetAddr << ", error code: " << result << std::endl; + return false; + } + } + + void HookEngine::ClearAllHooks() { + std::lock_guard lock(g_hookMutex); + + std::cout << "Clearing all hooks..." << std::endl; + + // Unhook all functions + for (const auto& pair : g_hookedFunctions) { + DobbyUnHook(pair.first); + } + + // Clear the map + g_hookedFunctions.clear(); + + std::cout << "All hooks cleared" << std::endl; + } + + namespace Implementation { + // Direct implementation for hooks + bool HookFunction(void* target, void* replacement, void** original) { + return HookEngine::RegisterHook(target, replacement, original); + } + + bool UnhookFunction(void* target) { + return HookEngine::UnregisterHook(target); + } + } +} diff --git a/source/cpp/hooks/hooks.hpp b/source/cpp/hooks/hooks.hpp index d891dc04..9eaa7a94 100644 --- a/source/cpp/hooks/hooks.hpp +++ b/source/cpp/hooks/hooks.hpp @@ -1,7 +1,7 @@ #pragma once // Define CI_BUILD for CI environments -#define CI_BUILD + #include #include diff --git a/source/cpp/ios/ExecutionEngine.h b/source/cpp/ios/ExecutionEngine.h index 2fc40cc4..4a9c30c2 100644 --- a/source/cpp/ios/ExecutionEngine.h +++ b/source/cpp/ios/ExecutionEngine.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ExecutionEngine.mm b/source/cpp/ios/ExecutionEngine.mm index c76cb2e1..855c6a32 100644 --- a/source/cpp/ios/ExecutionEngine.mm +++ b/source/cpp/ios/ExecutionEngine.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "ExecutionEngine.h" #include diff --git a/source/cpp/ios/FileSystem.h b/source/cpp/ios/FileSystem.h index 2e23febf..75f83c43 100644 --- a/source/cpp/ios/FileSystem.h +++ b/source/cpp/ios/FileSystem.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/FileSystem.mm b/source/cpp/ios/FileSystem.mm index 19ffca19..72045e07 100644 --- a/source/cpp/ios/FileSystem.mm +++ b/source/cpp/ios/FileSystem.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "FileSystem.h" #include diff --git a/source/cpp/ios/FloatingButtonController.h b/source/cpp/ios/FloatingButtonController.h index 1fba8199..84e90b58 100644 --- a/source/cpp/ios/FloatingButtonController.h +++ b/source/cpp/ios/FloatingButtonController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/FloatingButtonController.mm b/source/cpp/ios/FloatingButtonController.mm index 2049a285..3dc2dd17 100644 --- a/source/cpp/ios/FloatingButtonController.mm +++ b/source/cpp/ios/FloatingButtonController.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "FloatingButtonController.h" #include diff --git a/source/cpp/ios/GameDetector.h b/source/cpp/ios/GameDetector.h index 7bb0db1b..1cab6cf9 100644 --- a/source/cpp/ios/GameDetector.h +++ b/source/cpp/ios/GameDetector.h @@ -1,7 +1,7 @@ #include "../ios_compat.h" #pragma once -#define CI_BUILD + #include #include diff --git a/source/cpp/ios/GameDetector.mm b/source/cpp/ios/GameDetector.mm index 94f09aae..1aef667a 100644 --- a/source/cpp/ios/GameDetector.mm +++ b/source/cpp/ios/GameDetector.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "GameDetector.h" #include "MemoryAccess.h" diff --git a/source/cpp/ios/GameDetector_CI.cpp b/source/cpp/ios/GameDetector_CI.cpp index 42ff503d..60297383 100644 --- a/source/cpp/ios/GameDetector_CI.cpp +++ b/source/cpp/ios/GameDetector_CI.cpp @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "GameDetector.h" #include diff --git a/source/cpp/ios/JailbreakBypass.h b/source/cpp/ios/JailbreakBypass.h index 412c0d05..7544e126 100644 --- a/source/cpp/ios/JailbreakBypass.h +++ b/source/cpp/ios/JailbreakBypass.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/JailbreakBypass.mm b/source/cpp/ios/JailbreakBypass.mm index 9b2cc5ed..68da7560 100644 --- a/source/cpp/ios/JailbreakBypass.mm +++ b/source/cpp/ios/JailbreakBypass.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "JailbreakBypass.h" #include diff --git a/source/cpp/ios/MemoryAccess.h b/source/cpp/ios/MemoryAccess.h index c0e6179f..6ea61c72 100644 --- a/source/cpp/ios/MemoryAccess.h +++ b/source/cpp/ios/MemoryAccess.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/MemoryAccess.mm b/source/cpp/ios/MemoryAccess.mm index a80cd021..cfa76fc4 100644 --- a/source/cpp/ios/MemoryAccess.mm +++ b/source/cpp/ios/MemoryAccess.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "MemoryAccess.h" #include diff --git a/source/cpp/ios/MethodSwizzling.h b/source/cpp/ios/MethodSwizzling.h index 2cc2567a..76bf7dc1 100644 --- a/source/cpp/ios/MethodSwizzling.h +++ b/source/cpp/ios/MethodSwizzling.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" // // MethodSwizzling.h diff --git a/source/cpp/ios/PatternScanner.mm b/source/cpp/ios/PatternScanner.mm index f1229aa0..51ed4d9e 100644 --- a/source/cpp/ios/PatternScanner.mm +++ b/source/cpp/ios/PatternScanner.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "PatternScanner.h" #include diff --git a/source/cpp/ios/ScriptManager.h b/source/cpp/ios/ScriptManager.h index 6eb5e0c4..cf553f8e 100644 --- a/source/cpp/ios/ScriptManager.h +++ b/source/cpp/ios/ScriptManager.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ScriptManager.mm b/source/cpp/ios/ScriptManager.mm index b4bc1c28..c6131550 100644 --- a/source/cpp/ios/ScriptManager.mm +++ b/source/cpp/ios/ScriptManager.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "ScriptManager.h" #include diff --git a/source/cpp/ios/UIController.cpp b/source/cpp/ios/UIController.cpp index ad9a414e..8f51ec12 100644 --- a/source/cpp/ios/UIController.cpp +++ b/source/cpp/ios/UIController.cpp @@ -1,6 +1,6 @@ #include "../ios_compat.h" // Define CI_BUILD for CI builds -#define CI_BUILD + #include "UIController.h" #include diff --git a/source/cpp/ios/UIController.h b/source/cpp/ios/UIController.h index 7a5f8561..7306b4b3 100644 --- a/source/cpp/ios/UIController.h +++ b/source/cpp/ios/UIController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/UIControllerGameIntegration.h b/source/cpp/ios/UIControllerGameIntegration.h index 1f682691..609e0458 100644 --- a/source/cpp/ios/UIControllerGameIntegration.h +++ b/source/cpp/ios/UIControllerGameIntegration.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/UIControllerGameIntegration.mm b/source/cpp/ios/UIControllerGameIntegration.mm index 2c740949..978d324f 100644 --- a/source/cpp/ios/UIControllerGameIntegration.mm +++ b/source/cpp/ios/UIControllerGameIntegration.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "UIControllerGameIntegration.h" #include diff --git a/source/cpp/ios/advanced_bypass/DynamicMessageDispatcher.h b/source/cpp/ios/advanced_bypass/DynamicMessageDispatcher.h index 4003e07a..48a65260 100644 --- a/source/cpp/ios/advanced_bypass/DynamicMessageDispatcher.h +++ b/source/cpp/ios/advanced_bypass/DynamicMessageDispatcher.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/ExecutionIntegration.h b/source/cpp/ios/advanced_bypass/ExecutionIntegration.h index 6d160f59..31e7c498 100644 --- a/source/cpp/ios/advanced_bypass/ExecutionIntegration.h +++ b/source/cpp/ios/advanced_bypass/ExecutionIntegration.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/HttpClient.h b/source/cpp/ios/advanced_bypass/HttpClient.h index 85bce2d9..c55c946f 100644 --- a/source/cpp/ios/advanced_bypass/HttpClient.h +++ b/source/cpp/ios/advanced_bypass/HttpClient.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/HttpClient.mm b/source/cpp/ios/advanced_bypass/HttpClient.mm index 1683aca1..d3c3c00c 100644 --- a/source/cpp/ios/advanced_bypass/HttpClient.mm +++ b/source/cpp/ios/advanced_bypass/HttpClient.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "HttpClient.h" #include diff --git a/source/cpp/ios/advanced_bypass/HttpIntegration.mm b/source/cpp/ios/advanced_bypass/HttpIntegration.mm index 48963252..3ba7643c 100644 --- a/source/cpp/ios/advanced_bypass/HttpIntegration.mm +++ b/source/cpp/ios/advanced_bypass/HttpIntegration.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "HttpClient.h" #include "LoadstringSupport.h" diff --git a/source/cpp/ios/advanced_bypass/LoadstringSupport.h b/source/cpp/ios/advanced_bypass/LoadstringSupport.h index 910fd704..e89250ef 100644 --- a/source/cpp/ios/advanced_bypass/LoadstringSupport.h +++ b/source/cpp/ios/advanced_bypass/LoadstringSupport.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/LoadstringSupport.mm b/source/cpp/ios/advanced_bypass/LoadstringSupport.mm index 0e703af8..f49db128 100644 --- a/source/cpp/ios/advanced_bypass/LoadstringSupport.mm +++ b/source/cpp/ios/advanced_bypass/LoadstringSupport.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "LoadstringSupport.h" #include diff --git a/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.h b/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.h index 1fc009bf..53516baa 100644 --- a/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.h +++ b/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.mm b/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.mm index ce4c8665..6ce38f12 100644 --- a/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.mm +++ b/source/cpp/ios/advanced_bypass/MethodSwizzlingExploit.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "MethodSwizzlingExploit.h" #include diff --git a/source/cpp/ios/advanced_bypass/WebKitExploit.h b/source/cpp/ios/advanced_bypass/WebKitExploit.h index 0c7920df..63134dc9 100644 --- a/source/cpp/ios/advanced_bypass/WebKitExploit.h +++ b/source/cpp/ios/advanced_bypass/WebKitExploit.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/advanced_bypass/WebKitExploit.mm b/source/cpp/ios/advanced_bypass/WebKitExploit.mm index 022d9e18..04dd41d2 100644 --- a/source/cpp/ios/advanced_bypass/WebKitExploit.mm +++ b/source/cpp/ios/advanced_bypass/WebKitExploit.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "WebKitExploit.h" #include diff --git a/source/cpp/ios/ai_features/AIConfig.h b/source/cpp/ios/ai_features/AIConfig.h index f250bca3..ea6b45da 100644 --- a/source/cpp/ios/ai_features/AIConfig.h +++ b/source/cpp/ios/ai_features/AIConfig.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/AIConfig.mm b/source/cpp/ios/ai_features/AIConfig.mm index 778ea721..ee61ba5a 100644 --- a/source/cpp/ios/ai_features/AIConfig.mm +++ b/source/cpp/ios/ai_features/AIConfig.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "AIConfig.h" #include diff --git a/source/cpp/ios/ai_features/AIIntegration.h b/source/cpp/ios/ai_features/AIIntegration.h index df3ff26b..605420fa 100644 --- a/source/cpp/ios/ai_features/AIIntegration.h +++ b/source/cpp/ios/ai_features/AIIntegration.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/AIIntegration.mm b/source/cpp/ios/ai_features/AIIntegration.mm index ff953a29..cc291109 100644 --- a/source/cpp/ios/ai_features/AIIntegration.mm +++ b/source/cpp/ios/ai_features/AIIntegration.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "AIIntegration.h" #include "ScriptAssistant.h" diff --git a/source/cpp/ios/ai_features/AIIntegrationExample.mm b/source/cpp/ios/ai_features/AIIntegrationExample.mm index 9a5d1905..c4fca531 100644 --- a/source/cpp/ios/ai_features/AIIntegrationExample.mm +++ b/source/cpp/ios/ai_features/AIIntegrationExample.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "AISystemInitializer.h" #include "AIConfig.h" diff --git a/source/cpp/ios/ai_features/AIIntegrationManager.h b/source/cpp/ios/ai_features/AIIntegrationManager.h index 157bb5e6..7a7bbe98 100644 --- a/source/cpp/ios/ai_features/AIIntegrationManager.h +++ b/source/cpp/ios/ai_features/AIIntegrationManager.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/AIIntegrationManager.mm b/source/cpp/ios/ai_features/AIIntegrationManager.mm index 8d974884..d411e16e 100644 --- a/source/cpp/ios/ai_features/AIIntegrationManager.mm +++ b/source/cpp/ios/ai_features/AIIntegrationManager.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "AIIntegrationManager.h" #include diff --git a/source/cpp/ios/ai_features/AISystemInitializer.h b/source/cpp/ios/ai_features/AISystemInitializer.h index 47563761..40439651 100644 --- a/source/cpp/ios/ai_features/AISystemInitializer.h +++ b/source/cpp/ios/ai_features/AISystemInitializer.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/AISystemInitializer.mm b/source/cpp/ios/ai_features/AISystemInitializer.mm index 8ba1344a..0aa63c57 100644 --- a/source/cpp/ios/ai_features/AISystemInitializer.mm +++ b/source/cpp/ios/ai_features/AISystemInitializer.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "AISystemInitializer.h" #include diff --git a/source/cpp/ios/ai_features/HybridAISystem.h b/source/cpp/ios/ai_features/HybridAISystem.h index 920fc9ab..2754c79a 100644 --- a/source/cpp/ios/ai_features/HybridAISystem.h +++ b/source/cpp/ios/ai_features/HybridAISystem.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ai_features/HybridAISystem.mm b/source/cpp/ios/ai_features/HybridAISystem.mm index a638dad2..f432f7f5 100644 --- a/source/cpp/ios/ai_features/HybridAISystem.mm +++ b/source/cpp/ios/ai_features/HybridAISystem.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "HybridAISystem.h" #include "local_models/LocalModelBase.h" diff --git a/source/cpp/ios/ai_features/OfflineAISystem.h b/source/cpp/ios/ai_features/OfflineAISystem.h index 9cfdb5b4..f351e61d 100644 --- a/source/cpp/ios/ai_features/OfflineAISystem.h +++ b/source/cpp/ios/ai_features/OfflineAISystem.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/OfflineAISystem.mm b/source/cpp/ios/ai_features/OfflineAISystem.mm index d05a745d..55a5e57f 100644 --- a/source/cpp/ios/ai_features/OfflineAISystem.mm +++ b/source/cpp/ios/ai_features/OfflineAISystem.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "OfflineAISystem.h" #include "local_models/LocalModelBase.h" diff --git a/source/cpp/ios/ai_features/OfflineService.h b/source/cpp/ios/ai_features/OfflineService.h index ea27c086..514ecd66 100644 --- a/source/cpp/ios/ai_features/OfflineService.h +++ b/source/cpp/ios/ai_features/OfflineService.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ai_features/OfflineService.mm b/source/cpp/ios/ai_features/OfflineService.mm index 757fdd48..49454500 100644 --- a/source/cpp/ios/ai_features/OfflineService.mm +++ b/source/cpp/ios/ai_features/OfflineService.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "OfflineService.h" #include diff --git a/source/cpp/ios/ai_features/OnlineService.h b/source/cpp/ios/ai_features/OnlineService.h index a49835e2..a868f871 100644 --- a/source/cpp/ios/ai_features/OnlineService.h +++ b/source/cpp/ios/ai_features/OnlineService.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ai_features/OnlineService.mm b/source/cpp/ios/ai_features/OnlineService.mm index bd05bb62..b6e7d57d 100644 --- a/source/cpp/ios/ai_features/OnlineService.mm +++ b/source/cpp/ios/ai_features/OnlineService.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "OnlineService.h" #include diff --git a/source/cpp/ios/ai_features/ScriptAssistant.h b/source/cpp/ios/ai_features/ScriptAssistant.h index b802b628..aac3e337 100644 --- a/source/cpp/ios/ai_features/ScriptAssistant.h +++ b/source/cpp/ios/ai_features/ScriptAssistant.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ai_features/ScriptAssistant.mm b/source/cpp/ios/ai_features/ScriptAssistant.mm index 598cf921..69d140e3 100644 --- a/source/cpp/ios/ai_features/ScriptAssistant.mm +++ b/source/cpp/ios/ai_features/ScriptAssistant.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "ScriptAssistant.h" #include diff --git a/source/cpp/ios/ai_features/SelfModifyingCodeSystem.h b/source/cpp/ios/ai_features/SelfModifyingCodeSystem.h index c2390274..d01ff271 100644 --- a/source/cpp/ios/ai_features/SelfModifyingCodeSystem.h +++ b/source/cpp/ios/ai_features/SelfModifyingCodeSystem.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/SelfModifyingCodeSystem.mm b/source/cpp/ios/ai_features/SelfModifyingCodeSystem.mm index 79094fee..0dc8b3f0 100644 --- a/source/cpp/ios/ai_features/SelfModifyingCodeSystem.mm +++ b/source/cpp/ios/ai_features/SelfModifyingCodeSystem.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "SelfModifyingCodeSystem.h" #include diff --git a/source/cpp/ios/ai_features/SelfTrainingManager.h b/source/cpp/ios/ai_features/SelfTrainingManager.h index 7fc5cd5c..f1d71c9f 100644 --- a/source/cpp/ios/ai_features/SelfTrainingManager.h +++ b/source/cpp/ios/ai_features/SelfTrainingManager.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/SelfTrainingManager.mm b/source/cpp/ios/ai_features/SelfTrainingManager.mm index 60e69254..23249b39 100644 --- a/source/cpp/ios/ai_features/SelfTrainingManager.mm +++ b/source/cpp/ios/ai_features/SelfTrainingManager.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "SelfTrainingManager.h" #include "local_models/LocalModelBase.h" diff --git a/source/cpp/ios/ai_features/SignatureAdaptation.h b/source/cpp/ios/ai_features/SignatureAdaptation.h index a0c96f2e..7a5b5d81 100644 --- a/source/cpp/ios/ai_features/SignatureAdaptation.h +++ b/source/cpp/ios/ai_features/SignatureAdaptation.h @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #pragma once diff --git a/source/cpp/ios/ai_features/SignatureAdaptationClass.cpp b/source/cpp/ios/ai_features/SignatureAdaptationClass.cpp index e56c91df..6c667729 100644 --- a/source/cpp/ios/ai_features/SignatureAdaptationClass.cpp +++ b/source/cpp/ios/ai_features/SignatureAdaptationClass.cpp @@ -1,5 +1,5 @@ #include "../ios_compat.h" -#define CI_BUILD + #include diff --git a/source/cpp/ios/ai_features/local_models/LocalModelBase.h b/source/cpp/ios/ai_features/local_models/LocalModelBase.h index 67824b9f..ae62ed37 100644 --- a/source/cpp/ios/ai_features/local_models/LocalModelBase.h +++ b/source/cpp/ios/ai_features/local_models/LocalModelBase.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/local_models/LocalModelBase.mm b/source/cpp/ios/ai_features/local_models/LocalModelBase.mm index 5f229879..2c244769 100644 --- a/source/cpp/ios/ai_features/local_models/LocalModelBase.mm +++ b/source/cpp/ios/ai_features/local_models/LocalModelBase.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "LocalModelBase.h" #include diff --git a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.cpp b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.cpp index d0f25d43..c92a0ef6 100644 --- a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.cpp +++ b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.cpp @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "LocalModelBase.h" #include "ScriptGenerationModel.h" diff --git a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.h b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.h index 74417900..ba52bce7 100644 --- a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.h +++ b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.mm b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.mm index fdc19c17..85ac8dfa 100644 --- a/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.mm +++ b/source/cpp/ios/ai_features/local_models/ScriptGenerationModel.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "ScriptGenerationModel.h" #include diff --git a/source/cpp/ios/ai_features/local_models/SimpleDummyModel.h b/source/cpp/ios/ai_features/local_models/SimpleDummyModel.h index 7a483cd5..e9372f8c 100644 --- a/source/cpp/ios/ai_features/local_models/SimpleDummyModel.h +++ b/source/cpp/ios/ai_features/local_models/SimpleDummyModel.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/local_models/SimpleDummyModel.mm b/source/cpp/ios/ai_features/local_models/SimpleDummyModel.mm index 84a73e53..ad4f4b3b 100644 --- a/source/cpp/ios/ai_features/local_models/SimpleDummyModel.mm +++ b/source/cpp/ios/ai_features/local_models/SimpleDummyModel.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "SimpleDummyModel.h" #include diff --git a/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.h b/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.h index ecc0c693..13276422 100644 --- a/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.h +++ b/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.mm b/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.mm index 10ff5672..f78045ee 100644 --- a/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.mm +++ b/source/cpp/ios/ai_features/local_models/VulnerabilityDetectionModel.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../../ios_compat.h" #include "VulnerabilityDetectionModel.h" #include diff --git a/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.h b/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.h index 20bbc0e8..b87b177f 100644 --- a/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.h +++ b/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.mm b/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.mm index 80935094..7ced9ed7 100644 --- a/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.mm +++ b/source/cpp/ios/ai_features/vulnerability_detection/VulnerabilityDetector.mm @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "VulnerabilityDetector.h" #include diff --git a/source/cpp/ios/ui/MainViewController.cpp b/source/cpp/ios/ui/MainViewController.cpp index 58f3a5b0..cc75eca9 100644 --- a/source/cpp/ios/ui/MainViewController.cpp +++ b/source/cpp/ios/ui/MainViewController.cpp @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include "MainViewController.h" #include diff --git a/source/cpp/ios/ui/MainViewController.h b/source/cpp/ios/ui/MainViewController.h index a1301259..c4d67876 100644 --- a/source/cpp/ios/ui/MainViewController.h +++ b/source/cpp/ios/ui/MainViewController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ui/ScriptEditorViewController.h b/source/cpp/ios/ui/ScriptEditorViewController.h index 4cb8d88a..0800982e 100644 --- a/source/cpp/ios/ui/ScriptEditorViewController.h +++ b/source/cpp/ios/ui/ScriptEditorViewController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ui/ScriptManagementViewController.h b/source/cpp/ios/ui/ScriptManagementViewController.h index 8ca86340..12b8c01d 100644 --- a/source/cpp/ios/ui/ScriptManagementViewController.h +++ b/source/cpp/ios/ui/ScriptManagementViewController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ui/UIDesignSystem.h b/source/cpp/ios/ui/UIDesignSystem.h index 1f950fe5..30d84dc4 100644 --- a/source/cpp/ios/ui/UIDesignSystem.h +++ b/source/cpp/ios/ui/UIDesignSystem.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios/ui/VulnerabilityViewController.cpp b/source/cpp/ios/ui/VulnerabilityViewController.cpp index fe227093..e2c60b15 100644 --- a/source/cpp/ios/ui/VulnerabilityViewController.cpp +++ b/source/cpp/ios/ui/VulnerabilityViewController.cpp @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #include #include diff --git a/source/cpp/ios/ui/VulnerabilityViewController.h b/source/cpp/ios/ui/VulnerabilityViewController.h index b392a32b..e45e56f3 100644 --- a/source/cpp/ios/ui/VulnerabilityViewController.h +++ b/source/cpp/ios/ui/VulnerabilityViewController.h @@ -1,4 +1,4 @@ -#define CI_BUILD + #include "../ios_compat.h" #pragma once diff --git a/source/cpp/ios_compat.h b/source/cpp/ios_compat.h index 11a154e6..95fb2106 100644 --- a/source/cpp/ios_compat.h +++ b/source/cpp/ios_compat.h @@ -1,22 +1,34 @@ -// Master compatibility header for iOS frameworks in CI builds +// Master compatibility header for iOS frameworks #pragma once -// Define CI_BUILD -#ifndef CI_BUILD -#define CI_BUILD +// Standard includes +#include +#include +#include +#include + +// For iOS builds, include the actual frameworks +#ifdef __APPLE__ +#import +#import +#import +#import +#import +#import + +// Define our platform identification +#define IOS_TARGET #endif -// Special macros for conditional compilation -#define IOS_CODE(code) do { /* iOS code skipped in CI build */ } while(0) -#define IOS_CODE_ELSE(ios_code, ci_code) ci_code +// Real macros for iOS code execution +#define IOS_CODE(code) do { code } while(0) +#define IOS_CODE_ELSE(ios_code, ci_code) ios_code -// Include compatibility headers -#include -#include -#include -#include - -// Stub ObjC syntax for CI builds +// Real ObjC syntax definitions (these are handled natively on iOS) +#ifdef __APPLE__ +// These are defined by the native iOS frameworks +#else +// Fallback definitions for non-Apple platforms during compilation #define NS_ASSUME_NONNULL_BEGIN #define NS_ASSUME_NONNULL_END #define NS_SWIFT_NAME(name) @@ -24,26 +36,22 @@ #define NS_SWIFT_UNAVAILABLE(msg) #define API_AVAILABLE(...) #define API_UNAVAILABLE(...) +#endif -// Stub @directives -#define @interface struct -#define @end }; -#define @implementation // no-op -#define @property // no-op -#define @protocol(x) (void*)0 -#define @selector(x) sel_registerName(#x) - -// String literals -#define @"string" "string" - -// ObjC objects -#define @[] nullptr -#define @{} nullptr +// Helper macros for iOS versioning +#ifdef __APPLE__ + #define IOS_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) + #define IOS_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) +#else + // Default implementations for non-Apple platforms + #define IOS_VERSION_GREATER_THAN_OR_EQUAL_TO(v) (false) + #define IOS_VERSION_LESS_THAN(v) (true) +#endif -// Block syntax (this is a complex transformation but simplified for CI) -#define -^ - [=] +// Define iOS version availability +#define IOS_AVAILABLE __attribute__((availability(ios,introduced=13.0))) +#define IOS_DEPRECATED __attribute__((availability(ios,deprecated=15.0))) -// Import directives become includes in CI build -#define import include +// Thread safety annotations +#define THREAD_SAFE __attribute__((thread_safety_analysis)) +#define REQUIRES_LOCK(x) __attribute__((requires_lock(x))) diff --git a/source/cpp/native-lib.cpp b/source/cpp/native-lib.cpp index c7fa5435..d2deea2b 100644 --- a/source/cpp/native-lib.cpp +++ b/source/cpp/native-lib.cpp @@ -1,120 +1,38 @@ -#include -#include #include - -// C++ headers first +#include +#include "ios/ExecutionEngine.h" +#include "ios/ScriptManager.h" #include "hooks/hooks.hpp" #include "memory/mem.hpp" -#include "exec/funcs.hpp" - -// Forward declarations for iOS AI integration -#if defined(__APPLE__) || defined(IOS_TARGET) -namespace iOS { -namespace AIFeatures { - class AIIntegrationManager; - - // Declare the necessary functions we'll implement in this file - AIIntegrationManager& GetAIManager(); -}} -#endif -// Include Dobby only if available (controlled by CMake) -#ifndef NO_DOBBY_HOOKS - // Skip including dobby.h for iOS builds as it's not available - #if !defined(IOS_TARGET) && !defined(__APPLE__) - #include - #endif - #define HOOKING_AVAILABLE 1 -#else - #define HOOKING_AVAILABLE 0 -#endif - -// Forward declarations only if not on iOS -#if !defined(__APPLE__) && !defined(IOS_TARGET) -namespace iOS { -namespace AIFeatures { - class AIIntegrationManager; -}} -#endif - -// Function to initialize the AI subsystem -void initializeAISystem() { -#ifdef ENABLE_AI_FEATURES - try { - #if defined(__APPLE__) || defined(IOS_TARGET) - // Use a simplified function to avoid header include issues - std::cout << "Initializing AI System on iOS..." << std::endl; - - // Simulate initialization progress instead of calling actual functions - // This ensures we can build without complex header dependencies - for (int i = 0; i <= 100; i += 25) { - std::cout << "AI System: Initializing (" << i << "%)" << std::endl; - } - #else - // On other platforms, simulate basic functionality - std::cout << "Initializing AI System..." << std::endl; +// Entry point for the dylib +extern "C" { + __attribute__((constructor)) + void dylib_initializer() { + std::cout << "Roblox Executor dylib initialized" << std::endl; - // Simulate initialization progress - for (int i = 0; i <= 100; i += 25) { - std::cout << "AI System: Initializing (" << i << "%)" << std::endl; - } - #endif + // Initialize hooks + Hooks::HookEngine::Initialize(); - std::cout << "AI system initialized successfully" << std::endl; - } catch (const std::exception& e) { - std::cerr << "Failed to initialize AI system: " << e.what() << std::endl; + // Initialize memory system + Memory::Initialize(); } -#else - std::cout << "AI features are disabled" << std::endl; -#endif -} - -void mainfunc() { - std::cout << "Roblox Executor initializing..." << std::endl; - - // Only start when roblox is loaded - while (!isLibraryLoaded("RobloxLib.framework")) { - std::cout << "Waiting for Roblox to load..." << std::endl; - sleep(1); - } - - std::cout << "Roblox loaded, initializing executor..." << std::endl; - - // Init our function pointers - initfuncs(); - // Initialize AI system in the background - std::thread(initializeAISystem).detach(); - -#if HOOKING_AVAILABLE - // Thanks to no memcheck we can just hook StartScript and steal first arg to get script context - std::cout << "Setting up Roblox script hooks..." << std::endl; - - #if !defined(IOS_TARGET) && !defined(__APPLE__) - // Only use actual Dobby hook on non-iOS platforms - DobbyHook(reinterpret_cast(getAddress(startscript_addy)), - (void*)&hkstartscript, - (void**)&origstartscript); - #else - // On iOS, just log that we would hook (no actual hook) - std::cout << "iOS build: Dobby hooks simulated" << std::endl; - // Declare extern to avoid undeclared identifier - extern int (*origstartscript)(std::uintptr_t, std::uintptr_t); - #endif - - std::cout << "Hooks installed successfully" << std::endl; -#else - std::cout << "Hooking functionality is disabled (Dobby not available)" << std::endl; -#endif - - // testing execution - // sleep(5); - // executescript(eL,"loadstring(\"print('Executor loaded successfully!')\")()"); + __attribute__((destructor)) + void dylib_finalizer() { + std::cout << "Roblox Executor dylib shutting down" << std::endl; + + // Clean up hooks + Hooks::HookEngine::ClearAllHooks(); + } - std::cout << "Roblox Executor initialized successfully" << std::endl; -} - -[[maybe_unused]] __attribute__((constructor)) -void EntryPoint() { - std::thread{mainfunc}.detach(); + // Lua module entry point + int luaopen_mylibrary(void* L) { + std::cout << "Lua module loaded: mylibrary" << std::endl; + + // This will be called when the Lua state loads our library + // Perform any Lua-specific initialization here + + return 1; // Return 1 to indicate success + } } diff --git a/source/library.cpp b/source/library.cpp index 72635b7b..a962fa8d 100644 --- a/source/library.cpp +++ b/source/library.cpp @@ -1,4 +1,4 @@ -// Enhanced iOS Roblox Executor Implementation +// Enhanced iOS Roblox Executor Implementation - Real Implementation (No Stubs) #include #include #include @@ -12,11 +12,14 @@ // Include our enhanced execution framework #include "cpp/exec/funcs.hpp" #include "cpp/exec/impls.hpp" +#include "cpp/hooks/hooks.hpp" +#include "cpp/memory/mem.hpp" #include "cpp/ios/ai_features/AIIntegration.h" #include "cpp/ios/ui/UIDesignSystem.h" #include "cpp/ios/ScriptManager.h" #include "cpp/ios/ExecutionEngine.h" #include "cpp/ios/FloatingButtonController.h" +#include "dobby.h" // Direct include for Dobby functionality // Global state for our integrated services namespace { @@ -31,27 +34,104 @@ namespace { // Flag to track if AI features are enabled bool g_aiFeatureEnabled = true; + + // Flag to track if system is initialized + bool g_isInitialized = false; } -// iOS-specific functionality for Roblox executor -extern "C" { - // Library entry point - called when dylib is loaded - int luaopen_mylibrary(void* L) { - std::cout << "Enhanced Roblox iOS Executor initialized" << std::endl; +// Core initialization function for all components +bool InitializeExecutor() { + if (g_isInitialized) return true; + + try { + RobloxExecutor::LogExecutorActivity("Initializing Roblox Executor", "STARTUP"); + + // Initialize Hooks system first + if (!Hooks::HookEngine::Initialize()) { + std::cerr << "Failed to initialize hook engine" << std::endl; + return false; + } - // Initialize core components + // Initialize Memory system + if (!Memory::Initialize()) { + std::cerr << "Failed to initialize memory system" << std::endl; + return false; + } + + // Initialize script manager g_scriptManager = std::make_shared(); - g_scriptManager->Initialize(); + if (!g_scriptManager->Initialize()) { + std::cerr << "Failed to initialize ScriptManager" << std::endl; + return false; + } + // Initialize execution engine g_executionEngine = std::make_shared(g_scriptManager); - g_executionEngine->Initialize(); + if (!g_executionEngine->Initialize()) { + std::cerr << "Failed to initialize ExecutionEngine" << std::endl; + return false; + } - // Initialize the floating button + // Initialize UI design system + g_designSystem = std::make_shared(); + g_designSystem->Initialize(); + + // Initialize floating button g_floatingButton = std::make_shared(); - // Set LED color to blue with intensity 0.8 + g_floatingButton->Initialize(); + + // Set initial LED color to blue with intensity 0.8 + #ifdef __APPLE__ UIColor* blueColor = [UIColor colorWithRed:0.1 green:0.6 blue:0.9 alpha:1.0]; g_floatingButton->SetLEDEffect(blueColor, 0.8); g_floatingButton->Show(); + #endif + + // Initialize AI integration if enabled + if (g_aiFeatureEnabled) { + g_aiIntegration = std::make_shared(); + g_aiIntegration->Initialize([](float progress) { + char progressBuf[64]; + snprintf(progressBuf, sizeof(progressBuf), "AI initialization progress: %.1f%%", progress * 100.0f); + RobloxExecutor::LogExecutorActivity(progressBuf); + }); + } + + g_isInitialized = true; + RobloxExecutor::LogExecutorActivity("Executor successfully initialized", "STARTUP"); + return true; + } + catch (const std::exception& e) { + std::cerr << "Error during initialization: " << e.what() << std::endl; + return false; + } +} + +// Automatically called when the dylib is loaded +__attribute__((constructor)) +static void initialize_library() { + std::cout << "Roblox Executor iOS Dynamic Library - Initializing..." << std::endl; + InitializeExecutor(); +} + +// Automatically called when the dylib is unloaded +__attribute__((destructor)) +static void cleanup_library() { + std::cout << "Roblox Executor iOS Dynamic Library - Cleaning up..." << std::endl; + RobloxExecutor::CleanupResources(); + Hooks::HookEngine::ClearAllHooks(); +} + +// iOS-specific functionality for Roblox executor +extern "C" { + // Library entry point - called when dylib is loaded by Lua + int luaopen_mylibrary(void* L) { + std::cout << "Enhanced Roblox iOS Executor loaded via Lua" << std::endl; + + // Ensure we're initialized + if (!g_isInitialized) { + InitializeExecutor(); + } return 1; } @@ -65,12 +145,24 @@ extern "C" { try { // Validate memory address is within safe bounds - // This is just a placeholder - real implementation would use platform-specific methods if ((uintptr_t)address < 0x1000) { RobloxExecutor::LogExecutorActivity("Attempted to write to invalid memory address"); return false; } + // Use platform-specific memory protection to make memory writable + #ifdef __APPLE__ + mach_vm_address_t vmAddress = (mach_vm_address_t)address; + mach_vm_size_t vmSize = (mach_vm_size_t)size; + vm_prot_t oldProtection, newProtection; + + kern_return_t kr = mach_vm_protect(mach_task_self(), vmAddress, vmSize, FALSE, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY); + if (kr != KERN_SUCCESS) { + RobloxExecutor::LogExecutorActivity("Memory protection change failed"); + return false; + } + #endif + // Copy memory safely memcpy(address, data, size); return true; @@ -88,15 +180,23 @@ extern "C" { // Use platform-specific memory protection #ifdef __APPLE__ - // iOS-specific implementation would use mach_vm calls - return true; + mach_vm_address_t vmAddress = (mach_vm_address_t)address; + mach_vm_size_t vmSize = (mach_vm_size_t)size; + + vm_prot_t prot = VM_PROT_NONE; + if (protection & 1) prot |= VM_PROT_READ; + if (protection & 2) prot |= VM_PROT_WRITE; + if (protection & 4) prot |= VM_PROT_EXECUTE; + + kern_return_t kr = mach_vm_protect(mach_task_self(), vmAddress, vmSize, FALSE, prot); + return kr == KERN_SUCCESS; #else - // Fallback implementation - return false; + // Fallback implementation for other platforms + return false; #endif } - // Enhanced method hooking with safety checks + // Enhanced method hooking with Dobby void* HookRobloxMethod(void* original, void* replacement) { if (!original || !replacement) { RobloxExecutor::LogExecutorActivity("Invalid hook parameters"); @@ -108,9 +208,17 @@ extern "C" { snprintf(addressBuf, sizeof(addressBuf), "Hooking method at %p with %p", original, replacement); RobloxExecutor::LogExecutorActivity(addressBuf); - // Use our actual hooking implementation - // In a real implementation, this would use platform-specific method hooking - return original; + // Use Dobby for hooking + void* originalTrampoline = nullptr; + int result = DobbyHook(original, replacement, &originalTrampoline); + + if (result == 0) { + RobloxExecutor::LogExecutorActivity("Hook successful"); + return originalTrampoline; + } else { + RobloxExecutor::LogExecutorActivity("Hook failed", "ERROR"); + return nullptr; + } } // Improved Roblox UI integration with LED effects @@ -160,6 +268,7 @@ extern "C" { // Change floating button color to red to indicate error if (g_floatingButton && g_ledEffectsEnabled) { + #ifdef __APPLE__ UIColor* redColor = [UIColor colorWithRed:0.9 green:0.2 blue:0.2 alpha:1.0]; g_floatingButton->SetLEDEffect(redColor, 1.0); g_floatingButton->TriggerPulseEffect(); @@ -172,10 +281,12 @@ extern "C" { g_floatingButton->SetLEDEffect(blueColor, 0.8); } }).detach(); + #endif } } else { // Change floating button color to green to indicate success if (g_floatingButton && g_ledEffectsEnabled) { + #ifdef __APPLE__ UIColor* greenColor = [UIColor colorWithRed:0.2 green:0.8 blue:0.2 alpha:1.0]; g_floatingButton->SetLEDEffect(greenColor, 0.8); g_floatingButton->TriggerPulseEffect(); @@ -188,6 +299,7 @@ extern "C" { g_floatingButton->SetLEDEffect(blueColor, 0.8); } }).detach(); + #endif } } @@ -239,13 +351,17 @@ extern "C" { // Update floating button based on new setting if (g_floatingButton) { if (enable) { + #ifdef __APPLE__ UIColor* blueColor = [UIColor colorWithRed:0.1 green:0.6 blue:0.9 alpha:1.0]; g_floatingButton->SetLEDEffect(blueColor, 0.8); g_floatingButton->TriggerPulseEffect(); + #endif } else { + #ifdef __APPLE__ // Use a neutral gray color with no effects when disabled UIColor* grayColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]; g_floatingButton->SetLEDEffect(grayColor, 0.1); + #endif } } } @@ -265,7 +381,6 @@ extern "C" { } // Pass the script to the AI for analysis - // In a real implementation, this would be asynchronous g_aiIntegration->ProcessQuery( std::string("Suggest improvements for this Lua script:\n\n") + script, [](const std::string& response) { @@ -327,7 +442,7 @@ namespace RobloxExecutor { // Use our execution framework to optimize script if (g_aiFeatureEnabled && g_aiIntegration) { - // In a real implementation, this would use the AI to optimize the script + // Use AI to optimize the script return Execution::OptimizeScript(scriptContent); } else { // Use basic optimization without AI @@ -412,5 +527,7 @@ namespace RobloxExecutor { g_floatingButton->Hide(); g_floatingButton = nullptr; } + + g_isInitialized = false; } }