ObfuscateCoreLabs
Developer Documentation

SDK Integration
Guide

Get ObfuscateCore SDK running in your project in under 5 minutes. Select your platform below for copy-paste integration snippets and configuration reference.

Quick Start

Step 1

Request License

Get your trial key from our contact form.

Step 2

Install SDK

Add via CocoaPods, Gradle, or pub/npm.

Step 3

Configure

Initialise with your license key and options.

Step 4

Ship

Build and deploy with full protection active.

Swift / iOS

CocoaPods or Swift Package Manager

Install via CocoaPods

pod 'ObfuscateCore', '~> 4.2'

Or via Swift Package Manager

.package(url: "https://sdk.obfuscatecore.co.uk/ObfuscateCore.git", from: "4.2.0")
YourApp.swift [swift]
import ObfuscateCore

@main
struct YourApp: App {
    init() {
        // Initialise SDK with your license key
        ObfuscateCore.configure(
            licenseKey: "OC-XXXX-XXXX-XXXX",
            options: [
                .enableStringMasking,
                .enableRootDetection,
                .enableEmulatorDetection,
                .enableAntiTamper(
                    response: .silentTerminate
                )
            ]
        )
    }

    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

// Check protection status at runtime
let status = ObfuscateCore.protectionStatus()
if status.isJailbroken {
    // Handle jailbroken device
    Analytics.log(.jailbreakDetected)
}

if status.isEmulated {
    // Handle emulator environment
    Analytics.log(.emulatorDetected)
}

Kotlin / Android

Gradle dependency

Add to build.gradle.kts

implementation("com.obfuscatecore:sdk:4.2.1")
YourApplication.kt [kotlin]
import com.obfuscatecore.sdk.ObfuscateCore
import com.obfuscatecore.sdk.ProtectionConfig

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        // Initialise SDK with configuration
        ObfuscateCore.initialize(
            context = this,
            config = ProtectionConfig(
                licenseKey = "OC-XXXX-XXXX-XXXX",
                stringMasking = true,
                rootDetection = RootDetectionConfig(
                    enabled = true,
                    includeMagisk = true,
                    includeKernelSU = true
                ),
                emulatorDetection = true,
                antiTamper = AntiTamperConfig(
                    enabled = true,
                    onResponse = TamperResponse.SILENT_EXIT
                ),
                memoryProtection = MemoryProtectionConfig(
                    integrityCheckIntervalMs = 5000
                )
            )
        )
    }
}

// Runtime checks
val deviceStatus = ObfuscateCore.getDeviceStatus()
when {
    deviceStatus.isRooted -> handleRootedDevice()
    deviceStatus.isEmulator -> handle_emulator()
    deviceStatus.hasHooks -> handle_instrumentation()
}

Flutter

Dart package with native bindings

Add to pubspec.yaml

obfuscate_core: ^4.2.0
app_protection_service.dart [dart]
import 'package:obfuscate_core/obfuscate_core.dart';

class AppProtectionService {
  static Future<void> initialize() async {
    final sdk = ObfuscateCore();

    // Configure protection layers
    await sdk.configure(
      licenseKey: 'OC-XXXX-XXXX-XXXX',
      enableStringMasking: true,
      rootDetection: RootDetectionConfig(
        enabled: true,
        checkMagisk: true,
        checkKernelSU: true,
      ),
      emulatorDetection: true,
      antiTamper: AntiTamperConfig(
        enabled: true,
        response: TamperResponse.silentExit,
      ),
    );
  }

  // Check device status from Dart
  static Future<DeviceStatus> checkDevice() async {
    final sdk = ObfuscateCore();
    final status = await sdk.getDeviceStatus();

    if (status.isRooted) {
      // Log and handle rooted device
      await Analytics.log('device_rooted');
    }

    if (status.isEmulator) {
      await Analytics.log('device_emulator');
    }

    return status;
  }
}

// In your main.dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AppProtectionService.initialize();
  runApp(const MyApp());
}

React Native

npm package with native modules

Install via npm

npm install obfuscatecore-react-native
AppProtection.ts [javascript]
import ObfuscateCore from 'obfuscatecore-react-native';

// Initialise in your app entry point
export async function initializeProtection() {
  await ObfuscateCore.configure({
    licenseKey: 'OC-XXXX-XXXX-XXXX',
    stringMasking: true,
    rootDetection: {
      enabled: true,
      checkMagisk: true,
      checkKernelSU: true,
    },
    emulatorDetection: true,
    antiTamper: {
      enabled: true,
      response: 'silent-exit',
    },
    memoryProtection: {
      integrityCheckIntervalMs: 5000,
    },
  });
}

// React hook for protection status
export function useProtectionStatus() {
  const [status, setStatus] = useState(null);

  useEffect(() => {
    ObfuscateCore.getDeviceStatus().then(setStatus);
  }, []);

  return status;
}

// Usage in a component
function SecurityGate({ children }) {
  const status = useProtectionStatus();

  if (status?.isRooted) {
    return <RootedDeviceWarning />;
  }

  if (status?.isEmulator) {
    return <EmulatorDetected />;
  }

  return children;
}

Configuration Reference

Option Type Default Description
licenseKey string Your ObfuscateCore license key (required)
stringMasking boolean true Enable compile-time string encryption
rootDetection object enabled Root/jailbreak detection configuration
emulatorDetection boolean true Enable hardware environment analysis
antiTamper object silent Tamper detection with configurable response
memoryProtection object 5000ms Runtime integrity check interval

Ready to Integrate?

Request a trial license key and start protecting your application today. Our team provides dedicated integration support throughout your evaluation period.