diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml new file mode 100644 index 00000000..ba6573ca --- /dev/null +++ b/.github/workflows/package-publish.yml @@ -0,0 +1,19 @@ +name: package-publish + +on: workflow_dispatch + +jobs: + package-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - name: Install Package + run: yarn + - name: + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: yarn version:publish diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b4516087 --- /dev/null +++ b/.gitignore @@ -0,0 +1,79 @@ +node_modules +__generated__ + +.expo-shared +.expo +.DS_Store +.idea/ +.vscode/ +.chat/ +.claude/PRPs +.claude/settings.local.json +.clauderc +.tmp/ + +dist +build-electron +.next +build +*.tsbuildinfo +yarn-error.log + +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +.env +webpack.config.preview.json +webpack.config.preview.devServer.json + +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ +# !/apps/web-embed/web-build/ +/inpage-provider-bak + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +# Ignore yalc +.yalc/ +yalc.lock + +stats.json +stats.html +.java-version +.eslintcache +tsconfig.tsbuildinfo + +test-report.html + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# Ignore tamagui config file +.tamagui diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 00000000..526092ee --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1,6 @@ +compressionLevel: mixed + +enableGlobalCache: false + +nodeLinker: node-modules + diff --git a/README.md b/README.md index d562b180..7b602610 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# app-modules \ No newline at end of file +# app-modules + +## Create new package + +## Publish all package + +To update the versions of all workspace packages, run the following command in the project root directory: + +```shell +yarn version:bump +yarn version:apply +``` +Commit version changes and push to GitHub. + +Run publish package actions on GitHub. \ No newline at end of file diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..3ac5730a --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,42 @@ +# EXAMPLE USAGE: +# +# Refer for explanation to following link: +# https://lefthook.dev/configuration/ +# +# pre-push: +# jobs: +# - name: packages audit +# tags: +# - frontend +# - security +# run: yarn audit +# +# - name: gems audit +# tags: +# - backend +# - security +# run: bundle audit +# +# pre-commit: +# parallel: true +# jobs: +# - run: yarn eslint {staged_files} +# glob: "*.{js,ts,jsx,tsx}" +# +# - name: rubocop +# glob: "*.rb" +# exclude: +# - config/application.rb +# - config/routes.rb +# run: bundle exec rubocop --force-exclusion {all_files} +# +# - name: govet +# files: git ls-files -m +# glob: "*.go" +# run: go vet {files} +# +# - script: "hello.js" +# runner: node +# +# - script: "hello.go" +# runner: go run diff --git a/native-modules/react-native-lite-card/.editorconfig b/native-modules/react-native-lite-card/.editorconfig new file mode 100644 index 00000000..65365be6 --- /dev/null +++ b/native-modules/react-native-lite-card/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +indent_style = space +indent_size = 2 + +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/native-modules/react-native-lite-card/.gitattributes b/native-modules/react-native-lite-card/.gitattributes new file mode 100644 index 00000000..e27f70fa --- /dev/null +++ b/native-modules/react-native-lite-card/.gitattributes @@ -0,0 +1,3 @@ +*.pbxproj -text +# specific for windows script files +*.bat text eol=crlf diff --git a/native-modules/react-native-lite-card/.gitignore b/native-modules/react-native-lite-card/.gitignore new file mode 100644 index 00000000..67f32126 --- /dev/null +++ b/native-modules/react-native-lite-card/.gitignore @@ -0,0 +1,86 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.classpath +.cxx +.gradle +.idea +.project +.settings +local.properties +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +# Expo +.expo/ + +# Turborepo +.turbo/ + +# generated by bob +lib/ + +# React Native Codegen +ios/generated +android/generated + +# React Native Nitro Modules +nitrogen/ diff --git a/native-modules/react-native-lite-card/.nvmrc b/native-modules/react-native-lite-card/.nvmrc new file mode 100644 index 00000000..c004e356 --- /dev/null +++ b/native-modules/react-native-lite-card/.nvmrc @@ -0,0 +1 @@ +v22.20.0 diff --git a/native-modules/react-native-lite-card/.watchmanconfig b/native-modules/react-native-lite-card/.watchmanconfig new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/native-modules/react-native-lite-card/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/CODE_OF_CONDUCT.md b/native-modules/react-native-lite-card/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..45d257b2 --- /dev/null +++ b/native-modules/react-native-lite-card/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/native-modules/react-native-lite-card/CONTRIBUTING.md b/native-modules/react-native-lite-card/CONTRIBUTING.md new file mode 100644 index 00000000..f1da3822 --- /dev/null +++ b/native-modules/react-native-lite-card/CONTRIBUTING.md @@ -0,0 +1,132 @@ +# Contributing + +Contributions are always welcome, no matter how large or small! + +We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md). + +## Development workflow + +This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages: + +- The library package in the root directory. +- An example app in the `example/` directory. + +To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project. + +Run `yarn` in the root directory to install the required dependencies for each package: + +```sh +yarn +``` + +> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating. + +The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. + +It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app. + +If you want to use Android Studio or Xcode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ReactNativeLiteCardExample.xcworkspace` in Xcode and find the source files at `Pods > Development Pods > @onekeyfe/react-native-lite-card`. + +To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `onekeyfe-react-native-lite-card` under `Android`. + +You can use various commands from the root directory to work with the project. + +To start the packager: + +```sh +yarn example start +``` + +To run the example app on Android: + +```sh +yarn example android +``` + +To run the example app on iOS: + +```sh +yarn example ios +``` + +To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this: + +```sh +Running "ReactNativeLiteCardExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1} +``` + +Note the `"fabric":true` and `"concurrentRoot":true` properties. + +Make sure your code passes TypeScript: + +```sh +yarn typecheck +``` + +To check for linting errors, run the following: + +```sh +yarn lint +``` + +To fix formatting errors, run the following: + +```sh +yarn lint --fix +``` + +Remember to add tests for your change if possible. Run the unit tests by: + +```sh +yarn test +``` + + +### Commit message convention + +We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: + +- `fix`: bug fixes, e.g. fix crash due to deprecated method. +- `feat`: new features, e.g. add new method to the module. +- `refactor`: code refactor, e.g. migrate from class components to hooks. +- `docs`: changes into documentation, e.g. add usage example for the module. +- `test`: adding or updating tests, e.g. add integration tests using detox. +- `chore`: tooling changes, e.g. change CI config. + +Our pre-commit hooks verify that your commit message matches this format when committing. + + +### Publishing to npm + +We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. + +To publish new versions, run the following: + +```sh +yarn release +``` + + +### Scripts + +The `package.json` file contains various scripts for common tasks: + +- `yarn`: setup project by installing dependencies. +- `yarn typecheck`: type-check files with TypeScript. +- `yarn lint`: lint files with [ESLint](https://eslint.org/). +- `yarn test`: run unit tests with [Jest](https://jestjs.io/). +- `yarn example start`: start the Metro server for the example app. +- `yarn example android`: run the example app on Android. +- `yarn example ios`: run the example app on iOS. + +### Sending a pull request + +> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). + +When you're sending a pull request: + +- Prefer small pull requests focused on one change. +- Verify that linters and tests are passing. +- Review the documentation to make sure it looks good. +- Follow the pull request template when opening a pull request. +- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. diff --git a/native-modules/react-native-lite-card/LICENSE b/native-modules/react-native-lite-card/LICENSE new file mode 100644 index 00000000..9d2574bc --- /dev/null +++ b/native-modules/react-native-lite-card/LICENSE @@ -0,0 +1,20 @@ +MIT License + +Copyright (c) 2025 @onekeyfe +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/native-modules/react-native-lite-card/README.md b/native-modules/react-native-lite-card/README.md new file mode 100644 index 00000000..e52a9ecd --- /dev/null +++ b/native-modules/react-native-lite-card/README.md @@ -0,0 +1,37 @@ +# @onekeyfe/react-native-lite-card + +lite card + +## Installation + + +```sh +npm install @onekeyfe/react-native-lite-card +``` + + +## Usage + + +```js +import { multiply } from '@onekeyfe/react-native-lite-card'; + +// ... + +const result = multiply(3, 7); +``` + + +## Contributing + +- [Development workflow](CONTRIBUTING.md#development-workflow) +- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request) +- [Code of conduct](CODE_OF_CONDUCT.md) + +## License + +MIT + +--- + +Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) diff --git a/native-modules/react-native-lite-card/ReactNativeLiteCard.podspec b/native-modules/react-native-lite-card/ReactNativeLiteCard.podspec new file mode 100644 index 00000000..6f5f23a8 --- /dev/null +++ b/native-modules/react-native-lite-card/ReactNativeLiteCard.podspec @@ -0,0 +1,22 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) + +Pod::Spec.new do |s| + s.name = "ReactNativeLiteCard" + s.version = package["version"] + s.summary = package["description"] + s.homepage = package["homepage"] + s.license = package["license"] + s.authors = package["author"] + + s.platforms = { :ios => min_ios_version_supported } + s.source = { :git => "https://github.com/OneKeyHQ/app-modules/onekeyfe-react-native-lite-card.git", :tag => "#{s.version}" } + + s.source_files = "ios/**/*.{h,m,mm,swift,cpp}", "keys/**/*.{h,c,m,mm,swift,cpp}" + s.vendored_framework = "ios/GPChannelSDKCore.xcframework" + s.private_header_files = "ios/**/*.h" + + + install_modules_dependencies(s) +end diff --git a/native-modules/react-native-lite-card/android/build.gradle b/native-modules/react-native-lite-card/android/build.gradle new file mode 100644 index 00000000..b0f7119f --- /dev/null +++ b/native-modules/react-native-lite-card/android/build.gradle @@ -0,0 +1,79 @@ +buildscript { + ext.getExtOrDefault = {name -> + return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeLiteCard_' + name] + } + + repositories { + google() + mavenCentral() + } + + dependencies { + classpath "com.android.tools.build:gradle:8.7.2" + // noinspection DifferentKotlinGradleVersion + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}" + } +} + + +apply plugin: "com.android.library" +apply plugin: "kotlin-android" + +apply plugin: "com.facebook.react" + +def getExtOrIntegerDefault(name) { + return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeLiteCard_" + name]).toInteger() +} + +android { + namespace "com.onekeyfe.reactnativelitecard" + + compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") + + defaultConfig { + minSdkVersion getExtOrIntegerDefault("minSdkVersion") + targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") + } + + buildFeatures { + buildConfig true + } + + buildTypes { + release { + minifyEnabled false + } + } + + lintOptions { + disable "GradleCompatible" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + sourceSets { + main { + java.srcDirs += [ + "generated/java", + "generated/jni" + ] + } + } +} + +repositories { + mavenCentral() + google() +} + +def kotlin_version = getExtOrDefault("kotlinVersion") + +dependencies { + implementation "com.facebook.react:react-android" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'com.google.code.gson:gson:2.10.1' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' +} diff --git a/native-modules/react-native-lite-card/android/gradle.properties b/native-modules/react-native-lite-card/android/gradle.properties new file mode 100644 index 00000000..8b9b1979 --- /dev/null +++ b/native-modules/react-native-lite-card/android/gradle.properties @@ -0,0 +1,5 @@ +ReactNativeLiteCard_kotlinVersion=2.0.21 +ReactNativeLiteCard_minSdkVersion=24 +ReactNativeLiteCard_targetSdkVersion=34 +ReactNativeLiteCard_compileSdkVersion=35 +ReactNativeLiteCard_ndkVersion=27.1.12297006 diff --git a/native-modules/react-native-lite-card/android/src/main/AndroidManifest.xml b/native-modules/react-native-lite-card/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a2f47b60 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/native-modules/react-native-lite-card/android/src/main/config/command.json b/native-modules/react-native-lite-card/android/src/main/config/command.json new file mode 100644 index 00000000..7c16f07c --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/config/command.json @@ -0,0 +1,205 @@ +{ + "verify_certificate": { + "v1": { + "area": "none", + "command": "802A1810", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "none", + "command": "802A1810", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": true + } + }, + "verify_auth_data": { + "v1": { + "area": "none", + "command": "80821815", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "none", + "command": "80821815", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": true + } + }, + "select_primary_safety": { + "v1": { + "area": "none", + "command": "00A40400", + "useSafeChannel": false, + "needData": false + }, + "v2": { + "area": "none", + "command": "00A40400", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": false + } + }, + "select_backup_applet": { + "v1": { + "area": "none", + "command": "00A40400", + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "none", + "command": "00A40400", + "ignoreSafeChannel": true, + "useSafeChannel": false, + "needData": true + } + }, + "get_backup_status": { + "v1": { + "area": "backup", + "command": "806A0000", + "useSafeChannel": false, + "needData": false + }, + "v2": { + "area": "backup", + "command": "806A0000", + "useSafeChannel": false, + "needData": false + } + }, + "get_pin_status": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": false, + "needData": true + } + }, + "get_serial_number": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": false, + "useSafeChannelWhenOpen": true, + "needData": true + } + }, + "get_pin_retry_count": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": false, + "needData": true + } + }, + "reset_card": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + } + }, + "verify_pin": { + "v1": { + "area": "backup", + "command": "80200000", + "useSafeChannel": true, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80200000", + "useSafeChannel": true, + "needData": true + } + }, + "setup_new_pin": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + } + }, + "change_pin": { + "v1": { + "area": "master", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + }, + "v2": { + "area": "backup", + "command": "80CB8000", + "useSafeChannel": true, + "needData": true + } + }, + "backup_data": { + "v1": { + "area": "backup", + "command": "803B0000", + "useSafeChannel": false, + "needData": true + }, + "v2": { + "area": "backup", + "command": "803B0000", + "useSafeChannel": true, + "needData": true + } + }, + "export_data": { + "v1": { + "area": "backup", + "command": "804B0000", + "useSafeChannel": false, + "needData": false + }, + "v2": { + "area": "backup", + "command": "804B0000", + "useSafeChannel": true, + "needData": false + } + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/cpp/CMakeLists.txt b/native-modules/react-native-lite-card/android/src/main/cpp/CMakeLists.txt new file mode 100644 index 00000000..0480b0dd --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/cpp/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.4.1) + +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Os -Oz") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Os -Oz") +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) + +# Support for Android 15 16KB page size +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384") + +add_library(keys SHARED + ../../../../keys/keys.c + validation.c) + +# Include libraries needed for native-lib lib +target_link_libraries(keys + android + log) \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/cpp/validation.c b/native-modules/react-native-lite-card/android/src/main/cpp/validation.c new file mode 100644 index 00000000..fbb83576 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/cpp/validation.c @@ -0,0 +1,227 @@ +#include "validation.h" +#include + +// 查看签名信息:gradlew sR +// 签名信息 +const char hexcode[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', + 'F'}; + +char *signatureSha1(JNIEnv *pInterface, jbyteArray pVoid); + +/** + * 获取 Android 系统版本 + * @return 系统版本号 + */ +int currentAndroidOSVersion() { + int version; + + char sdk_ver_str[8]; + if (__system_property_get("ro.build.version.sdk", sdk_ver_str)) { + version = atoi(sdk_ver_str); + } else { + version = 0; + } + return version; +} + +jbyteArray getSignatureSha1By1(JNIEnv *env, jobject context_object) { + //上下文对象 + jclass context_class = (*env)->GetObjectClass(env, context_object); + + //反射获取PackageManager + jmethodID methodId = (*env)->GetMethodID(env, context_class, "getPackageManager", + "()Landroid/content/pm/PackageManager;"); + jobject package_manager = (*env)->CallObjectMethod(env, context_object, methodId); + if (package_manager == NULL) { + LOGD("package_manager is NULL!!!"); + return NULL; + } + + //反射获取包名 + methodId = (*env)->GetMethodID(env, context_class, "getPackageName", "()Ljava/lang/String;"); + jstring package_name = (jstring)(*env)->CallObjectMethod(env, context_object, methodId); + if (package_name == NULL) { + LOGD("package_name is NULL!!!"); + return NULL; + } + (*env)->DeleteLocalRef(env, context_class); + + //获取PackageInfo对象 + jclass pack_manager_class = (*env)->GetObjectClass(env, package_manager); + methodId = (*env)->GetMethodID(env, pack_manager_class, "getPackageInfo", + "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;"); + (*env)->DeleteLocalRef(env, pack_manager_class); + jobject package_info = (*env)->CallObjectMethod(env, package_manager, methodId, package_name, + 0x00000040); + if (package_info == NULL) { + LOGD("getPackageInfo() is NULL!!!"); + return NULL; + } + (*env)->DeleteLocalRef(env, package_manager); + + //获取签名信息 + jclass package_info_class = (*env)->GetObjectClass(env, package_info); + jfieldID fieldId = (*env)->GetFieldID(env, package_info_class, "signatures", + "[Landroid/content/pm/Signature;"); + (*env)->DeleteLocalRef(env, package_info_class); + jobjectArray signature_object_array = (jobjectArray)(*env)->GetObjectField(env, package_info, + fieldId); + if (signature_object_array == NULL) { + LOGD("signature is NULL!!!"); + return NULL; + } + jobject signature_object = (*env)->GetObjectArrayElement(env, signature_object_array, 0); + (*env)->DeleteLocalRef(env, package_info); + + jclass signature_class = (*env)->GetObjectClass(env, signature_object); + methodId = (*env)->GetMethodID(env, signature_class, "toByteArray", "()[B"); + (*env)->DeleteLocalRef(env, signature_class); + jbyteArray signature_byte = (jbyteArray)(*env)->CallObjectMethod(env, signature_object, + methodId); + return signature_byte; +} + +jbyteArray getSignatureSha1By28(JNIEnv *env, jobject context_object) { + //上下文对象 + jclass context_class = (*env)->GetObjectClass(env, context_object); + + //反射获取PackageManager + jmethodID methodId = (*env)->GetMethodID(env, context_class, "getPackageManager", + "()Landroid/content/pm/PackageManager;"); + jobject package_manager = (*env)->CallObjectMethod(env, context_object, methodId); + if (package_manager == NULL) { + LOGD("package_manager is NULL!!!"); + return NULL; + } + + //反射获取包名 + methodId = (*env)->GetMethodID(env, context_class, "getPackageName", "()Ljava/lang/String;"); + jstring package_name = (jstring)(*env)->CallObjectMethod(env, context_object, methodId); + if (package_name == NULL) { + LOGD("package_name is NULL!!!"); + return NULL; + } + (*env)->DeleteLocalRef(env, context_class); + + //获取PackageInfo对象 + jclass pack_manager_class = (*env)->GetObjectClass(env, package_manager); + methodId = (*env)->GetMethodID(env, pack_manager_class, "getPackageInfo", + "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;"); + (*env)->DeleteLocalRef(env, pack_manager_class); + jobject package_info = (*env)->CallObjectMethod(env, package_manager, methodId, package_name, + 0x08000000); + if (package_info == NULL) { + LOGD("getPackageInfo() is NULL!!!"); + return NULL; + } + (*env)->DeleteLocalRef(env, package_manager); + + //获取SigningInfo对象 + jclass package_info_class = (*env)->GetObjectClass(env, package_info); + jfieldID fieldId = (*env)->GetFieldID(env, package_info_class, "signingInfo", + "Landroid/content/pm/SigningInfo;"); + (*env)->DeleteLocalRef(env, package_info_class); + jobject signing_info = (jobjectArray)(*env)->GetObjectField(env, package_info, + fieldId); + if (signing_info == NULL) { + LOGD("signingInfo is NULL!!!"); + return NULL; + } + + //获取签名信息 + jclass signing_info_class = (*env)->GetObjectClass(env, signing_info); + methodId = (*env)->GetMethodID(env, signing_info_class, "getApkContentsSigners", + "()[Landroid/content/pm/Signature;"); + (*env)->DeleteLocalRef(env, signing_info_class); + jobjectArray signature_object_array = (jobjectArray)(*env)->CallObjectMethod(env, signing_info, + methodId); + if (signature_object_array == NULL) { + LOGD("signature is NULL!!!"); + return NULL; + } + jobject signature_object = (*env)->GetObjectArrayElement(env, signature_object_array, 0); + (*env)->DeleteLocalRef(env, signing_info); + + jclass signature_class = (*env)->GetObjectClass(env, signature_object); + methodId = (*env)->GetMethodID(env, signature_class, "toByteArray", "()[B"); + (*env)->DeleteLocalRef(env, signature_class); + jbyteArray signature_byte = (jbyteArray)(*env)->CallObjectMethod(env, signature_object, + methodId); + return signature_byte; +} + +char *getSignatureSha1(JNIEnv *env, jobject context_object) { + + LOGD("android version is %d", currentAndroidOSVersion()); + int version = currentAndroidOSVersion(); + jbyteArray signature_byte; + if (version >= 28) { + signature_byte = getSignatureSha1By28(env, context_object); + } else { + signature_byte = getSignatureSha1By1(env, context_object); + } + //签名信息转换成sha1值 + return signatureSha1(env, signature_byte); +} + +char *signatureSha1(JNIEnv *env, jbyteArray message) { + jclass byte_array_input_class = (*env)->FindClass(env, "java/io/ByteArrayInputStream"); + jmethodID methodId = (*env)->GetMethodID(env, byte_array_input_class, "", "([B)V"); + jobject byte_array_input = (*env)->NewObject(env, byte_array_input_class, methodId, + message); + jclass certificate_factory_class = (*env)->FindClass(env, + "java/security/cert/CertificateFactory"); + methodId = (*env)->GetStaticMethodID(env, certificate_factory_class, "getInstance", + "(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;"); + jstring x_509_jstring = (*env)->NewStringUTF(env, "X.509"); + jobject cert_factory = (*env)->CallStaticObjectMethod(env, certificate_factory_class, methodId, + x_509_jstring); + methodId = (*env)->GetMethodID(env, certificate_factory_class, "generateCertificate", + ("(Ljava/io/InputStream;)Ljava/security/cert/Certificate;")); + jobject x509_cert = (*env)->CallObjectMethod(env, cert_factory, methodId, byte_array_input); + (*env)->DeleteLocalRef(env, certificate_factory_class); + jclass x509_cert_class = (*env)->GetObjectClass(env, x509_cert); + methodId = (*env)->GetMethodID(env, x509_cert_class, "getEncoded", "()[B"); + jbyteArray cert_byte = (jbyteArray)(*env)->CallObjectMethod(env, x509_cert, methodId); + (*env)->DeleteLocalRef(env, x509_cert_class); + jclass message_digest_class = (*env)->FindClass(env, "java/security/MessageDigest"); + methodId = (*env)->GetStaticMethodID(env, message_digest_class, "getInstance", + "(Ljava/lang/String;)Ljava/security/MessageDigest;"); + jstring sha1_jstring = (*env)->NewStringUTF(env, "SHA1"); + jobject sha1_digest = (*env)->CallStaticObjectMethod(env, message_digest_class, methodId, + sha1_jstring); + methodId = (*env)->GetMethodID(env, message_digest_class, "digest", "([B)[B"); + jbyteArray sha1_byte = (jbyteArray)(*env)->CallObjectMethod(env, sha1_digest, methodId, + cert_byte); + (*env)->DeleteLocalRef(env, message_digest_class); + + //转换成char + jsize array_size = (*env)->GetArrayLength(env, sha1_byte); + unsigned char *sha1 = (unsigned char *) (*env)->GetByteArrayElements(env, sha1_byte, 0); + char *hex_sha = malloc(array_size * 2 + 1); + for (int i = 0; i < array_size; ++i) { + hex_sha[2 * i] = hexcode[(sha1[i]) / 16]; + hex_sha[2 * i + 1] = hexcode[(sha1[i]) % 16]; + } + hex_sha[array_size * 2] = '\0'; + + return hex_sha; +} + +jboolean checkValidity(char *sha1, char * app_sha1[], size_t size) { + //比较签名 + for (int i = 0; i < size; ++i) { + const char *current = app_sha1[i]; + if (strcmp(sha1, current) == 0) { + LOGD("signature is success."); + return JNI_TRUE; + } + } + LOGD("signature is error."); + return JNI_FALSE; +} + +jboolean checkSecurityPermission(JNIEnv *env, jobject contextObject, char * app_sha1[], size_t size) { + char *sha1 = getSignatureSha1(env, contextObject); + return checkValidity(sha1, app_sha1, size); +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/cpp/validation.h b/native-modules/react-native-lite-card/android/src/main/cpp/validation.h new file mode 100644 index 00000000..ef3554fb --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/cpp/validation.h @@ -0,0 +1,19 @@ +#ifndef VALIDATION_H_ +#define VALIDATION_H_ + +#include +#include +#include +#include +#include + +#define TAG "AuthorityKey Jni Log" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG,__VA_ARGS__) + +char *getSignatureSha1(JNIEnv *env, jobject context_object); + +jboolean checkValidity(char *sha1, char * app_sha1[], size_t size); + +jboolean checkSecurityPermission(JNIEnv *env, jobject context_object, char * app_sha1[], size_t size); + +#endif /* VALIDATION_H_ */ \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/LoggerManager.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/LoggerManager.kt new file mode 100644 index 00000000..62d102f2 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/LoggerManager.kt @@ -0,0 +1,35 @@ +package so.onekey.app.wallet.lite + +import android.util.Log +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.bridge.ReactContextBaseJavaModule +import com.facebook.react.bridge.ReactMethod +import so.onekey.app.wallet.lite.utils.sendEvent + +class LoggerManager(private val context: ReactApplicationContext) : + ReactContextBaseJavaModule(context) { + + companion object { + private val TAG = LoggerManager::class.simpleName.toString() + + private const val LOG_EVENT_INFO = "native_log_info" + + private var instance: LoggerManager? = null + + fun getInstance(): LoggerManager? { + return instance + } + } + + init { + instance = this + } + + override fun getName(): String = TAG + + @ReactMethod + public fun logInfo(message: String) { + Log.d(TAG, message) + sendEvent(context, LOG_EVENT_INFO, message) + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardModule.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardModule.kt new file mode 100644 index 00000000..b476006d --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardModule.kt @@ -0,0 +1,420 @@ +package com.onekeyfe.reactnativelitecard + +import android.content.Intent +import android.nfc.NfcAdapter +import android.nfc.Tag +import android.nfc.tech.IsoDep +import android.util.Log +import androidx.annotation.IntDef +import androidx.fragment.app.FragmentActivity +import kotlinx.coroutines.* +import kotlinx.coroutines.channels.Channel +import com.facebook.react.bridge.Callback +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.annotations.ReactModule +import so.onekey.app.wallet.lite.nfc.NFCExceptions +import so.onekey.app.wallet.lite.nfc.NfcUtils +import so.onekey.app.wallet.lite.onekeyLite.OneKeyLiteCard +import so.onekey.app.wallet.lite.onekeyLite.entitys.CardState +import so.onekey.app.wallet.lite.utils.NfcPermissionUtils +import so.onekey.app.wallet.lite.utils.Utils +import java.util.concurrent.atomic.AtomicInteger +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.BaseActivityEventListener +import com.facebook.react.bridge.LifecycleEventListener +import com.facebook.react.bridge.WritableMap +import so.onekey.app.wallet.lite.nfc.broadcast.NfcStatusChangeBroadcastReceiver +import java.util.concurrent.Executors.newFixedThreadPool + +private val NFCDispatcher = newFixedThreadPool(1).asCoroutineDispatcher() +public fun NFCScope(): CoroutineScope = CoroutineScope(SupervisorJob() + NFCDispatcher) + +@ReactModule(name = ReactNativeLiteCardModule.NAME) +class ReactNativeLiteCardModule(reactContext: ReactApplicationContext) : + NativeReactNativeLiteCardSpec(reactContext), LifecycleEventListener, CoroutineScope by NFCScope() { + + companion object { + const val NAME = "ReactNativeLiteCard" + private val TAG = ReactNativeLiteCardModule::class.simpleName + } + + @IntDef(NFCState.Dead, NFCState.Started) + annotation class NFCState { + companion object { + const val Dead = -1 + const val Started = 0 + } + } + + override fun getName(): String { + return NAME + } + + private val mNFCConnectedChannel = Channel(1) + private var lastIsoDep: IsoDep? = null + private val mNFCState = AtomicInteger(NFCState.Dead) + private val mShowDialogNumber = AtomicInteger(0) + private var mCurrentCardState: CardState? = null + + private val mActivityEventListener = object : BaseActivityEventListener() { + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + val action = intent.action + if (action == null) { + return + } + if ((action == NfcAdapter.ACTION_NDEF_DISCOVERED) + || action == NfcAdapter.ACTION_TECH_DISCOVERED + || action == NfcAdapter.ACTION_TAG_DISCOVERED + ) { + val tags = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG) + val isoDep: IsoDep? = IsoDep.get(tags) + if (isoDep == null) { + // 未知设备 + val dataMap = Arguments.createMap().apply { + putString("type", "unknown") + } + emitOnNFCActiveConnection(dataMap) + Log.d(TAG, "Unknown device") + return + } + + Log.d(TAG, isoDep.toString()) + launch(Dispatchers.IO) { + mNFCConnectedChannel.trySend(isoDep) + try { + // 处理主动触发 NFC + delay(100) + if (!mNFCConnectedChannel.isEmpty) { + Log.e(TAG, "There is no way to use NFC") +// mNFCConnectedChannel.receive() + val startRequest = OneKeyLiteCard.initRequest(isoDep) + val dataMap = Arguments.createMap().apply { + putInt("code", -1) + putString("type", "OneKey_Lite") + putString("serialNum", startRequest.serialNum) + putBoolean("isNewCard", startRequest.isNewCard) + putBoolean("hasBackup", startRequest.hasBackup) + } + emitOnNFCActiveConnection(dataMap) + } + } catch (e: Exception) { + e.printStackTrace() + // 未知设备或连接失败 + val dataMap = Arguments.createMap().apply { + putInt("code", -1) + putString("type", "unknown") + } + emitOnNFCActiveConnection(dataMap) + emitOnNFCActiveConnection(dataMap) + } + } + } + } + } + + init { + reactContext.addLifecycleEventListener(this) + reactContext.addActivityEventListener(mActivityEventListener) + } + + private fun releaseDevice() { + if (mShowDialogNumber.get() <= 0) return + + mCurrentCardState = null + val decrementAndGet = mShowDialogNumber.decrementAndGet() + + // 关闭连接结束 ui + emitOnNFCUIEvent(Arguments.createMap().also { + it.putInt("code", 3) + it.putString("message", "close_connect_ui") + }) + + // 还有需要处理的 NFC 事件 + if (decrementAndGet > 0) { + // 展示连接 ui + emitOnNFCUIEvent(Arguments.createMap().also { + it.putInt("code", 1) + it.putString("message", "show_connect_ui") + }) + } + } + + @Throws(NFCExceptions::class) + private suspend fun acquireDevice(): IsoDep? { + // 展示连接 ui + emitOnNFCUIEvent(Arguments.createMap().also { + it.putInt("code", 1) + it.putString("message", "show_connect_ui") + }) + mShowDialogNumber.incrementAndGet() + val tryReceiveResult = mNFCConnectedChannel.tryReceive() + + fun IsoDep?.isSafeConnected(): Boolean { + return runCatching { this?.isConnected ?: false }.getOrDefault(false) + } + var receiveIsoDep: IsoDep? = null + + if (tryReceiveResult.isSuccess) { + receiveIsoDep = tryReceiveResult.getOrNull() + if (!receiveIsoDep.isSafeConnected()) { + receiveIsoDep = null + } + } + + if (receiveIsoDep == null && lastIsoDep.isSafeConnected()) { + receiveIsoDep = lastIsoDep + } + if (receiveIsoDep == null) { + receiveIsoDep = mNFCConnectedChannel.receive() + } + + lastIsoDep = receiveIsoDep + if (receiveIsoDep == null) { + // 取消连接 + releaseDevice() + } else { + val initChannelRequest = OneKeyLiteCard.initRequest(receiveIsoDep) + + mCurrentCardState = initChannelRequest + + // 展示连接结束 ui + emitOnNFCUIEvent(Arguments.createMap().also { + it.putInt("code", 2) + it.putString("message", "connected") + }) + } + return receiveIsoDep + } + + private suspend fun handleOperation( + callback: Callback?, + execute: (isoDep: IsoDep) -> T + ) { + val topActivity = Utils.getTopActivity() ?: return + NfcPermissionUtils.checkPermission(topActivity) { + try { + Log.d(TAG, "NFC permission check success") + val isoDep = acquireDevice() ?: return + val executeResult = execute(isoDep) + callback?.invoke(null, executeResult, mCurrentCardState.createArguments()) + } catch (e: NFCExceptions) { + Log.e(TAG, "NFC device execute error", e) + callback?.invoke(e.createArguments(), null, mCurrentCardState.createArguments()) + } finally { + releaseDevice() + } + return + } + // 没有 NFC 使用权限 + Log.d(TAG, "NFC device not permission") + callback?.invoke(NFCExceptions.NotNFCPermission().createArguments(), null, null) + } + + private fun CardState?.createArguments(): WritableMap { + val map = Arguments.createMap() + if (this == null) return map + map.putBoolean("hasBackup", this.hasBackup) + map.putBoolean("isNewCard", this.isNewCard) + map.putString("serialNum", this.serialNum) + map.putInt("pinRetryCount", this.pinRetryCount) + return map + } + + private fun NFCExceptions?.createArguments(): WritableMap { + val map = Arguments.createMap() + if (this == null) return map + map.putInt("code", this.code) + map.putString("message", this.message) + return map + } + + override fun getLiteInfo(callback: Callback?) { + launch { + Log.d(TAG, "getLiteInfo") + handleOperation(callback) { isoDep -> + Log.e(TAG, "getLiteInfo Obtain the device") + val cardInfo = OneKeyLiteCard.getCardInfo(isoDep) + Log.e(TAG, "getLiteInfo result $cardInfo") + cardInfo.createArguments() + } + } + } + + override fun checkNFCPermission(callback: Callback?) { + val topActivity = Utils.getTopActivity() + if (topActivity == null) { + callback?.invoke(NFCExceptions.InitializedException().createArguments(), null, null) + return + } + val isNfcExists = NfcUtils.isNfcExits(topActivity) + if (!isNfcExists) { + // 没有 NFC 设备 + Log.d(TAG, "NFC device not found") + callback?.invoke(NFCExceptions.NotExistsNFC().createArguments(), null, null) + return + } + + val isNfcEnable = NfcUtils.isNfcEnable(topActivity) + if (!isNfcEnable) { + // 没有打开 NFC 开关 + Log.d(TAG, "NFC device not enable") + callback?.invoke(NFCExceptions.NotEnableNFC().createArguments(), null, null) + return + } + NfcPermissionUtils.checkPermission(topActivity) { + callback?.invoke(null, null, null) + return + } + // 没有 NFC 使用权限 + Log.d(TAG, "NFC device not permission") + callback?.invoke(NFCExceptions.NotNFCPermission().createArguments(), null, null) + } + + override fun setMnemonic( + mnemonic: String?, + pwd: String?, + overwrite: Boolean, + callback: Callback? + ) { + launch { + handleOperation(callback) { isoDep -> + Log.e(TAG, "setMnemonic Obtain the device") + val isSuccess = + OneKeyLiteCard.setMnemonic( + mCurrentCardState, + isoDep, + mnemonic, + pwd, + overwrite + ) + if (!isSuccess) throw NFCExceptions.ExecFailureException() + Log.e(TAG, "setMnemonic result success") + true + } + } + } + + override fun getMnemonicWithPin( + pwd: String, + callback: Callback? + ) { + launch { + Log.d(TAG, "getMnemonicWithPin") + handleOperation(callback) { isoDep -> + Log.e(TAG, "getMnemonicWithPin Obtain the device") + OneKeyLiteCard.getMnemonicWithPin(mCurrentCardState, isoDep, pwd) + } + } + } + + override fun changePin( + oldPin: String, + newPin: String, + callback: Callback? + ) { + launch { + Log.d(TAG, "changePin") + handleOperation(callback) { isoDep -> + Log.e(TAG, "changePin Obtain the device") + OneKeyLiteCard.changPin(mCurrentCardState, isoDep, oldPin, newPin) + } + } + } + + override fun reset(callback: Callback?) { + launch { + Log.d(TAG, "reset") + handleOperation(callback) { isoDep -> + Log.e(TAG, "reset Obtain the device") + val isSuccess = OneKeyLiteCard.reset(isoDep) + if (!isSuccess) throw NFCExceptions.ExecFailureException() + Log.e(TAG, "reset result success") + true + } + } + } + + override fun cancel() { + if (mNFCConnectedChannel.isEmpty) { + mNFCConnectedChannel.trySend(null) + } + } + + override fun intoSetting() { + launch { + Log.d(TAG, "intoSetting") + Utils.getTopActivity()?.let { + NfcUtils.intentToNfcSetting(it) + } + } + } + + private val mNfcStateBroadcastReceiver by lazy { + object : NfcStatusChangeBroadcastReceiver() { + override fun onCardPayMode() { + super.onCardPayMode() + } + + override fun onNfcOff() { + super.onNfcOff() + } + + override fun onNfcOn() { + super.onNfcOn() + Utils.getTopActivity()?.let { + launch(Dispatchers.IO) { + OneKeyLiteCard.startNfc(it as FragmentActivity) {} + } + } + } + + override fun onNfcTurningOff() { + super.onNfcTurningOff() + } + + override fun onNfcTurningOn() { + super.onNfcTurningOn() + } + } + } + + + override fun onHostResume() { + Utils.getTopActivity()?.let { + launch(Dispatchers.IO) { + if (it !is FragmentActivity) return@launch + try { + OneKeyLiteCard.startNfc(it) { + mNFCState.set(NFCState.Started) + + Log.d(TAG, "NFC starting success") + } + } catch (e: Exception) { + Log.e(TAG, "startNfc failed", e) + } + } + } + } + + override fun onHostPause() { + Utils.getTopActivity()?.let { + launch(Dispatchers.IO) { + try { + OneKeyLiteCard.stopNfc(it as FragmentActivity) + mNFCState.set(NFCState.Dead) + Log.d(TAG, "NFC 已关闭") + } catch (e: Exception) { + Log.e(TAG, "stopNfc failed", e) + } + } + } + } + + override fun onHostDestroy() { + try { + Utils.getTopActivity()?.unregisterReceiver(mNfcStateBroadcastReceiver) + } catch (ignore: Exception) { + } + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardPackage.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardPackage.kt new file mode 100644 index 00000000..39fabd6f --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/ReactNativeLiteCardPackage.kt @@ -0,0 +1,33 @@ +package com.onekeyfe.reactnativelitecard + +import com.facebook.react.BaseReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.model.ReactModuleInfo +import com.facebook.react.module.model.ReactModuleInfoProvider +import java.util.HashMap + +class ReactNativeLiteCardPackage : BaseReactPackage() { + override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { + return if (name == ReactNativeLiteCardModule.NAME) { + ReactNativeLiteCardModule(reactContext) + } else { + null + } + } + + override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { + return ReactModuleInfoProvider { + val moduleInfos: MutableMap = HashMap() + moduleInfos[ReactNativeLiteCardModule.NAME] = ReactModuleInfo( + ReactNativeLiteCardModule.NAME, + ReactNativeLiteCardModule.NAME, + false, // canOverrideExistingModule + false, // needsEagerInit + false, // isCxxModule + true // isTurboModule + ) + moduleInfos + } + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/keys/KeysNativeProvider.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/keys/KeysNativeProvider.kt new file mode 100644 index 00000000..25d74307 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/keys/KeysNativeProvider.kt @@ -0,0 +1,13 @@ +package so.onekey.app.wallet.lite.keys + +import android.content.Context + +class KeysNativeProvider { + companion object { + init { + System.loadLibrary("keys") + } + } + + external fun getLiteSecureChannelInitParams(context: Context): String +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/Exceptions.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/Exceptions.kt new file mode 100644 index 00000000..930d860a --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/Exceptions.kt @@ -0,0 +1,58 @@ +package so.onekey.app.wallet.lite.nfc + +sealed class NFCExceptions(val code: Int, override val message: String? = null) : Exception(message) { + fun toJson(): String { + return """{"code":$code,"message":"$message"}""" + } + + // 初始化异常 + class InitChannelException(message: String? = null) : NFCExceptions(1000, message) + + // 没有 NFC 设备 + class NotExistsNFC(message: String? = null) : NFCExceptions(1001, message) + + // 没有开启 NFC 设备 + class NotEnableNFC(message: String? = null) : NFCExceptions(1002, message) + + // 没有使用 NFC 的权限 + class NotNFCPermission(message: String? = null) : NFCExceptions(1003, message) + + // 连接失败 + class ConnectionFailException(message: String? = null) : NFCExceptions(2001, message) + + // 操作中断(可能是连接问题) + class InterruptException(message: String? = null) : NFCExceptions(2002, message) + + // 连接设备不匹配 + class DeviceMismatchException(message: String? = null) : NFCExceptions(2003, message) + + // 用户主动取消 + class UserCancelExceptions(message: String? = null) : NFCExceptions(2004, message) + + // 密码错误 + class PasswordWrongException(message: String? = null) : NFCExceptions(3001, message) + + // 输入密码为空 + class InputPasswordEmptyException(message: String? = null) : NFCExceptions(3002, message) + + // 未设置过密码 + class PasswordEmptyException(message: String? = null) : NFCExceptions(3003, message) + + // 设置初始化密码错误 + class InitPasswordException(message: String? = null) : NFCExceptions(3004, message) + + // 密码重试次数太多已经锁死 + class CardLockException(message: String? = null) : NFCExceptions(3005, message) + + // 密码重试次数太多已经自动重制卡片 + class UpperErrorAutoResetException(message: String? = null) : NFCExceptions(3006, message) + + // 未知的命令执行失败 + class ExecFailureException(message: String? = null) : NFCExceptions(4000, message) + + // 已经备份过内容 + class InitializedException(message: String? = null) : NFCExceptions(4001, message) + + // 没有备份过内容 + class NotInitializedException(message: String? = null) : NFCExceptions(4002, message) +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/NfcUtils.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/NfcUtils.kt new file mode 100644 index 00000000..0c173a18 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/NfcUtils.kt @@ -0,0 +1,142 @@ +package so.onekey.app.wallet.lite.nfc + +import android.app.Activity +import android.app.PendingIntent +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.nfc.NfcAdapter +import android.nfc.tech.* +import android.os.Build +import android.provider.Settings +import so.onekey.app.wallet.lite.utils.MiUtil + +object NfcUtils { + + @JvmField + var mNfcAdapter: NfcAdapter? = null + + @JvmField + var mIntentFilter: Array? = null + + @JvmField + var mPendingIntent: PendingIntent? = null + + @JvmField + var mTechList: Array>? = null + + private fun getPendingIntent(activity: Activity): PendingIntent? { + val intent = Intent(activity, activity.javaClass) + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP) + var flag = 0 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + flag = PendingIntent.FLAG_MUTABLE + } else { + flag = PendingIntent.FLAG_UPDATE_CURRENT + } + return PendingIntent.getActivity(activity, 0, intent, flag) + } + + private fun getIntentFilters(): Array { + return arrayOf( + IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED, "*/*"), + ) + } + + private fun getTechLists(): Array> { + return arrayOf( + arrayOf(NfcA::class.java.name), + arrayOf(IsoDep::class.java.name) + ) + } + + @JvmStatic + fun init(activity: Activity): NfcAdapter? { + mNfcAdapter = NfcAdapter.getDefaultAdapter(activity) + mTechList = getTechLists() + mPendingIntent = getPendingIntent(activity) + mIntentFilter = getIntentFilters() + return mNfcAdapter + } + + /** + * 判断手机是否具备NFC功能. + * + * @param context [Context] + * @return `true`: 具备 `false`: 不具备 + */ + fun isNfcExits(context: Context): Boolean { + val nfcAdapter = NfcAdapter.getDefaultAdapter(context) + return nfcAdapter != null + } + + /** + * 判断手机NFC是否开启. + * + * OPPO A37m 发现必须同时开启NFC以及Android Beam才可以使用 + * 20180108 发现OPPO单独打开NFC即可读取标签,不清楚是否是系统更新 + * + * @param context [Context] + * @return `true`: 已开启 `false`: 未开启 + */ + fun isNfcEnable(context: Context): Boolean { + val nfcAdapter = NfcAdapter.getDefaultAdapter(context) + return nfcAdapter != null && nfcAdapter.isEnabled + } + + /** + * 判断手机是否具备Android Beam. + * + * @param context [Context] + * @return `true`:具备 `false`:不具备 + */ + fun isAndroidBeamExits(context: Context): Boolean { + return Build.VERSION.SDK_INT < Build.VERSION_CODES.Q && isNfcExits(context) + } + + /** + * 跳转至系统NFC设置界面. + * + * @param context [Context] + * @return `true` 跳转成功

`false` 跳转失败 + */ + fun intentToNfcSetting(context: Context): Boolean { + if (isNfcExits(context)) { + return toIntent(context, Settings.ACTION_NFC_SETTINGS) + } + return false + + } + + /** + * 跳转至系统NFC Android Beam设置界面,同页面基本都有NFC开关. + * + * @param context [Context] + * @return `true` 跳转成功

`false` 跳转失败 + */ + fun intentToNfcShare(context: Context): Boolean { + return if (isAndroidBeamExits(context)) { + toIntent(context, Settings.ACTION_NFCSHARING_SETTINGS) + } else false + } + + /** + * 跳转方法. + * + * @param context [Context] + * @param action 意图 + * @return 是否跳转成功 `true ` 成功

`false`失败 + */ + private fun toIntent(context: Context, action: String): Boolean { + try { + val intent = Intent(action) + context.startActivity(intent) + } catch (ex: Exception) { + ex.printStackTrace() + return false + } + + return true + } + +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/broadcast/NfcStatusChangeBroadcastReceiver.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/broadcast/NfcStatusChangeBroadcastReceiver.kt new file mode 100644 index 00000000..dd969de9 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/broadcast/NfcStatusChangeBroadcastReceiver.kt @@ -0,0 +1,56 @@ +package so.onekey.app.wallet.lite.nfc.broadcast + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.nfc.NfcAdapter +import android.util.Log + +open class NfcStatusChangeBroadcastReceiver : BroadcastReceiver() { + + override fun onReceive(context: Context, intent: Intent) { + val action = intent.action + if (NfcAdapter.ACTION_ADAPTER_STATE_CHANGED == action) { + val state = + intent.getIntExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_OFF) + + Log.e(TAG, "nfc state broadcast receiver, state is $state") + when (state) { + NfcAdapter.STATE_OFF -> onNfcOff() + NfcAdapter.STATE_ON -> onNfcOn() + NfcAdapter.STATE_TURNING_OFF -> onNfcTurningOff() + NfcAdapter.STATE_TURNING_ON -> onNfcTurningOn() + 5 -> onCardPayMode() //samsumg return 5 that minds card pay mode + else -> onNfcOff() + } + } + } + + protected open fun onNfcTurningOn() { + + } + + protected open fun onNfcTurningOff() { + + } + + protected open fun onNfcOn() { + + } + + protected open fun onNfcOff() { + + } + + protected open fun onCardPayMode() { + + } + + companion object { + val TAG: String = NfcStatusChangeBroadcastReceiver::class.java.simpleName + + val nfcBroadcastReceiverIntentFilter: IntentFilter + get() = IntentFilter("android.nfc.action.ADAPTER_STATE_CHANGED") + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/gpchannel/GPChannelNatives.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/gpchannel/GPChannelNatives.kt new file mode 100644 index 00000000..ea05b1d0 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/nfc/gpchannel/GPChannelNatives.kt @@ -0,0 +1,32 @@ +package org.haobtc.onekey.card.gpchannel + +/** @Date 2020-07-09 16:29 @Author li @Version 1.0 + */ +object GPChannelNatives { + /** + * 当native接口的返回值不是int时,需要调用该接口获取错误码 + * + * @return + */ + external fun nativeGetErrorCode(): Int + external fun nativeGPCInitialize(json: String?): Int + external fun nativeGPCFinalize(): Int + external fun nativeGPCBuildMutualAuthData(): String + external fun nativeGPCOpenSecureChannel(response: String?): Int + external fun nativeGPCBuildAPDU( + cla: Long, ins: Long, p1: Long, p2: Long, data: String = "" + ): String + + external fun nativeGPCBuildSafeAPDU( + cla: Long, ins: Long, p1: Long, p2: Long, data: String = "" + ): String + + external fun nativeGPCParseSafeAPDUResponse(response: String?): String + external fun nativeGPCParseAPDUResponse(response: String?): String + external fun nativeGPCTLVDecode(apdu: String?): String + external fun nativeGPCParseCertificate(cert: String?): String + + init { + System.loadLibrary("gpchannelNDK") + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/NfcConstant.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/NfcConstant.kt new file mode 100644 index 00000000..27e9c475 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/NfcConstant.kt @@ -0,0 +1,38 @@ +package so.onekey.app.wallet.lite.onekeyLite + +import android.nfc.tech.IsoDep +import so.onekey.app.wallet.lite.utils.HexUtils +import java.io.IOException + + +/** + * @Author: peter Qin + */ +object NfcConstant { + const val DEBUG = false + const val MNEMONIC = "mnemonics" + const val MODE = "statusMode" + const val SELECT_CARD_ID = "select_card_id" + const val VERIFY_SUCCESS = 100 + const val INTERRUPT_STATUS = 1000 + const val RESET_INTERRUPT_STATUS = 1001 + const val GET_RETRY_NUM_INTERRUPT_STATUS = 1002 + const val RESET_PIN_SUCCESS = -1 + const val CHANGE_PIN_SUCCESS = -10 + const val CHANGE_PIN_ERROR = -100 + const val NEW_PIN = "029000" + const val MAX_RETRY_NUM = 10 + const val NO_RETRY_NUM_RESET_CARD = 0 + const val NOT_MATCH_DEVICE = "cannot_match_device" + const val INIT_CHANNEL_SUCCESS = 104 + const val INIT_CHANNEL_FAILURE = 105 + const val STATUS_SUCCESS = "9000" + const val STATUS_FAILURE = "FFFF" + const val HAS_BACK_UP = "029000" + + const val LITE_VERSION = "01" + const val LITE_LANGUAGE = "00"// english + const val LITE_TAG = "ffff" + + private const val RESPONSE_STATUS_LENGTH = 4 +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/OnekeyLiteCard.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/OnekeyLiteCard.kt new file mode 100644 index 00000000..84b6ada6 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/OnekeyLiteCard.kt @@ -0,0 +1,236 @@ +package so.onekey.app.wallet.lite.onekeyLite + +import android.app.Activity +import android.nfc.tech.IsoDep +import android.util.Log +import androidx.fragment.app.FragmentActivity +import androidx.lifecycle.Lifecycle +import com.google.gson.Gson +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import so.onekey.app.wallet.lite.nfc.NFCExceptions +import so.onekey.app.wallet.lite.nfc.NfcUtils +import so.onekey.app.wallet.lite.onekeyLite.entitys.CardState +import so.onekey.app.wallet.lite.onekeyLite.nfc.AppleCardType +import so.onekey.app.wallet.lite.onekeyLite.nfc.Connection +import so.onekey.app.wallet.lite.onekeyLite.nfc.CommandGenerator +import so.onekey.app.wallet.lite.utils.LogUtil.printLog +import so.onekey.app.wallet.lite.utils.NfcPermissionUtils + +object OneKeyLiteCard { + const val TAG = "OneKeyLiteCard" + + private val mCommandGenerator by lazy(LazyThreadSafetyMode.NONE) { + CommandGenerator() + } + private var mCardConnection: Connection? = null + + suspend fun startNfc(activity: FragmentActivity, callback: ((Boolean) -> Unit)? = null) = + withContext(Dispatchers.Main) { + if (NfcUtils.isNfcExits(activity)) { + val adapter = NfcUtils.init(activity) + if (adapter == null) { + printLog(TAG, "startNfc: NfcAdapter is null") + callback?.invoke(false) + return@withContext + } + } + printLog(TAG, "startNfc: ${NfcUtils.isNfcExits(activity)}") + + NfcPermissionUtils.checkPermission(activity) { + printLog(TAG, "startNfc Have permission") + if (!activity.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) { + return@checkPermission + } + + NfcUtils.mNfcAdapter?.enableForegroundDispatch( + activity, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList + ) + + printLog(TAG, "startNfc: enableForegroundDispatch") + + callback?.invoke(true) + return@withContext + } + Log.e(TAG, "startNfc Not NFC permission") + callback?.invoke(false) + } + + fun stopNfc(activity: Activity) { + NfcUtils.mNfcAdapter?.disableForegroundDispatch(activity) + } + + // first init channel ,can filter not match device + @Throws(NFCExceptions::class) + suspend fun initRequest(isoDep: IsoDep?) = withContext(Dispatchers.IO) { + if (isoDep == null) { + throw NFCExceptions.ConnectionFailException() + } + mCardConnection = Connection(isoDep, mCommandGenerator) + return@withContext mCardConnection?.getCardInfo() + ?: throw NFCExceptions.InitChannelException() + } + + @Throws(NFCExceptions::class) + private fun setupNewPinRequest(isoDep: IsoDep, pin: String?): Boolean { + if (pin.isNullOrEmpty()) { + throw NFCExceptions.InputPasswordEmptyException() + } + return mCardConnection?.setupNewPin(pin) ?: false + } + + @Throws(NFCExceptions::class) + fun changePinRequest(isoDep: IsoDep, oldPwd: String?, newPwd: String?): Int { + if (oldPwd.isNullOrEmpty()) { + throw NFCExceptions.InputPasswordEmptyException() + } + return mCardConnection?.changePin(oldPwd, newPwd) ?: 0 + } + + @Throws(NFCExceptions::class) + fun verifyPinBackupRequest(isoDep: IsoDep, verifyPin: String?): Int { + if (verifyPin.isNullOrEmpty()) { + throw NFCExceptions.InputPasswordEmptyException() + } + return mCardConnection?.startVerifyPin(verifyPin) ?: 0 + } + + @Throws(NFCExceptions::class) + fun getCardInfo(isoDep: IsoDep): CardState { + return mCardConnection?.getCardInfo() ?: throw NFCExceptions.ConnectionFailException() + } + + @Throws(NFCExceptions::class) + fun setMnemonic( + cardState: CardState?, + isoDep: IsoDep, + mnemonic: String?, + pwd: String?, + overwrite: Boolean = false + ): Boolean { + if (cardState == null) throw NFCExceptions.ConnectionFailException() + + printLog(TAG, "--> setMnemonic: cardState:${Gson().toJson(cardState)}") + + if (!overwrite) { + // 不是覆写要验证是否已经已经存有备份 + if (!cardState.isNewCard || cardState.hasBackup) { + throw NFCExceptions.InitializedException() + } + } + + if (overwrite && mCardConnection?.getCardType() == AppleCardType.V2) { + // Verify the password before clearing the card + val verifyPin = verifyPinBackupRequest(isoDep, pwd) + if (verifyPin != NfcConstant.VERIFY_SUCCESS) { + handlerVerifyPinError(cardState, verifyPin) + } + + // 如果是覆写,并且是V2卡,直接使用 setupNewPinRequest 清空卡片 + cardState.isNewCard = true + } + + if (cardState.isNewCard) { + // 如果是新卡设置密码 + if (!setupNewPinRequest(isoDep, pwd)) { + throw NFCExceptions.InitPasswordException() + } + } + + val verifyPin = verifyPinBackupRequest(isoDep, pwd) + if (verifyPin != NfcConstant.VERIFY_SUCCESS) { + if (overwrite) { + handlerVerifyPinError(cardState, verifyPin) + } else { + throw NFCExceptions.InitPasswordException() + } + } + + return mCardConnection?.backupData(mnemonic ?: "") == true + } + + @Throws(NFCExceptions::class) + fun getMnemonicWithPin(cardState: CardState?, isoDep: IsoDep, pwd: String): String { + if (cardState == null) throw NFCExceptions.ConnectionFailException() + + if (cardState.isNewCard || !cardState.hasBackup) { + throw NFCExceptions.NotInitializedException() + } + + val verifyPin = verifyPinBackupRequest(isoDep, pwd) + if (verifyPin != NfcConstant.VERIFY_SUCCESS) { + handlerVerifyPinError(cardState, verifyPin) + } + + val result = mCardConnection?.exportData() + + if (result.isNullOrEmpty()) { + throw NFCExceptions.NotInitializedException() + } + return result + } + + @Throws(NFCExceptions::class) + fun changPin(cardState: CardState?, isoDep: IsoDep, oldPwd: String, newPwd: String): Boolean { + if (cardState == null) throw NFCExceptions.ConnectionFailException() + + if (cardState.isNewCard || !cardState.hasBackup) { + throw NFCExceptions.NotInitializedException() + } + + val result = changePinRequest(isoDep, oldPwd, newPwd) + handlerVerifyPinError(cardState, result, true) + + return when (result) { + NfcConstant.CHANGE_PIN_SUCCESS -> { + true + } + NfcConstant.CHANGE_PIN_ERROR -> { + false + } + else -> { + // 密码错误 + cardState.pinRetryCount = result + throw NFCExceptions.PasswordWrongException() + } + } + } + + fun reset(isoDep: IsoDep): Boolean { + return mCardConnection?.resetCard() == NfcConstant.RESET_PIN_SUCCESS + } + + private fun handlerVerifyPinError( + cardState: CardState, status: Int, ignoreDefault: Boolean = false + ) { + when (status) { + NfcConstant.RESET_INTERRUPT_STATUS -> { + // Reset 卡片错误,已经锁定 + throw NFCExceptions.CardLockException() + } + NfcConstant.GET_RETRY_NUM_INTERRUPT_STATUS -> { + // 密码错误 + cardState.pinRetryCount = cardState.pinRetryCount - 1 + if (cardState.pinRetryCount <= 0) { + throw NFCExceptions.CardLockException() + } else { + throw NFCExceptions.PasswordWrongException() + } + } + NfcConstant.RESET_PIN_SUCCESS -> { + // Reset 卡片成功 + throw NFCExceptions.UpperErrorAutoResetException() + } + NfcConstant.INTERRUPT_STATUS -> { + throw NFCExceptions.ConnectionFailException() + } + else -> { + if (!ignoreDefault) { + // 密码错误 + cardState.pinRetryCount = status + throw NFCExceptions.PasswordWrongException() + } + } + } + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/APDUParam.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/APDUParam.kt new file mode 100644 index 00000000..5270bd4f --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/APDUParam.kt @@ -0,0 +1,17 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys + +data class APDUParam( + val cla: Long, + val ins: Long, + val p1: Long, + val p2: Long, + val data: String = "" +) { + constructor(command: LongArray, data: String) : this( + command[0], + command[1], + command[2], + command[3], + data + ) +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardInfo.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardInfo.java new file mode 100644 index 00000000..8949896d --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardInfo.java @@ -0,0 +1,84 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys; + + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; + + +public class CardInfo { + + /** + * bleVersion : + * firmwareVersion : + * label : + * pinMaxRetry : 10 + * pinRetry : 10 + * sn : BXNFC20052500001 + */ + + @SerializedName("bleVersion") + private String bleVersion; + @SerializedName("firmwareVersion") + private String firmwareVersion; + @SerializedName("label") + private String label; + @SerializedName("pinMaxRetry") + private int pinMaxRetry; + @SerializedName("pinRetry") + private int pinRetry; + @SerializedName("sn") + private String sn; + + public static CardInfo objectFromData(String str) { + + return new Gson().fromJson(str, CardInfo.class); + } + + public String getBleVersion() { + return bleVersion; + } + + public void setBleVersion(String bleVersion) { + this.bleVersion = bleVersion; + } + + public String getFirmwareVersion() { + return firmwareVersion; + } + + public void setFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public int getPinMaxRetry() { + return pinMaxRetry; + } + + public void setPinMaxRetry(int pinMaxRetry) { + this.pinMaxRetry = pinMaxRetry; + } + + public int getPinRetry() { + return pinRetry; + } + + public void setPinRetry(int pinRetry) { + this.pinRetry = pinRetry; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardResponse.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardResponse.java new file mode 100644 index 00000000..d29a8dd6 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardResponse.java @@ -0,0 +1,37 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys; + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; + +/** + * @author liyan + * @date 2020/7/15 + */ +// +public class CardResponse { + + @SerializedName(value = "response", alternate = "value") + private String response; + @SerializedName(value = "wRet", alternate = "tag") + private int wRet; + + public static CardResponse objectFromData(String str) { + return new Gson().fromJson(str, CardResponse.class); + } + + public String getResponse() { + return response; + } + + public void setResponse(String response) { + this.response = response; + } + + public int getWRet() { + return wRet; + } + + public void setWRet(int wRet) { + this.wRet = wRet; + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardState.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardState.kt new file mode 100644 index 00000000..f3ddff8f --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/CardState.kt @@ -0,0 +1,10 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys + +import android.nfc.tech.IsoDep + +data class CardState( + var hasBackup: Boolean = false, + var isNewCard: Boolean = true, + var serialNum: String = "", + var pinRetryCount: Int = 0 +) diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/ParsedCertInfo.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/ParsedCertInfo.java new file mode 100644 index 00000000..df627be4 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/ParsedCertInfo.java @@ -0,0 +1,39 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys; + +/** + * @author liyan + * @date 2/23/21 + */ +// + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; + +/** sn : subjectID: */ +public class ParsedCertInfo { + @SerializedName("sn") + public String sn; + + @SerializedName("subjectID") + public String subjectID; + + public static ParsedCertInfo objectFromData(String str) { + return new Gson().fromJson(str, ParsedCertInfo.class); + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public String getSubjectID() { + return subjectID; + } + + public void setSubjectID(String subjectID) { + this.subjectID = subjectID; + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SecureChanelParam.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SecureChanelParam.java new file mode 100644 index 00000000..e826ac8c --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SecureChanelParam.java @@ -0,0 +1,113 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys; + +import androidx.annotation.NonNull; + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; + +/** + * @author liyan + * @date 2020/7/18 + */ +// +public class SecureChanelParam { + + @SerializedName("scpID") + private String scpID; + + @SerializedName("keyUsage") + private String keyUsage; + + @SerializedName("keyType") + private String keyType; + + @SerializedName("keyLength") + private int keyLength; + + @SerializedName("hostID") + private String hostID; + + @SerializedName("crt") + private String crt; + + @SerializedName("sk") + private String sk; + + @SerializedName("cardGroupID") + private String cardGroupID; + + public static SecureChanelParam objectFromData(String str) { + + return new Gson().fromJson(str, SecureChanelParam.class); + } + + public String getScpID() { + return scpID; + } + + public void setScpID(String scpID) { + this.scpID = scpID; + } + + public String getKeyUsage() { + return keyUsage; + } + + public void setKeyUsage(String keyUsage) { + this.keyUsage = keyUsage; + } + + public String getKeyType() { + return keyType; + } + + public void setKeyType(String keyType) { + this.keyType = keyType; + } + + public int getKeyLength() { + return keyLength; + } + + public void setKeyLength(int keyLength) { + this.keyLength = keyLength; + } + + public String getHostID() { + return hostID; + } + + public void setHostID(String hostID) { + this.hostID = hostID; + } + + public String getCrt() { + return crt; + } + + public void setCrt(String crt) { + this.crt = crt; + } + + public String getSk() { + return sk; + } + + public void setSk(String sk) { + this.sk = sk; + } + + public String getCardGroupID() { + return cardGroupID; + } + + public void setCardGroupID(String cardGroupID) { + this.cardGroupID = cardGroupID; + } + + @NonNull + @Override + public String toString() { + return new Gson().toJson(this); + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SendResponse.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SendResponse.kt new file mode 100644 index 00000000..b76dd222 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/entitys/SendResponse.kt @@ -0,0 +1,26 @@ +package so.onekey.app.wallet.lite.onekeyLite.entitys + +import so.onekey.app.wallet.lite.utils.HexUtils + +data class SendResponse( + // Original return result + val rawResponse: String, + val sw1: Byte, + val sw2: Byte, + val data: String? = null, + // Processed result + var result: String? = null +) { + fun isSuccess() = sw1 == 0x90.toByte() && sw2 == 0x00.toByte() + + fun isConnectFailure() = sw1 == 0x6F.toByte() && sw2 == 0x00.toByte() + + fun isEmptyData() = data.isNullOrEmpty() + + fun getCodeBytes(): ByteArray = byteArrayOf(sw1, sw2) + + fun getCode(): String = HexUtils.byteArr2HexStr(byteArrayOf(sw1, sw2)) + + fun getDataBytes(): ByteArray? = + if (isEmptyData()) null else HexUtils.hexString2Bytes(data) +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/CommandGenerator.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/CommandGenerator.kt new file mode 100644 index 00000000..78c735c4 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/CommandGenerator.kt @@ -0,0 +1,178 @@ +package so.onekey.app.wallet.lite.onekeyLite.nfc + +import com.google.gson.JsonObject +import com.google.gson.JsonParser +import org.haobtc.onekey.card.gpchannel.GPChannelNatives.nativeGPCParseAPDUResponse +import org.haobtc.onekey.card.gpchannel.GPChannelNatives.nativeGPCParseSafeAPDUResponse +import so.onekey.app.wallet.lite.nfc.NFCExceptions +import so.onekey.app.wallet.lite.onekeyLite.entitys.APDUParam +import so.onekey.app.wallet.lite.onekeyLite.entitys.CardResponse +import so.onekey.app.wallet.lite.onekeyLite.entitys.SendResponse +import so.onekey.app.wallet.lite.utils.Utils + +enum class AppleCardType(val aid: String, val prefixSN: String) { + V1("D156000132834001", "OKLFT"), + V2("6f6e656b65792e6261636b757001", "OKLFB"), +} + +enum class CommandArea(val code: String) { + None("none"), BackupApplet("backup"), PrimarySafety("master"); + + companion object { + fun parse(code: String): CommandArea { + return when (code) { + "backup" -> BackupApplet + "master" -> PrimarySafety + else -> None + } + } + } +} + +enum class CommandType(val code: String) { + SELECT_BACKUP_APPLET("select_backup_applet"), + SELECT_PRIMARY_SAFETY("select_primary_safety"), + GET_BACKUP_STATUS("get_backup_status"), + GET_PIN_STATUS("get_pin_status"), + GET_SERIAL_NUMBER("get_serial_number"), + GET_PIN_RETRY_COUNT("get_pin_retry_count"), + RESET_CARD("reset_card"), + VERIFY_PIN("verify_pin"), + SETUP_NEW_PIN("setup_new_pin"), + CHANGE_PIN("change_pin"), + BACKUP_DATA("backup_data"), + EXPORT_DATA("export_data"), + VERIFY_CERTIFICATE("verify_certificate"), + VERIFY_AUTH_DATA("verify_auth_data"), +} + +class Command( + private val cardType: AppleCardType, + val area: CommandArea, + val command: String, + private val ignoreSafeChannel: Boolean, + private val useSafeChannel: Boolean, + private val useSafeChannelWhenOpen: Boolean, + private val hasOpenSafeChannel: Boolean, + val data: String, +) { + private fun beforeConnecting(connection: Connection) { + val needOpenSafeChannel = useSafeChannel || (useSafeChannelWhenOpen && hasOpenSafeChannel) + val needCloseSafeChannel = + (!useSafeChannel && !(useSafeChannelWhenOpen && hasOpenSafeChannel)) + + if (!ignoreSafeChannel && needCloseSafeChannel) { + if (hasOpenSafeChannel) connection.resetSecureChannel() + } + + if (area == CommandArea.BackupApplet) { + if (connection.getCurrentCommandArea() != CommandArea.BackupApplet) { + connection.selectBackupApplet(cardType) + } + } else if (area == CommandArea.PrimarySafety) { + if (connection.getCurrentCommandArea() != CommandArea.PrimarySafety) { + connection.selectPrimarySafety() + } + } + + if (!ignoreSafeChannel && needOpenSafeChannel) { + val res = connection.openSafeChannel() + if (!res) throw NFCExceptions.InterruptException() + } + } + + private fun splitHex(hex: String): List { + val result = mutableListOf() + for (i in hex.indices step 2) { + result.add(hex.substring(i, i + 2)) + } + return result + } + + private fun buildApdu(): String { + val commandByteArray = splitHex(command).map { it.toLong(16) }.toLongArray() + return GPCAPDUGenerator.buildGPCAPDU( + APDUParam(commandByteArray, data), + useSafeChannel || (useSafeChannelWhenOpen && hasOpenSafeChannel) + ) + } + + private fun parseResponse(response: String): String { + return if (useSafeChannel || (useSafeChannelWhenOpen && hasOpenSafeChannel)) { + nativeGPCParseSafeAPDUResponse(response) + } else { + nativeGPCParseAPDUResponse(response) + } + } + + fun send(connection: Connection): SendResponse { + beforeConnecting(connection) + // buildApdu && parseResponse Use in pairs + val apdu = buildApdu() + val result = Connection.send(connection.isoDep, apdu) + val resultObject = CardResponse.objectFromData(parseResponse(result.rawResponse)) + result.result = resultObject?.response ?: "" + return result + } +} + +class CommandGenerator { + companion object { + private fun readConfig(): JsonObject { + val context = Utils.getApp() + val config = context.assets.open("config/command.json") + config.use { + val json = it.bufferedReader().use { it.readText() } + return JsonParser.parseString(json).asJsonObject + } + } + + val instanceConfig by lazy(LazyThreadSafetyMode.NONE) { + readConfig() + } + } + + fun generalCommand( + cardType: AppleCardType, + type: CommandType, + hasOpenSafeChannel: Boolean, + data: String? = null + ): Command { + + val config = when (cardType) { + AppleCardType.V1 -> instanceConfig.getAsJsonObject(type.code).getAsJsonObject("v1") + AppleCardType.V2 -> instanceConfig.getAsJsonObject(type.code).getAsJsonObject("v2") + } + + val area = if (config.has("area")) { + CommandArea.parse(config["area"].asString) + } else { + CommandArea.None + } + val ignoreSafeChannel = + config.has("ignoreSafeChannel") && config["ignoreSafeChannel"].asBoolean + val useSafeChannel = config.has("useSafeChannel") && config["useSafeChannel"].asBoolean + val useSafeChannelWhenOpen = + config.has("useSafeChannelWhenOpen") && config["useSafeChannelWhenOpen"].asBoolean + val needData = config.has("needData") && config["needData"].asBoolean + val command = if (config.has("command")) { + config["command"].asString + } else { + throw Exception("command not found") + } + + if (needData && data == null) throw Exception("data is null") + + return Command( + cardType = cardType, + area = area, + command = command, + ignoreSafeChannel = ignoreSafeChannel, + useSafeChannel = useSafeChannel, + useSafeChannelWhenOpen = useSafeChannelWhenOpen, + hasOpenSafeChannel = hasOpenSafeChannel, + data = data ?: "" + ) + } + +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/Connection.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/Connection.kt new file mode 100644 index 00000000..409125b1 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/Connection.kt @@ -0,0 +1,439 @@ +package so.onekey.app.wallet.lite.onekeyLite.nfc + +import android.nfc.TagLostException +import android.nfc.tech.IsoDep +import org.haobtc.onekey.card.gpchannel.GPChannelNatives +import org.haobtc.onekey.card.gpchannel.GPChannelNatives.nativeGPCFinalize +import so.onekey.app.wallet.lite.keys.KeysNativeProvider +import so.onekey.app.wallet.lite.nfc.NFCExceptions +import so.onekey.app.wallet.lite.onekeyLite.NfcConstant +import so.onekey.app.wallet.lite.onekeyLite.entitys.* +import so.onekey.app.wallet.lite.onekeyLite.nfc.GPCAPDUGenerator.buildGPCAPDU +import so.onekey.app.wallet.lite.onekeyLite.nfc.GPCAPDUGenerator.combCommand +import so.onekey.app.wallet.lite.utils.HexUtils +import so.onekey.app.wallet.lite.utils.HexUtils.byteArr2HexStr +import so.onekey.app.wallet.lite.utils.HexUtils.hexString2Bytes +import so.onekey.app.wallet.lite.utils.LogUtil.printLog +import so.onekey.app.wallet.lite.utils.Utils +import java.io.IOException + +class Connection(val isoDep: IsoDep, private val mCommandGenerator: CommandGenerator) { + companion object { + private const val TAG = "Connection" + + @JvmStatic + private fun connect(isoDep: IsoDep?) { + val isConnected: Boolean = try { + isoDep?.isConnected ?: false + } catch (e: Exception) { + false + } + if (isConnected == false) { + isoDep?.connect() + isoDep?.timeout = 15000 + } + } + + @JvmStatic + fun send(isoDep: IsoDep, request: String?): SendResponse { + try { + connect(isoDep) + val response = isoDep.transceive(hexString2Bytes(request)) ?: byteArrayOf( + 0xFF.toByte(), 0xFF.toByte() + ) + val resp: ByteArray = if (response.size > 2) { + response.copyOfRange(0, response.size - 2) + } else byteArrayOf() + val sw1 = response[response.size - 2] + val sw2 = response[response.size - 1] + + return SendResponse(byteArr2HexStr(response), sw1, sw2, byteArr2HexStr(resp)) + } catch (e: TagLostException) { + // throw NFCExceptions.InterruptException() + return SendResponse("0xFFFF", 0xFF.toByte(), 0xFF.toByte()) + } catch (e: IOException) { + // e.printStackTrace() + return SendResponse("0xFFFF", 0xFF.toByte(), 0xFF.toByte()) + } + } + } + + private var mCardType: AppleCardType = AppleCardType.V2 + private var mCardSerialNumber: String = NfcConstant.NOT_MATCH_DEVICE + private var hasOpenSafeChannel: Boolean = false + private var hasSetupPin: Boolean = false + private var hasBackup: Boolean = false + private var mCommandArea = CommandArea.None + + init { + readCardInfo() + } + + fun getCardType(): AppleCardType { + return mCardType + } + + fun getCurrentCommandArea(): CommandArea { + return mCommandArea + } + + fun selectPrimarySafety(): Boolean { + printLog(TAG, "---> selectPrimarySafety begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.SELECT_PRIMARY_SAFETY, hasOpenSafeChannel, + ) + val res = command.send(this) + printLog( + TAG, "<--- selectPrimarySafety end: ${res.getCode()} ${res.data} area:${mCommandArea}" + ) + + if (res.isSuccess() && !res.isEmptyData()) { + mCommandArea = CommandArea.PrimarySafety + return true + } + return false + } + + fun selectBackupApplet(cardType: AppleCardType?): Boolean { + printLog(TAG, "---> selectApplet begin") + val command = mCommandGenerator.generalCommand( + cardType ?: mCardType, + CommandType.SELECT_BACKUP_APPLET, + hasOpenSafeChannel, + cardType?.aid ?: mCardType.aid + ) + val res = command.send(this) + + printLog(TAG, "<--- selectApplet end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (res.isSuccess()) { + mCommandArea = CommandArea.BackupApplet + return true + } + return false + } + + private fun getDeviceCertificate(): ParsedCertInfo? { + printLog(TAG, "---> getDeviceCertificate begin") + // #1.NFC:GET CERT.SD.ECKA 获取智能卡证书 + val apdu = buildGPCAPDU(APDUParam(0x80, 0xCA, 0xBF, 0x21, "A60483021518")) + val rawCert = send(isoDep, apdu) + printLog( + TAG, + "<--- getDeviceCertificate end: ${rawCert.getCode()} ${rawCert.data} area:${mCommandArea}" + ) + + val cert = GPChannelNatives.nativeGPCTLVDecode(rawCert.data) + val certificate = CardResponse.objectFromData(cert).response + + val certInfo = GPChannelNatives.nativeGPCParseCertificate(certificate) + return ParsedCertInfo.objectFromData(certInfo) + } + + fun openSafeChannel(): Boolean { + printLog(TAG, "---> openSafeChannel begin") + + if (hasOpenSafeChannel) { + printLog(TAG, "<--- has open safe channel") + return true + } + + printLog(TAG, "0. ---> getDeviceCertificate begin") + val certInfo = getDeviceCertificate() ?: return false + printLog(TAG, "0. <--- getDeviceCertificate end: ${certInfo.subjectID}") + + printLog(TAG, "1. ---> nativeGPCInitialize begin") + val param = SecureChanelParam.objectFromData( + KeysNativeProvider().getLiteSecureChannelInitParams(Utils.getApp()) + ) + param.cardGroupID = certInfo.subjectID + printLog(TAG, "nativeGPCInitialize read param done") + val initializeStatus = GPChannelNatives.nativeGPCInitialize(param.toString()) + if (initializeStatus != 0) { + return false + } + printLog(TAG, "1. <--- nativeGPCInitialize end") + + printLog(TAG, "2. ---> Perform security operation begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.VERIFY_CERTIFICATE, hasOpenSafeChannel, param.crt + ) + val securityRes = command.send(this) + printLog( + TAG, + "2. <--- Perform security operation end: ${securityRes.getCode()} ${securityRes.data}" + ) + if (!securityRes.isSuccess()) { + return false + } + + printLog(TAG, "3. ---> mutual authenticate begin") + val authData = GPChannelNatives.nativeGPCBuildMutualAuthData() + printLog(TAG, "mutual authenticate data") + val authCommand = mCommandGenerator.generalCommand( + mCardType, CommandType.VERIFY_AUTH_DATA, hasOpenSafeChannel, authData + ) + val authRes = authCommand.send(this) + printLog(TAG, "3. <--- mutual authenticate end") + if (authRes.isEmptyData() || !authRes.isSuccess()) { + return false + } + + printLog(TAG, "4. ---> open secure channel begin") + val openStatus = GPChannelNatives.nativeGPCOpenSecureChannel(authRes.result) + if (openStatus != 0) { + return false + } + printLog(TAG, "4. <--- open secure channel end") + + printLog(TAG, "<--- openSafeChannel end: Open Secure Channel OK") + + hasOpenSafeChannel = true + return true + } + + fun resetSecureChannel(): Boolean { + printLog(TAG, "---> resetSecureChannel begin") + nativeGPCFinalize() + hasOpenSafeChannel = false + printLog(TAG, "<--- resetSecureChannel end") + return true + } + + private fun loadBackupStatus(): Boolean { + printLog(TAG, "---> getBackupStatus begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.GET_BACKUP_STATUS, hasOpenSafeChannel + ) + val res = command.send(this) + printLog(TAG, "<--- getBackupStatus end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (!res.isSuccess()) { + return false + } + + return (res.data == "02").also { hasBackup = it } + } + + private fun loadPinStatus(): Boolean { + printLog(TAG, "---> getPinStatus begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.GET_PIN_STATUS, hasOpenSafeChannel, "DFFF028105" + ) + val res = command.send(this) + printLog(TAG, "<--- getPinStatus end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (!res.isSuccess()) { + return false + } + + val notSetPin = res.data == "02" + hasSetupPin = !notSetPin + return notSetPin + } + + private fun loadSerialNumber(cardType: AppleCardType? = null): String { + printLog(TAG, "---> getSerialNumber begin") + val command = mCommandGenerator.generalCommand( + cardType ?: mCardType, CommandType.GET_SERIAL_NUMBER, hasOpenSafeChannel, "DFFF028101" + ) + val res = command.send(this) + + printLog(TAG, "<--- getSerialNumber end: ${res.getCode()} ${res.data} area:${mCommandArea}") + if (!res.isSuccess()) { + return NfcConstant.NOT_MATCH_DEVICE + } + + return String(hexString2Bytes(res.data)).also { + mCardSerialNumber = it + } + } + + private fun getRetryCount(): Int { + printLog(TAG, "---> getRetryNum begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.GET_PIN_RETRY_COUNT, hasOpenSafeChannel, "DFFF028102" + ) + val res = command.send(this) + + printLog(TAG, "<--- getRetryNum end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (res.isEmptyData() || !res.isSuccess()) { + return NfcConstant.GET_RETRY_NUM_INTERRUPT_STATUS + } + return res.data?.toInt(16) ?: NfcConstant.GET_RETRY_NUM_INTERRUPT_STATUS + } + + private fun readCardInfo() { + printLog(TAG, "---> initCard begin") + try { + val cardTypes = arrayOf(AppleCardType.V1, AppleCardType.V2) + for (cardType in cardTypes) { + printLog(TAG, "---->> selectApplet: $cardType") + val serialNumber = loadSerialNumber(cardType) + if (serialNumber.startsWith(cardType.prefixSN)) { + mCardType = cardType + break + } + } + } catch (e: NFCExceptions) { + printLog(TAG, " init_channel NFCExceptions-->$e") + } + + loadPinStatus() + if (mCardType == AppleCardType.V2) { + loadBackupStatus() + } else { + hasBackup = hasSetupPin + } + printLog(TAG, "<--- initCard end") + } + + fun getCardInfo(): CardState { + val retryCount = getRetryCount() + return CardState(hasBackup, !hasSetupPin, mCardSerialNumber, retryCount) + } + + fun getSerialNumber() = mCardSerialNumber + + fun setupNewPin(pin: String): Boolean { + printLog(TAG, "---> setupNewPin begin") + val pinHex = HexUtils.stringToHexString(pin) + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.SETUP_NEW_PIN, hasOpenSafeChannel, "DFFE0B8204080006$pinHex" + ) + val res = command.send(this) + printLog(TAG, "<--- setupNewPin end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (!res.isSuccess()) { + return false + } + + return true + } + + fun changePin(oldPin: String, newPin: String?): Int { + printLog(TAG, "---> changePin begin") + val oldPinHex = HexUtils.stringToHexString(oldPin) + val newPinHex = HexUtils.stringToHexString(newPin) + val changePinCommand = combCommand( + hexString2Bytes("8204"), hexString2Bytes(oldPinHex), hexString2Bytes(newPinHex) + ) + val execCommand = combCommand(hexString2Bytes("DFFE"), changePinCommand) + + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.CHANGE_PIN, hasOpenSafeChannel, byteArr2HexStr(execCommand) + ) + val res = command.send(this) + + printLog(TAG, "<--- changePin end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + return if (res.isConnectFailure()) { + NfcConstant.INTERRUPT_STATUS + } else if (res.isSuccess()) { + printLog(TAG, "--- verify success") + NfcConstant.CHANGE_PIN_SUCCESS + } else if (res.getCode() == "9B01") { + // V1 Lite Pin error + printLog(TAG, "--- verify error") + retryNumCommandAndReset() + } else if (res.getCode() == "6983") { + // V2 Lite Locked + printLog(TAG, "--- verify Too many errors, Locked") + resetCard() + } else { + if (res.getCode().startsWith("63C")) { + return res.sw2.toInt() and 0x0F + } + retryNumCommandAndReset() + } + } + + fun startVerifyPin(pin: String): Int { + printLog(TAG, "---> startVerifyPin begin") + val pinHex = HexUtils.stringToHexString(pin) + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.VERIFY_PIN, hasOpenSafeChannel, "06$pinHex" + ) + val res = command.send(this) + printLog(TAG, "<--- startVerifyPin end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + return if (res.isConnectFailure()) { + NfcConstant.INTERRUPT_STATUS + } else if (res.isSuccess()) { + printLog(TAG, "--- verify success") + NfcConstant.VERIFY_SUCCESS + } else if (res.getCode() == "9B01") { + // V1 Lite Pin error + printLog(TAG, "--- verify error") + retryNumCommandAndReset() + } else if (res.getCode() == "6983") { + // V2 Lite Locked + printLog(TAG, "--- verify Too many errors, Locked") + resetCard() + } else { + if (res.getCode().startsWith("63C")) { + return res.sw2.toInt() and 0x0F + } + retryNumCommandAndReset() + } + } + + fun backupData(mnemonic: String): Boolean { + printLog(TAG, "---> backupData begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.BACKUP_DATA, hasOpenSafeChannel, mnemonic + ) + val res = command.send(this) + printLog(TAG, "<--- backupData end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + if (!res.isSuccess()) { + return false + } + + return true + } + + fun exportData(): String? { + printLog(TAG, "---> exportData begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.EXPORT_DATA, hasOpenSafeChannel + ) + val res = command.send(this) + printLog( + TAG, + "<--- exportData end: ${res.getCode()} emptyData:${res.isEmptyData()} area:${mCommandArea}" + ) + + if (res.isEmptyData() || !res.isSuccess()) { + return null + } + + return res.result + } + + private fun retryNumCommandAndReset(): Int { + val leftRetryNum = getRetryCount() + return if (leftRetryNum == 0) { + resetCard() + } else { + leftRetryNum + } + } + + fun resetCard(): Int { + printLog(TAG, "---> resetCard begin") + val command = mCommandGenerator.generalCommand( + mCardType, CommandType.RESET_CARD, hasOpenSafeChannel, "DFFE028205" + ) + val res = command.send(this) + + printLog(TAG, "<--- resetCard end: ${res.getCode()} ${res.data} area:${mCommandArea}") + + return if (res.isConnectFailure()) { + NfcConstant.RESET_INTERRUPT_STATUS + } else { + NfcConstant.RESET_PIN_SUCCESS + } + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/GPCAPDUGenerator.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/GPCAPDUGenerator.kt new file mode 100644 index 00000000..0e4de83d --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/onekeyLite/nfc/GPCAPDUGenerator.kt @@ -0,0 +1,56 @@ +package so.onekey.app.wallet.lite.onekeyLite.nfc + +import com.google.gson.Gson +import org.haobtc.onekey.card.gpchannel.GPChannelNatives +import so.onekey.app.wallet.lite.onekeyLite.entitys.APDUParam +import so.onekey.app.wallet.lite.utils.LogUtil.printLog + +object GPCAPDUGenerator { + private const val TAG = "GPCAPDUGenerator" + + @JvmStatic + fun buildGPCAPDU(param: APDUParam, safeChannel: Boolean = false): String { + printLog(TAG, " --->> BuildGPCAPDU begin") + return if (safeChannel) { + GPChannelNatives.nativeGPCBuildSafeAPDU( + param.cla, + param.ins, + param.p1, + param.p2, + param.data + ) + } else { + GPChannelNatives.nativeGPCBuildAPDU( + param.cla, + param.ins, + param.p1, + param.p2, + param.data + ) + }.also { + printLog(TAG, " <<--- BuildGPCAPDU done: safeChannel:$safeChannel") + } + } + + @JvmStatic + fun combCommand(command: ByteArray? = null, vararg params: ByteArray?): ByteArray { + var combParam = byteArrayOf() + params.forEach { param -> + param?.let { + combParam = combParam.plus(it.size.toByte()) + combParam = combParam.plus(it) + } + } + + var combCommand = byteArrayOf() + command?.let { + combCommand = combCommand.plus(it) + if (params.size != 1) { + // params 只有一个的时候就不再次拼接长度了 + combCommand = combCommand.plus(combParam.size.toByte()) + } + } + combCommand = combCommand.plus(combParam) + return combCommand + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/EventUtils.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/EventUtils.kt new file mode 100644 index 00000000..9fa97d9f --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/EventUtils.kt @@ -0,0 +1,14 @@ +package so.onekey.app.wallet.lite.utils + +import com.facebook.react.bridge.ReactContext +import com.facebook.react.modules.core.DeviceEventManagerModule + +fun sendEvent( + reactContext: ReactContext, + eventName: String, + params: String? = null +) { + reactContext + .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) + .emit(eventName, params) +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/GpsUtil.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/GpsUtil.kt new file mode 100644 index 00000000..a79671a3 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/GpsUtil.kt @@ -0,0 +1,38 @@ +package so.onekey.app.wallet.lite.utils + +import android.content.Context +import android.content.Intent +import android.provider.Settings + + +object GpsUtil { + /** + * 判断GPS是否开启,GPS或者AGPS开启一个就认为是开启的 + * @param context + * @return true 表示开启 + */ + fun isOpen(context: Context?): Boolean { + if (context == null) { + return true + } + var locationMode = 0 + val locationProviders: String + + locationMode = try { + Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE) + } catch (e: Settings.SettingNotFoundException) { + e.printStackTrace() + return false + } + return locationMode != Settings.Secure.LOCATION_MODE_OFF + } + + /** + * 跳转设置 打开GPS + * @param context + */ + fun openGPS(context: Context) { + val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS) + context.startActivity(intent) + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/HexUtils.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/HexUtils.java new file mode 100644 index 00000000..d10fddfe --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/HexUtils.java @@ -0,0 +1,93 @@ +package so.onekey.app.wallet.lite.utils; + +import java.math.BigInteger; +import java.util.Collections; + +/** + * @author liyan + */ +public class HexUtils { + + public static byte[] hexString2Bytes(String hex) { + if (hex == null) return new byte[0]; + return String2Bytes(hex, 16); + } + + private static byte[] String2Bytes(String str, int digit) { + byte[] bArray = new BigInteger("10" + str, digit).toByteArray(); + + byte[] ret = new byte[bArray.length - 1]; + for (int i = 0; i < ret.length; i++) { + ret[i] = bArray[i + 1]; + } + + return ret; + } + + + public static String stringToHexString(String s) { + if (s == null) return ""; + String str = ""; + for (int i = 0; i < s.length(); i++) { + int ch = s.charAt(i); + String s4 = Integer.toHexString(ch); + str = str + s4; + } + return str; + } + + /** + * 将字节数组转换成十六进制的字符串 + * + * @param bt 字节数组 + * @param start 起始下标 + * @param end 终止下标 + */ + public static String byteArr2HexStr(byte[] bt, int start, int end) { + return byteArr2HexStr(bt, start, end, ""); + } + + /** + * 将字节数组转换成十六进制的字符串 + * + * @param bt 字节数组 + */ + public static String byteArr2HexStr(byte[] bt) { + if (bt == null) return ""; + if (bt.length == 0) return ""; + return byteArr2HexStr(bt, 0, bt.length, ""); + } + + /** + * 将字节数组转换成十六进制的字符串 + * + * @param bt 字节数组 + * @param start 起始下标 + * @param end 终止下标 + * @param sep 每个字节之间的分割字符串 + */ + public static String byteArr2HexStr(byte[] bt, int start, int end, String sep) { + if (bt == null || bt.length < end || start < 0 || start >= end) { + throw new RuntimeException("param format error"); + } + + StringBuffer sb = new StringBuffer(); + for (int i = start; i < end; i++) { + sb.append(byte2HexStr(bt[i])).append(sep); + } + return sb.toString(); + } + + /** + * 将byte转换成对应的十六进制字符串(如:byte值0x3D转换成字符串"3D") + * + * @return 返回字符串长度一定为2 + */ + public static String byte2HexStr(byte b) { + int i = (b & 0xF0) >> 4; + int j = (b & 0x0F); + char c = (char) (i > 9 ? 'A' + i % 10 : '0' + i); + char d = (char) (j > 9 ? 'A' + j % 10 : '0' + j); + return "" + c + d; + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/LogUtil.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/LogUtil.kt new file mode 100644 index 00000000..a5f5e9a7 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/LogUtil.kt @@ -0,0 +1,11 @@ +package so.onekey.app.wallet.lite.utils + +import so.onekey.app.wallet.lite.onekeyLite.NfcConstant +import so.onekey.app.wallet.lite.LoggerManager + +object LogUtil { + @JvmStatic + fun printLog(tag: String, msg: String) { + if (NfcConstant.DEBUG) LoggerManager.getInstance()?.logInfo("$tag: $msg") + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/MiUtil.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/MiUtil.kt new file mode 100644 index 00000000..d3851551 --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/MiUtil.kt @@ -0,0 +1,93 @@ +package so.onekey.app.wallet.lite.utils + +import android.app.AppOpsManager +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.provider.Settings +import android.util.Log +import androidx.annotation.IntDef +import androidx.annotation.RequiresApi +import so.onekey.app.wallet.lite.utils.MiUtil.PermissionResult.Companion.PERMISSION_ASK +import so.onekey.app.wallet.lite.utils.MiUtil.PermissionResult.Companion.PERMISSION_DENIED +import so.onekey.app.wallet.lite.utils.MiUtil.PermissionResult.Companion.PERMISSION_GRANTED +import so.onekey.app.wallet.lite.utils.MiUtil.PermissionResult.Companion.PERMISSION_UNKNOWN + +object MiUtil { + val TAG = MiUtil::class.simpleName + + @IntDef(value = [PERMISSION_GRANTED, PERMISSION_DENIED, PERMISSION_ASK, PERMISSION_UNKNOWN]) + @kotlin.annotation.Retention( + AnnotationRetention.SOURCE + ) + annotation class PermissionResult { + companion object { + /** + * Permission check result: this is returned by [.check] + * if the permission has been granted to the given package. + */ + const val PERMISSION_GRANTED = 0 + + /** + * Permission check result: this is returned by [.check] + * if the permission has not been granted to the given package. + */ + const val PERMISSION_DENIED = -1 + + const val PERMISSION_ASK = 1 + + const val PERMISSION_UNKNOWN = 2 + } + } + + /** + * 检测NFC权限是否有授权. + */ + @PermissionResult + @RequiresApi(Build.VERSION_CODES.KITKAT) + fun checkNfcPermission(context: Context): Int { + try { + val mAppOps = context.getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager + val pkg = context.applicationContext.packageName + val uid = context.applicationInfo.uid + val appOpsClass = Class.forName(AppOpsManager::class.java.name) + val checkOpNoThrowMethod = appOpsClass.getDeclaredMethod( + "checkOpNoThrow", Integer.TYPE, Integer.TYPE, + String::class.java + ) + //the ops of NFC is 10016,check /data/system/appops/xxx.xml + val invoke = checkOpNoThrowMethod.invoke(mAppOps, 10016, uid, pkg) + if (invoke == null) { + Log.d(TAG, + "MIUI check permission checkOpNoThrowMethod(AppOpsManager) invoke result is null" + ) + return PERMISSION_UNKNOWN + } + val result = invoke.toString() + Log.d(TAG, + "MIUI check permission checkOpNoThrowMethod(AppOpsManager) invoke result = $result" + ) + when (result) { + "0" -> return PERMISSION_GRANTED + "1" -> return PERMISSION_DENIED + "5" -> return PERMISSION_ASK + } + } catch (e: Exception) { + Log.d(TAG, "check nfc permission fail ${e.message}", e) + } + return PERMISSION_UNKNOWN + } + + fun intentToAppSetting(context: Context): Boolean { + val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) + intent.data = Uri.fromParts("package", context.packageName, null) + return try { + context.startActivity(intent) + true + } catch (e: Exception) { + Log.d(TAG, "open app setting fail ${e.message}", e) + false + } + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/NfcPermissionUtils.kt b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/NfcPermissionUtils.kt new file mode 100755 index 00000000..928261af --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/NfcPermissionUtils.kt @@ -0,0 +1,24 @@ +package so.onekey.app.wallet.lite.utils + +import android.app.Activity +import android.os.Build + +object NfcPermissionUtils { + + inline fun checkPermission(activity: Activity, doNext: () -> Unit): Int { + return if ("xiaomi".equals(Build.MANUFACTURER, true)) { + return checkMiuiPermission(activity, doNext) + } else { + doNext.invoke() + 0 + } + } + + inline fun checkMiuiPermission(activity: Activity, doNext: () -> Unit): Int { + when (MiUtil.checkNfcPermission(activity)) { + MiUtil.PermissionResult.PERMISSION_GRANTED -> doNext.invoke() + else -> {} + } + return MiUtil.checkNfcPermission(activity) + } +} \ No newline at end of file diff --git a/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/Utils.java b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/Utils.java new file mode 100755 index 00000000..d57ed46c --- /dev/null +++ b/native-modules/react-native-lite-card/android/src/main/java/com/onekeyfe/reactnativelitecard/utils/Utils.java @@ -0,0 +1,437 @@ +package so.onekey.app.wallet.lite.utils; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.Application; +import android.app.Application.ActivityLifecycleCallbacks; +import android.content.Context; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.ReactApplicationContext; + +import org.jetbrains.annotations.NotNull; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + *
+ *     author:
+ *                                      ___           ___           ___         ___
+ *         _____                       /  /\         /__/\         /__/|       /  /\
+ *        /  /::\                     /  /::\        \  \:\       |  |:|      /  /:/
+ *       /  /:/\:\    ___     ___    /  /:/\:\        \  \:\      |  |:|     /__/::\
+ *      /  /:/~/::\  /__/\   /  /\  /  /:/~/::\   _____\__\:\   __|  |:|     \__\/\:\
+ *     /__/:/ /:/\:| \  \:\ /  /:/ /__/:/ /:/\:\ /__/::::::::\ /__/\_|:|____    \  \:\
+ *     \  \:\/:/~/:/  \  \:\  /:/  \  \:\/:/__\/ \  \:\~~\~~\/ \  \:\/:::::/     \__\:\
+ *      \  \::/ /:/    \  \:\/:/    \  \::/       \  \:\  ~~~   \  \::/~~~~      /  /:/
+ *       \  \:\/:/      \  \::/      \  \:\        \  \:\        \  \:\         /__/:/
+ *        \  \::/        \__\/        \  \:\        \  \:\        \  \:\        \__\/
+ *         \__\/                       \__\/         \__\/         \__\/
+ *     blog  : http://blankj.com
+ *     time  : 16/12/08
+ *     desc  : utils about initialization
+ * 
+ */ +public final class Utils { + + @SuppressLint("StaticFieldLeak") + private static Application sApplication; + + static final ActivityLifecycleImpl ACTIVITY_LIFECYCLE = new ActivityLifecycleImpl(); + + private Utils() { + throw new UnsupportedOperationException("u can't instantiate me..."); + } + + /** + * Init utils. + * + *

Init it in the class of Application. + * + * @param context context + */ + public static void init(@NonNull final ReactApplicationContext context) { + Utils.getActivityLifecycle().setTopActivity(context.getCurrentActivity()); + init((Application) context.getApplicationContext()); + } + + /** + * Init utils. + * + *

Init it in the class of Application. + * + * @param app application + */ + public static void init(@NonNull final Application app) { + if (sApplication == null) { + Utils.sApplication = app; + Utils.sApplication.registerActivityLifecycleCallbacks(ACTIVITY_LIFECYCLE); + } + } + + /** + * Return the context of Application object. + * + * @return the context of Application object + */ + public static Application getApp() { + if (sApplication != null) { + return sApplication; + } + try { + @SuppressLint("PrivateApi") + Class activityThread = Class.forName("android.app.ActivityThread"); + Object at = activityThread.getMethod("currentActivityThread").invoke(null); + Object app = activityThread.getMethod("getApplication").invoke(at); + if (app == null) { + throw new NullPointerException("u should init first"); + } + init((Application) app); + return sApplication; + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + throw new NullPointerException("u should init first"); + } + + public static ActivityLifecycleImpl getActivityLifecycle() { + return ACTIVITY_LIFECYCLE; + } + + public static LinkedList getActivityList() { + return ACTIVITY_LIFECYCLE.mActivityList; + } + + @NotNull + public static Context getTopActivityOrApp() { + if (isAppForeground()) { + Activity topActivity = ACTIVITY_LIFECYCLE.getTopActivity(); + return topActivity == null ? Utils.getApp() : topActivity; + } else { + return Utils.getApp(); + } + } + + @Nullable + public static Activity getTopActivity() { + if (!isAppForeground()) { + return null; + } + return ACTIVITY_LIFECYCLE.getTopActivity(); + } + + /** + * Finish all of activities. + */ + public static void finishAllActivities() { + finishAllActivities(false); + } + + /** + * Finish all of activities. + * + * @param isLoadAnim True to use animation for the outgoing activity, false otherwise. + */ + public static void finishAllActivities(final boolean isLoadAnim) { + List activityList = getActivityList(); + for (Activity act : activityList) { + // sActivityList remove the index activity at onActivityDestroyed + act.finish(); + if (!isLoadAnim) { + act.overridePendingTransition(0, 0); + } + } + } + + /** + * Finish all of activities except the newest activity. + */ + public static void finishAllActivitiesExceptNewest() { + finishAllActivitiesExceptNewest(false); + } + + /** + * Finish all of activities except the newest activity. + * + * @param isLoadAnim True to use animation for the outgoing activity, false otherwise. + */ + public static void finishAllActivitiesExceptNewest(final boolean isLoadAnim) { + List activities = getActivityList(); + for (int i = 1; i < activities.size(); i++) { + finishActivity(activities.get(i), isLoadAnim); + } + } + + public static void finishActivity(@NonNull final Activity activity) { + finishActivity(activity, false); + } + + public static void finishActivity(@NonNull final Activity activity, final boolean isLoadAnim) { + activity.finish(); + if (!isLoadAnim) { + activity.overridePendingTransition(0, 0); + } + } + + /** + * Finish the activity. + * + * @param clz The activity class. + */ + public static void finishActivity(@NonNull final Class clz) { + finishActivity(clz, false); + } + + /** + * Finish the activity. + * + * @param clz The activity class. + * @param isLoadAnim True to use animation for the outgoing activity, false otherwise. + */ + public static void finishActivity( + @NonNull final Class clz, final boolean isLoadAnim) { + List activities = getActivityList(); + for (Activity activity : activities) { + if (activity.getClass().equals(clz)) { + activity.finish(); + if (!isLoadAnim) { + activity.overridePendingTransition(0, 0); + } + } + } + } + + /** + * Finish the activities whose type not equals the activity class. + * + * @param clz The activity class. + */ + public static void finishOtherActivities(@NonNull final Class clz) { + finishOtherActivities(clz, false); + } + + /** + * Finish the activities whose type not equals the activity class. + * + * @param clz The activity class. + * @param isLoadAnim True to use animation for the outgoing activity, false otherwise. + */ + public static void finishOtherActivities( + @NonNull final Class clz, final boolean isLoadAnim) { + List activities = getActivityList(); + for (Activity act : activities) { + if (!act.getClass().equals(clz)) { + finishActivity(act, isLoadAnim); + } + } + } + + public static boolean isAppForeground() { + ActivityManager am = + (ActivityManager) Utils.getApp().getSystemService(Context.ACTIVITY_SERVICE); + if (am == null) { + return false; + } + List info = am.getRunningAppProcesses(); + if (info == null || info.size() == 0) { + return false; + } + for (ActivityManager.RunningAppProcessInfo aInfo : info) { + if (aInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) { + return aInfo.processName.equals(Utils.getApp().getPackageName()); + } + } + return false; + } + + static class ActivityLifecycleImpl implements ActivityLifecycleCallbacks { + + final LinkedList mActivityList = new LinkedList<>(); + final HashMap mStatusListenerMap = new HashMap<>(); + + private int mForegroundCount = 0; + private int mConfigCount = 0; + + void addListener(final Object object, final OnAppStatusChangedListener listener) { + mStatusListenerMap.put(object, listener); + } + + void removeListener(final Object object) { + mStatusListenerMap.remove(object); + } + + @Override + public void onActivityCreated(Activity activity, Bundle savedInstanceState) { + setTopActivity(activity); + } + + @Override + public void onActivityStarted(Activity activity) { + setTopActivity(activity); + if (mForegroundCount <= 0) { + postStatus(true); + } + if (mConfigCount < 0) { + ++mConfigCount; + } else { + ++mForegroundCount; + } + } + + @Override + public void onActivityResumed(Activity activity) { + setTopActivity(activity); + } + + @Override + public void onActivityPaused(Activity activity) { + /**/ + } + + @Override + public void onActivityStopped(Activity activity) { + if (activity.isChangingConfigurations()) { + --mConfigCount; + } else { + --mForegroundCount; + if (mForegroundCount <= 0) { + postStatus(false); + } + } + } + + @Override + public void onActivitySaveInstanceState(Activity activity, Bundle outState) { + /**/ + } + + @Override + public void onActivityDestroyed(Activity activity) { + mActivityList.remove(activity); + } + + private void postStatus(final boolean isForeground) { + if (mStatusListenerMap.isEmpty()) { + return; + } + for (OnAppStatusChangedListener onAppStatusChangedListener : + mStatusListenerMap.values()) { + if (onAppStatusChangedListener == null) { + return; + } + if (isForeground) { + onAppStatusChangedListener.onForeground(); + } else { + onAppStatusChangedListener.onBackground(); + } + } + } + + private void setTopActivity(final Activity activity) { + if (activity == null || mActivityList == null) { + return; + } + if (mActivityList.contains(activity)) { + Activity lastActivity = mActivityList.getLast(); + if (lastActivity != null && !lastActivity.equals(activity)) { + mActivityList.remove(activity); + mActivityList.addLast(activity); + } + } else { + mActivityList.addLast(activity); + } + } + + @Nullable + Activity getTopActivity() { + if (!mActivityList.isEmpty()) { + final Activity topActivity = mActivityList.getLast(); + if (topActivity != null) { + return topActivity; + } + } + // using reflect to get top activity + try { + @SuppressLint("PrivateApi") + Class activityThreadClass = Class.forName("android.app.ActivityThread"); + Object activityThread = + activityThreadClass.getMethod("currentActivityThread").invoke(null); + Field activitiesField = activityThreadClass.getDeclaredField("mActivityList"); + activitiesField.setAccessible(true); + Map activities = (Map) activitiesField.get(activityThread); + if (activities == null) { + return null; + } + for (Object activityRecord : activities.values()) { + Class activityRecordClass = activityRecord.getClass(); + Field pausedField = activityRecordClass.getDeclaredField("paused"); + pausedField.setAccessible(true); + if (!pausedField.getBoolean(activityRecord)) { + Field activityField = activityRecordClass.getDeclaredField("activity"); + activityField.setAccessible(true); + Activity activity = (Activity) activityField.get(activityRecord); + setTopActivity(activity); + return activity; + } + } + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + return null; + } + } + + /////////////////////////////////////////////////////////////////////////// + // interface + /////////////////////////////////////////////////////////////////////////// + + public interface OnAppStatusChangedListener { + + void onForeground(); + + void onBackground(); + } + + public static int dp2px(final @NotNull Context context, final Float dpValue) { + final float scale = context.getResources().getDisplayMetrics().density; + return (int) (dpValue * scale + 0.5f); + } + + public static int sp2px(final @NotNull Context context, final Float sp) { + final float scale = context.getResources().getDisplayMetrics().scaledDensity; + return (int) (sp * scale + 0.5f); + } + + public static boolean isEmail(String email) { + if (null == email || "".equals(email)) return false; + // Pattern p = Pattern.compile("\\w+@(\\w+.)+[a-z]{2,3}"); //简单匹配 + Pattern p = Pattern.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"); // 复杂匹配 + Matcher m = p.matcher(email); + return m.matches(); + } +} diff --git a/native-modules/react-native-lite-card/android/src/main/jniLibs/arm64-v8a/libgpchannelNDK.so b/native-modules/react-native-lite-card/android/src/main/jniLibs/arm64-v8a/libgpchannelNDK.so new file mode 100644 index 00000000..b95ee5b2 Binary files /dev/null and b/native-modules/react-native-lite-card/android/src/main/jniLibs/arm64-v8a/libgpchannelNDK.so differ diff --git a/native-modules/react-native-lite-card/android/src/main/jniLibs/armeabi-v7a/libgpchannelNDK.so b/native-modules/react-native-lite-card/android/src/main/jniLibs/armeabi-v7a/libgpchannelNDK.so new file mode 100644 index 00000000..c5697ed4 Binary files /dev/null and b/native-modules/react-native-lite-card/android/src/main/jniLibs/armeabi-v7a/libgpchannelNDK.so differ diff --git a/native-modules/react-native-lite-card/babel.config.js b/native-modules/react-native-lite-card/babel.config.js new file mode 100644 index 00000000..0c05fd69 --- /dev/null +++ b/native-modules/react-native-lite-card/babel.config.js @@ -0,0 +1,12 @@ +module.exports = { + overrides: [ + { + exclude: /\/node_modules\//, + presets: ['module:react-native-builder-bob/babel-preset'], + }, + { + include: /\/node_modules\//, + presets: ['module:@react-native/babel-preset'], + }, + ], +}; diff --git a/native-modules/react-native-lite-card/eslint.config.mjs b/native-modules/react-native-lite-card/eslint.config.mjs new file mode 100644 index 00000000..16b00bbc --- /dev/null +++ b/native-modules/react-native-lite-card/eslint.config.mjs @@ -0,0 +1,29 @@ +import { fixupConfigRules } from '@eslint/compat'; +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import prettier from 'eslint-plugin-prettier'; +import { defineConfig } from 'eslint/config'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default defineConfig([ + { + extends: fixupConfigRules(compat.extends('@react-native', 'prettier')), + plugins: { prettier }, + rules: { + 'react/react-in-jsx-scope': 'off', + 'prettier/prettier': 'error', + }, + }, + { + ignores: ['node_modules/', 'lib/'], + }, +]); diff --git a/native-modules/react-native-lite-card/example/.bundle/config b/native-modules/react-native-lite-card/example/.bundle/config new file mode 100644 index 00000000..848943bb --- /dev/null +++ b/native-modules/react-native-lite-card/example/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/native-modules/react-native-lite-card/example/.watchmanconfig b/native-modules/react-native-lite-card/example/.watchmanconfig new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/native-modules/react-native-lite-card/example/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/native-modules/react-native-lite-card/example/Gemfile b/native-modules/react-native-lite-card/example/Gemfile new file mode 100644 index 00000000..6a4c5f17 --- /dev/null +++ b/native-modules/react-native-lite-card/example/Gemfile @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version +ruby ">= 2.6.10" + +# Exclude problematic versions of cocoapods and activesupport that causes build failures. +gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' +gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' +gem 'xcodeproj', '< 1.26.0' +gem 'concurrent-ruby', '< 1.3.4' + +# Ruby 3.4.0 has removed some libraries from the standard library. +gem 'bigdecimal' +gem 'logger' +gem 'benchmark' +gem 'mutex_m' diff --git a/native-modules/react-native-lite-card/example/README.md b/native-modules/react-native-lite-card/example/README.md new file mode 100644 index 00000000..3e2c3f85 --- /dev/null +++ b/native-modules/react-native-lite-card/example/README.md @@ -0,0 +1,97 @@ +This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). + +# Getting Started + +> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding. + +## Step 1: Start Metro + +First, you will need to run **Metro**, the JavaScript build tool for React Native. + +To start the Metro dev server, run the following command from the root of your React Native project: + +```sh +# Using npm +npm start + +# OR using Yarn +yarn start +``` + +## Step 2: Build and run your app + +With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app: + +### Android + +```sh +# Using npm +npm run android + +# OR using Yarn +yarn android +``` + +### iOS + +For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps). + +The first time you create a new project, run the Ruby bundler to install CocoaPods itself: + +```sh +bundle install +``` + +Then, and every time you update your native dependencies, run: + +```sh +bundle exec pod install +``` + +For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). + +```sh +# Using npm +npm run ios + +# OR using Yarn +yarn ios +``` + +If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device. + +This is one way to run your app — you can also build it directly from Android Studio or Xcode. + +## Step 3: Modify your app + +Now that you have successfully run the app, let's make changes! + +Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh). + +When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload: + +- **Android**: Press the R key twice or select **"Reload"** from the **Dev Menu**, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS). +- **iOS**: Press R in iOS Simulator. + +## Congratulations! :tada: + +You've successfully run and modified your React Native App. :partying_face: + +### Now what? + +- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). +- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started). + +# Troubleshooting + +If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. + +# Learn More + +To learn more about React Native, take a look at the following resources: + +- [React Native Website](https://reactnative.dev) - learn more about React Native. +- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. +- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. +- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. +- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. diff --git a/native-modules/react-native-lite-card/example/android/app/build.gradle b/native-modules/react-native-lite-card/example/android/app/build.gradle new file mode 100644 index 00000000..905eb13c --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/build.gradle @@ -0,0 +1,124 @@ +apply plugin: "com.android.application" +apply plugin: "org.jetbrains.kotlin.android" +apply plugin: "com.facebook.react" + +/** + * This is the configuration block to customize your React Native Android app. + * By default you don't need to apply any configuration, just uncomment the lines you need. + */ +react { + reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() + hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc" + codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() + enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean() + + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") + + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. By default is just 'debug'. + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "prodDebug"] + + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() +} + +/** + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. + */ +def enableProguardInReleaseBuilds = false + +/** + * The preferred build flavor of JavaScriptCore (JSC) + * + * For example, to use the international variant, you can use: + * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` + * + * The international variant includes ICU i18n library and necessary data + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that + * give correct results when using with locales other than en-US. Note that + * this variant is about 6MiB larger per architecture than default. + */ +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' + +android { + ndkVersion rootProject.ext.ndkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion + + namespace "onekeyfe.reactnativelitecard.example" + defaultConfig { + applicationId "onekeyfe.reactnativelitecard.example" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + } + signingConfigs { + debug { + storeFile file('debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + } + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + // Caution! In production, you need to generate your own keystore file. + // see https://reactnative.dev/docs/signed-apk-android. + signingConfig signingConfigs.debug + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } +} + +dependencies { + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") + + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") + } else { + implementation jscFlavor + } +} diff --git a/native-modules/react-native-lite-card/example/android/app/debug.keystore b/native-modules/react-native-lite-card/example/android/app/debug.keystore new file mode 100644 index 00000000..364e105e Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/debug.keystore differ diff --git a/native-modules/react-native-lite-card/example/android/app/proguard-rules.pro b/native-modules/react-native-lite-card/example/android/app/proguard-rules.pro new file mode 100644 index 00000000..11b02572 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/proguard-rules.pro @@ -0,0 +1,10 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/AndroidManifest.xml b/native-modules/react-native-lite-card/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..fb78f397 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainActivity.kt b/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainActivity.kt new file mode 100644 index 00000000..e4ab435f --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainActivity.kt @@ -0,0 +1,22 @@ +package onekeyfe.reactnativelitecard.example + +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +class MainActivity : ReactActivity() { + + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "ReactNativeLiteCardExample" + + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainApplication.kt b/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainApplication.kt new file mode 100644 index 00000000..abb71802 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/java/onekeyfe/reactnativelitecard/example/MainApplication.kt @@ -0,0 +1,27 @@ +package onekeyfe.reactnativelitecard.example + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost + +class MainApplication : Application(), ReactApplication { + + override val reactHost: ReactHost by lazy { + getDefaultReactHost( + context = applicationContext, + packageList = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + }, + ) + } + + override fun onCreate() { + super.onCreate() + loadReactNative(this) + } +} diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/drawable/rn_edit_text_material.xml b/native-modules/react-native-lite-card/example/android/app/src/main/res/drawable/rn_edit_text_material.xml new file mode 100644 index 00000000..5c25e728 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..a2f59082 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..1b523998 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..ff10afd6 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..115a4c76 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..dcd3cd80 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..459ca609 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..8ca12fe0 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..8e19b410 Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..b824ebdd Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..4c19a13c Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/values/strings.xml b/native-modules/react-native-lite-card/example/android/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..fec98c7f --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + ReactNativeLiteCardExample + diff --git a/native-modules/react-native-lite-card/example/android/app/src/main/res/values/styles.xml b/native-modules/react-native-lite-card/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..7ba83a2a --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/native-modules/react-native-lite-card/example/android/build.gradle b/native-modules/react-native-lite-card/example/android/build.gradle new file mode 100644 index 00000000..c2dcf068 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/build.gradle @@ -0,0 +1,41 @@ +buildscript { + ext { + buildToolsVersion = "36.0.0" + minSdkVersion = 24 + compileSdkVersion = 36 + targetSdkVersion = 36 + ndkVersion = "27.1.12297006" + kotlinVersion = "2.1.20" + } + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle") + classpath("com.facebook.react:react-native-gradle-plugin") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") + } +} + +def reactNativeAndroidDir = new File( + providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('react-native/package.json')") + }.standardOutput.asText.get().trim(), + "../android" +) + +allprojects { + repositories { + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url(reactNativeAndroidDir) + } + google() + mavenCentral() + maven { url 'https://www.jitpack.io' } + } +} + +apply plugin: "com.facebook.react.rootproject" diff --git a/native-modules/react-native-lite-card/example/android/gradle.properties b/native-modules/react-native-lite-card/example/android/gradle.properties new file mode 100644 index 00000000..9afe6159 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/gradle.properties @@ -0,0 +1,44 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true + +# Use this property to specify which architecture you want to build. +# You can also override it from the CLI using +# ./gradlew -PreactNativeArchitectures=x86_64 +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property to enable support to the new architecture. +# This will allow you to use TurboModules and the Fabric render in +# your application. You should enable this flag either if you want +# to write custom TurboModules/Fabric components OR use libraries that +# are providing them. +newArchEnabled=true + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true + +# Use this property to enable edge-to-edge display support. +# This allows your app to draw behind system bars for an immersive UI. +# Note: Only works with ReactActivity and should not be used with custom Activity. +edgeToEdgeEnabled=false diff --git a/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.jar b/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..8bdaf60c Binary files /dev/null and b/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.properties b/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..2a84e188 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/native-modules/react-native-lite-card/example/android/gradlew b/native-modules/react-native-lite-card/example/android/gradlew new file mode 100755 index 00000000..ef07e016 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/native-modules/react-native-lite-card/example/android/gradlew.bat b/native-modules/react-native-lite-card/example/android/gradlew.bat new file mode 100644 index 00000000..dd2b8eed --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/gradlew.bat @@ -0,0 +1,99 @@ +@REM Copyright (c) Meta Platforms, Inc. and affiliates. +@REM +@REM This source code is licensed under the MIT license found in the +@REM LICENSE file in the root directory of this source tree. + +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/native-modules/react-native-lite-card/example/android/settings.gradle b/native-modules/react-native-lite-card/example/android/settings.gradle new file mode 100644 index 00000000..1a1fd5c5 --- /dev/null +++ b/native-modules/react-native-lite-card/example/android/settings.gradle @@ -0,0 +1,22 @@ +pluginManagement { + def reactNativeGradlePlugin = new File( + providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })") + }.standardOutput.asText.get().trim() + ).getParentFile().absolutePath + includeBuild(reactNativeGradlePlugin) +} +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +rootProject.name = 'onekeyfe.reactnativelitecard.example' +include ':app' + +def reactNativeGradlePlugin = new File( +providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })") +}.standardOutput.asText.get().trim() +).getParentFile().absolutePath +includeBuild(reactNativeGradlePlugin) + diff --git a/native-modules/react-native-lite-card/example/app.json b/native-modules/react-native-lite-card/example/app.json new file mode 100644 index 00000000..65c27d60 --- /dev/null +++ b/native-modules/react-native-lite-card/example/app.json @@ -0,0 +1,4 @@ +{ + "name": "ReactNativeLiteCardExample", + "displayName": "ReactNativeLiteCardExample" +} diff --git a/native-modules/react-native-lite-card/example/babel.config.js b/native-modules/react-native-lite-card/example/babel.config.js new file mode 100644 index 00000000..486a0930 --- /dev/null +++ b/native-modules/react-native-lite-card/example/babel.config.js @@ -0,0 +1,12 @@ +const path = require('path'); +const { getConfig } = require('react-native-builder-bob/babel-config'); +const pkg = require('../package.json'); + +const root = path.resolve(__dirname, '..'); + +module.exports = getConfig( + { + presets: ['module:@react-native/babel-preset'], + }, + { root, pkg } +); diff --git a/native-modules/react-native-lite-card/example/index.js b/native-modules/react-native-lite-card/example/index.js new file mode 100644 index 00000000..117ddcae --- /dev/null +++ b/native-modules/react-native-lite-card/example/index.js @@ -0,0 +1,5 @@ +import { AppRegistry } from 'react-native'; +import App from './src/App'; +import { name as appName } from './app.json'; + +AppRegistry.registerComponent(appName, () => App); diff --git a/native-modules/react-native-lite-card/example/ios/.xcode.env b/native-modules/react-native-lite-card/example/ios/.xcode.env new file mode 100644 index 00000000..3d5782c7 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/.xcode.env @@ -0,0 +1,11 @@ +# This `.xcode.env` file is versioned and is used to source the environment +# used when running script phases inside Xcode. +# To customize your local environment, you can create an `.xcode.env.local` +# file that is not versioned. + +# NODE_BINARY variable contains the PATH to the node executable. +# +# Customize the NODE_BINARY variable here. +# For example, to use nvm with brew, add the following line +# . "$(brew --prefix nvm)/nvm.sh" --no-use +export NODE_BINARY=$(command -v node) diff --git a/native-modules/react-native-lite-card/example/ios/Podfile b/native-modules/react-native-lite-card/example/ios/Podfile new file mode 100644 index 00000000..213c1ac9 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/Podfile @@ -0,0 +1,36 @@ +ENV['RCT_NEW_ARCH_ENABLED'] = '1' + +# Resolve react_native_pods.rb with node to allow for hoisting +require Pod::Executable.execute_command('node', ['-p', + 'require.resolve( + "react-native/scripts/react_native_pods.rb", + {paths: [process.argv[1]]}, + )', __dir__]).strip + +platform :ios, min_ios_version_supported +prepare_react_native_project! + +linkage = ENV['USE_FRAMEWORKS'] +if linkage != nil + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end + +target 'ReactNativeLiteCardExample' do + config = use_native_modules! + + use_react_native!( + :path => config[:reactNativePath], + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." + ) + + post_install do |installer| + react_native_post_install( + installer, + config[:reactNativePath], + :mac_catalyst_enabled => false, + # :ccache_enabled => true + ) + end +end diff --git a/native-modules/react-native-lite-card/example/ios/Podfile.lock b/native-modules/react-native-lite-card/example/ios/Podfile.lock new file mode 100644 index 00000000..81c763aa --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/Podfile.lock @@ -0,0 +1,2811 @@ +PODS: + - boost (1.84.0) + - DoubleConversion (1.1.6) + - fast_float (8.0.0) + - FBLazyVector (0.83.0) + - fmt (11.0.2) + - glog (0.3.5) + - hermes-engine (0.14.0): + - hermes-engine/Pre-built (= 0.14.0) + - hermes-engine/Pre-built (0.14.0) + - RCT-Folly (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCT-Folly/Default (= 2024.11.18.00) + - RCT-Folly/Default (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCT-Folly/Fabric (2024.11.18.00): + - boost + - DoubleConversion + - fast_float (= 8.0.0) + - fmt (= 11.0.2) + - glog + - RCTDeprecation (0.83.0) + - RCTRequired (0.83.0) + - RCTSwiftUI (0.83.0) + - RCTSwiftUIWrapper (0.83.0): + - RCTSwiftUI + - RCTTypeSafety (0.83.0): + - FBLazyVector (= 0.83.0) + - RCTRequired (= 0.83.0) + - React-Core (= 0.83.0) + - React (0.83.0): + - React-Core (= 0.83.0) + - React-Core/DevSupport (= 0.83.0) + - React-Core/RCTWebSocket (= 0.83.0) + - React-RCTActionSheet (= 0.83.0) + - React-RCTAnimation (= 0.83.0) + - React-RCTBlob (= 0.83.0) + - React-RCTImage (= 0.83.0) + - React-RCTLinking (= 0.83.0) + - React-RCTNetwork (= 0.83.0) + - React-RCTSettings (= 0.83.0) + - React-RCTText (= 0.83.0) + - React-RCTVibration (= 0.83.0) + - React-callinvoker (0.83.0) + - React-Core (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.83.0) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/CoreModulesHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/Default (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/DevSupport (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.83.0) + - React-Core/RCTWebSocket (= 0.83.0) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTActionSheetHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTAnimationHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTBlobHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTImageHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTLinkingHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTNetworkHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTSettingsHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTTextHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTVibrationHeaders (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-Core/RCTWebSocket (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTDeprecation + - React-Core/Default (= 0.83.0) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-CoreModules (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety (= 0.83.0) + - React-Core/CoreModulesHeaders (= 0.83.0) + - React-debug + - React-jsi (= 0.83.0) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-NativeModulesApple + - React-RCTBlob + - React-RCTFBReactNativeSpec + - React-RCTImage (= 0.83.0) + - React-runtimeexecutor + - React-utils + - ReactCommon + - SocketRocket + - React-cxxreact (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.83.0) + - React-debug (= 0.83.0) + - React-jsi (= 0.83.0) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-logger (= 0.83.0) + - React-perflogger (= 0.83.0) + - React-runtimeexecutor + - React-timing (= 0.83.0) + - React-utils + - SocketRocket + - React-debug (0.83.0) + - React-defaultsnativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-domnativemodule + - React-featureflags + - React-featureflagsnativemodule + - React-idlecallbacksnativemodule + - React-intersectionobservernativemodule + - React-jsi + - React-jsiexecutor + - React-microtasksnativemodule + - React-RCTFBReactNativeSpec + - React-webperformancenativemodule + - SocketRocket + - Yoga + - React-domnativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Fabric + - React-Fabric/bridging + - React-FabricComponents + - React-graphics + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-Fabric (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/animated (= 0.83.0) + - React-Fabric/animationbackend (= 0.83.0) + - React-Fabric/animations (= 0.83.0) + - React-Fabric/attributedstring (= 0.83.0) + - React-Fabric/bridging (= 0.83.0) + - React-Fabric/componentregistry (= 0.83.0) + - React-Fabric/componentregistrynative (= 0.83.0) + - React-Fabric/components (= 0.83.0) + - React-Fabric/consistency (= 0.83.0) + - React-Fabric/core (= 0.83.0) + - React-Fabric/dom (= 0.83.0) + - React-Fabric/imagemanager (= 0.83.0) + - React-Fabric/leakchecker (= 0.83.0) + - React-Fabric/mounting (= 0.83.0) + - React-Fabric/observers (= 0.83.0) + - React-Fabric/scheduler (= 0.83.0) + - React-Fabric/telemetry (= 0.83.0) + - React-Fabric/templateprocessor (= 0.83.0) + - React-Fabric/uimanager (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/animated (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/animationbackend (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/animations (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/attributedstring (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/bridging (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/componentregistry (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/componentregistrynative (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/components/legacyviewmanagerinterop (= 0.83.0) + - React-Fabric/components/root (= 0.83.0) + - React-Fabric/components/scrollview (= 0.83.0) + - React-Fabric/components/view (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/legacyviewmanagerinterop (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/root (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/scrollview (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/components/view (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-Fabric/consistency (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/core (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/dom (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/imagemanager (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/leakchecker (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/mounting (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/observers (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/observers/events (= 0.83.0) + - React-Fabric/observers/intersection (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/observers/events (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/observers/intersection (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/scheduler (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/observers/events + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-performancecdpmetrics + - React-performancetimeline + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/telemetry (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/templateprocessor (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/uimanager (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric/uimanager/consistency (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-Fabric/uimanager/consistency (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - React-FabricComponents (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components (= 0.83.0) + - React-FabricComponents/textlayoutmanager (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components/inputaccessory (= 0.83.0) + - React-FabricComponents/components/iostextinput (= 0.83.0) + - React-FabricComponents/components/modal (= 0.83.0) + - React-FabricComponents/components/rncore (= 0.83.0) + - React-FabricComponents/components/safeareaview (= 0.83.0) + - React-FabricComponents/components/scrollview (= 0.83.0) + - React-FabricComponents/components/switch (= 0.83.0) + - React-FabricComponents/components/text (= 0.83.0) + - React-FabricComponents/components/textinput (= 0.83.0) + - React-FabricComponents/components/unimplementedview (= 0.83.0) + - React-FabricComponents/components/virtualview (= 0.83.0) + - React-FabricComponents/components/virtualviewexperimental (= 0.83.0) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/inputaccessory (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/iostextinput (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/modal (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/rncore (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/safeareaview (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/scrollview (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/switch (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/text (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/textinput (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/unimplementedview (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/virtualview (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/virtualviewexperimental (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/textlayoutmanager (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricImage (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired (= 0.83.0) + - RCTTypeSafety (= 0.83.0) + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsiexecutor (= 0.83.0) + - React-logger + - React-rendererdebug + - React-utils + - ReactCommon + - SocketRocket + - Yoga + - React-featureflags (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-featureflagsnativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - SocketRocket + - React-graphics (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-utils + - SocketRocket + - React-hermes (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact (= 0.83.0) + - React-jsi + - React-jsiexecutor (= 0.83.0) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-oscompat + - React-perflogger (= 0.83.0) + - React-runtimeexecutor + - SocketRocket + - React-idlecallbacksnativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - React-runtimescheduler + - ReactCommon/turbomodule/core + - SocketRocket + - React-ImageManager (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/Default + - React-debug + - React-Fabric + - React-graphics + - React-rendererdebug + - React-utils + - SocketRocket + - React-intersectionobservernativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-Fabric + - React-Fabric/bridging + - React-graphics + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - React-runtimescheduler + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-jserrorhandler (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - ReactCommon/turbomodule/bridging + - SocketRocket + - React-jsi (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-jsiexecutor (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-debug + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-perflogger + - React-runtimeexecutor + - React-utils + - SocketRocket + - React-jsinspector (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-jsinspectortracing + - React-oscompat + - React-perflogger (= 0.83.0) + - React-runtimeexecutor + - React-utils + - SocketRocket + - React-jsinspectorcdp (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-jsinspectornetwork (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-jsinspectorcdp + - SocketRocket + - React-jsinspectortracing (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsinspectornetwork + - React-oscompat + - React-timing + - SocketRocket + - React-jsitooling (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact (= 0.83.0) + - React-debug + - React-jsi (= 0.83.0) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-runtimeexecutor + - React-utils + - SocketRocket + - React-jsitracing (0.83.0): + - React-jsi + - React-logger (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-Mapbuffer (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - SocketRocket + - React-microtasksnativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - SocketRocket + - React-NativeModulesApple (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-runtimeexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - React-networking (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsinspectornetwork + - React-jsinspectortracing + - React-performancetimeline + - React-timing + - SocketRocket + - React-oscompat (0.83.0) + - React-perflogger (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - SocketRocket + - React-performancecdpmetrics (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-jsi + - React-performancetimeline + - React-runtimeexecutor + - React-timing + - SocketRocket + - React-performancetimeline (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-jsinspectortracing + - React-perflogger + - React-timing + - SocketRocket + - React-RCTActionSheet (0.83.0): + - React-Core/RCTActionSheetHeaders (= 0.83.0) + - React-RCTAnimation (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTAnimationHeaders + - React-featureflags + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTAppDelegate (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-CoreModules + - React-debug + - React-defaultsnativemodule + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-jsitooling + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTNetwork + - React-RCTRuntime + - React-rendererdebug + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon + - SocketRocket + - React-RCTBlob (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/RCTBlobHeaders + - React-Core/RCTWebSocket + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - SocketRocket + - React-RCTFabric (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTSwiftUIWrapper + - React-Core + - React-debug + - React-Fabric + - React-FabricComponents + - React-FabricImage + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-networking + - React-performancecdpmetrics + - React-performancetimeline + - React-RCTAnimation + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTText + - React-rendererconsistency + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - Yoga + - React-RCTFBReactNativeSpec (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec/components (= 0.83.0) + - ReactCommon + - SocketRocket + - React-RCTFBReactNativeSpec/components (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-NativeModulesApple + - React-rendererdebug + - React-utils + - ReactCommon + - SocketRocket + - Yoga + - React-RCTImage (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTImageHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - SocketRocket + - React-RCTLinking (0.83.0): + - React-Core/RCTLinkingHeaders (= 0.83.0) + - React-jsi (= 0.83.0) + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactCommon/turbomodule/core (= 0.83.0) + - React-RCTNetwork (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTNetworkHeaders + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-NativeModulesApple + - React-networking + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTRuntime (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-Core + - React-debug + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - React-utils + - SocketRocket + - React-RCTSettings (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - RCTTypeSafety + - React-Core/RCTSettingsHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-RCTText (0.83.0): + - React-Core/RCTTextHeaders (= 0.83.0) + - Yoga + - React-RCTVibration (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-Core/RCTVibrationHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - SocketRocket + - React-rendererconsistency (0.83.0) + - React-renderercss (0.83.0): + - React-debug + - React-utils + - React-rendererdebug (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - SocketRocket + - React-RuntimeApple (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-Core/Default + - React-CoreModules + - React-cxxreact + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-Mapbuffer + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - React-runtimescheduler + - React-utils + - SocketRocket + - React-RuntimeCore (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-Fabric + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-performancetimeline + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - SocketRocket + - React-runtimeexecutor (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - React-featureflags + - React-jsi (= 0.83.0) + - React-utils + - SocketRocket + - React-RuntimeHermes (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-featureflags + - React-hermes + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-jsitracing + - React-RuntimeCore + - React-runtimeexecutor + - React-utils + - SocketRocket + - React-runtimescheduler (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectortracing + - React-performancetimeline + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-timing + - React-utils + - SocketRocket + - React-timing (0.83.0): + - React-debug + - React-utils (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - React-jsi (= 0.83.0) + - SocketRocket + - React-webperformancenativemodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-cxxreact + - React-jsi + - React-jsiexecutor + - React-performancetimeline + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - SocketRocket + - ReactAppDependencyProvider (0.83.0): + - ReactCodegen + - ReactCodegen (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-FabricImage + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-NativeModulesApple + - React-RCTAppDelegate + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - ReactCommon (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - ReactCommon/turbomodule (= 0.83.0) + - SocketRocket + - ReactCommon/turbomodule (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.83.0) + - React-cxxreact (= 0.83.0) + - React-jsi (= 0.83.0) + - React-logger (= 0.83.0) + - React-perflogger (= 0.83.0) + - ReactCommon/turbomodule/bridging (= 0.83.0) + - ReactCommon/turbomodule/core (= 0.83.0) + - SocketRocket + - ReactCommon/turbomodule/bridging (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.83.0) + - React-cxxreact (= 0.83.0) + - React-jsi (= 0.83.0) + - React-logger (= 0.83.0) + - React-perflogger (= 0.83.0) + - SocketRocket + - ReactCommon/turbomodule/core (0.83.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - React-callinvoker (= 0.83.0) + - React-cxxreact (= 0.83.0) + - React-debug (= 0.83.0) + - React-featureflags (= 0.83.0) + - React-jsi (= 0.83.0) + - React-logger (= 0.83.0) + - React-perflogger (= 0.83.0) + - React-utils (= 0.83.0) + - SocketRocket + - ReactNativeLiteCard (0.1.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - SocketRocket (0.7.1) + - Yoga (0.0.0) + +DEPENDENCIES: + - boost (from `../../../../node_modules/react-native/third-party-podspecs/boost.podspec`) + - DoubleConversion (from `../../../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) + - fast_float (from `../../../../node_modules/react-native/third-party-podspecs/fast_float.podspec`) + - FBLazyVector (from `../../../../node_modules/react-native/Libraries/FBLazyVector`) + - fmt (from `../../../../node_modules/react-native/third-party-podspecs/fmt.podspec`) + - glog (from `../../../../node_modules/react-native/third-party-podspecs/glog.podspec`) + - hermes-engine (from `../../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - RCT-Folly (from `../../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) + - RCTDeprecation (from `../../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) + - RCTRequired (from `../../../../node_modules/react-native/Libraries/Required`) + - RCTSwiftUI (from `../../../../node_modules/react-native/ReactApple/RCTSwiftUI`) + - RCTSwiftUIWrapper (from `../../../../node_modules/react-native/ReactApple/RCTSwiftUIWrapper`) + - RCTTypeSafety (from `../../../../node_modules/react-native/Libraries/TypeSafety`) + - React (from `../../../../node_modules/react-native/`) + - React-callinvoker (from `../../../../node_modules/react-native/ReactCommon/callinvoker`) + - React-Core (from `../../../../node_modules/react-native/`) + - React-Core/RCTWebSocket (from `../../../../node_modules/react-native/`) + - React-CoreModules (from `../../../../node_modules/react-native/React/CoreModules`) + - React-cxxreact (from `../../../../node_modules/react-native/ReactCommon/cxxreact`) + - React-debug (from `../../../../node_modules/react-native/ReactCommon/react/debug`) + - React-defaultsnativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults`) + - React-domnativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/dom`) + - React-Fabric (from `../../../../node_modules/react-native/ReactCommon`) + - React-FabricComponents (from `../../../../node_modules/react-native/ReactCommon`) + - React-FabricImage (from `../../../../node_modules/react-native/ReactCommon`) + - React-featureflags (from `../../../../node_modules/react-native/ReactCommon/react/featureflags`) + - React-featureflagsnativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags`) + - React-graphics (from `../../../../node_modules/react-native/ReactCommon/react/renderer/graphics`) + - React-hermes (from `../../../../node_modules/react-native/ReactCommon/hermes`) + - React-idlecallbacksnativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`) + - React-ImageManager (from `../../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`) + - React-intersectionobservernativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/intersectionobserver`) + - React-jserrorhandler (from `../../../../node_modules/react-native/ReactCommon/jserrorhandler`) + - React-jsi (from `../../../../node_modules/react-native/ReactCommon/jsi`) + - React-jsiexecutor (from `../../../../node_modules/react-native/ReactCommon/jsiexecutor`) + - React-jsinspector (from `../../../../node_modules/react-native/ReactCommon/jsinspector-modern`) + - React-jsinspectorcdp (from `../../../../node_modules/react-native/ReactCommon/jsinspector-modern/cdp`) + - React-jsinspectornetwork (from `../../../../node_modules/react-native/ReactCommon/jsinspector-modern/network`) + - React-jsinspectortracing (from `../../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing`) + - React-jsitooling (from `../../../../node_modules/react-native/ReactCommon/jsitooling`) + - React-jsitracing (from `../../../../node_modules/react-native/ReactCommon/hermes/executor/`) + - React-logger (from `../../../../node_modules/react-native/ReactCommon/logger`) + - React-Mapbuffer (from `../../../../node_modules/react-native/ReactCommon`) + - React-microtasksnativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) + - React-NativeModulesApple (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) + - React-networking (from `../../../../node_modules/react-native/ReactCommon/react/networking`) + - React-oscompat (from `../../../../node_modules/react-native/ReactCommon/oscompat`) + - React-perflogger (from `../../../../node_modules/react-native/ReactCommon/reactperflogger`) + - React-performancecdpmetrics (from `../../../../node_modules/react-native/ReactCommon/react/performance/cdpmetrics`) + - React-performancetimeline (from `../../../../node_modules/react-native/ReactCommon/react/performance/timeline`) + - React-RCTActionSheet (from `../../../../node_modules/react-native/Libraries/ActionSheetIOS`) + - React-RCTAnimation (from `../../../../node_modules/react-native/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../../../../node_modules/react-native/Libraries/AppDelegate`) + - React-RCTBlob (from `../../../../node_modules/react-native/Libraries/Blob`) + - React-RCTFabric (from `../../../../node_modules/react-native/React`) + - React-RCTFBReactNativeSpec (from `../../../../node_modules/react-native/React`) + - React-RCTImage (from `../../../../node_modules/react-native/Libraries/Image`) + - React-RCTLinking (from `../../../../node_modules/react-native/Libraries/LinkingIOS`) + - React-RCTNetwork (from `../../../../node_modules/react-native/Libraries/Network`) + - React-RCTRuntime (from `../../../../node_modules/react-native/React/Runtime`) + - React-RCTSettings (from `../../../../node_modules/react-native/Libraries/Settings`) + - React-RCTText (from `../../../../node_modules/react-native/Libraries/Text`) + - React-RCTVibration (from `../../../../node_modules/react-native/Libraries/Vibration`) + - React-rendererconsistency (from `../../../../node_modules/react-native/ReactCommon/react/renderer/consistency`) + - React-renderercss (from `../../../../node_modules/react-native/ReactCommon/react/renderer/css`) + - React-rendererdebug (from `../../../../node_modules/react-native/ReactCommon/react/renderer/debug`) + - React-RuntimeApple (from `../../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios`) + - React-RuntimeCore (from `../../../../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimeexecutor (from `../../../../node_modules/react-native/ReactCommon/runtimeexecutor`) + - React-RuntimeHermes (from `../../../../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimescheduler (from `../../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`) + - React-timing (from `../../../../node_modules/react-native/ReactCommon/react/timing`) + - React-utils (from `../../../../node_modules/react-native/ReactCommon/react/utils`) + - React-webperformancenativemodule (from `../../../../node_modules/react-native/ReactCommon/react/nativemodule/webperformance`) + - ReactAppDependencyProvider (from `build/generated/ios/ReactAppDependencyProvider`) + - ReactCodegen (from `build/generated/ios/ReactCodegen`) + - ReactCommon/turbomodule/core (from `../../../../node_modules/react-native/ReactCommon`) + - ReactNativeLiteCard (from `../..`) + - SocketRocket (~> 0.7.1) + - Yoga (from `../../../../node_modules/react-native/ReactCommon/yoga`) + +SPEC REPOS: + trunk: + - SocketRocket + +EXTERNAL SOURCES: + boost: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/boost.podspec" + DoubleConversion: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" + fast_float: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/fast_float.podspec" + FBLazyVector: + :path: "../../../../node_modules/react-native/Libraries/FBLazyVector" + fmt: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/fmt.podspec" + glog: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/glog.podspec" + hermes-engine: + :podspec: "../../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" + :tag: hermes-v0.14.0 + RCT-Folly: + :podspec: "../../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" + RCTDeprecation: + :path: "../../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation" + RCTRequired: + :path: "../../../../node_modules/react-native/Libraries/Required" + RCTSwiftUI: + :path: "../../../../node_modules/react-native/ReactApple/RCTSwiftUI" + RCTSwiftUIWrapper: + :path: "../../../../node_modules/react-native/ReactApple/RCTSwiftUIWrapper" + RCTTypeSafety: + :path: "../../../../node_modules/react-native/Libraries/TypeSafety" + React: + :path: "../../../../node_modules/react-native/" + React-callinvoker: + :path: "../../../../node_modules/react-native/ReactCommon/callinvoker" + React-Core: + :path: "../../../../node_modules/react-native/" + React-CoreModules: + :path: "../../../../node_modules/react-native/React/CoreModules" + React-cxxreact: + :path: "../../../../node_modules/react-native/ReactCommon/cxxreact" + React-debug: + :path: "../../../../node_modules/react-native/ReactCommon/react/debug" + React-defaultsnativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults" + React-domnativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/dom" + React-Fabric: + :path: "../../../../node_modules/react-native/ReactCommon" + React-FabricComponents: + :path: "../../../../node_modules/react-native/ReactCommon" + React-FabricImage: + :path: "../../../../node_modules/react-native/ReactCommon" + React-featureflags: + :path: "../../../../node_modules/react-native/ReactCommon/react/featureflags" + React-featureflagsnativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags" + React-graphics: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/graphics" + React-hermes: + :path: "../../../../node_modules/react-native/ReactCommon/hermes" + React-idlecallbacksnativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks" + React-ImageManager: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios" + React-intersectionobservernativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/intersectionobserver" + React-jserrorhandler: + :path: "../../../../node_modules/react-native/ReactCommon/jserrorhandler" + React-jsi: + :path: "../../../../node_modules/react-native/ReactCommon/jsi" + React-jsiexecutor: + :path: "../../../../node_modules/react-native/ReactCommon/jsiexecutor" + React-jsinspector: + :path: "../../../../node_modules/react-native/ReactCommon/jsinspector-modern" + React-jsinspectorcdp: + :path: "../../../../node_modules/react-native/ReactCommon/jsinspector-modern/cdp" + React-jsinspectornetwork: + :path: "../../../../node_modules/react-native/ReactCommon/jsinspector-modern/network" + React-jsinspectortracing: + :path: "../../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing" + React-jsitooling: + :path: "../../../../node_modules/react-native/ReactCommon/jsitooling" + React-jsitracing: + :path: "../../../../node_modules/react-native/ReactCommon/hermes/executor/" + React-logger: + :path: "../../../../node_modules/react-native/ReactCommon/logger" + React-Mapbuffer: + :path: "../../../../node_modules/react-native/ReactCommon" + React-microtasksnativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" + React-NativeModulesApple: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios" + React-networking: + :path: "../../../../node_modules/react-native/ReactCommon/react/networking" + React-oscompat: + :path: "../../../../node_modules/react-native/ReactCommon/oscompat" + React-perflogger: + :path: "../../../../node_modules/react-native/ReactCommon/reactperflogger" + React-performancecdpmetrics: + :path: "../../../../node_modules/react-native/ReactCommon/react/performance/cdpmetrics" + React-performancetimeline: + :path: "../../../../node_modules/react-native/ReactCommon/react/performance/timeline" + React-RCTActionSheet: + :path: "../../../../node_modules/react-native/Libraries/ActionSheetIOS" + React-RCTAnimation: + :path: "../../../../node_modules/react-native/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../../../../node_modules/react-native/Libraries/AppDelegate" + React-RCTBlob: + :path: "../../../../node_modules/react-native/Libraries/Blob" + React-RCTFabric: + :path: "../../../../node_modules/react-native/React" + React-RCTFBReactNativeSpec: + :path: "../../../../node_modules/react-native/React" + React-RCTImage: + :path: "../../../../node_modules/react-native/Libraries/Image" + React-RCTLinking: + :path: "../../../../node_modules/react-native/Libraries/LinkingIOS" + React-RCTNetwork: + :path: "../../../../node_modules/react-native/Libraries/Network" + React-RCTRuntime: + :path: "../../../../node_modules/react-native/React/Runtime" + React-RCTSettings: + :path: "../../../../node_modules/react-native/Libraries/Settings" + React-RCTText: + :path: "../../../../node_modules/react-native/Libraries/Text" + React-RCTVibration: + :path: "../../../../node_modules/react-native/Libraries/Vibration" + React-rendererconsistency: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/consistency" + React-renderercss: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/css" + React-rendererdebug: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/debug" + React-RuntimeApple: + :path: "../../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios" + React-RuntimeCore: + :path: "../../../../node_modules/react-native/ReactCommon/react/runtime" + React-runtimeexecutor: + :path: "../../../../node_modules/react-native/ReactCommon/runtimeexecutor" + React-RuntimeHermes: + :path: "../../../../node_modules/react-native/ReactCommon/react/runtime" + React-runtimescheduler: + :path: "../../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler" + React-timing: + :path: "../../../../node_modules/react-native/ReactCommon/react/timing" + React-utils: + :path: "../../../../node_modules/react-native/ReactCommon/react/utils" + React-webperformancenativemodule: + :path: "../../../../node_modules/react-native/ReactCommon/react/nativemodule/webperformance" + ReactAppDependencyProvider: + :path: build/generated/ios/ReactAppDependencyProvider + ReactCodegen: + :path: build/generated/ios/ReactCodegen + ReactCommon: + :path: "../../../../node_modules/react-native/ReactCommon" + ReactNativeLiteCard: + :path: "../.." + Yoga: + :path: "../../../../node_modules/react-native/ReactCommon/yoga" + +SPEC CHECKSUMS: + boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 + DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb + fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 + FBLazyVector: a293a88992c4c33f0aee184acab0b64a08ff9458 + fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd + glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 + hermes-engine: 70fdc9d0bb0d8532e0411dcb21e53ce5a160960a + RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 + RCTDeprecation: 2b70c6e3abe00396cefd8913efbf6a2db01a2b36 + RCTRequired: f3540eee8094231581d40c5c6d41b0f170237a81 + RCTSwiftUI: 5928f7ca7e9e2f1a82d85d4c79ea3065137ad81c + RCTSwiftUIWrapper: 8ff2f9da84b47db66d11ece1589d8e5515c0ab8b + RCTTypeSafety: 6359ff3fcbe18c52059f4d4ce301e47f9da5f0d5 + React: f6f8fc5c01e77349cdfaf49102bcb928ac31d8ed + React-callinvoker: 032b6d1d03654b9fb7de9e2b3b978d3cb1a893ad + React-Core: 418c9278f8a071b44a88a87be9a4943234cc2e77 + React-CoreModules: 925b8cb677649f967f6000f9b1ef74dc4ff60c30 + React-cxxreact: 21f6f0cb2a7d26fbed4d09e04482e5c75662beaf + React-debug: 8fc21f2fecd3d6244e988dc55d60cb117d122588 + React-defaultsnativemodule: 05c6115a2d3a7f4a2cc3f96022261570700dbfa5 + React-domnativemodule: f19d7fd59facf19a4e6cb75bf48357c329acaea7 + React-Fabric: 94acdbc0b889bdcec2d5b1a90ae48f1032c5a5a1 + React-FabricComponents: 9754fb783979b88fb82ed3d0c50ae5f5d775a86f + React-FabricImage: d8f5bcb5006eafc0e2262c11bf4dedaa610fd66c + React-featureflags: 8bd4abaf8adf3cf5cc115f128e8761fd3d95b848 + React-featureflagsnativemodule: 0062ca1dc92cb5aae22df8aed4e8f261759cb3bd + React-graphics: 318048b8f98e040c093adcb77ffeb46d78961c30 + React-hermes: 05ca52f53557a31b8ef8bac8f94c3f9db1ff00ed + React-idlecallbacksnativemodule: d3c5ba0150555ce9b7db85008aeb170a02bbf2d8 + React-ImageManager: 225b19fcb16fd353851d664c344025a6d4d79870 + React-intersectionobservernativemodule: d490ebd28572754dfdad4a8d0771573345b1ec92 + React-jserrorhandler: caafb9c1d42c24422829e71e8178de3dd1c7ea12 + React-jsi: 749de748ad3b760011255326c63bf7b7dd6f8f9d + React-jsiexecutor: 02a5ee45bffcae98197eaa253fbf13b65c95073d + React-jsinspector: 4a031b0605009d4bcd079c99df85eb55d142cd12 + React-jsinspectorcdp: 6d25166ec876053b7b6e290eb57f41a9f9496846 + React-jsinspectornetwork: 5c481d208eade7a338f545b2645a2cf134fdf265 + React-jsinspectortracing: b4d2404ecd64a0dd65e2746d9867fbc3a7cd0927 + React-jsitooling: e0d93e78a5a231e4089459ddbed8d4844be9e238 + React-jsitracing: f3c4aae144b86799e9e23eb5ef16bae6b474d4e2 + React-logger: 9e597cbeda7b8cc8aa8fb93860dade97190f69cc + React-Mapbuffer: 20046c0447efaa7aace0b76085aa9bb35b0e8105 + React-microtasksnativemodule: 0e837de56519c92d8a2e3097717df9497feb33cb + React-NativeModulesApple: 1a378198515f8e825c5931a7613e98da69320cee + React-networking: bfd1695ada5a57023006ce05823ac5391c3ce072 + React-oscompat: aedc0afbded67280de6bb6bfac8cfde0389e2b33 + React-perflogger: c174462de00c0b7d768f0b2d61b8e2240717a667 + React-performancecdpmetrics: 2607a034407d55049f1820b7ec86db1efd3d22e1 + React-performancetimeline: 6ebdcdf745dbe372508ad7164e732362e7eeae6f + React-RCTActionSheet: 175c74d343e92793d3187b3a819d565f534e0b1d + React-RCTAnimation: d67919cddb7da39c949b8010b4fd4ea39815fe4e + React-RCTAppDelegate: 5f7b1e4b7ee5a44faf5f9518a7d3cabafb801adf + React-RCTBlob: 7ceb93e0918511163f036cfd295973f132a2bc57 + React-RCTFabric: f2250d34e1143c659b845af7e369b3f8f015950c + React-RCTFBReactNativeSpec: b0fc0c9c8adaf8b9183f9e9fb5455ca5deedc7a0 + React-RCTImage: d6297035168312fc3089f8ca0ee7a75216f21715 + React-RCTLinking: 619a2553c4ef83acaccfb551ada1b7d45cf1cce3 + React-RCTNetwork: 7df41788a194dc5b628f58db6a765224b6b37eac + React-RCTRuntime: f75ec08d991c611f1d74154dfeb852e30b1825dd + React-RCTSettings: fa7882ce3d73f1e3482fe05f9cb3167a35a60869 + React-RCTText: 4d659598d9b7730343d465c43d97b3f4aad13938 + React-RCTVibration: 968c3184bfe5005bedd86c913a3b52438222e3a4 + React-rendererconsistency: 1204c62facf6168b69bc5022e0020f19c92f138e + React-renderercss: 36c02a3c55402fdb06226c2ef04d82fc06c4e2fc + React-rendererdebug: 11b54233498d961d939d2f2ec6c640d44efa3c12 + React-RuntimeApple: 5287d92680f4b08c8e882afe9791a41eab69d4a7 + React-RuntimeCore: 402b658d8e9cefb44824624e39a0804f2237e205 + React-runtimeexecutor: a1ce75c4e153ede11be957ef31bb72eef9cc4daf + React-RuntimeHermes: c987b19a1284c685062d3eaad79fd9300a3aa82f + React-runtimescheduler: a12722da46f562626f5897edf9b8fa02219de065 + React-timing: a453a65192dbe400d61d299024e95a302e726661 + React-utils: 43479e74f806f6633ee04c212c48811530041170 + React-webperformancenativemodule: bd1ad71ea9e217e55f66233e99d02581ee3d5cb7 + ReactAppDependencyProvider: ebcf3a78dc1bcdf054c9e8d309244bade6b31568 + ReactCodegen: 038e59443a6e1ff5d42e041395148a6561b523d6 + ReactCommon: 424cc34cf5055d69a3dcf02f3436481afb8b0f6f + ReactNativeLiteCard: c264844a7a45f419b484ad93cefa13e4f3f0cd02 + SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 + Yoga: 6ca93c8c13f56baeec55eb608577619b17a4d64e + +PODFILE CHECKSUM: e52469a2edb1251ae716ad511daeef6c46b21608 + +COCOAPODS: 1.16.2 diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/project.pbxproj b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/project.pbxproj new file mode 100644 index 00000000..727f48c8 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/project.pbxproj @@ -0,0 +1,480 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 0C80B921A6F3F58F76C31292 /* libPods-ReactNativeLiteCardExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeLiteCardExample.a */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + AE4BC730851A9703B23D1F55 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 13B07F961A680F5B00A75B9A /* ReactNativeLiteCardExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeLiteCardExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeLiteCardExample/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeLiteCardExample/Info.plist; sourceTree = ""; }; + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = ReactNativeLiteCardExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3B4392A12AC88292D35C810B /* Pods-ReactNativeLiteCardExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeLiteCardExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample.debug.xcconfig"; sourceTree = ""; }; + 5709B34CF0A7D63546082F79 /* Pods-ReactNativeLiteCardExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeLiteCardExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample.release.xcconfig"; sourceTree = ""; }; + 5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeLiteCardExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeLiteCardExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = ReactNativeLiteCardExample/AppDelegate.swift; sourceTree = ""; }; + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeLiteCardExample/LaunchScreen.storyboard; sourceTree = ""; }; + ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0C80B921A6F3F58F76C31292 /* libPods-ReactNativeLiteCardExample.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 13B07FAE1A68108700A75B9A /* ReactNativeLiteCardExample */ = { + isa = PBXGroup; + children = ( + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 761780EC2CA45674006654EE /* AppDelegate.swift */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, + ); + name = ReactNativeLiteCardExample; + sourceTree = ""; + }; + 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { + isa = PBXGroup; + children = ( + ED297162215061F000B7C4FE /* JavaScriptCore.framework */, + 5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeLiteCardExample.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + ); + name = Libraries; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* ReactNativeLiteCardExample */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + 2D16E6871FA4F8E400B85C8A /* Frameworks */, + BBD78D7AC51CEA395F1C20DB /* Pods */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + usesTabs = 0; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* ReactNativeLiteCardExample.app */, + ); + name = Products; + sourceTree = ""; + }; + BBD78D7AC51CEA395F1C20DB /* Pods */ = { + isa = PBXGroup; + children = ( + 3B4392A12AC88292D35C810B /* Pods-ReactNativeLiteCardExample.debug.xcconfig */, + 5709B34CF0A7D63546082F79 /* Pods-ReactNativeLiteCardExample.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* ReactNativeLiteCardExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeLiteCardExample" */; + buildPhases = ( + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ReactNativeLiteCardExample; + productName = ReactNativeLiteCardExample; + productReference = 13B07F961A680F5B00A75B9A /* ReactNativeLiteCardExample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1210; + TargetAttributes = { + 13B07F861A680F5B00A75B9A = { + LastSwiftMigration = 1120; + }; + }; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeLiteCardExample" */; + compatibilityVersion = "Xcode 12.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* ReactNativeLiteCardExample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + AE4BC730851A9703B23D1F55 /* PrivacyInfo.xcprivacy in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/.xcode.env.local", + "$(SRCROOT)/.xcode.env", + ); + name = "Bundle React Native code and images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"\\\"$WITH_ENVIRONMENT\\\" \\\"$REACT_NATIVE_XCODE\\\"\"\n"; + }; + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ReactNativeLiteCardExample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeLiteCardExample/Pods-ReactNativeLiteCardExample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-ReactNativeLiteCardExample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = ReactNativeLiteCardExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = onekeyfe.reactnativelitecard.example; + PRODUCT_NAME = ReactNativeLiteCardExample; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-ReactNativeLiteCardExample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = ReactNativeLiteCardExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = onekeyfe.reactnativelitecard.example; + PRODUCT_NAME = ReactNativeLiteCardExample; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = "$(inherited)"; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../../node_modules/react-native"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; + USE_HERMES = true; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = "$(inherited)"; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../../node_modules/react-native"; + SDKROOT = iphoneos; + USE_HERMES = true; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeLiteCardExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeLiteCardExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/xcshareddata/xcschemes/ReactNativeLiteCardExample.xcscheme b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/xcshareddata/xcschemes/ReactNativeLiteCardExample.xcscheme new file mode 100644 index 00000000..b1b9eee0 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcodeproj/xcshareddata/xcschemes/ReactNativeLiteCardExample.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcworkspace/contents.xcworkspacedata b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..cfb79312 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/AppDelegate.swift b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/AppDelegate.swift new file mode 100644 index 00000000..945bafba --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "ReactNativeLiteCardExample", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { +#if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") +#else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") +#endif + } +} diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/AppIcon.appiconset/Contents.json b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..81213230 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/Contents.json b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/Contents.json new file mode 100644 index 00000000..2d92bd53 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Info.plist b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Info.plist new file mode 100644 index 00000000..114ec983 --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/Info.plist @@ -0,0 +1,55 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ReactNativeLiteCardExample + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + + NSLocationWhenInUseUsageDescription + + RCTNewArchEnabled + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/LaunchScreen.storyboard b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/LaunchScreen.storyboard new file mode 100644 index 00000000..076c7d9a --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/LaunchScreen.storyboard @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/PrivacyInfo.xcprivacy b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..41b8317f --- /dev/null +++ b/native-modules/react-native-lite-card/example/ios/ReactNativeLiteCardExample/PrivacyInfo.xcprivacy @@ -0,0 +1,37 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/native-modules/react-native-lite-card/example/jest.config.js b/native-modules/react-native-lite-card/example/jest.config.js new file mode 100644 index 00000000..8eb675e9 --- /dev/null +++ b/native-modules/react-native-lite-card/example/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + preset: 'react-native', +}; diff --git a/native-modules/react-native-lite-card/example/metro.config.js b/native-modules/react-native-lite-card/example/metro.config.js new file mode 100644 index 00000000..64f07f21 --- /dev/null +++ b/native-modules/react-native-lite-card/example/metro.config.js @@ -0,0 +1,26 @@ +const path = require('path'); +const { getDefaultConfig } = require('@react-native/metro-config'); +const { withMetroConfig } = require('react-native-monorepo-config'); + +const root = path.resolve(__dirname, '..'); + +/** + * Metro configuration + * https://facebook.github.io/metro/docs/configuration + * + * @type {import('metro-config').MetroConfig} + */ +const workspaceRoot = path.resolve(__dirname, '../../../'); +const metroConfig = withMetroConfig(getDefaultConfig(__dirname), { + root, + dirname: __dirname, +}); + +metroConfig.watchFolders = [workspaceRoot]; + +metroConfig.resolver.nodeModulesPaths = [ + path.resolve(root, 'node_modules'), + path.resolve(workspaceRoot, 'node_modules'), +]; + +module.exports = metroConfig; diff --git a/native-modules/react-native-lite-card/example/package.json b/native-modules/react-native-lite-card/example/package.json new file mode 100644 index 00000000..97caaf4c --- /dev/null +++ b/native-modules/react-native-lite-card/example/package.json @@ -0,0 +1,33 @@ +{ + "name": "@onekeyfe/react-native-lite-card-example", + "version": "0.0.1", + "private": true, + "scripts": { + "android": "react-native run-android", + "ios": "react-native run-ios", + "start": "react-native start", + "build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"", + "build:ios": "react-native build-ios --mode Debug" + }, + "dependencies": { + "react": "19.2.0", + "react-native": "0.83.0" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", + "@babel/runtime": "^7.25.0", + "@react-native-community/cli": "20.0.0", + "@react-native-community/cli-platform-android": "20.0.0", + "@react-native-community/cli-platform-ios": "20.0.0", + "@react-native/babel-preset": "0.83.0", + "@react-native/metro-config": "0.83.0", + "@react-native/typescript-config": "0.83.0", + "@types/react": "^19.2.0", + "react-native-builder-bob": "^0.40.13", + "react-native-monorepo-config": "^0.3.1" + }, + "engines": { + "node": ">=20" + } +} diff --git a/native-modules/react-native-lite-card/example/react-native.config.js b/native-modules/react-native-lite-card/example/react-native.config.js new file mode 100644 index 00000000..17387599 --- /dev/null +++ b/native-modules/react-native-lite-card/example/react-native.config.js @@ -0,0 +1,22 @@ +const path = require('path'); +const pkg = require('../package.json'); + +module.exports = { + reactNativePath: path.join(__dirname, '..', '..', '..', 'node_modules', 'react-native'), + project: { + ios: { + automaticPodsInstallation: true, + }, + }, + dependencies: { + [pkg.name]: { + root: path.join(__dirname, '..'), + platforms: { + // Codegen script incorrectly fails without this + // So we explicitly specify the platforms with empty object + ios: {}, + android: {}, + }, + }, + }, +}; diff --git a/native-modules/react-native-lite-card/example/src/App.tsx b/native-modules/react-native-lite-card/example/src/App.tsx new file mode 100644 index 00000000..5f52e0af --- /dev/null +++ b/native-modules/react-native-lite-card/example/src/App.tsx @@ -0,0 +1,96 @@ +import {View, StyleSheet, Button, ScrollView, Alert } from 'react-native'; +import onekeyLite from '@onekeyfe/react-native-lite-card'; + +export default function App() { + const handleGetLiteInfo = () => { + onekeyLite.getLiteInfo().then((result) => { + Alert.alert('getLiteInfo', JSON.stringify(result, null, 2)); + }); + }; + + const handleCheckNFCPermission = () => { + onekeyLite.checkNFCPermission().then((result) => { + Alert.alert('checkNFCPermission', JSON.stringify(result, null, 2)); + }); + }; + + const handleSetMnemonic = () => { + const mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'; + const pwd = '123456'; + const overwrite = false; + onekeyLite.setMnemonic(mnemonic, pwd, overwrite).then((result) => { + Alert.alert('setMnemonic', JSON.stringify(result, null, 2)); + }); + }; + + const handleGetMnemonicWithPin = () => { + const pwd = '123456'; + onekeyLite.getMnemonicWithPin(pwd).then((result) => { + Alert.alert('getMnemonicWithPin', JSON.stringify(result, null, 2)); + }); + }; + + const handleChangePin = () => { + const oldPin = '123456'; + const newPin = '654321'; + onekeyLite.changePin(oldPin, newPin).then((result) => { + Alert.alert('changePin', JSON.stringify(result, null, 2)); + }); + }; + + const handleReset = () => { + onekeyLite.reset().then((result) => { + Alert.alert('reset', JSON.stringify(result, null, 2)); + }); + }; + + const handleCancel = () => { + onekeyLite.cancel(); + Alert.alert('cancel', 'Cancel called'); + }; + + const handleIntoSetting = () => { + onekeyLite.intoSetting(); + Alert.alert('intoSetting', 'Opening settings'); + }; + + return ( + + +