What's Changed
- #49 feat: add Expo Device parity APIs (uptime, year class, sideloading) (@l2hyunwoo)
- #48 feat: add device integrity API for root/jailbreak detection (@l2hyunwoo)
- #41 test: Add e2e tests using react-native-harness (@l2hyunwoo)
Added
- Expo Device Parity APIs: New APIs to achieve feature parity with
expo-device
Device Integrity (#48) - isRootedExperimentalAsync() equivalent:
isDeviceCompromised(): boolean: Synchronous local-only detection (<50ms)verifyDeviceIntegrity(): Promise<boolean>: Async with SSH port scan on iOS (up to 200ms)- Returns
falseon emulators/simulators for development convenience
Android Root Detection:
- su binary paths, Magisk, KernelSU, APatch, Busybox
- Build props (
ro.debuggable,ro.secure, test-keys) - Legacy Superuser apps (SuperSU, Superuser.apk)
iOS Jailbreak Detection:
- Jailbreak apps (Cydia, Sileo, Zebra, Installer 5)
- URL schemes, system file write test, DYLD injection
- Symbolic links, SSH ports (22, 44)
System Resources (#49) - getUptimeAsync() equivalent:
getUptime(): number: Device uptime since boot in milliseconds (excludes deep sleep)- iOS: Uses
systemUptime - Android: Uses
uptimeMillis() - Both platforms return consistent "active time" matching expo-device behavior
- iOS: Uses
Device Capabilities (#49) - deviceYearClass equivalent:
deviceYearClass: number: Estimated device year class based on hardware specs- Extended Facebook algorithm updated for 2025 (supports 16GB+ RAM)
- RAM-based: ≤2GB→2013, ≤4GB→2015, ≤8GB→2019, ≤16GB→2023, >16GB→2025
- Cached after first access
Platform Capabilities (#49) - isSideLoadingEnabledAsync() equivalent:
isSideLoadingEnabled(): boolean: Check if sideloading is enabled (Android only)- Android 8.0+: Per-app permission (
canRequestPackageInstalls())- Requires
REQUEST_INSTALL_PACKAGESpermission in AndroidManifest.xml
- Requires
- Android 7.x: Global device setting
- iOS: Always returns
false
- Android 8.0+: Per-app permission (
Limitations (Device Integrity):
- Local detection only - Does NOT use Play Integrity API or iOS App Attest
- All detection methods can be bypassed (Magisk + Shamiko, RootHide, etc.)
- Use as one layer of defense-in-depth, not as sole security measure
Usage Example:
import { DeviceInfoModule } from 'react-native-nitro-device-info';
// Device integrity check
if (DeviceInfoModule.isDeviceCompromised()) {
console.warn('Rooted/Jailbroken device detected');
}
// Device uptime
const uptime = DeviceInfoModule.getUptime();
console.log(`Running for ${Math.floor(uptime / 1000 / 60 / 60)}h`);
// Device year class for feature toggling
const yearClass = DeviceInfoModule.deviceYearClass;
if (yearClass >= 2020) {
enableHighEndFeatures();
}
// Sideloading check (Android)
if (DeviceInfoModule.isSideLoadingEnabled()) {
console.warn('Sideloading enabled');
}Installation
npm install [email protected]
# or
yarn add [email protected]Documentation
Full Changelog: mcp-server-v1.0.1...v1.4.2