Skip to content

Conversation

@Szymon20000
Copy link
Contributor

@Szymon20000 Szymon20000 commented Oct 15, 2025

Description

Jailmonkey by default computes constants when we need them. The problem is that some operations it does are super slow. So instead we check if phone is rooted on background thread and return the answer right away without blocking anything.
Ticket: [CP-]

Please provide:

  • A summary of the changes
  • Motivation and context for this change
  • Any dependencies introduced
  • (If breaking) migration steps and instructions

Screenshots/Videos

Include relevant screenshots or screen recordings of iOS and Android.

Testing

Dev Testing (if applicable)

  • Provide steps to test the happy path of your feature
  • Provide steps to test edge cases and error states
  • Trigger a build on bitrise and reference it here
  • Move the ticket into the "Testing" column on Jira

QA Testing (if applicable)

  • Provide instructions for QA to test this feature thoroughly
  • State expected behavior / acceptance criteria

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have included screenshots / videos of android and ios
  • I have added testing steps
  • I have added/updated necessary unit tests
  • I have updated the documentation

- check = new GreaterThan23();
- } else {
- check = new LessThan23();
+ Trace.beginSection("[JailMonkey] checkWithJailMonkeyMethod");
Copy link
Collaborator

Choose a reason for hiding this comment

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

is all this tracing logic still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

diff --git a/android/src/main/java/com/gantix/JailMonkey/JailMonkeyModule.java b/android/src/main/java/com/gantix/JailMonkey/JailMonkeyModule.java
index 018d7051a57a2250c738e018ba8e1518d1b9525a..e89a135c10edc50174315c5cf0a3c9871fe65e6a 100644
--- a/android/src/main/java/com/gantix/JailMonkey/JailMonkeyModule.java
+++ b/android/src/main/java/com/gantix/JailMonkey/JailMonkeyModule.java
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you also drop a quick comment in packages/core-mobile/docs/patches.md about this patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Added a note about precomputing constants for jail-monkey checks.

Signed-off-by: Szymon Kapała <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants