{"id":19146680,"url":"https://github.com/mukeshsolanki/android-tamper-detector","last_synced_at":"2025-04-19T13:34:36.332Z","repository":{"id":39647963,"uuid":"175428042","full_name":"mukeshsolanki/Android-Tamper-Detector","owner":"mukeshsolanki","description":"A simple library that can help you detect if you app is modded or tampered with","archived":false,"fork":false,"pushed_at":"2023-10-20T06:27:00.000Z","size":252,"stargazers_count":172,"open_issues_count":4,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-02T05:23:05.329Z","etag":null,"topics":["android","hack-detection","libraries","modded","security","tamper-detector"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mukeshsolanki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"mukeshsolanki","custom":"https://paypal.me/mukeshsolanki"}},"created_at":"2019-03-13T13:37:34.000Z","updated_at":"2024-04-07T07:24:57.000Z","dependencies_parsed_at":"2024-02-06T01:50:16.782Z","dependency_job_id":null,"html_url":"https://github.com/mukeshsolanki/Android-Tamper-Detector","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mukeshsolanki%2FAndroid-Tamper-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mukeshsolanki%2FAndroid-Tamper-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mukeshsolanki%2FAndroid-Tamper-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mukeshsolanki%2FAndroid-Tamper-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mukeshsolanki","download_url":"https://codeload.github.com/mukeshsolanki/Android-Tamper-Detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223801073,"owners_count":17205008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","hack-detection","libraries","modded","security","tamper-detector"],"created_at":"2024-11-09T07:47:42.214Z","updated_at":"2024-11-09T07:47:42.789Z","avatar_url":"https://github.com/mukeshsolanki.png","language":"Kotlin","funding_links":["https://github.com/sponsors/mukeshsolanki","https://paypal.me/mukeshsolanki","https://www.paypal.me/mukeshsolanki"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eAndroid Tamper Detector\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://jitpack.io/#mukeshsolanki/Android-Tamper-Detector\"\u003e \u003cimg src=\"https://jitpack.io/v/mukeshsolanki/Android-Tamper-Detector/month.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://jitpack.io/#mukeshsolanki/Android-Tamper-Detector\"\u003e \u003cimg src=\"https://jitpack.io/v/mukeshsolanki/Android-Tamper-Detector.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/mukeshsolanki/Android-Tamper-Detector/actions\"\u003e \u003cimg src=\"https://github.com/mukeshsolanki/Android-Tamper-Detector/workflows/Build/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\"/\u003e\u003c/a\u003e\n  \u003cbr /\u003e\u003cbr /\u003e\n    A simple library that can help you detect if you app is modded or tampered with or debugger tools are being used to break your app and checks install source.\n\u003c/p\u003e\n\n# Supporting Tamper Detector\n\nTamper Detector is an independent project with ongoing development and support made possible thanks to donations made by you.\n- [Become a backer](https://www.paypal.me/mukeshsolanki)\n\n## How to integrate into your app?\nTo integrate tamper detector to your project, Follow the below steps\n\nStep 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:\n\n```groovy\nallprojects {\n  repositories {\n    ...\n    maven { url \"https://jitpack.io\" }\n  }\n}\n```\nStep 2. Add the dependency\n```groovy\ndependencies {\n        debugImplementation 'com.github.mukeshsolanki.Android-Tamper-Detector:tamperdetector-no-op:1.0.0'\n        releaseImplementation 'com.github.mukeshsolanki.Android-Tamper-Detector:tamperdetector:1.0.0'\n}\n```\n\n## How to use the library?\nOkay seems like you integrated the library in your project but **how do you use it**? Well its really easy\n1. Debugger Check\nYou can make a debugger check before running any function by calling `guardDebugger()`\n```kotlin\nguardDebugger({\n    //No debugger tools detected continue executing the code.\n}, {\n    //Some debugger tools were detected.\n})\n```\n\n2. Verify Installer\nTo verify whether your app is downloaded from the right source call `verifyInstaller()`\n```kotlin\nthis.verifyInstaller(Installer.GOOGLE_PLAY_STORE)?.let {\n    if (it) {\n        // App is installed from Google Play\n    } else {\n        // App is not installed from Google Play\n    }\n}\n```\n\n3. Verify Signature\nTo verify whether your app has been modified or not you can use `validateSignature()`. You can get your release signature from [here](#how-to-get-release-signature?)\n```kotlin\nif (this.validateSignature(\"INSERT YOUR RELEASE SIGNATURE HERE\") == Result.VALID) {\n    // Signature is valid continue using the app\n} else {\n    // Signature is invalid likely a modded version of the app\n}\n```\n\n## How to get release signature?\nThis would be a onetime process. Inorder to get your signature you would have to temporarily enable debugging on the release version of the app and sign the app. Don't worry you don't have to publish the app you just want to take a look at the logs for the release version.\nStep 1. Change the releaseImplementation to point to 'com.github.mukeshsolanki.Android-Tamper-Detector:tamperdetector-no-op:1.0.0'\nStep 2. Adding the `debuggable true` to your `app/build.gradle` file\n```groovy\n    ...\n    buildTypes {\n        debug {\n\n        }\n        release {\n            debuggable true // This is the temporary flag we added. Please remove this once you have got the signature\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    ...\n```\nNext we are going to call the `getSignature()` to get and log our signature.\n```Kotlin\n    Log.d(\"Signature\", context.getSignature())\n```\nSign the app and run the release version and look at logcat. You should be able to see your release signature on the console. Note it down and then we can use this to securely validate your apk using `validateSignature()`.\n**Please remove the debuggable flag and change the releaseImplementation to the original one back once you have noted down the signature. Also the getSignature() method only works on the debug version and not on production**\n\n## Author\nMaintained by [Mukesh Solanki](https://www.github.com/mukeshsolanki)\n\n## Contribution\n[![GitHub contributors](https://img.shields.io/github/contributors/mukeshsolanki/Android-Tamper-Detector.svg)](https://github.com/mukeshsolanki/Android-Tamper-Detector/graphs/contributors)\n\n* Bug reports and pull requests are welcome.\n\n## License\n```\nMIT License\n\nCopyright (c) 2019 Mukesh Solanki\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukeshsolanki%2Fandroid-tamper-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmukeshsolanki%2Fandroid-tamper-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukeshsolanki%2Fandroid-tamper-detector/lists"}