Skip to content

fix: disable andriod root check#4020

Open
jayachandhar wants to merge 1 commit intomasterfrom
disable_android_rooted_check
Open

fix: disable andriod root check#4020
jayachandhar wants to merge 1 commit intomasterfrom
disable_android_rooted_check

Conversation

@jayachandhar
Copy link
Contributor

@jayachandhar jayachandhar commented Nov 24, 2025

Clickup

Please add link here

Code Coverage

Please add code coverage here

UI Preview

Please add screenshots for UI changes

Summary by CodeRabbit

  • Bug Fixes
    • Removed device compatibility restriction that was preventing app launch on certain devices.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added the size/XS Extra Small PR label Nov 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

Ayy, even Superstar cannot stop a man from removing obstacles! This change disables the rooted-device security check in MainActivity.onCreate by commenting out the RootCheck usage and associated termination logic, allowing the application to run on rooted Android devices without restrictions.

Changes

Cohort / File(s) Summary
Rooted Device Check Disabled
android/app/src/main/java/com/ionicframework/fyle595781/MainActivity.java
RootCheck invocation and device-rooted conditional handling commented out, removing runtime app termination on rooted devices while preserving root-tap filtering setup

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Security consideration: Verify whether disabling root detection is intentional and authorized—this is a security-relevant change that may expose the app to unauthorized modifications or attacks on compromised devices
  • Context verification: Confirm if this change aligns with app requirements and security policies; root detection removal could have compliance implications
  • Code preservation: Ensure commented-out code is intentional rather than incomplete cleanup

Poem

Like a rebel breaking free from chains of control,
The rooted devices now claim their rightful role,
One comment, one moment—the gate swings wide,
Security yields to the dev's iron pride. 🎬⚡

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only template placeholders with no actual content filled in - all three required sections lack substantive information. Add ClickUp ticket link, code coverage details, and UI preview screenshots or explain why they are not applicable to this change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change - disabling the Android root check in MainActivity, which aligns with the code modifications shown in the summary.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch disable_android_rooted_check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

PR description must contain a link to a ClickUp (case-insensitive)

@github-actions
Copy link

🔁 Code Duplication Report - Angular

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
java 4 169 1189 0 0 (0.00%) 0 (0.00%)
typescript 744 56516 487176 202 2767 (4.90%) 25376 (5.21%)
scss 191 21241 113702 111 3886 (18.29%) 20937 (18.41%)
markup 290 19421 163531 104 1402 (7.22%) 11717 (7.17%)
python 4 697 5373 3 32 (4.59%) 368 (6.85%)
css 1 38 219 0 0 (0.00%) 0 (0.00%)
swift 1 60 405 0 0 (0.00%) 0 (0.00%)
properties 2 29 73 0 0 (0.00%) 0 (0.00%)
javascript 14 930 6540 1 10 (1.08%) 108 (1.65%)
prolog 1 60 559 0 0 (0.00%) 0 (0.00%)
groovy 6 178 1051 0 0 (0.00%) 0 (0.00%)
yaml 14 618 4561 9 187 (30.26%) 1554 (34.07%)
markdown 2 274 2046 0 0 (0.00%) 0 (0.00%)
bash 1 12 83 0 0 (0.00%) 0 (0.00%)
Total: 1275 100243 786508 430 8284 (8.26%) 60060 (7.64%)

📊 No significant change in code duplication.

@github-actions
Copy link

PR description must contain a link to a ClickUp (case-insensitive)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
android/app/src/main/java/com/ionicframework/fyle595781/MainActivity.java (2)

7-7: Unused import, just like a villain who never appears in Superstar's movie, da!

The RootCheck import is no longer used after commenting out the root detection logic. If this change is approved by your security team, clean up by removing this import.

Apply this diff if the security change is approved:

-import com.ionicframework.fyle595781.utils.RootCheck;

3-5: Even Rajini doesn't need two entries on screen when one is enough, pa!

You have android.os.Bundle imported twice (lines 3 and 5). Remove the duplicate.

Apply this diff:

 package com.ionicframework.fyle595781;
 
 import android.os.Bundle;
 import com.getcapacitor.BridgeActivity;
-import android.os.Bundle;
 import android.view.View;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4090d16 and 0256135.

📒 Files selected for processing (1)
  • android/app/src/main/java/com/ionicframework/fyle595781/MainActivity.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-app
  • GitHub Check: build
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)

Comment on lines +20 to +28
// // Prevent rooted devices (vapt)
// RootCheck rootCheck = new RootCheck(this);
// Boolean isDeviceRooted = rootCheck.rootBeerCheck();

if (isDeviceRooted) {
// Show a Toast message and close the app
Toast.makeText(this, "This application can't run on Rooted android phone", Toast.LENGTH_LONG).show();
finish();
}
// if (isDeviceRooted) {
// // Show a Toast message and close the app
// Toast.makeText(this, "This application can't run on Rooted android phone", Toast.LENGTH_LONG).show();
// finish();
// }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Arey, this is not just code, machaan—this is security we're playing with, da!

Disabling the rooted device check is like removing the locks from Superstar's fort! Listen carefully:

Security implications:

  • Rooted devices bypass Android's security sandbox entirely
  • Attackers can intercept sensitive data, inject malicious code, or access app internals
  • This was marked as a VAPT requirement—meaning your security team specifically requested it

What's missing, pa:

  • No ClickUp link explaining why this protection is being removed
  • No evidence of security team approval
  • No risk assessment or mitigation strategy
  • No code coverage for alternative security measures

My style is, I don't compromise on security without proper justification!

Before merging this change, you must:

  1. Provide business justification with ClickUp ticket
  2. Get explicit approval from your security/compliance team
  3. Document the risk acceptance
  4. Consider alternative controls (certificate pinning, SafetyNet/Play Integrity API, runtime tamper detection)

If your security team has already approved this, confirm that approval and run the following to check if there are other security controls in place:


🏁 Script executed:

#!/bin/bash
# Description: Check for alternative security controls in the codebase

# Check for SafetyNet or Play Integrity API usage
rg -n -C3 'SafetyNet|PlayIntegrity|AttestationClient' --type java

# Check for certificate pinning
rg -n -C3 'CertificatePinner|TrustManager|SSLContext' --type java

# Check for other root detection mechanisms
rg -n -C3 'isRooted|detectRoot|checkRoot' --type java

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check AndroidManifest for sensitive permissions
echo "=== Checking AndroidManifest.xml for sensitive permissions ==="
fd -e "AndroidManifest.xml" -x cat {} \; 2>/dev/null | grep -i "permission" | head -20

# Check for what this app actually does
echo -e "\n=== Checking for sensitive operations in MainActivity ==="
cat android/app/src/main/java/com/ionicframework/fyle595781/MainActivity.java 2>/dev/null | head -100

# Check if RootCheck is used elsewhere in codebase
echo -e "\n=== Checking if RootCheck is referenced elsewhere ==="
rg -n "RootCheck" --type java

# Check for any PR or commit message explaining this change
echo -e "\n=== Checking for documentation about security changes ==="
rg -n "VAPT|rooted|root.*device|security.*approval" --type java -i

Length of output: 2431


Thalaiva has spoken—the security fortress is now unprotected, da!

Your verification confirms what I suspected, machaan. Listen to the evidence:

The Damning Facts:

  • NO alternative security controls exist in the entire codebase (no SafetyNet, no Play Integrity API, no certificate pinning—nothing!)
  • Root device check DISABLED with zero replacement - you've removed the only guard standing at the gates
  • ✓ Tapjacking protection still active (good, at least that lock works)
  • Dead code and imports left behind (line 7: unused RootCheck import; lines 3 & 5: duplicate Bundle imports)

This is a Fyle app, pa—handling expense and financial data! You cannot trust rooted devices with this sensitive information. Attackers on rooted phones can intercept API calls, inject code, modify app behavior, or steal credentials.

Before this PR touches production, you MUST:

  1. Provide immediate justification with ClickUp ticket - Why is this control being removed?
  2. Get explicit security team written approval - Email evidence required, not just verbal
  3. Implement at least ONE replacement control:
    • Google Play Integrity API (modern SafetyNet replacement)
    • Certificate pinning for API communication
    • Runtime tamper detection for critical functions
    • Device attestation
  4. Clean up the dead code:
    • Remove line 7 (unused RootCheck import)
    • Remove lines 3 OR 5 (duplicate Bundle import)
    • Either remove commented lines 20-28 OR restore the functionality

The style is non-negotiable when it comes to security! This change cannot merge without proper approval documentation and replacement controls in place.

🤖 Prompt for AI Agents
In android/app/src/main/java/com/ionicframework/fyle595781/MainActivity.java
around lines 20 to 28, the root-check code has been commented out leaving dead
code and unused/duplicate imports; restore or replace the control and clean up
imports: either re-enable the RootCheck flow (show toast and finish on rooted
devices) or implement an approved replacement control (e.g., Play Integrity
attestation, certificate pinning, or runtime tamper detection) and attach the
security team approval/ClickUp ticket before merging, then remove the unused
RootCheck import (line ~7), delete the duplicate Bundle import (one of lines ~3
or ~5), and remove the commented-out block if you keep a replacement so no dead
code remains.

@github-actions
Copy link

Unit Test Coverage % values
Statements 95.01% ( 20813 / 21906 )
Branches 91.12% ( 7619 / 8361 )
Functions 94.15% ( 6121 / 6501 )
Lines 95.04% ( 20152 / 21202 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra Small PR

Development

Successfully merging this pull request may close these issues.

2 participants