Skip to content

Android signals that will help enhance your app security and protect your app from bad actors

License

Notifications You must be signed in to change notification settings

sense-opensource/sense-app-protect-android

Repository files navigation

Sense App Protect - Android

🛡️ Device Integrity Checks

Frida Rooted Emulator Installed Apps Cloned Apps Unknown Apps VPN SIM Factory Reset Remote Control

Sense is a client side library that enables you to identify users by pinpointing their hardware and software characteristics. This is done by computing a token that stays consistent in spite of any manipulation.

Getting started with Sense

Requirements

* Use Android 5.1 (API level 21) and above.
* Use Kotlin version 1.6.10 and above.
* Add READ_PHONE_STATE Permission in Android Manifest for deivce information(Optional)

Note: If the application does not have the listed permissions, the values collected using those permissions will be ignored. To provide a valid device details, we recommend employing as much permission as possible based on your use-case.

Step 1 - Add Dependency

Add the dependency in the app level build.gradle:

dependencies {
    implementation 'io.github.sense-opensource:SenseOSProtect:0.0.1'
}

Step 2 - Import SDK

import io.github.senseopensource.SenseOSProtect
import io.github.senseopensource.SenseOSProtectConfig

Step 3 - Initialize SDK

Add the following line of code to initialize it.

val config = SenseOSProtectConfig(
    installedApplications = listOf(
        mapOf("name" to "App Name", "package" to "Package Name")
    )
)
SenseOSProtect.initSDK(activity, config)

Step 4 - Get Device Details

Use the below code to get the Device Details

SenseOSProtect.getSenseDetails(this)

Step 5 - Implement Listener

Set and Implement our listener to receive the Callback details

SenseOSProtect.getSenseDetails(object : SenseOSProtect.SenseOSProtectListener {
    override fun onSuccess(data: String) {
        // success callback 
    }
    override fun onFailure(message: String) {
        // failure callback
    }
})

Sample Program

Here you can find the demonstration to do the integration.

import io.github.senseopensource.SenseOSProtect
import io.github.senseopensource.SenseOSProtectConfig

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val config = SenseOSProtectConfig(
            installedApplications = listOf(
                mapOf("name" to "Google Pay", "package" to "com.google.android.apps.nbu.paisa.user"),
                mapOf("name" to "PhonePe", "package" to "com.phonepe.app"),
                mapOf("name" to "Paytm", "package" to "net.one97.paytm"),
                mapOf("name" to "BHIM", "package" to "in.org.npci.upiapp"),
                mapOf("name" to "Amazon (Pay)", "package" to "in.amazon.mShop.android.shopping"),
                mapOf("name" to "Chrome", "package" to "com.android.chrome")
            )
        )

        //Initialize SDK
        SenseOSProtect.initSDK(this, config)

        // Fetch device details
        getSenseDetails();
    }
    private fun getSenseDetails() {
        SenseOSProtect.getSenseDetails(object : SenseOSProtect.SenseOSProtectListener {
            override fun onSuccess(data: String) {
                // Handle success callback
            }
            override fun onFailure(message: String) {
                // Handle failure callback
            }
        })
    }
}

Plug and play, in just 3 steps

1️⃣ Visit the GitHub Repository
2️⃣ Download or Clone the Repository. Use the GitHub interface to download the ZIP file, or run.
3️⃣ Run the Installer / Setup Script. Follow the setup instructions provided below.
4️⃣ Start Testing. Once installed, begin testing and validating the accuracy of the metrics you're interested in.

With Sense, you can

✅ Predict user intent : Identify the good from the bad visitors with precision
✅ Create user identities : Tokenise events with a particular user and device
✅ Custom risk signals : Developer specific scripts that perform unique functions
✅ Protect against Identity spoofing : Prevent users from impersonation
✅ Stop device or browser manipulation : Detect user behaviour anomalies

Resources

MIT license :

Sense OS is available under the MIT license

Contributors code of conduct :

Thank you for your interest in contributing to this project! We welcome all contributions and are excited to have you join our community. Please read these Code of conduct to ensure a smooth collaboration.

Where you can get support :

Gmail [email protected]

Public Support:

For questions, bug reports, or feature requests, please use the Issues and Discussions sections on our repository. This helps the entire community benefit from shared knowledge and solutions.

Community Chat:

Join our Discord server (link) to connect with other developers, ask questions in real-time, and share your feedback on Sense.

Interested in contributing to Sense?

Please review our Contribution Guidelines to learn how to get started, submit pull requests, or run the project locally. We encourage you to read these guidelines carefully before making any contributions. Your input helps us make Sense better for everyone!