Android Gradle Setup
Install ByteHide Monitor in your Android project by adding the Maven repository and Gradle dependency.
Requirements
- Android Studio Arctic Fox or later
- Gradle 7.0+
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 34+ recommended
- Languages: Java 11+ or Kotlin 1.6+
Step 1: Add the ByteHide Maven Repository
Add the ByteHide Maven repository to your project's settings.gradle.kts:
pluginManagement {
repositories {
maven {
url = uri("https://maven.bytehide.com/releases")
}
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://maven.bytehide.com/releases")
}
google()
mavenCentral()
}
}pluginManagement {
repositories {
maven {
url = uri("https://maven.bytehide.com/releases")
}
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://maven.bytehide.com/releases")
}
google()
mavenCentral()
}
}If you use settings.gradle (Groovy):
pluginManagement {
repositories {
maven { url 'https://maven.bytehide.com/releases' }
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories {
maven { url 'https://maven.bytehide.com/releases' }
google()
mavenCentral()
}
}pluginManagement {
repositories {
maven { url 'https://maven.bytehide.com/releases' }
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories {
maven { url 'https://maven.bytehide.com/releases' }
google()
mavenCentral()
}
}Step 2: Add the Monitor Dependency
Add Monitor to your app module's build.gradle.kts:
dependencies {
implementation("com.bytehide:monitor-integration:2.0.0")
}dependencies {
implementation("com.bytehide:monitor-integration:2.0.0")
}Or in build.gradle (Groovy):
dependencies {
implementation 'com.bytehide:monitor-integration:2.0.0'
}dependencies {
implementation 'com.bytehide:monitor-integration:2.0.0'
}Step 3: Configure the Gradle Plugin
The Gradle plugin handles token embedding and configuration download. Set your token as an environment variable:
export BYTEHIDE_API_TOKEN="your-token-here"export BYTEHIDE_API_TOKEN="your-token-here"Alternatively, configure the plugin directly in build.gradle.kts:
bytehideMonitor {
apiToken = "your-token-here"
}bytehideMonitor {
apiToken = "your-token-here"
}The token is resolved in this order: explicit apiToken > BYTEHIDE_API_TOKEN environment variable > bytehide.api.token system property.
Step 4: Sync and Build
Sync your Gradle files and build the project:
./gradlew assembleDebug./gradlew assembleDebugMonitor is now included in your application. Continue with configuration to set up protections.
ProGuard / R8
If you use code minification, no additional ProGuard rules are needed. Monitor's library includes its own consumer rules automatically.