Repository navigation
Releases
Releases · CarlosSTS/rtn-utils
Version 1.0.4
What's new
Installed-app insights for Android (#3).
New methods
getInstalledApps(options?): lists launchable apps with their metadata: name, version, install/update time, target/min SDK, category, requested permission count, system flag and an optional base64 icon. When "Usage access" is granted it also returns foreground time, last-used time, launch count and storage size (app / data / cache /- Options:
includeSystemApps,includeIcons,sortBy(totalSize|usageTime|lastUsed|name),usagePeriod(day|week|month|year),limit. - Runs on a background thread.
- Options:
hasUsageAccessPermission(): checks whetherPACKAGE_USAGE_STATSis granted.openUsageAccessSettings(): opens the system "Usage access" screen.openAppSettings(packageName): opens the system "App info" screen for a package.getDeviceMemoryInfo(): device-wide RAM snapshot (total, available, used, low-memory flag and threshold).
Android manifest (merged into your app)
The library now ships an AndroidManifest.xml that adds:
android.permission.PACKAGE_USAGE_STATS: a special permission the user grants in Settings. It is only needed for the usage and storage fields.<queries>forMAIN/LAUNCHERandgeo:VIEW intents, so app listing andopenAppWithLocationwork on Android 11+ withoutQUERY_ALL_PACKAGES.
If your app doesn't use getInstalledApps and you don't want the permission declared, remove it with:
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:node="remove" />Other changes
- The
TurboModuletype is now imported fromreact-nativeinstead of the deepreact-native/Libraries/TurboModule/RCTExportpath. - README: docs for the new APIs and a local-development guide.
Notes
- Per-app RAM usage is not available: Android has no Play-compliant API for it.
launchCountcounts foreground transitions in the period, so it can be higher than the actual number of app launches.
Full Changelog: v1.0.3...v1.0.4
Version 1.0.3
Fixes
- Fix Android build failure on React Native 0.80+ (validated on RN 0.87):
e: UtilsModule.kt Function invocation 'getCurrentActivity()' expected.
ReactContextBaseJavaModuleis now Kotlin and no longer exposes a synthetic
currentActivityaccessor — the activity is now read via
reactApplicationContext.currentActivity. - Remove an always-false
intent == nullcheck ingetLocationApps.
Android build modernization
- Support React Native 0.87 / React 19 / Kotlin 2.2 / AGP 9 /
compileSdk36. android/build.gradle: pinned AGP 7.3.1 / Kotlin 1.7.22 classpaths are now applied
only for standalone builds; added Java 17compileOptions/kotlinOptions,
minSdk24 /targetSdk36 defaults, andbuildFeatures.buildConfig true.- Runtime dependency
com.facebook.react:react-native→com.facebook.react:react-android. TurboReactPackage→BaseReactPackage;ReactModuleInfo6-arg constructor
(dropped deprecatedhasConstants).
Notes
- No public API changes — drop-in upgrade from 1.0.2.
- Requires a host app on the New Architecture with JDK 17 / AGP 8+.
Full Changelog: v1.0.3...v1.0.3