### Configure VST3 SDK Options
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Sets cache variables to enable VSTGUI support and run the VST validator while disabling unnecessary examples.
```cmake
set(SMTG_ENABLE_VSTGUI_SUPPORT ON CACHE BOOL "" FORCE) # needed for the editors
set(SMTG_ENABLE_VST3_PLUGIN_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SMTG_ENABLE_VST3_HOSTING_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SMTG_CREATE_PLUGIN_LINK OFF CACHE BOOL "" FORCE)
set(SMTG_RUN_VST_VALIDATOR ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(vst3sdk)
smtg_enable_vst3_sdk()
```
--------------------------------
### Configure audio_effects.conf for JamesDSP
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp/README.md
Manual installation steps for integrating the JamesDSP library into the Android system audio configuration.
```text
jdsp {
path /system/lib/soundfx/libjamesdsp.so
}
```
```text
bundle {
path /system/lib/soundfx/libbundlewrapper.so
}
```
```text
jamesdsp {
library jdsp
uuid f27317f4-c984-4de6-9a90-545759495bf2
}
```
```text
effects {
```
--------------------------------
### Remove Magisk modules via ADB
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/README.md
Run this command while the device is connected via USB debugging to disable all installed Magisk modules.
```bash
adb wait-for-device shell magisk --remove-modules
```
--------------------------------
### CMake Project Configuration and Source Discovery
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/CMakeLists.txt
Initializes the project, sets the C++ standard, and locates source files for the AIDL backend and the audio engine.
```cmake
cmake_minimum_required(VERSION 3.22)
project(rv4a_effect_aidl CXX C)
set(CMAKE_CXX_STANDARD 17)
set(GEN ${CMAKE_CURRENT_SOURCE_DIR}/generated)
set(ENGINE ${CMAKE_CURRENT_SOURCE_DIR}/../../app/src/main/cpp)
if(NOT EXISTS ${GEN}/include)
message(FATAL_ERROR "Run magisk/aidl/generate.sh first: ${GEN} is empty")
endif()
file(GLOB_RECURSE AIDL_SRC ${GEN}/src/*.cpp)
# Recursive: the engine is not flat - the convolver and several others sit in
# subdirectories, and a shallow glob leaves their symbols undefined at link.
file(GLOB_RECURSE ENGINE_SRC ${ENGINE}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/*.c)
```
--------------------------------
### Initialize CMake Project
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Sets the minimum CMake version, project name, and C++ standard requirements.
```cmake
cmake_minimum_required(VERSION 3.20)
project(RV4ABassExciter VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
```
--------------------------------
### Define project and source files
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp-wrapper/CMakeLists.txt
Initializes the project and uses GLOB_RECURSE to collect all C++ source and header files in the current directory.
```cmake
project(jamesdsp-wrapper LANGUAGES CXX)
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/*.cpp ${CMAKE_CURRENT_LIST_DIR}/*.h)
```
--------------------------------
### Build the module using the build script
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/README.md
Execute the build script from the repository root to generate the Magisk module zip file.
```bash
magisk/build-module.sh
```
--------------------------------
### Diagnostic commands for Pixel audio configuration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
Commands to verify configuration location, library declarations, serving binaries, and linker namespace paths.
```bash
ls -l /apex/*/etc/audio_effects_config.xml
cat /apex/*/etc/audio_effects_config.xml | head -40
pgrep -f audio.effect | head -1 | xargs -I{} readlink /proc/{}/exe
pgrep -f audio.effect | head -1 | xargs -I{} cat /proc/{}/maps | grep -o '/[^ ]*lib64[^ ]*' | sort -u | head
```
--------------------------------
### Generate and Build AIDL Project
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/DESIGN.md
Run the generation script followed by CMake configuration and build commands. Note that build-tools 37 is required, as version 34 causes header emission errors.
```bash
magisk/aidl/generate.sh # build-tools 37, not 34
cmake -S magisk/aidl -B
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-33
cmake --build
```
--------------------------------
### Manually build the native library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/README.md
Use Gradle and CMake to build the native HAL library required for the module.
```bash
./gradlew :app:externalNativeBuildRootFdroidRelease # or build the target directly
cmake --build --target jamesdsp_hal
```
--------------------------------
### Build the VST3 plugin with CMake
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/README.md
Commands to configure and build the VST3 plugin using CMake. The build process automatically fetches the Steinberg VST3 SDK.
```bash
cmake -S vst -B build/vst -DCMAKE_BUILD_TYPE=Release
cmake --build build/vst --config Release
```
--------------------------------
### EffectMain.cpp configuration file lookup
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
This snippet shows the logic used to locate the configuration file, specifically omitting the APEX branch to allow fallback to /odm, /vendor, or /system.
```cpp
if (argc > 1 && access(argv[1], R_OK) == 0) configFile = argv[1];
else configFile = android::audio_find_readable_configuration_file(kDefaultConfigName);
```
--------------------------------
### Check Audio Effect Configuration and Service Registration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/DESIGN.md
Commands to verify the existence of audio effect configuration files and identify registered AIDL audio effect services.
```bash
ls /vendor/etc/audio_effects_config.xml -> No such file or directory
ls /vendor/etc/audio_effects.xml -> No such file or directory
service list | grep audio.effect
-> android.hardware.audio.effect.IFactory/default
find /system -name "*audio_effects*.xml"
-> /system/etc/audio_effects.xml
```
--------------------------------
### Fetch VST3 SDK
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Configures the VST3 SDK dependency using FetchContent with submodules enabled.
```cmake
include(FetchContent)
# The SDK needs its submodules (base, pluginterfaces, public.sdk); without them
# the CMake helpers below simply do not exist.
FetchContent_Declare(vst3sdk
GIT_REPOSITORY https://github.com/steinbergmedia/vst3sdk.git
GIT_TAG v3.7.9_build_61
GIT_SUBMODULES_RECURSE ON
GIT_SHALLOW ON)
```
--------------------------------
### Include directories and library linking
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjdspimptoolbox/CMakeLists.txt
Configures public include directories and links the jdspimprestoolbox library with jamesdsp and the previously located log library.
```cmake
target_include_directories(jdspimprestoolbox PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/)
target_link_libraries( # Specifies the target library.
jdspimprestoolbox
jamesdsp
# Links the target library to the log library
# included in the NDK.
${log-lib})
```
--------------------------------
### Project Declaration and Includes
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Defines the project names and includes additional CMake configuration files for dependencies.
```cmake
project(jamesdsp LANGUAGES C)
project(jamesdsp-wrapper LANGUAGES CXX)
include(libcrashlytics-connector/CMakeLists.txt)
include(libjdspimptoolbox/CMakeLists.txt)
include(libjamesdsp-wrapper/CMakeLists.txt)
```
--------------------------------
### Generate NDK backend code with aidl tool
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/interfaces/README.md
Use this command to generate the NDK backend code from the vendored AIDL interfaces. It specifies the version, stability, and include paths required for the generation process.
```bash
aidl --lang=ndk --structured --stability=vintf --version=3 \
-I android.hardware.audio.effect-V3 \
-I android.media.audio.common.types-V3 \
-I android.media.audio.eraser-V1 \
-I android.hardware.common.fmq-V1 \
-I android.hardware.common-V2 \
-o out/src -h out/include
```
--------------------------------
### Verify audio effect configuration and service registration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/DESIGN.md
Use these ADB commands to check for the existence of audio effect configuration files and to confirm if an AIDL effect service is registered on the device.
```bash
adb shell ls -l /vendor/etc/audio_effects_config.xml
adb shell ls -l /vendor/etc/audio_effects.xml
adb shell dumpsys media.audio_flinger | head -40
adb shell service list | grep -i audio.effect
```
--------------------------------
### CMake project and library definition
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjdspimptoolbox/CMakeLists.txt
Initializes the project as C and defines the jdspimprestoolbox shared library using recursively globbed source files.
```cmake
project(jdspimprestoolbox LANGUAGES C)
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS
${CMAKE_CURRENT_LIST_DIR}/*.c ${CMAKE_CURRENT_LIST_DIR}/*.h
)
add_library( # Sets the name of the library.
jdspimprestoolbox
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
${SOURCE_FILES}
)
```
--------------------------------
### Set include directories
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp-wrapper/CMakeLists.txt
Configures the public include directories required for the jamesdsp-wrapper library.
```cmake
target_include_directories(jamesdsp-wrapper PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/)
target_include_directories(jamesdsp-wrapper PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libjdspimptoolbox/main)
target_include_directories(jamesdsp-wrapper PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libcrashlytics-connector)
```
--------------------------------
### Configure icons in manifest.json
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/img/icons/web/README.txt
Add the icons array to your app's manifest.json file to specify icon sources, types, sizes, and purposes.
```json
{
"icons": [
{ "src": "/favicon.ico", "type": "image/x-icon", "sizes": "16x16 32x32" },
{ "src": "/icon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "/icon-512.png", "type": "image/png", "sizes": "512x512" },
{ "src": "/icon-192-maskable.png", "type": "image/png", "sizes": "192x192", "purpose": "maskable" },
{ "src": "/icon-512-maskable.png", "type": "image/png", "sizes": "512x512", "purpose": "maskable" }
]
}
```
--------------------------------
### Sepolicy Configuration for audioserver
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
The sepolicy rule required to allow the audioserver to find the custom service.
```text
allow audioserver default_android_service service_manager find
```
--------------------------------
### Audio effect library configuration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
XML configuration defining the library names and paths for jdsp and v4a_re audio effects.
```xml
```
--------------------------------
### Locate audio_effects_config.xml in AOSP
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
Code snippet from EffectMain.cpp showing the search order for the audio effects configuration file.
```cpp
candidatePath = "/apex/" + apexName + "/etc/audio_effects_config.xml";
if (access(candidatePath, R_OK) == 0) return candidatePath;
return audio_find_readable_configuration_file("audio_effects_config.xml");
```
--------------------------------
### Generate AIDL interfaces with aidl command
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/DESIGN.md
Command to generate NDK-compatible AIDL interfaces with specified stability and versioning.
```bash
aidl --lang=ndk --structured --stability=vintf --version=3 \
-I magisk/aidl/interfaces/android.hardware.audio.effect-V3 \
-I magisk/aidl/interfaces/android.media.audio.common.types-V3 \
-o out/src -h out/include
```
--------------------------------
### Compiler and Linker Options
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/CMakeLists.txt
Configures compiler flags for legacy C code and linker options to handle unresolved platform symbols.
```cmake
target_compile_options(rv4a-effect-service PRIVATE -O2
$<$:-std=gnu11>
$<$:-Wno-error=implicit-function-declaration>
$<$:-Wno-error=implicit-int>
$<$:-Wno-error=incompatible-function-pointer-types>)
find_library(log-lib log)
find_library(binder-lib binder_ndk)
target_link_libraries(rv4a-effect-service ${log-lib} ${binder-lib})
target_link_options(rv4a-effect-service PRIVATE
-Wl,--unresolved-symbols=ignore-in-object-files)
```
--------------------------------
### Executable Definition and Include Directories
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/CMakeLists.txt
Defines the rv4a-effect-service executable and specifies the necessary include paths for platform compatibility and binder APIs.
```cmake
add_executable(rv4a-effect-service
src/service.cpp
fmq/EventFlag.cpp
${AIDL_SRC}
${ENGINE_SRC})
target_include_directories(rv4a-effect-service PRIVATE
${GEN}/include
fmq/include
fmq/base
fmq/compat # stand-ins for platform headers absent from the NDK
compat # binder service APIs, vendored from AOSP
${ENGINE}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp
${ENGINE}/hal # shared parameter dispatch
${ENGINE}/libjamesdsp/VeryOldOpen_source_edition/Audio_Engine/eclipse_libjamesdsp_free_bp/jni)
```
--------------------------------
### Patching libaudiohal@aidl.so with patchelf
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
Commands used to modify the client library to redirect service lookups by adding dependencies and renaming symbols.
```bash
patchelf --add-needed aml.so
patchelf --clear-symbol-version AServiceManager_waitForService
patchelf --rename-dynamic-symbols aml_map.txt
```
--------------------------------
### Define RV4ADynamicSystem Plugin Target
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Adds the RV4ADynamicSystem plugin target, sets include directories, links libraries, and adds UI resources.
```cmake
smtg_add_vst3plugin(RV4ADynamicSystem src/plugin_dynamicbass.cpp src/DynamicBassDsp.h)
target_include_directories(RV4ADynamicSystem PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(RV4ADynamicSystem PRIVATE sdk vstgui_support)
smtg_target_add_plugin_resources(RV4ADynamicSystem RESOURCES resource/RV4ADynamicSystem.uidesc)
```
--------------------------------
### Define crashlytics-connector library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libcrashlytics-connector/CMakeLists.txt
Initializes the project and defines the crashlytics-connector as a shared library including its source files.
```cmake
project(crashlytics-connector LANGUAGES CXX)
add_library( # Sets the name of the library.
crashlytics-connector
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
${CMAKE_CURRENT_LIST_DIR}/crashlytics.h
${CMAKE_CURRENT_LIST_DIR}/Log.h
${CMAKE_CURRENT_LIST_DIR}/Log.cpp
)
```
--------------------------------
### Add shared library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp-wrapper/CMakeLists.txt
Defines the jamesdsp-wrapper as a shared library using the collected source files.
```cmake
add_library( # Sets the name of the library.
jamesdsp-wrapper
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
${SOURCE_FILES}
)
```
--------------------------------
### Library Definition and Target Configuration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Defines the jamesdsp shared library, sets compiler options, and includes directories.
```cmake
add_library( # Sets the name of the library.
jamesdsp
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
${LIBJAMESDSP_SOURCE_FILES}
EELStdOutExtension.c
EELStdOutExtension.h)
target_compile_options(jamesdsp PRIVATE -O2)
target_compile_options(jamesdsp PRIVATE -std=gnu11)
target_include_directories(jamesdsp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/)
```
--------------------------------
### Link target libraries
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp-wrapper/CMakeLists.txt
Links the jamesdsp-wrapper library with its dependencies, including jdspimprestoolbox, crashlytics-connector, jamesdsp, and the NDK log library.
```cmake
target_link_libraries( # Specifies the target library.
jamesdsp-wrapper
jdspimprestoolbox
crashlytics-connector
jamesdsp
# Links the target library to the log library
# included in the NDK.
${log-lib})
```
--------------------------------
### Plugin interface symbols
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
The three symbols resolved by the service when loading libraries defined in the configuration.
```text
createEffect queryEffect destroyEffect
```
--------------------------------
### Source File Globbing
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Recursively finds source files for the JamesDSP library.
```cmake
file(GLOB_RECURSE LIBJAMESDSP_SOURCE_FILES CONFIGURE_DEPENDS
${CMAKE_CURRENT_LIST_DIR}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/*.c
${CMAKE_CURRENT_LIST_DIR}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/*.h)
```
--------------------------------
### AOSP EffectMain.cpp Service Registration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/DESIGN.md
Snippet from AOSP's EffectMain.cpp showing the hardcoded service instance name registration.
```cpp
std::string serviceName = std::string() + effectFactory->descriptor + "/default";
binder_status_t status = AServiceManager_addService(..., serviceName.c_str());
CHECK_EQ(STATUS_OK, status);
```
--------------------------------
### HAL Audio Effect Library Configuration
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Defines the jamesdsp_hal library for system-wide audio effects, excluding it from the default build and applying specific compiler flags to handle legacy code.
```cmake
add_library(
jamesdsp_hal
SHARED
EXCLUDE_FROM_ALL
${LIBJAMESDSP_SOURCE_FILES}
EELStdOutExtension.c
hal/JamesDspHalEffect.cpp)
target_compile_options(jamesdsp_hal PRIVATE -O2 -fvisibility=hidden
$<$:-std=gnu11>
$<$:-Wno-error=implicit-function-declaration>
$<$:-Wno-error=implicit-int>
$<$:-Wno-error=incompatible-function-pointer-types>)
target_include_directories(jamesdsp_hal PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/libjamesdsp/Main/libjamesdsp/jni/jamesdsp/jdsp/
${CMAKE_CURRENT_SOURCE_DIR}/libjamesdsp/VeryOldOpen_source_edition/Audio_Engine/eclipse_libjamesdsp_free_bp/jni/)
target_link_libraries(jamesdsp_hal ${log-lib})
```
--------------------------------
### Configure audio effects
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp/VeryOldOpen_source_edition/README.md
Snippet for defining the effects block in the configuration file.
```text
effects {
```
--------------------------------
### Define RV4AMultibandDistortion Plugin Target
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Adds the RV4AMultibandDistortion plugin target, including engine source files, include directories, and UI resources.
```cmake
smtg_add_vst3plugin(RV4AMultibandDistortion
src/plugin_multiband.cpp
src/engine/multibandDist.c
src/engine/digitalFilters.c
src/engine/jdsp_lock.c
)
target_include_directories(RV4AMultibandDistortion PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/engine)
target_link_libraries(RV4AMultibandDistortion PRIVATE sdk vstgui_support)
smtg_target_add_plugin_resources(RV4AMultibandDistortion RESOURCES resource/RV4AMultibandDistortion.uidesc)
```
--------------------------------
### CMake Minimum Version and Compiler Flags
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Sets the required CMake version and defines global C and C++ compiler flags for optimization and debugging.
```cmake
cmake_minimum_required(VERSION 3.22.1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Ofast -ftree-vectorize -DDEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections -Ofast -ftree-vectorize -DDEBUG")
```
--------------------------------
### Locate NDK log library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libjamesdsp-wrapper/CMakeLists.txt
Finds the NDK log library to be used for logging purposes.
```cmake
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
```
--------------------------------
### Locate and link NDK log library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/libcrashlytics-connector/CMakeLists.txt
Finds the NDK log library and links it to the crashlytics-connector target.
```cmake
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
target_link_libraries( # Specifies the target library.
crashlytics-connector
# Links the target library to the log library
# included in the NDK.
${log-lib})
```
--------------------------------
### AMLServiceManager_waitForService Implementation
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
The C implementation that intercepts the service lookup and redirects it to the custom IFactory/aml service.
```c
if (strcmp(instance, "android.hardware.audio.effect.IFactory/default") == 0)
return AServiceManager_waitForService(".../IFactory/aml");
return AServiceManager_waitForService(instance);
```
--------------------------------
### Engine Source Validation
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/CMakeLists.txt
Verifies that the required number of engine source files were found to prevent link-time errors.
```cmake
list(LENGTH ENGINE_SRC ENGINE_COUNT)
message(STATUS "engine sources found: ${ENGINE_COUNT}")
if(ENGINE_COUNT LESS 40)
message(FATAL_ERROR
"Only ${ENGINE_COUNT} engine sources matched - the effects in "
"jdsp/Effects are missing, so the link would fail on AgcProcess and "
"friends. Check the ENGINE path: ${ENGINE}")
endif()
```
--------------------------------
### Define RV4ABassExciter Plugin Target
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/vst/CMakeLists.txt
Adds the RV4ABassExciter plugin target, sets include directories, links libraries, and adds UI resources.
```cmake
smtg_add_vst3plugin(RV4ABassExciter src/plugin.cpp src/BassExciterDsp.h)
target_include_directories(RV4ABassExciter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(RV4ABassExciter PRIVATE sdk vstgui_support)
smtg_target_add_plugin_resources(RV4ABassExciter RESOURCES resource/RV4ABassExciter.uidesc)
```
--------------------------------
### Linking NDK Log Library
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/app/src/main/cpp/CMakeLists.txt
Locates and links the Android NDK log library to the jamesdsp target.
```cmake
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
target_link_libraries( # Specifies the target library.
jamesdsp
# Links the target library to the log library
# included in the NDK.
${log-lib})
```
--------------------------------
### Symbol Mapping in aml_map.txt
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
The mapping file used by patchelf to rename the AServiceManager_waitForService symbol.
```text
AServiceManager_waitForService AMLServiceManager_waitForService
```
--------------------------------
### Add icons to HTML head
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/img/icons/web/README.txt
Include these link tags within the section of your HTML document to define the favicon and apple touch icon.
```html
```
--------------------------------
### Remove module via TWRP shell
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/README.md
Use this command in the TWRP shell to manually delete the module directory and resolve boot issues.
```bash
rm -rf /data/adb/modules/rv4a_engine
```
--------------------------------
### audio_effects_conf XML structure
Source: https://github.com/alienware377/rootlessviper4android/blob/viper-extras/magisk/aidl/PIXEL-ROUTE.md
The base XML structure used for audio effects configuration, which is dynamically modified by shell scripts to register libraries and effects.
```xml
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.