diff --git a/.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch b/.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch new file mode 100644 index 0000000000..c52f22bd88 --- /dev/null +++ b/.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch @@ -0,0 +1,82 @@ +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 +@@ -74,11 +74,7 @@ public class JailMonkeyModule extends ReactContextBaseJavaModule { + final Map constants = new HashMap<>(); + + constants.put("isJailBroken", rootedCheck.isJailBroken()); +- constants.put("rootedDetectionMethods", rootedCheck.getResultByDetectionMethod()); +- constants.put("hookDetected", hookDetected(context)); +- constants.put("canMockLocation", isMockLocationOn(context)); +- constants.put("isOnExternalStorage", isOnExternalStorage(context)); +- constants.put("AdbEnabled", AdbEnabled(context)); + return constants; + } + } ++ +diff --git a/android/src/main/java/com/gantix/JailMonkey/Rooted/RootedCheck.java b/android/src/main/java/com/gantix/JailMonkey/Rooted/RootedCheck.java +index bf75f27fd11293205bf6d58de4f8069ea0a155fe..d63ac51b87e456bd13e252c7ca691c07e28704a5 100644 +--- a/android/src/main/java/com/gantix/JailMonkey/Rooted/RootedCheck.java ++++ b/android/src/main/java/com/gantix/JailMonkey/Rooted/RootedCheck.java +@@ -4,25 +4,44 @@ import android.content.Context; + import com.scottyab.rootbeer.RootBeer; + import java.util.HashMap; + import java.util.Map; ++import java.util.concurrent.CountDownLatch; ++ ++import androidx.tracing.Trace; + + public class RootedCheck { + private static boolean checkWithJailMonkeyMethod() { +- CheckApiVersion check; +- +- if (android.os.Build.VERSION.SDK_INT >= 23) { +- check = new GreaterThan23(); +- } else { +- check = new LessThan23(); ++ Trace.beginSection("[JailMonkey] checkWithJailMonkeyMethod"); ++ try { ++ CheckApiVersion check; ++ ++ if (android.os.Build.VERSION.SDK_INT >= 23) { ++ check = new GreaterThan23(); ++ } else { ++ check = new LessThan23(); ++ } ++ return check.checkRooted(); ++ } finally { ++ Trace.endSection(); + } +- return check.checkRooted(); + } + +- private final boolean jailMonkeyResult; +- private final RootBeerResults rootBeerResults; ++ private static boolean jailMonkeyResult; ++ private static RootBeerResults rootBeerResults; ++ private static CountDownLatch latch = new CountDownLatch(1); ++ public static void precompute(Context context) { ++ new Thread(() -> { ++ jailMonkeyResult = checkWithJailMonkeyMethod(); ++ rootBeerResults = new RootBeerResults(context); ++ latch.countDown(); ++ }).start(); ++ } + + public RootedCheck(Context context) { +- jailMonkeyResult = checkWithJailMonkeyMethod(); +- rootBeerResults = new RootBeerResults(context); ++ try { ++ latch.await(); ++ } catch (InterruptedException e) { ++ throw new RuntimeException(e); ++ } + } + + public boolean isJailBroken() { +@@ -87,3 +106,4 @@ public class RootedCheck { + } + } + } ++ diff --git a/.yarnrc.yml b/.yarnrc.yml index 23286945a0..cca2ec2804 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,5 @@ +checksumBehavior: update + enableScripts: false enableTelemetry: false @@ -6,13 +8,11 @@ nmHoistingLimits: workspaces nmSelfReferences: false -checksumBehavior: update - nodeLinker: node-modules plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs - spec: '@yarnpkg/plugin-workspace-tools' + spec: "@yarnpkg/plugin-workspace-tools" yarnPath: .yarn/releases/yarn-3.6.4.cjs diff --git a/package.json b/package.json index a01ed5103b..419bc25712 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "@scure/bip39/@noble/hashes": "1.8.0", "@scure/btc-signer/@noble/hashes": "1.8.0", "lodash@4.17.3": "4.17.21", - "@ledgerhq/hw-transport": "6.31.0" + "@ledgerhq/hw-transport": "6.31.0", + "jail-monkey@2.8.0": "patch:jail-monkey@npm%3A2.8.0#./.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch" }, "engines": { "node": ">=20.18.0", diff --git a/yarn.lock b/yarn.lock index 954bc38a1e..ca2ef615cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26522,6 +26522,13 @@ __metadata: languageName: node linkType: hard +"jail-monkey@patch:jail-monkey@npm%3A2.8.0#./.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch::locator=mobile-monorepo%40workspace%3A.": + version: 2.8.0 + resolution: "jail-monkey@patch:jail-monkey@npm%3A2.8.0#./.yarn/patches/jail-monkey-npm-2.8.0-77e4d06b40.patch::version=2.8.0&hash=225a6a&locator=mobile-monorepo%40workspace%3A." + checksum: c5caacdc4a38dcdd45209f55c3376d39cd2ea7ae788f90e4bdb270838cb8f13c1b5001a79cd7c6f1ed7f0d462c9ef2d0fbc959e1e48a26dff4dd9aa7ab9ab4f4 + languageName: node + linkType: hard + "jake@npm:^10.8.5": version: 10.9.2 resolution: "jake@npm:10.9.2" @@ -33161,7 +33168,7 @@ react-native-webview@ava-labs/react-native-webview: peerDependencies: react: "*" react-native: "*" - checksum: 44ee8c8ebc4dc4d3423e9045e1aebac31829eb518824e24f41b2bd10ab1e8343e824e9d912f259bfec7bfa798e96513cc05dbdcdf36087b2a43806f74a3b0fa2 + checksum: df3e07107bec2bab08ffe837b81a8e9d4b8f8a3940833dead94a6d994aa38253cfd5d4d9484ad24efe3bf2b89a6697fd6bf0750785e168b58f5ed5f74ff8383a languageName: node linkType: hard