Skip to content

feat(device-utils): add StoreKit 2 installer lookup and installation time APIs - #332

Merged
huhuanming merged 6 commits into
mainfrom
feat/device-utils-install-info
Nov 26, 2026
Merged

huhuanming merged 6 commits into
mainfrom
feat/device-utils-install-info

Conversation

@huhuanming

@huhuanming huhuanming commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add getInstallerPackageNameAsync(): Promise<InstallerPackageName> to @onekeyfe/react-native-device-utils:
    • iOS 16.4+: Uses StoreKit 2 AppTransaction.shared without requesting a refresh instead of the deprecated Bundle.main.appStoreReceiptURL, prioritizing simulator (unknown) and embedded.mobileprovision (other), and mapping .production -> appStore, .sandbox -> testFlight, .xcode -> other, unverified/error -> unknown. The signed transaction may require connectivity or an authenticated App Store account, so a genuine store install can temporarily return unknown.
    • Android: Delegates asynchronously to PackageManager.getInstallSourceInfo / getInstallerPackageName.
    • Keep synchronous getInstallerPackageName() for backwards compatibility and mark it @deprecated for iOS callers.
  • Add symmetric getInstallationTime(): Promise<number> (Unix epoch milliseconds):
    • iOS: Reads sandbox Documents directory FileAttributeKey.creationDate off the main thread.
    • Android: Reads PackageInfo.firstInstallTime (API 33+ PackageInfoFlags.of(0) compatible) via Promise.async.
  • Link StoreKit and ship the DeviceUtils PrivacyInfo.xcprivacy resource bundle with file timestamp reason C617.1 and UserDefaults reason CA92.1 in the iOS pod.
  • Document the contract in native-modules/react-native-device-utils/docs/SPEC.md and README.md.

Verification

  • yarn workspace @onekeyfe/react-native-device-utils prepare (nitrogen + bob build)
  • yarn workspace @onekeyfe/react-native-device-utils typecheck
  • Android ./gradlew :onekeyfe_react-native-device-utils:assembleDebug
  • iOS xcodebuild test -workspace example.xcworkspace -scheme ReactNativeDeviceUtils-Unit-Tests (8 new XCTest cases in InstallInfoTests.swift + existing AppleAdsAttributionTests.swift)
  • Android Nitro bridge smoke test on API 29 and 34 matched PackageManager for installer values unknown and other and firstInstallTime at package-dump precision. On API 34, verified the owner and a secondary user with distinct install times.
  • Verified the SDK manifest in the npm package contents, in an unsigned iOS example archive before adding the UserDefaults declaration, and in current minimal consumer archives using CocoaPods static-library, static-framework, and dynamic-framework linkage.
  • Live StoreKit 2 AppTransaction.shared (production / sandbox) still requires an App Store or TestFlight device build.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@sidmorizon

Copy link
Copy Markdown
Contributor

Cursor review failed.

Remote error: cursor_permission_denied: HTTP 403 Forbidden: Cloud Agent is not available for free users. Please upgrade to Pro.

@cursor

cursor Bot commented Nov 26, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@sidmorizon

Copy link
Copy Markdown
Contributor

Devin Cloud review ↗

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T06:19:54.222785Z 166c694 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 166c694e2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sidmorizon

Copy link
Copy Markdown
Contributor

@huhuanming
huhuanming enabled auto-merge (squash) November 26, 2026 09:07
Comment thread example/react-native/smoke/README.md Resolved
limichange
limichange previously approved these changes Nov 26, 2026
@huhuanming
huhuanming merged commit d5d7e3a into main Nov 26, 2026
10 checks passed
@huhuanming
huhuanming deleted the feat/device-utils-install-info branch November 26, 2026 10:21
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.

5 participants