root化とFrida検知 - #32
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds security checks to detect rooted devices and Frida debugging frameworks to protect the Android application from reverse engineering and tampering attempts.
- Creates a new
SecurityChecksobject with methods to detect device rooting and Frida presence - Integrates security checks into the app's startup process in
MainActivity - Implements the security mechanism to terminate the app if threats are detected
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| SecurityChecks.kt | New security utility class implementing root detection and Frida detection methods |
| MainActivity.kt | Integration of security checks during app initialization with termination on threat detection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| private fun hasSuBinary(): Boolean { | ||
| val paths = arrayOf( | ||
| "/system/bin/su","/system/xbin/su","/sbin/su", |
There was a problem hiding this comment.
[nitpick] Missing spaces after commas in the array elements make the code harder to read. Add spaces after each comma for better readability.
| "com.topjohnwu.magisk","eu.chainfire.supersu","com.noshufou.android.su", | ||
| "com.koushikdutta.superuser","com.zachspong.temprootremovejb","com.ramdroid.appquarantine" |
There was a problem hiding this comment.
[nitpick] Missing spaces after commas in the package name list make the code harder to read. Add spaces after each comma for better readability.
| "com.topjohnwu.magisk","eu.chainfire.supersu","com.noshufou.android.su", | |
| "com.koushikdutta.superuser","com.zachspong.temprootremovejb","com.ramdroid.appquarantine" | |
| "com.topjohnwu.magisk", "eu.chainfire.supersu", "com.noshufou.android.su", | |
| "com.koushikdutta.superuser", "com.zachspong.temprootremovejb", "com.ramdroid.appquarantine" |
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| installSplashScreen() | ||
| // 起動時チェック |
There was a problem hiding this comment.
[nitpick] The comment uses Japanese while the rest of the codebase appears to use English. Consider using English for consistency: // Security check on startup
| // 起動時チェック | |
| // Security check on startup |
| val rooted = SecurityChecks.isRooted(this) | ||
| val frida = SecurityChecks.isFridaDetected() | ||
| Log.w("Security", "rooted=$rooted frida=$frida") | ||
| if (rooted || frida) finish() |
There was a problem hiding this comment.
[nitpick] The comment uses Japanese while the rest of the codebase appears to use English. Consider using English for consistency: // Security check on startup
| val rooted = SecurityChecks.isRooted(this) | ||
| val frida = SecurityChecks.isFridaDetected() | ||
| Log.w("Security", "rooted=$rooted frida=$frida") |
There was a problem hiding this comment.
Inconsistent indentation in the security check block. Lines 22-24 use tabs while line 21 and 25 use spaces. Standardize to use consistent indentation throughout.
| val rooted = SecurityChecks.isRooted(this) | |
| val frida = SecurityChecks.isFridaDetected() | |
| Log.w("Security", "rooted=$rooted frida=$frida") | |
| val rooted = SecurityChecks.isRooted(this) | |
| val frida = SecurityChecks.isFridaDetected() | |
| Log.w("Security", "rooted=$rooted frida=$frida") |
セキュリティ機構の追加