--- title: "Start the analysis (s method)" slug: "root-detect-sdk-ig-start-analysis-s-method-4-33-0" updated: 2026-09-28T12:17:18Z published: 2026-09-28T12:17:18Z canonical: "docs.onespan.com/root-detect-sdk-ig-start-analysis-s-method-4-33-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Start the analysis (s method) The s method starts the analysis process, which detects whether a device is rooted or jailbroken. As of version 4.4 of the Root Detection SDK, this method also checks the version of the signature file. The signature file version must be higher than or equal to the version defined in the Root Detection SDK (indicated by the constant t). The aim is to prevent anyone from using signature files that may contain deprecated verification rules. > For Android platforms, another signature for this method exists: public static S s(String c), which does not use the Android context. However, the Android context is necessary to improve the root detection process. As a result, the deprecated method must only be used for backward-compatibility to manage earlier client integrations (Root Detection SDK 4.3 or earlier versions). ## Syntax Android publicstatic S s(String c, Context a) iOS +(s) s: (NSData*) c ## Parameters The following signatures are available for this function: | Start the analysis parameters | | --- | | Parameter name | Data type | Use | Description | | `c` | String/NSData* | I (mandatory) | Signature file content. | | `a` | Context | I (mandatory) | Android context (Android only). | ## Return values This method returns the S response object, which contains the following: Android: - A return code that indicates the result of the analysis. - An exception if an unknown error occurs. iOS: - A return code that indicates the result of the analysis. - An exception if an unknown error occurs. - A cause string if the return code indicates that the device is jailbroken. Could be used for debugging when there is a doubt for a false positive. ## Exceptions The following are the possible error codes for this function. | Start the analysis exceptions | | --- | | Name | Value | Error message | | n | 0 | Indicates that the device is not rooted/jailbroken. | | z | –4600 | Indicates an unknown error. | | r | –4601 | Indicates that the device is rooted/jailbroken. | | e | –4602 | Indicates that the signature file is null. | | l | –4603 | Indicates that the signature file length is incorrect—it must be at least 256 characters. | | f | –4604 | Indicates that the signature file format is incorrect—only hexadecimal characters are allowed. | | i | –4605 | Indicates that the signature file is invalid: wrong signature or XML parsing error. | | a | –4606 | Indicates that the version of the signature file is too old to be used by the Root Detection SDK. | ## Examples This section illustrates how to integrate and use the s method to start the analysis. For more information, refer to the Root Detection SDK sample project in the OneSpan Mobile Security Suite package. ### Android ```java // Retrieve the signature file        InputStream ins = assetManager.open(path);        // Start analysis process        S response = P.s(convertInsToString(ins),        this.getApplicationContext());        int returnCode = response.r();        // Check the result from the analysis process        if (returnCode == O.n)        {        System.out.println("Device is not rooted.");        }        else if (returnCode == O.r)        {        System.out.println("Device is rooted.");        }        else        {        System.out.println(getMsgFromReturnCode(returnCode));        System.out.println("Error code: " + returnCode);        } ``` #### Metadata about rooting To collect more details about the reason why a device has been classified as rooted, you can call the `getFailureStackTrace()` method which returns the metadata together with some information about the versions of both the SDK and the signature file. With this, it is possible to pin-point the exact reason that caused the device to be classified as rooted. Another method, `clearFailureStackTrace()` is provided to clear the failure reason once it has been noted for further analysis. ### iOS ```objectivec // Get file signature path        NSString * filePath = [[NSBundlemainBundle] pathForResource:@"signature" ofType:nil];        // Load signature file        NSData * d = [NSData dataWithContentsOfFile:filePath];        // Call s method: check if phone is rooted        s response = [P s:d];        NSString * resultText = @"";        // Parse result        switch(response.r){        case P_r:        resultText = @"** Device is rooted **";        break;        case P_n:        resultText = @"** Device is not rooted **";        break;        ...        ... ```