expo-app-blocker 0.1.36 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,12 +90,8 @@ class ExpoAppBlockerModule : Module() {
90
90
 
91
91
  AsyncFunction("getInstalledApps") {
92
92
  val pm = context.packageManager
93
- val intent = Intent(Intent.ACTION_MAIN).apply {
94
- addCategory(Intent.CATEGORY_LAUNCHER)
95
- }
96
- val apps = pm.queryIntentActivities(intent, 0)
97
- apps.mapNotNull { resolveInfo ->
98
- val appInfo = resolveInfo.activityInfo.applicationInfo
93
+ val allApps = pm.getInstalledApplications(0)
94
+ allApps.mapNotNull { appInfo ->
99
95
  if (appInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0) return@mapNotNull null
100
96
  if (appInfo.packageName == context.packageName) return@mapNotNull null
101
97
 
@@ -474,7 +474,7 @@ public class ExpoAppBlockerModule: Module {
474
474
  }
475
475
 
476
476
  if !validWebDomainTokens.isEmpty {
477
- store.shield.webDomains = .specific(Set(validWebDomainTokens))
477
+ store.shield.webDomains = Set(validWebDomainTokens)
478
478
  } else {
479
479
  store.shield.webDomains = nil
480
480
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-app-blocker",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "Expo module for cross-platform app blocking. Android: UsageStatsManager + Overlay. iOS: Screen Time API (FamilyControls + ManagedSettings + DeviceActivity).",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -120,7 +120,7 @@ class AppBlockerDeviceActivityMonitor: DeviceActivityMonitor {
120
120
  }
121
121
 
122
122
  if !validWebDomainTokens.isEmpty {
123
- store.shield.webDomains = .specific(Set(validWebDomainTokens))
123
+ store.shield.webDomains = Set(validWebDomainTokens)
124
124
  } else {
125
125
  store.shield.webDomains = nil
126
126
  }