├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── bcryptreactnative │ ├── BCrypt.java │ ├── BcryptReactNativeModule.java │ └── BcryptReactNativePackage.java ├── babel.config.js ├── bcrypt-react-native.podspec ├── example ├── android │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── bcryptreactnative │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── bcryptreactnative │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.tsx ├── ios │ ├── BcryptReactNativeExample-Bridging-Header.h │ ├── BcryptReactNativeExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── BcryptReactNativeExample.xcscheme │ ├── BcryptReactNativeExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── BcryptReactNativeExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ ├── File.swift │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json ├── src │ └── App.tsx └── yarn.lock ├── ios ├── BcryptReactNative-Bridging-Header.h ├── BcryptReactNative.m ├── BcryptReactNative.swift └── BcryptReactNative.xcodeproj │ └── project.pbxproj ├── package.json ├── src ├── __tests__ │ └── index.test.tsx └── index.tsx ├── tsconfig.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | executors: 4 | default: 5 | docker: 6 | - image: circleci/node:10 7 | working_directory: ~/project 8 | 9 | commands: 10 | attach_project: 11 | steps: 12 | - attach_workspace: 13 | at: ~/project 14 | 15 | jobs: 16 | install-dependencies: 17 | executor: default 18 | steps: 19 | - checkout 20 | - attach_project 21 | - restore_cache: 22 | keys: 23 | - dependencies-{{ checksum "package.json" }} 24 | - dependencies- 25 | - restore_cache: 26 | keys: 27 | - dependencies-example-{{ checksum "example/package.json" }} 28 | - dependencies-example- 29 | - run: 30 | name: Install dependencies 31 | command: | 32 | yarn install --cwd example --frozen-lockfile 33 | yarn install --frozen-lockfile 34 | - save_cache: 35 | key: dependencies-{{ checksum "package.json" }} 36 | paths: node_modules 37 | - save_cache: 38 | key: dependencies-example-{{ checksum "example/package.json" }} 39 | paths: example/node_modules 40 | - persist_to_workspace: 41 | root: . 42 | paths: . 43 | 44 | lint: 45 | executor: default 46 | steps: 47 | - attach_project 48 | - run: 49 | name: Lint files 50 | command: | 51 | yarn lint 52 | 53 | typescript: 54 | executor: default 55 | steps: 56 | - attach_project 57 | - run: 58 | name: Typecheck files 59 | command: | 60 | yarn typescript 61 | 62 | unit-tests: 63 | executor: default 64 | steps: 65 | - attach_project 66 | - run: 67 | name: Run unit tests 68 | command: | 69 | yarn test --coverage 70 | - store_artifacts: 71 | path: coverage 72 | destination: coverage 73 | 74 | build-package: 75 | executor: default 76 | steps: 77 | - attach_project 78 | - run: 79 | name: Build package 80 | command: | 81 | yarn prepare 82 | 83 | workflows: 84 | build-and-test: 85 | jobs: 86 | - install-dependencies 87 | - lint: 88 | requires: 89 | - install-dependencies 90 | - typescript: 91 | requires: 92 | - install-dependencies 93 | - unit-tests: 94 | requires: 95 | - install-dependencies 96 | - build-package: 97 | requires: 98 | - install-dependencies 99 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .idea 35 | .gradle 36 | local.properties 37 | android.iml 38 | 39 | # Cocoapods 40 | # 41 | example/ios/Pods 42 | 43 | # node.js 44 | # 45 | node_modules/ 46 | npm-debug.log 47 | yarn-debug.log 48 | yarn-error.log 49 | 50 | # BUCK 51 | buck-out/ 52 | \.buckd/ 53 | android/app/libs 54 | android/keystores/debug.keystore 55 | 56 | # Expo 57 | .expo/* 58 | 59 | # generated by bob 60 | lib/ 61 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. 4 | 5 | ## Development workflow 6 | 7 | To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package: 8 | 9 | ```sh 10 | yarn bootstrap 11 | ``` 12 | 13 | While developing, you can run the [example app](/example/) to test your changes. 14 | 15 | To start the packager: 16 | 17 | ```sh 18 | yarn example start 19 | ``` 20 | 21 | To run the example app on Android: 22 | 23 | ```sh 24 | yarn example android 25 | ``` 26 | 27 | To run the example app on iOS: 28 | 29 | ```sh 30 | yarn example ios 31 | ``` 32 | 33 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 34 | 35 | ```sh 36 | yarn typescript 37 | yarn lint 38 | ``` 39 | 40 | To fix formatting errors, run the following: 41 | 42 | ```sh 43 | yarn lint --fix 44 | ``` 45 | 46 | Remember to add tests for your change if possible. Run the unit tests by: 47 | 48 | ```sh 49 | yarn test 50 | ``` 51 | 52 | To edit the Objective-C files, open `example/ios/BcryptReactNativeExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > bcrypt-react-native`. 53 | 54 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `bcryptreactnative` under `Android`. 55 | 56 | ### Commit message convention 57 | 58 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 59 | 60 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 61 | - `feat`: new features, e.g. add new method to the module. 62 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 63 | - `docs`: changes into documentation, e.g. add usage example for the module.. 64 | - `test`: adding or updating tests, eg add integration tests using detox. 65 | - `chore`: tooling changes, e.g. change CI config. 66 | 67 | Our pre-commit hooks verify that your commit message matches this format when committing. 68 | 69 | ### Linting and tests 70 | 71 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 72 | 73 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 74 | 75 | Our pre-commit hooks verify that the linter and tests pass when committing. 76 | 77 | ### Scripts 78 | 79 | The `package.json` file contains various scripts for common tasks: 80 | 81 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 82 | - `yarn typescript`: type-check files with TypeScript. 83 | - `yarn lint`: lint files with ESLint. 84 | - `yarn test`: run unit tests with Jest. 85 | - `yarn example start`: start the Metro server for the example app. 86 | - `yarn example android`: run the example app on Android. 87 | - `yarn example ios`: run the example app on iOS. 88 | 89 | ### Sending a pull request 90 | 91 | > **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://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). 92 | 93 | When you're sending a pull request: 94 | 95 | - Prefer small pull requests focused on one change. 96 | - Verify that linters and tests are passing. 97 | - Review the documentation to make sure it looks good. 98 | - Follow the pull request template when opening a pull request. 99 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 100 | 101 | ## Code of Conduct 102 | 103 | ### Our Pledge 104 | 105 | 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, religion, or sexual identity and orientation. 106 | 107 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 108 | 109 | ### Our Standards 110 | 111 | Examples of behavior that contributes to a positive environment for our community include: 112 | 113 | - Demonstrating empathy and kindness toward other people 114 | - Being respectful of differing opinions, viewpoints, and experiences 115 | - Giving and gracefully accepting constructive feedback 116 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 117 | - Focusing on what is best not just for us as individuals, but for the overall community 118 | 119 | Examples of unacceptable behavior include: 120 | 121 | - The use of sexualized language or imagery, and sexual attention or 122 | advances of any kind 123 | - Trolling, insulting or derogatory comments, and personal or political attacks 124 | - Public or private harassment 125 | - Publishing others' private information, such as a physical or email 126 | address, without their explicit permission 127 | - Other conduct which could reasonably be considered inappropriate in a 128 | professional setting 129 | 130 | ### Enforcement Responsibilities 131 | 132 | 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. 133 | 134 | 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. 135 | 136 | ### Scope 137 | 138 | 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. 139 | 140 | ### Enforcement 141 | 142 | 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. 143 | 144 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 145 | 146 | ### Enforcement Guidelines 147 | 148 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 149 | 150 | #### 1. Correction 151 | 152 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 153 | 154 | **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. 155 | 156 | #### 2. Warning 157 | 158 | **Community Impact**: A violation through a single incident or series of actions. 159 | 160 | **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. 161 | 162 | #### 3. Temporary Ban 163 | 164 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 165 | 166 | **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. 167 | 168 | #### 4. Permanent Ban 169 | 170 | **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. 171 | 172 | **Consequence**: A permanent ban from any sort of public interaction within the community. 173 | 174 | ### Attribution 175 | 176 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 177 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 178 | 179 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 180 | 181 | [homepage]: https://www.contributor-covenant.org 182 | 183 | For answers to common questions about this code of conduct, see the FAQ at 184 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 185 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 singhandresh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bcrypt-react-native 2 | 3 | **Native** implementation of bcrypt for react-native. 4 | 5 | Uses [BCrypt](https://libraries.io/cocoapods/BCrypt) for iOS. 6 | 7 | ## Installation 8 | 9 | ```sh 10 | npm install bcrypt-react-native 11 | ``` 12 | or 13 | ```sh 14 | yarn add bcrypt-react-native 15 | ``` 16 | 17 | ```sh 18 | cd ios && pod install 19 | ``` 20 | 21 | ## Usage 22 | 23 | ```js 24 | import BcryptReactNative from 'bcrypt-react-native'; 25 | 26 | // ... 27 | try{ 28 | 29 | const salt = await BcryptReactNative.getSalt(10); 30 | const hash = await BcryptReactNative.hash(salt, 'password'); 31 | const isSame = await BcryptReactNative.compareSync('password', hash); 32 | } catch(e) { 33 | console.log({ e }) 34 | } 35 | ``` 36 | 37 | ## Contributing 38 | 39 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 40 | 41 | ## License 42 | 43 | MIT 44 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android_ 4 | Project android_ created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | // Buildscript is evaluated before everything else so we can't use getExtOrDefault 3 | def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['BcryptReactNative_kotlinVersion'] 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | // noinspection DifferentKotlinGradleVersion 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | apply plugin: 'com.android.library' 18 | apply plugin: 'kotlin-android' 19 | 20 | def getExtOrDefault(name) { 21 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['BcryptReactNative_' + name] 22 | } 23 | 24 | def getExtOrIntegerDefault(name) { 25 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['BcryptReactNative_' + name]).toInteger() 26 | } 27 | 28 | android { 29 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') 30 | buildToolsVersion getExtOrDefault('buildToolsVersion') 31 | defaultConfig { 32 | minSdkVersion 16 33 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') 34 | versionCode 1 35 | versionName "1.0" 36 | 37 | } 38 | 39 | buildTypes { 40 | release { 41 | minifyEnabled false 42 | } 43 | } 44 | lintOptions { 45 | disable 'GradleCompatible' 46 | } 47 | compileOptions { 48 | sourceCompatibility JavaVersion.VERSION_1_8 49 | targetCompatibility JavaVersion.VERSION_1_8 50 | } 51 | } 52 | 53 | repositories { 54 | mavenCentral() 55 | jcenter() 56 | google() 57 | 58 | def found = false 59 | def defaultDir = null 60 | def androidSourcesName = 'React Native sources' 61 | 62 | if (rootProject.ext.has('reactNativeAndroidRoot')) { 63 | defaultDir = rootProject.ext.get('reactNativeAndroidRoot') 64 | } else { 65 | defaultDir = new File( 66 | projectDir, 67 | '/../../../node_modules/react-native/android' 68 | ) 69 | } 70 | 71 | if (defaultDir.exists()) { 72 | maven { 73 | url defaultDir.toString() 74 | name androidSourcesName 75 | } 76 | 77 | logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") 78 | found = true 79 | } else { 80 | def parentDir = rootProject.projectDir 81 | 82 | 1.upto(5, { 83 | if (found) return true 84 | parentDir = parentDir.parentFile 85 | 86 | def androidSourcesDir = new File( 87 | parentDir, 88 | 'node_modules/react-native' 89 | ) 90 | 91 | def androidPrebuiltBinaryDir = new File( 92 | parentDir, 93 | 'node_modules/react-native/android' 94 | ) 95 | 96 | if (androidPrebuiltBinaryDir.exists()) { 97 | maven { 98 | url androidPrebuiltBinaryDir.toString() 99 | name androidSourcesName 100 | } 101 | 102 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") 103 | found = true 104 | } else if (androidSourcesDir.exists()) { 105 | maven { 106 | url androidSourcesDir.toString() 107 | name androidSourcesName 108 | } 109 | 110 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") 111 | found = true 112 | } 113 | }) 114 | } 115 | 116 | if (!found) { 117 | throw new GradleException( 118 | "${project.name}: unable to locate React Native android sources. " + 119 | "Ensure you have you installed React Native as a dependency in your project and try again." 120 | ) 121 | } 122 | } 123 | 124 | def kotlin_version = getExtOrDefault('kotlinVersion') 125 | 126 | dependencies { 127 | // noinspection GradleDynamicVersion 128 | api 'com.facebook.react:react-native:+' 129 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 130 | } 131 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | BcryptReactNative_kotlinVersion=1.3.50 2 | BcryptReactNative_compileSdkVersion=28 3 | BcryptReactNative_buildToolsVersion=28.0.3 4 | BcryptReactNative_targetSdkVersion=28 5 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/bcryptreactnative/BCrypt.java: -------------------------------------------------------------------------------- 1 | package com.bcryptreactnative; 2 | 3 | 4 | import java.io.UnsupportedEncodingException; 5 | import java.security.SecureRandom; 6 | 7 | public class BCrypt { 8 | // BCrypt parameters 9 | private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10; 10 | private static final int BCRYPT_SALT_LEN = 16; 11 | 12 | // Blowfish parameters 13 | private static final int BLOWFISH_NUM_ROUNDS = 16; 14 | 15 | // Initial contents of key schedule 16 | private static final int P_orig[] = { 17 | 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 18 | 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 19 | 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 20 | 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 21 | 0x9216d5d9, 0x8979fb1b 22 | }; 23 | private static final int S_orig[] = { 24 | 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 25 | 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 26 | 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 27 | 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 28 | 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 29 | 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 30 | 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 31 | 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 32 | 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 33 | 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 34 | 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 35 | 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 36 | 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 37 | 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 38 | 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 39 | 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 40 | 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 41 | 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 42 | 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 43 | 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 44 | 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 45 | 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 46 | 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 47 | 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 48 | 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 49 | 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 50 | 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 51 | 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 52 | 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 53 | 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 54 | 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 55 | 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 56 | 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 57 | 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 58 | 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 59 | 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 60 | 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 61 | 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 62 | 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 63 | 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 64 | 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 65 | 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 66 | 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 67 | 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 68 | 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 69 | 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 70 | 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 71 | 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 72 | 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 73 | 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 74 | 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 75 | 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 76 | 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 77 | 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 78 | 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 79 | 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 80 | 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 81 | 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 82 | 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 83 | 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 84 | 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 85 | 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 86 | 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 87 | 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 88 | 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 89 | 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 90 | 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 91 | 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 92 | 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 93 | 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 94 | 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 95 | 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 96 | 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 97 | 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 98 | 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 99 | 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 100 | 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 101 | 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 102 | 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 103 | 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 104 | 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 105 | 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 106 | 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 107 | 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 108 | 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 109 | 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 110 | 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 111 | 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 112 | 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 113 | 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 114 | 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 115 | 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 116 | 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 117 | 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 118 | 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 119 | 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 120 | 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 121 | 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 122 | 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 123 | 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 124 | 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 125 | 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 126 | 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 127 | 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 128 | 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 129 | 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 130 | 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 131 | 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 132 | 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 133 | 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 134 | 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 135 | 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 136 | 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 137 | 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 138 | 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 139 | 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 140 | 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 141 | 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 142 | 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 143 | 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 144 | 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 145 | 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 146 | 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 147 | 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 148 | 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 149 | 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 150 | 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 151 | 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, 152 | 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 153 | 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 154 | 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 155 | 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 156 | 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 157 | 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 158 | 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 159 | 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 160 | 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 161 | 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 162 | 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 163 | 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 164 | 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 165 | 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 166 | 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 167 | 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 168 | 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 169 | 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 170 | 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 171 | 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 172 | 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 173 | 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 174 | 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 175 | 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 176 | 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 177 | 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 178 | 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 179 | 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 180 | 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 181 | 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 182 | 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 183 | 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 184 | 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 185 | 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 186 | 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 187 | 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 188 | 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 189 | 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 190 | 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 191 | 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 192 | 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 193 | 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 194 | 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 195 | 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 196 | 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 197 | 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 198 | 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 199 | 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 200 | 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 201 | 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 202 | 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 203 | 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 204 | 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 205 | 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 206 | 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 207 | 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 208 | 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 209 | 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 210 | 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 211 | 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 212 | 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 213 | 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 214 | 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 215 | 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, 216 | 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 217 | 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 218 | 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 219 | 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 220 | 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 221 | 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 222 | 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 223 | 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 224 | 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 225 | 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 226 | 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 227 | 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 228 | 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 229 | 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 230 | 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 231 | 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 232 | 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 233 | 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 234 | 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 235 | 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 236 | 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 237 | 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 238 | 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 239 | 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 240 | 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 241 | 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 242 | 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 243 | 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 244 | 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 245 | 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 246 | 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 247 | 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 248 | 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 249 | 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 250 | 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 251 | 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, 252 | 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 253 | 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 254 | 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 255 | 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 256 | 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 257 | 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 258 | 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 259 | 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 260 | 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 261 | 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 262 | 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 263 | 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 264 | 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 265 | 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 266 | 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 267 | 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 268 | 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 269 | 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 270 | 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 271 | 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 272 | 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 273 | 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 274 | 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 275 | 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 276 | 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 277 | 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 278 | 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 279 | 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 280 | }; 281 | 282 | // bcrypt IV: "OrpheanBeholderScryDoubt". The C implementation calls 283 | // this "ciphertext", but it is really plaintext or an IV. We keep 284 | // the name to make code comparison easier. 285 | static private final int bf_crypt_ciphertext[] = { 286 | 0x4f727068, 0x65616e42, 0x65686f6c, 287 | 0x64657253, 0x63727944, 0x6f756274 288 | }; 289 | 290 | // Table for Base64 encoding 291 | static private final char base64_code[] = { 292 | '.', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 293 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 294 | 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 295 | 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 296 | 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', 297 | '6', '7', '8', '9' 298 | }; 299 | 300 | // Table for Base64 decoding 301 | static private final byte index_64[] = { 302 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 303 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 305 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 306 | -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 307 | 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, 308 | -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 309 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 310 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 311 | -1, -1, -1, -1, -1, -1, 28, 29, 30, 312 | 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 313 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 314 | 51, 52, 53, -1, -1, -1, -1, -1 315 | }; 316 | 317 | // Expanded Blowfish key 318 | private int P[]; 319 | private int S[]; 320 | 321 | /** 322 | * Encode a byte array using bcrypt's slightly-modified base64 323 | * encoding scheme. Note that this is *not* compatible with 324 | * the standard MIME-base64 encoding. 325 | * 326 | * @param d the byte array to encode 327 | * @param len the number of bytes to encode 328 | * @return base64-encoded string 329 | * @exception IllegalArgumentException if the length is invalid 330 | */ 331 | private static String encode_base64(byte d[], int len) 332 | throws IllegalArgumentException { 333 | int off = 0; 334 | StringBuffer rs = new StringBuffer(); 335 | int c1, c2; 336 | 337 | if (len <= 0 || len > d.length) 338 | throw new IllegalArgumentException ("Invalid len"); 339 | 340 | while (off < len) { 341 | c1 = d[off++] & 0xff; 342 | rs.append(base64_code[(c1 >> 2) & 0x3f]); 343 | c1 = (c1 & 0x03) << 4; 344 | if (off >= len) { 345 | rs.append(base64_code[c1 & 0x3f]); 346 | break; 347 | } 348 | c2 = d[off++] & 0xff; 349 | c1 |= (c2 >> 4) & 0x0f; 350 | rs.append(base64_code[c1 & 0x3f]); 351 | c1 = (c2 & 0x0f) << 2; 352 | if (off >= len) { 353 | rs.append(base64_code[c1 & 0x3f]); 354 | break; 355 | } 356 | c2 = d[off++] & 0xff; 357 | c1 |= (c2 >> 6) & 0x03; 358 | rs.append(base64_code[c1 & 0x3f]); 359 | rs.append(base64_code[c2 & 0x3f]); 360 | } 361 | return rs.toString(); 362 | } 363 | 364 | /** 365 | * Look up the 3 bits base64-encoded by the specified character, 366 | * range-checking againt conversion table 367 | * @param x the base64-encoded value 368 | * @return the decoded value of x 369 | */ 370 | private static byte char64(char x) { 371 | if ((int)x < 0 || (int)x > index_64.length) 372 | return -1; 373 | return index_64[(int)x]; 374 | } 375 | 376 | /** 377 | * Decode a string encoded using bcrypt's base64 scheme to a 378 | * byte array. Note that this is *not* compatible with 379 | * the standard MIME-base64 encoding. 380 | * @param s the string to decode 381 | * @param maxolen the maximum number of bytes to decode 382 | * @return an array containing the decoded bytes 383 | * @throws IllegalArgumentException if maxolen is invalid 384 | */ 385 | private static byte[] decode_base64(String s, int maxolen) 386 | throws IllegalArgumentException { 387 | StringBuffer rs = new StringBuffer(); 388 | int off = 0, slen = s.length(), olen = 0; 389 | byte ret[]; 390 | byte c1, c2, c3, c4, o; 391 | 392 | if (maxolen <= 0) 393 | throw new IllegalArgumentException ("Invalid maxolen"); 394 | 395 | while (off < slen - 1 && olen < maxolen) { 396 | c1 = char64(s.charAt(off++)); 397 | c2 = char64(s.charAt(off++)); 398 | if (c1 == -1 || c2 == -1) 399 | break; 400 | o = (byte)(c1 << 2); 401 | o |= (c2 & 0x30) >> 4; 402 | rs.append((char)o); 403 | if (++olen >= maxolen || off >= slen) 404 | break; 405 | c3 = char64(s.charAt(off++)); 406 | if (c3 == -1) 407 | break; 408 | o = (byte)((c2 & 0x0f) << 4); 409 | o |= (c3 & 0x3c) >> 2; 410 | rs.append((char)o); 411 | if (++olen >= maxolen || off >= slen) 412 | break; 413 | c4 = char64(s.charAt(off++)); 414 | o = (byte)((c3 & 0x03) << 6); 415 | o |= c4; 416 | rs.append((char)o); 417 | ++olen; 418 | } 419 | 420 | ret = new byte[olen]; 421 | for (off = 0; off < olen; off++) 422 | ret[off] = (byte)rs.charAt(off); 423 | return ret; 424 | } 425 | 426 | /** 427 | * Blowfish encipher a single 64-bit block encoded as 428 | * two 32-bit halves 429 | * @param lr an array containing the two 32-bit half blocks 430 | * @param off the position in the array of the blocks 431 | */ 432 | private final void encipher(int lr[], int off) { 433 | int i, n, l = lr[off], r = lr[off + 1]; 434 | 435 | l ^= P[0]; 436 | for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) { 437 | // Feistel substitution on left word 438 | n = S[(l >> 24) & 0xff]; 439 | n += S[0x100 | ((l >> 16) & 0xff)]; 440 | n ^= S[0x200 | ((l >> 8) & 0xff)]; 441 | n += S[0x300 | (l & 0xff)]; 442 | r ^= n ^ P[++i]; 443 | 444 | // Feistel substitution on right word 445 | n = S[(r >> 24) & 0xff]; 446 | n += S[0x100 | ((r >> 16) & 0xff)]; 447 | n ^= S[0x200 | ((r >> 8) & 0xff)]; 448 | n += S[0x300 | (r & 0xff)]; 449 | l ^= n ^ P[++i]; 450 | } 451 | lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; 452 | lr[off + 1] = l; 453 | } 454 | 455 | /** 456 | * Cycically extract a word of key material 457 | * @param data the string to extract the data from 458 | * @param offp a "pointer" (as a one-entry array) to the 459 | * current offset into data 460 | * @return the next word of material from data 461 | */ 462 | private static int streamtoword(byte data[], int offp[]) { 463 | int i; 464 | int word = 0; 465 | int off = offp[0]; 466 | 467 | for (i = 0; i < 4; i++) { 468 | word = (word << 8) | (data[off] & 0xff); 469 | off = (off + 1) % data.length; 470 | } 471 | 472 | offp[0] = off; 473 | return word; 474 | } 475 | 476 | /** 477 | * Initialise the Blowfish key schedule 478 | */ 479 | private void init_key() { 480 | P = (int[])P_orig.clone(); 481 | S = (int[])S_orig.clone(); 482 | } 483 | 484 | /** 485 | * Key the Blowfish cipher 486 | * @param key an array containing the key 487 | */ 488 | private void key(byte key[]) { 489 | int i; 490 | int koffp[] = { 0 }; 491 | int lr[] = { 0, 0 }; 492 | int plen = P.length, slen = S.length; 493 | 494 | for (i = 0; i < plen; i++) 495 | P[i] = P[i] ^ streamtoword(key, koffp); 496 | 497 | for (i = 0; i < plen; i += 2) { 498 | encipher(lr, 0); 499 | P[i] = lr[0]; 500 | P[i + 1] = lr[1]; 501 | } 502 | 503 | for (i = 0; i < slen; i += 2) { 504 | encipher(lr, 0); 505 | S[i] = lr[0]; 506 | S[i + 1] = lr[1]; 507 | } 508 | } 509 | 510 | /** 511 | * Perform the "enhanced key schedule" step described by 512 | * Provos and Mazieres in "A Future-Adaptable Password Scheme" 513 | * http://www.openbsd.org/papers/bcrypt-paper.ps 514 | * @param data salt information 515 | * @param key password information 516 | */ 517 | private void ekskey(byte data[], byte key[]) { 518 | int i; 519 | int koffp[] = { 0 }, doffp[] = { 0 }; 520 | int lr[] = { 0, 0 }; 521 | int plen = P.length, slen = S.length; 522 | 523 | for (i = 0; i < plen; i++) 524 | P[i] = P[i] ^ streamtoword(key, koffp); 525 | 526 | for (i = 0; i < plen; i += 2) { 527 | lr[0] ^= streamtoword(data, doffp); 528 | lr[1] ^= streamtoword(data, doffp); 529 | encipher(lr, 0); 530 | P[i] = lr[0]; 531 | P[i + 1] = lr[1]; 532 | } 533 | 534 | for (i = 0; i < slen; i += 2) { 535 | lr[0] ^= streamtoword(data, doffp); 536 | lr[1] ^= streamtoword(data, doffp); 537 | encipher(lr, 0); 538 | S[i] = lr[0]; 539 | S[i + 1] = lr[1]; 540 | } 541 | } 542 | 543 | /** 544 | * Perform the central password hashing step in the 545 | * bcrypt scheme 546 | * @param password the password to hash 547 | * @param salt the binary salt to hash with the password 548 | * @param log_rounds the binary logarithm of the number 549 | * of rounds of hashing to apply 550 | * @param cdata the plaintext to encrypt 551 | * @return an array containing the binary hashed password 552 | */ 553 | public byte[] crypt_raw(byte password[], byte salt[], int log_rounds, 554 | int cdata[]) { 555 | int rounds, i, j; 556 | int clen = cdata.length; 557 | byte ret[]; 558 | 559 | if (log_rounds < 4 || log_rounds > 30) 560 | throw new IllegalArgumentException ("Bad number of rounds"); 561 | rounds = 1 << log_rounds; 562 | if (salt.length != BCRYPT_SALT_LEN) 563 | throw new IllegalArgumentException ("Bad salt length"); 564 | 565 | init_key(); 566 | ekskey(salt, password); 567 | for (i = 0; i != rounds; i++) { 568 | key(password); 569 | key(salt); 570 | } 571 | 572 | for (i = 0; i < 64; i++) { 573 | for (j = 0; j < (clen >> 1); j++) 574 | encipher(cdata, j << 1); 575 | } 576 | 577 | ret = new byte[clen * 4]; 578 | for (i = 0, j = 0; i < clen; i++) { 579 | ret[j++] = (byte)((cdata[i] >> 24) & 0xff); 580 | ret[j++] = (byte)((cdata[i] >> 16) & 0xff); 581 | ret[j++] = (byte)((cdata[i] >> 8) & 0xff); 582 | ret[j++] = (byte)(cdata[i] & 0xff); 583 | } 584 | return ret; 585 | } 586 | 587 | /** 588 | * Hash a password using the OpenBSD bcrypt scheme 589 | * @param password the password to hash 590 | * @param salt the salt to hash with (perhaps generated 591 | * using BCrypt.gensalt) 592 | * @return the hashed password 593 | */ 594 | public static String hashpw(String password, String salt) { 595 | BCrypt B; 596 | String real_salt; 597 | byte passwordb[], saltb[], hashed[]; 598 | char minor = (char)0; 599 | int rounds, off = 0; 600 | StringBuffer rs = new StringBuffer(); 601 | 602 | if (salt.charAt(0) != '$' || salt.charAt(1) != '2') 603 | throw new IllegalArgumentException ("Invalid salt version"); 604 | if (salt.charAt(2) == '$') 605 | off = 3; 606 | else { 607 | minor = salt.charAt(2); 608 | if (!(minor == 'a' || minor == 'b' || minor == 'y') || salt.charAt(3) != '$') 609 | throw new IllegalArgumentException ("Invalid salt revision"); 610 | off = 4; 611 | } 612 | 613 | // Extract number of rounds 614 | if (salt.charAt(off + 2) > '$') 615 | throw new IllegalArgumentException ("Missing salt rounds"); 616 | rounds = Integer.parseInt(salt.substring(off, off + 2)); 617 | 618 | real_salt = salt.substring(off + 3, off + 25); 619 | try { 620 | passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8"); 621 | } catch (UnsupportedEncodingException uee) { 622 | throw new AssertionError("UTF-8 is not supported"); 623 | } 624 | 625 | saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); 626 | 627 | B = new BCrypt(); 628 | hashed = B.crypt_raw(passwordb, saltb, rounds, 629 | (int[])bf_crypt_ciphertext.clone()); 630 | 631 | rs.append("$2"); 632 | if (minor >= 'a') 633 | rs.append(minor); 634 | rs.append("$"); 635 | if (rounds < 10) 636 | rs.append("0"); 637 | if (rounds > 30) { 638 | throw new IllegalArgumentException( 639 | "rounds exceeds maximum (30)"); 640 | } 641 | rs.append(Integer.toString(rounds)); 642 | rs.append("$"); 643 | rs.append(encode_base64(saltb, saltb.length)); 644 | rs.append(encode_base64(hashed, 645 | bf_crypt_ciphertext.length * 4 - 1)); 646 | return rs.toString(); 647 | } 648 | 649 | /** 650 | * Generate a salt for use with the BCrypt.hashpw() method 651 | * @param log_rounds the log2 of the number of rounds of 652 | * hashing to apply - the work factor therefore increases as 653 | * 2**log_rounds. 654 | * @param random an instance of SecureRandom to use 655 | * @return an encoded salt value 656 | */ 657 | public static String gensalt(int log_rounds, SecureRandom random) { 658 | StringBuffer rs = new StringBuffer(); 659 | byte rnd[] = new byte[BCRYPT_SALT_LEN]; 660 | 661 | random.nextBytes(rnd); 662 | 663 | rs.append("$2a$"); 664 | if (log_rounds < 10) 665 | rs.append("0"); 666 | if (log_rounds > 30) { 667 | throw new IllegalArgumentException( 668 | "log_rounds exceeds maximum (30)"); 669 | } 670 | rs.append(Integer.toString(log_rounds)); 671 | rs.append("$"); 672 | rs.append(encode_base64(rnd, rnd.length)); 673 | return rs.toString(); 674 | } 675 | 676 | /** 677 | * Generate a salt for use with the BCrypt.hashpw() method 678 | * @param log_rounds the log2 of the number of rounds of 679 | * hashing to apply - the work factor therefore increases as 680 | * 2**log_rounds. 681 | * @return an encoded salt value 682 | */ 683 | public static String gensalt(int log_rounds) { 684 | return gensalt(log_rounds, new SecureRandom()); 685 | } 686 | 687 | /** 688 | * Generate a salt for use with the BCrypt.hashpw() method, 689 | * selecting a reasonable default for the number of hashing 690 | * rounds to apply 691 | * @return an encoded salt value 692 | */ 693 | public static String gensalt() { 694 | return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS); 695 | } 696 | 697 | /** 698 | * Check that a plaintext password matches a previously hashed 699 | * one 700 | * @param plaintext the plaintext password to verify 701 | * @param hashed the previously-hashed password 702 | * @return true if the passwords match, false otherwise 703 | */ 704 | public static boolean checkpw(String plaintext, String hashed) { 705 | byte hashed_bytes[]; 706 | byte try_bytes[]; 707 | try { 708 | String try_pw = hashpw(plaintext, hashed); 709 | hashed_bytes = hashed.getBytes("UTF-8"); 710 | try_bytes = try_pw.getBytes("UTF-8"); 711 | } catch (UnsupportedEncodingException uee) { 712 | return false; 713 | } 714 | if (hashed_bytes.length != try_bytes.length) 715 | return false; 716 | byte ret = 0; 717 | for (int i = 0; i < try_bytes.length; i++) 718 | ret |= hashed_bytes[i] ^ try_bytes[i]; 719 | return ret == 0; 720 | } 721 | } 722 | -------------------------------------------------------------------------------- /android/src/main/java/com/bcryptreactnative/BcryptReactNativeModule.java: -------------------------------------------------------------------------------- 1 | package com.bcryptreactnative; 2 | 3 | import com.facebook.react.bridge.Promise; 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | 8 | public class BcryptReactNativeModule extends ReactContextBaseJavaModule { 9 | private static ReactApplicationContext reactContext; 10 | 11 | BcryptReactNativeModule(ReactApplicationContext context) { 12 | super(context); 13 | reactContext = context; 14 | } 15 | 16 | @Override 17 | public String getName() { 18 | return "BcryptReactNative"; 19 | } 20 | 21 | @ReactMethod 22 | public void getSalt( 23 | int rounds, 24 | Promise promise 25 | ) { 26 | try { 27 | String salt = BCrypt.gensalt(rounds); 28 | promise.resolve(salt); 29 | } catch (Exception e){ 30 | promise.reject("Error Generating Salt", e); 31 | } 32 | } 33 | 34 | @ReactMethod 35 | public void hash( 36 | String salt, 37 | String item, 38 | Promise promise 39 | ) { 40 | try { 41 | String hash = BCrypt.hashpw(item, salt); 42 | promise.resolve(hash); 43 | } catch (Exception e){ 44 | promise.reject("Error Generating Hash", e); 45 | } 46 | } 47 | 48 | @ReactMethod 49 | public void compareSync( 50 | String password, 51 | String hash, 52 | Promise promise 53 | ) { 54 | try { 55 | Boolean success = BCrypt.checkpw(password, hash); 56 | promise.resolve(success); 57 | } catch (Exception e){ 58 | promise.reject("Error Checking Hash", e); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /android/src/main/java/com/bcryptreactnative/BcryptReactNativePackage.java: -------------------------------------------------------------------------------- 1 | package com.bcryptreactnative; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.NativeModule; 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.uimanager.ViewManager; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | import androidx.annotation.NonNull; 13 | 14 | public class BcryptReactNativePackage implements ReactPackage { 15 | @NonNull 16 | @Override 17 | public List createNativeModules(@NonNull ReactApplicationContext reactContext) { 18 | List modules = new ArrayList<>(1); 19 | modules.add(new BcryptReactNativeModule(reactContext)); 20 | return modules; 21 | } 22 | 23 | @NonNull 24 | @Override 25 | public List createViewManagers(@NonNull ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /bcrypt-react-native.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "bcrypt-react-native" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.homepage = package["homepage"] 10 | s.license = package["license"] 11 | s.authors = package["author"] 12 | 13 | s.platforms = { :ios => "11.0" } 14 | s.source = { :git => "https://github.com/andreshsingh/bcrypt-react-native.git", :tag => "#{s.version}" } 15 | 16 | 17 | s.source_files = "ios/**/*.{h,m,mm,swift}" 18 | 19 | 20 | s.dependency "React" 21 | s.dependency "BCrypt" 22 | end 23 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for BcryptReactNativeExample: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for BcryptReactNativeExample, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | enableHermes: false, // clean and rebuild if changing 80 | ] 81 | 82 | apply from: "../../node_modules/react-native/react.gradle" 83 | 84 | /** 85 | * Set this to true to create two separate APKs instead of one: 86 | * - An APK that only works on ARM devices 87 | * - An APK that only works on x86 devices 88 | * The advantage is the size of the APK is reduced by about 4MB. 89 | * Upload all the APKs to the Play Store and people will download 90 | * the correct one based on the CPU architecture of their device. 91 | */ 92 | def enableSeparateBuildPerCPUArchitecture = false 93 | 94 | /** 95 | * Run Proguard to shrink the Java bytecode in release builds. 96 | */ 97 | def enableProguardInReleaseBuilds = false 98 | 99 | /** 100 | * The preferred build flavor of JavaScriptCore. 101 | * 102 | * For BcryptReactNativeExample, to use the international variant, you can use: 103 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 104 | * 105 | * The international variant includes ICU i18n library and necessary data 106 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 107 | * give correct results when using with locales other than en-US. Note that 108 | * this variant is about 6MiB larger per architecture than default. 109 | */ 110 | def jscFlavor = 'org.webkit:android-jsc:+' 111 | 112 | /** 113 | * Whether to enable the Hermes VM. 114 | * 115 | * This should be set on project.ext.react and mirrored here. If it is not set 116 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 117 | * and the benefits of using Hermes will therefore be sharply reduced. 118 | */ 119 | def enableHermes = project.ext.react.get("enableHermes", false); 120 | 121 | android { 122 | compileSdkVersion rootProject.ext.compileSdkVersion 123 | 124 | compileOptions { 125 | sourceCompatibility JavaVersion.VERSION_1_8 126 | targetCompatibility JavaVersion.VERSION_1_8 127 | } 128 | 129 | defaultConfig { 130 | applicationId "com.example.bcryptreactnative" 131 | minSdkVersion rootProject.ext.minSdkVersion 132 | targetSdkVersion rootProject.ext.targetSdkVersion 133 | versionCode 1 134 | versionName "1.0" 135 | } 136 | splits { 137 | abi { 138 | reset() 139 | enable enableSeparateBuildPerCPUArchitecture 140 | universalApk false // If true, also generate a universal APK 141 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 142 | } 143 | } 144 | signingConfigs { 145 | debug { 146 | storeFile file('debug.keystore') 147 | storePassword 'android' 148 | keyAlias 'androiddebugkey' 149 | keyPassword 'android' 150 | } 151 | } 152 | buildTypes { 153 | debug { 154 | signingConfig signingConfigs.debug 155 | } 156 | release { 157 | // Caution! In production, you need to generate your own keystore file. 158 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 159 | signingConfig signingConfigs.debug 160 | minifyEnabled enableProguardInReleaseBuilds 161 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 162 | } 163 | } 164 | // applicationVariants are e.g. debug, release 165 | applicationVariants.all { variant -> 166 | variant.outputs.each { output -> 167 | // For each separate APK per architecture, set a unique version code as described here: 168 | // https://developer.android.com/studio/build/configure-apk-splits.html 169 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 170 | def abi = output.getFilter(OutputFile.ABI) 171 | if (abi != null) { // null for the universal-debug, universal-release variants 172 | output.versionCodeOverride = 173 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 174 | } 175 | 176 | } 177 | } 178 | 179 | packagingOptions { 180 | pickFirst "lib/armeabi-v7a/libc++_shared.so" 181 | pickFirst "lib/arm64-v8a/libc++_shared.so" 182 | pickFirst "lib/x86/libc++_shared.so" 183 | pickFirst "lib/x86_64/libc++_shared.so" 184 | } 185 | } 186 | 187 | dependencies { 188 | implementation fileTree(dir: "libs", include: ["*.jar"]) 189 | //noinspection GradleDynamicVersion 190 | implementation "com.facebook.react:react-native:+" // From node_modules 191 | 192 | 193 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 194 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 195 | exclude group:'com.facebook.fbjni' 196 | } 197 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 198 | exclude group:'com.facebook.flipper' 199 | } 200 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 201 | exclude group:'com.facebook.flipper' 202 | } 203 | 204 | if (enableHermes) { 205 | def hermesPath = "../../node_modules/hermes-engine/android/"; 206 | debugImplementation files(hermesPath + "hermes-debug.aar") 207 | releaseImplementation files(hermesPath + "hermes-release.aar") 208 | } else { 209 | implementation jscFlavor 210 | } 211 | 212 | implementation project(':bcryptreactnative') 213 | } 214 | 215 | // Run this once to be able to run the application with BUCK 216 | // puts all compile dependencies into folder libs for BUCK to use 217 | task copyDownloadableDepsToLibs(type: Copy) { 218 | from configurations.compile 219 | into 'libs' 220 | } 221 | 222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 223 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/bcryptreactnative/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.example.bcryptreactnative; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 32 | client.addPlugin(new ReactFlipperPlugin()); 33 | client.addPlugin(new DatabasesFlipperPlugin(context)); 34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 35 | client.addPlugin(CrashReporterPlugin.getInstance()); 36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 37 | NetworkingModule.setCustomClientBuilder( 38 | new NetworkingModule.CustomClientBuilder() { 39 | @Override 40 | public void apply(OkHttpClient.Builder builder) { 41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 42 | } 43 | }); 44 | client.addPlugin(networkFlipperPlugin); 45 | client.start(); 46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 47 | // Hence we run if after all native modules have been initialized 48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 49 | if (reactContext == null) { 50 | reactInstanceManager.addReactInstanceEventListener( 51 | new ReactInstanceManager.ReactInstanceEventListener() { 52 | @Override 53 | public void onReactContextInitialized(ReactContext reactContext) { 54 | reactInstanceManager.removeReactInstanceEventListener(this); 55 | reactContext.runOnNativeModulesQueueThread( 56 | new Runnable() { 57 | @Override 58 | public void run() { 59 | client.addPlugin(new FrescoFlipperPlugin()); 60 | } 61 | }); 62 | } 63 | }); 64 | } else { 65 | client.addPlugin(new FrescoFlipperPlugin()); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/bcryptreactnative/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.bcryptreactnative; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "BcryptReactNativeExample"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/bcryptreactnative/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.bcryptreactnative; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactInstanceManager; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | import com.bcryptreactnative.BcryptReactNativePackage; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for BcryptReactNativeExample: 30 | // packages.add(new MyReactNativePackage()); 31 | packages.add(new BcryptReactNativePackage()); 32 | 33 | return packages; 34 | } 35 | 36 | @Override 37 | protected String getJSMainModuleName() { 38 | return "index"; 39 | } 40 | }; 41 | 42 | @Override 43 | public ReactNativeHost getReactNativeHost() { 44 | return mReactNativeHost; 45 | } 46 | 47 | @Override 48 | public void onCreate() { 49 | super.onCreate(); 50 | SoLoader.init(this, /* native exopackage */ false); 51 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled 52 | } 53 | 54 | /** 55 | * Loads Flipper in React Native templates. 56 | * 57 | * @param context 58 | */ 59 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 60 | if (BuildConfig.DEBUG) { 61 | try { 62 | /* 63 | We use reflection here to pick up the class that initializes Flipper, 64 | since Flipper library is not available in release mode 65 | */ 66 | Class aClass = Class.forName("com.bcryptreactnativeExample.ReactNativeFlipper"); 67 | aClass 68 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 69 | .invoke(null, context, reactInstanceManager); 70 | } catch (ClassNotFoundException e) { 71 | e.printStackTrace(); 72 | } catch (NoSuchMethodException e) { 73 | e.printStackTrace(); 74 | } catch (IllegalAccessException e) { 75 | e.printStackTrace(); 76 | } catch (InvocationTargetException e) { 77 | e.printStackTrace(); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BcryptReactNative Example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.5.2") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | FLIPPER_VERSION=0.33.1 23 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshsingh/bcrypt-react-native/f5206a6d18b5e95c8312011167942ed167b4c208/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'BcryptReactNativeExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | 5 | include ':bcryptreactnative' 6 | project(':bcryptreactnative').projectDir = new File(rootProject.projectDir, '../../android') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BcryptReactNativeExample", 3 | "displayName": "BcryptReactNative Example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = { 5 | presets: ['module:metro-react-native-babel-preset'], 6 | plugins: [ 7 | [ 8 | 'module-resolver', 9 | { 10 | alias: { 11 | [pak.name]: path.join(__dirname, '..', pak.source), 12 | }, 13 | }, 14 | ], 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0D1336C0461A88D01186E375 /* libPods-BcryptReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BCEA90A70F4BEAD7E9FA28B2 /* libPods-BcryptReactNativeExample.a */; }; 11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 12 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 20F357B024636CDF00C146DC /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F357AF24636CDF00C146DC /* File.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 20 | 13B07F961A680F5B00A75B9A /* BcryptReactNativeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BcryptReactNativeExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BcryptReactNativeExample/AppDelegate.h; sourceTree = ""; }; 22 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = BcryptReactNativeExample/AppDelegate.m; sourceTree = ""; }; 23 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 24 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BcryptReactNativeExample/Images.xcassets; sourceTree = ""; }; 25 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = BcryptReactNativeExample/Info.plist; sourceTree = ""; }; 26 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BcryptReactNativeExample/main.m; sourceTree = ""; }; 27 | 20F357AD24636CDE00C146DC /* BcryptReactNativeExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BcryptReactNativeExample-Bridging-Header.h"; sourceTree = ""; }; 28 | 20F357AE24636CDF00C146DC /* BcryptReactNativeExample-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "BcryptReactNativeExample-Bridging-Header.h"; sourceTree = ""; }; 29 | 20F357AF24636CDF00C146DC /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; 30 | 4D7192F03A36A017E887435B /* Pods-BcryptReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BcryptReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-BcryptReactNativeExample/Pods-BcryptReactNativeExample.release.xcconfig"; sourceTree = ""; }; 31 | 871719007ECC5EAD276C345C /* Pods-BcryptReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BcryptReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-BcryptReactNativeExample/Pods-BcryptReactNativeExample.debug.xcconfig"; sourceTree = ""; }; 32 | BCEA90A70F4BEAD7E9FA28B2 /* libPods-BcryptReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BcryptReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | 0D1336C0461A88D01186E375 /* libPods-BcryptReactNativeExample.a in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 13B07FAE1A68108700A75B9A /* BcryptReactNativeExample */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 52 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 53 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 54 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 55 | 13B07FB61A68108700A75B9A /* Info.plist */, 56 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 57 | 13B07FB71A68108700A75B9A /* main.m */, 58 | ); 59 | name = BcryptReactNativeExample; 60 | sourceTree = ""; 61 | }; 62 | 1CFFDEF7170271C97B8B7E5A /* Pods */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 871719007ECC5EAD276C345C /* Pods-BcryptReactNativeExample.debug.xcconfig */, 66 | 4D7192F03A36A017E887435B /* Pods-BcryptReactNativeExample.release.xcconfig */, 67 | ); 68 | path = Pods; 69 | sourceTree = ""; 70 | }; 71 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 75 | BCEA90A70F4BEAD7E9FA28B2 /* libPods-BcryptReactNativeExample.a */, 76 | ); 77 | name = Frameworks; 78 | sourceTree = ""; 79 | }; 80 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | ); 84 | name = Libraries; 85 | sourceTree = ""; 86 | }; 87 | 83CBB9F61A601CBA00E9B192 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 20F357AF24636CDF00C146DC /* File.swift */, 91 | 20F357AE24636CDF00C146DC /* BcryptReactNativeExample-Bridging-Header.h */, 92 | 13B07FAE1A68108700A75B9A /* BcryptReactNativeExample */, 93 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 94 | 83CBBA001A601CBA00E9B192 /* Products */, 95 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 96 | 1CFFDEF7170271C97B8B7E5A /* Pods */, 97 | 20F357AD24636CDE00C146DC /* BcryptReactNativeExample-Bridging-Header.h */, 98 | ); 99 | indentWidth = 2; 100 | sourceTree = ""; 101 | tabWidth = 2; 102 | usesTabs = 0; 103 | }; 104 | 83CBBA001A601CBA00E9B192 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 13B07F961A680F5B00A75B9A /* BcryptReactNativeExample.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | 13B07F861A680F5B00A75B9A /* BcryptReactNativeExample */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BcryptReactNativeExample" */; 118 | buildPhases = ( 119 | CCCC07BCAFDEF1FCADC0D0C9 /* [CP] Check Pods Manifest.lock */, 120 | FD10A7F022414F080027D42C /* Start Packager */, 121 | 13B07F871A680F5B00A75B9A /* Sources */, 122 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 123 | 13B07F8E1A680F5B00A75B9A /* Resources */, 124 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = BcryptReactNativeExample; 131 | productName = BcryptReactNativeExample; 132 | productReference = 13B07F961A680F5B00A75B9A /* BcryptReactNativeExample.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | /* End PBXNativeTarget section */ 136 | 137 | /* Begin PBXProject section */ 138 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 139 | isa = PBXProject; 140 | attributes = { 141 | LastUpgradeCheck = 0940; 142 | ORGANIZATIONNAME = Facebook; 143 | TargetAttributes = { 144 | 13B07F861A680F5B00A75B9A = { 145 | LastSwiftMigration = 1110; 146 | }; 147 | }; 148 | }; 149 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BcryptReactNativeExample" */; 150 | compatibilityVersion = "Xcode 3.2"; 151 | developmentRegion = English; 152 | hasScannedForEncodings = 0; 153 | knownRegions = ( 154 | English, 155 | en, 156 | Base, 157 | ); 158 | mainGroup = 83CBB9F61A601CBA00E9B192; 159 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 160 | projectDirPath = ""; 161 | projectRoot = ""; 162 | targets = ( 163 | 13B07F861A680F5B00A75B9A /* BcryptReactNativeExample */, 164 | ); 165 | }; 166 | /* End PBXProject section */ 167 | 168 | /* Begin PBXResourcesBuildPhase section */ 169 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 170 | isa = PBXResourcesBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 174 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXResourcesBuildPhase section */ 179 | 180 | /* Begin PBXShellScriptBuildPhase section */ 181 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 182 | isa = PBXShellScriptBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | ); 186 | inputPaths = ( 187 | ); 188 | name = "Bundle React Native code and images"; 189 | outputPaths = ( 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | shellPath = /bin/sh; 193 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 194 | }; 195 | CCCC07BCAFDEF1FCADC0D0C9 /* [CP] Check Pods Manifest.lock */ = { 196 | isa = PBXShellScriptBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | ); 200 | inputFileListPaths = ( 201 | ); 202 | inputPaths = ( 203 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 204 | "${PODS_ROOT}/Manifest.lock", 205 | ); 206 | name = "[CP] Check Pods Manifest.lock"; 207 | outputFileListPaths = ( 208 | ); 209 | outputPaths = ( 210 | "$(DERIVED_FILE_DIR)/Pods-BcryptReactNativeExample-checkManifestLockResult.txt", 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | shellPath = /bin/sh; 214 | 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"; 215 | showEnvVarsInLog = 0; 216 | }; 217 | FD10A7F022414F080027D42C /* Start Packager */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputFileListPaths = ( 223 | ); 224 | inputPaths = ( 225 | ); 226 | name = "Start Packager"; 227 | outputFileListPaths = ( 228 | ); 229 | outputPaths = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | shellPath = /bin/sh; 233 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 234 | showEnvVarsInLog = 0; 235 | }; 236 | /* End PBXShellScriptBuildPhase section */ 237 | 238 | /* Begin PBXSourcesBuildPhase section */ 239 | 13B07F871A680F5B00A75B9A /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 244 | 20F357B024636CDF00C146DC /* File.swift in Sources */, 245 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin PBXVariantGroup section */ 252 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 253 | isa = PBXVariantGroup; 254 | children = ( 255 | 13B07FB21A68108700A75B9A /* Base */, 256 | ); 257 | name = LaunchScreen.xib; 258 | path = BcryptReactNativeExample; 259 | sourceTree = ""; 260 | }; 261 | /* End PBXVariantGroup section */ 262 | 263 | /* Begin XCBuildConfiguration section */ 264 | 13B07F941A680F5B00A75B9A /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | baseConfigurationReference = 871719007ECC5EAD276C345C /* Pods-BcryptReactNativeExample.debug.xcconfig */; 267 | buildSettings = { 268 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 269 | CLANG_ENABLE_MODULES = YES; 270 | CURRENT_PROJECT_VERSION = 1; 271 | DEAD_CODE_STRIPPING = NO; 272 | INFOPLIST_FILE = BcryptReactNativeExample/Info.plist; 273 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 274 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 275 | OTHER_CFLAGS = ( 276 | "$(inherited)", 277 | "-DFB_SONARKIT_ENABLED=1", 278 | ); 279 | OTHER_LDFLAGS = ( 280 | "$(inherited)", 281 | "-ObjC", 282 | "-lc++", 283 | ); 284 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.BcryptReactNativeExample.$(PRODUCT_NAME:rfc1034identifier)"; 285 | PRODUCT_NAME = BcryptReactNativeExample; 286 | SWIFT_OBJC_BRIDGING_HEADER = "BcryptReactNativeExample-Bridging-Header.h"; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 288 | SWIFT_VERSION = 5.0; 289 | VERSIONING_SYSTEM = "apple-generic"; 290 | }; 291 | name = Debug; 292 | }; 293 | 13B07F951A680F5B00A75B9A /* Release */ = { 294 | isa = XCBuildConfiguration; 295 | baseConfigurationReference = 4D7192F03A36A017E887435B /* Pods-BcryptReactNativeExample.release.xcconfig */; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | CLANG_ENABLE_MODULES = YES; 299 | CURRENT_PROJECT_VERSION = 1; 300 | INFOPLIST_FILE = BcryptReactNativeExample/Info.plist; 301 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 303 | OTHER_CFLAGS = ( 304 | "$(inherited)", 305 | "-DFB_SONARKIT_ENABLED=1", 306 | ); 307 | OTHER_LDFLAGS = ( 308 | "$(inherited)", 309 | "-ObjC", 310 | "-lc++", 311 | ); 312 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.BcryptReactNativeExample.$(PRODUCT_NAME:rfc1034identifier)"; 313 | PRODUCT_NAME = BcryptReactNativeExample; 314 | SWIFT_OBJC_BRIDGING_HEADER = "BcryptReactNativeExample-Bridging-Header.h"; 315 | SWIFT_VERSION = 5.0; 316 | VERSIONING_SYSTEM = "apple-generic"; 317 | }; 318 | name = Release; 319 | }; 320 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | ALWAYS_SEARCH_USER_PATHS = NO; 324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 325 | CLANG_CXX_LIBRARY = "libc++"; 326 | CLANG_ENABLE_MODULES = YES; 327 | CLANG_ENABLE_OBJC_ARC = YES; 328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 329 | CLANG_WARN_BOOL_CONVERSION = YES; 330 | CLANG_WARN_COMMA = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INFINITE_RECURSION = YES; 337 | CLANG_WARN_INT_CONVERSION = YES; 338 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 339 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | ENABLE_STRICT_OBJC_MSGSEND = YES; 350 | ENABLE_TESTABILITY = YES; 351 | GCC_C_LANGUAGE_STANDARD = gnu99; 352 | GCC_DYNAMIC_NO_PIC = NO; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_OPTIMIZATION_LEVEL = 0; 355 | GCC_PREPROCESSOR_DEFINITIONS = ( 356 | "DEBUG=1", 357 | "$(inherited)", 358 | ); 359 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 362 | GCC_WARN_UNDECLARED_SELECTOR = YES; 363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 364 | GCC_WARN_UNUSED_FUNCTION = YES; 365 | GCC_WARN_UNUSED_VARIABLE = YES; 366 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 367 | MTL_ENABLE_DEBUG_INFO = YES; 368 | ONLY_ACTIVE_ARCH = YES; 369 | SDKROOT = iphoneos; 370 | }; 371 | name = Debug; 372 | }; 373 | 83CBBA211A601CBA00E9B192 /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 378 | CLANG_CXX_LIBRARY = "libc++"; 379 | CLANG_ENABLE_MODULES = YES; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_COMMA = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INFINITE_RECURSION = YES; 390 | CLANG_WARN_INT_CONVERSION = YES; 391 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 392 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 393 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 396 | CLANG_WARN_STRICT_PROTOTYPES = YES; 397 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 398 | CLANG_WARN_UNREACHABLE_CODE = YES; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 401 | COPY_PHASE_STRIP = YES; 402 | ENABLE_NS_ASSERTIONS = NO; 403 | ENABLE_STRICT_OBJC_MSGSEND = YES; 404 | GCC_C_LANGUAGE_STANDARD = gnu99; 405 | GCC_NO_COMMON_BLOCKS = YES; 406 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 407 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 408 | GCC_WARN_UNDECLARED_SELECTOR = YES; 409 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 410 | GCC_WARN_UNUSED_FUNCTION = YES; 411 | GCC_WARN_UNUSED_VARIABLE = YES; 412 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 413 | MTL_ENABLE_DEBUG_INFO = NO; 414 | SDKROOT = iphoneos; 415 | VALIDATE_PRODUCT = YES; 416 | }; 417 | name = Release; 418 | }; 419 | /* End XCBuildConfiguration section */ 420 | 421 | /* Begin XCConfigurationList section */ 422 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BcryptReactNativeExample" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | 13B07F941A680F5B00A75B9A /* Debug */, 426 | 13B07F951A680F5B00A75B9A /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | defaultConfigurationName = Release; 430 | }; 431 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BcryptReactNativeExample" */ = { 432 | isa = XCConfigurationList; 433 | buildConfigurations = ( 434 | 83CBBA201A601CBA00E9B192 /* Debug */, 435 | 83CBBA211A601CBA00E9B192 /* Release */, 436 | ); 437 | defaultConfigurationIsVisible = 0; 438 | defaultConfigurationName = Release; 439 | }; 440 | /* End XCConfigurationList section */ 441 | }; 442 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 443 | } 444 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample.xcodeproj/xcshareddata/xcschemes/BcryptReactNativeExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | #if DEBUG 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | static void InitializeFlipper(UIApplication *application) { 22 | FlipperClient *client = [FlipperClient sharedClient]; 23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 26 | [client addPlugin:[FlipperKitReactPlugin new]]; 27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 28 | [client start]; 29 | } 30 | #endif 31 | 32 | @implementation AppDelegate 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 35 | { 36 | #if DEBUG 37 | InitializeFlipper(application); 38 | #endif 39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 41 | moduleName:@"BcryptReactNativeExample" 42 | initialProperties:nil]; 43 | 44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 45 | 46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 47 | UIViewController *rootViewController = [UIViewController new]; 48 | rootViewController.view = rootView; 49 | self.window.rootViewController = rootViewController; 50 | [self.window makeKeyAndVisible]; 51 | return YES; 52 | } 53 | 54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 55 | { 56 | #if DEBUG 57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 58 | #else 59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 60 | #endif 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | BcryptReactNative Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/ios/BcryptReactNativeExample/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // BcryptReactNativeExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | def add_flipper_pods! 5 | version = '~> 0.33.1' 6 | pod 'FlipperKit', version, :configuration => 'Debug' 7 | pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug' 8 | pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug' 9 | pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug' 10 | pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug' 11 | end 12 | # Post Install processing for Flipper 13 | def flipper_post_install(installer) 14 | installer.pods_project.targets.each do |target| 15 | if target.name == 'YogaKit' 16 | target.build_configurations.each do |config| 17 | config.build_settings['SWIFT_VERSION'] = '4.1' 18 | end 19 | end 20 | end 21 | end 22 | 23 | target 'BcryptReactNativeExample' do 24 | # Pods for BcryptReactNativeExample 25 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 26 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 27 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 28 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 29 | pod 'React', :path => '../node_modules/react-native/' 30 | pod 'React-Core', :path => '../node_modules/react-native/' 31 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 32 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 33 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 34 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 35 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 36 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 37 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 38 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 39 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 40 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 41 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 42 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 43 | 44 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 45 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 46 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 47 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 48 | pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon" 49 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 50 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true 51 | 52 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 53 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 54 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 55 | 56 | pod 'bcrypt-react-native', :path => '../..' 57 | 58 | use_native_modules! 59 | 60 | # Enables Flipper. 61 | # 62 | # Note that if you have use_frameworks! enabled, Flipper will not work and 63 | # you should disable these next few lines. 64 | add_flipper_pods! 65 | post_install do |installer| 66 | flipper_post_install(installer) 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BCrypt (1.0.0) 3 | - bcrypt-react-native (0.1.0): 4 | - BCrypt 5 | - React 6 | - boost-for-react-native (1.63.0) 7 | - CocoaAsyncSocket (7.6.4) 8 | - CocoaLibEvent (1.0.0) 9 | - DoubleConversion (1.1.6) 10 | - FBLazyVector (0.62.2) 11 | - FBReactNativeSpec (0.62.2): 12 | - Folly (= 2018.10.22.00) 13 | - RCTRequired (= 0.62.2) 14 | - RCTTypeSafety (= 0.62.2) 15 | - React-Core (= 0.62.2) 16 | - React-jsi (= 0.62.2) 17 | - ReactCommon/turbomodule/core (= 0.62.2) 18 | - Flipper (0.33.1): 19 | - Flipper-Folly (~> 2.1) 20 | - Flipper-RSocket (~> 1.0) 21 | - Flipper-DoubleConversion (1.1.7) 22 | - Flipper-Folly (2.2.0): 23 | - boost-for-react-native 24 | - CocoaLibEvent (~> 1.0) 25 | - Flipper-DoubleConversion 26 | - Flipper-Glog 27 | - OpenSSL-Universal (= 1.0.2.19) 28 | - Flipper-Glog (0.3.6) 29 | - Flipper-PeerTalk (0.0.4) 30 | - Flipper-RSocket (1.1.0): 31 | - Flipper-Folly (~> 2.2) 32 | - FlipperKit (0.33.1): 33 | - FlipperKit/Core (= 0.33.1) 34 | - FlipperKit/Core (0.33.1): 35 | - Flipper (~> 0.33.1) 36 | - FlipperKit/CppBridge 37 | - FlipperKit/FBCxxFollyDynamicConvert 38 | - FlipperKit/FBDefines 39 | - FlipperKit/FKPortForwarding 40 | - FlipperKit/CppBridge (0.33.1): 41 | - Flipper (~> 0.33.1) 42 | - FlipperKit/FBCxxFollyDynamicConvert (0.33.1): 43 | - Flipper-Folly (~> 2.1) 44 | - FlipperKit/FBDefines (0.33.1) 45 | - FlipperKit/FKPortForwarding (0.33.1): 46 | - CocoaAsyncSocket (~> 7.6) 47 | - Flipper-PeerTalk (~> 0.0.4) 48 | - FlipperKit/FlipperKitHighlightOverlay (0.33.1) 49 | - FlipperKit/FlipperKitLayoutPlugin (0.33.1): 50 | - FlipperKit/Core 51 | - FlipperKit/FlipperKitHighlightOverlay 52 | - FlipperKit/FlipperKitLayoutTextSearchable 53 | - YogaKit (~> 1.18) 54 | - FlipperKit/FlipperKitLayoutTextSearchable (0.33.1) 55 | - FlipperKit/FlipperKitNetworkPlugin (0.33.1): 56 | - FlipperKit/Core 57 | - FlipperKit/FlipperKitReactPlugin (0.33.1): 58 | - FlipperKit/Core 59 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.33.1): 60 | - FlipperKit/Core 61 | - FlipperKit/SKIOSNetworkPlugin (0.33.1): 62 | - FlipperKit/Core 63 | - FlipperKit/FlipperKitNetworkPlugin 64 | - Folly (2018.10.22.00): 65 | - boost-for-react-native 66 | - DoubleConversion 67 | - Folly/Default (= 2018.10.22.00) 68 | - glog 69 | - Folly/Default (2018.10.22.00): 70 | - boost-for-react-native 71 | - DoubleConversion 72 | - glog 73 | - glog (0.3.5) 74 | - OpenSSL-Universal (1.0.2.19): 75 | - OpenSSL-Universal/Static (= 1.0.2.19) 76 | - OpenSSL-Universal/Static (1.0.2.19) 77 | - RCTRequired (0.62.2) 78 | - RCTTypeSafety (0.62.2): 79 | - FBLazyVector (= 0.62.2) 80 | - Folly (= 2018.10.22.00) 81 | - RCTRequired (= 0.62.2) 82 | - React-Core (= 0.62.2) 83 | - React (0.62.2): 84 | - React-Core (= 0.62.2) 85 | - React-Core/DevSupport (= 0.62.2) 86 | - React-Core/RCTWebSocket (= 0.62.2) 87 | - React-RCTActionSheet (= 0.62.2) 88 | - React-RCTAnimation (= 0.62.2) 89 | - React-RCTBlob (= 0.62.2) 90 | - React-RCTImage (= 0.62.2) 91 | - React-RCTLinking (= 0.62.2) 92 | - React-RCTNetwork (= 0.62.2) 93 | - React-RCTSettings (= 0.62.2) 94 | - React-RCTText (= 0.62.2) 95 | - React-RCTVibration (= 0.62.2) 96 | - React-Core (0.62.2): 97 | - Folly (= 2018.10.22.00) 98 | - glog 99 | - React-Core/Default (= 0.62.2) 100 | - React-cxxreact (= 0.62.2) 101 | - React-jsi (= 0.62.2) 102 | - React-jsiexecutor (= 0.62.2) 103 | - Yoga 104 | - React-Core/CoreModulesHeaders (0.62.2): 105 | - Folly (= 2018.10.22.00) 106 | - glog 107 | - React-Core/Default 108 | - React-cxxreact (= 0.62.2) 109 | - React-jsi (= 0.62.2) 110 | - React-jsiexecutor (= 0.62.2) 111 | - Yoga 112 | - React-Core/Default (0.62.2): 113 | - Folly (= 2018.10.22.00) 114 | - glog 115 | - React-cxxreact (= 0.62.2) 116 | - React-jsi (= 0.62.2) 117 | - React-jsiexecutor (= 0.62.2) 118 | - Yoga 119 | - React-Core/DevSupport (0.62.2): 120 | - Folly (= 2018.10.22.00) 121 | - glog 122 | - React-Core/Default (= 0.62.2) 123 | - React-Core/RCTWebSocket (= 0.62.2) 124 | - React-cxxreact (= 0.62.2) 125 | - React-jsi (= 0.62.2) 126 | - React-jsiexecutor (= 0.62.2) 127 | - React-jsinspector (= 0.62.2) 128 | - Yoga 129 | - React-Core/RCTActionSheetHeaders (0.62.2): 130 | - Folly (= 2018.10.22.00) 131 | - glog 132 | - React-Core/Default 133 | - React-cxxreact (= 0.62.2) 134 | - React-jsi (= 0.62.2) 135 | - React-jsiexecutor (= 0.62.2) 136 | - Yoga 137 | - React-Core/RCTAnimationHeaders (0.62.2): 138 | - Folly (= 2018.10.22.00) 139 | - glog 140 | - React-Core/Default 141 | - React-cxxreact (= 0.62.2) 142 | - React-jsi (= 0.62.2) 143 | - React-jsiexecutor (= 0.62.2) 144 | - Yoga 145 | - React-Core/RCTBlobHeaders (0.62.2): 146 | - Folly (= 2018.10.22.00) 147 | - glog 148 | - React-Core/Default 149 | - React-cxxreact (= 0.62.2) 150 | - React-jsi (= 0.62.2) 151 | - React-jsiexecutor (= 0.62.2) 152 | - Yoga 153 | - React-Core/RCTImageHeaders (0.62.2): 154 | - Folly (= 2018.10.22.00) 155 | - glog 156 | - React-Core/Default 157 | - React-cxxreact (= 0.62.2) 158 | - React-jsi (= 0.62.2) 159 | - React-jsiexecutor (= 0.62.2) 160 | - Yoga 161 | - React-Core/RCTLinkingHeaders (0.62.2): 162 | - Folly (= 2018.10.22.00) 163 | - glog 164 | - React-Core/Default 165 | - React-cxxreact (= 0.62.2) 166 | - React-jsi (= 0.62.2) 167 | - React-jsiexecutor (= 0.62.2) 168 | - Yoga 169 | - React-Core/RCTNetworkHeaders (0.62.2): 170 | - Folly (= 2018.10.22.00) 171 | - glog 172 | - React-Core/Default 173 | - React-cxxreact (= 0.62.2) 174 | - React-jsi (= 0.62.2) 175 | - React-jsiexecutor (= 0.62.2) 176 | - Yoga 177 | - React-Core/RCTSettingsHeaders (0.62.2): 178 | - Folly (= 2018.10.22.00) 179 | - glog 180 | - React-Core/Default 181 | - React-cxxreact (= 0.62.2) 182 | - React-jsi (= 0.62.2) 183 | - React-jsiexecutor (= 0.62.2) 184 | - Yoga 185 | - React-Core/RCTTextHeaders (0.62.2): 186 | - Folly (= 2018.10.22.00) 187 | - glog 188 | - React-Core/Default 189 | - React-cxxreact (= 0.62.2) 190 | - React-jsi (= 0.62.2) 191 | - React-jsiexecutor (= 0.62.2) 192 | - Yoga 193 | - React-Core/RCTVibrationHeaders (0.62.2): 194 | - Folly (= 2018.10.22.00) 195 | - glog 196 | - React-Core/Default 197 | - React-cxxreact (= 0.62.2) 198 | - React-jsi (= 0.62.2) 199 | - React-jsiexecutor (= 0.62.2) 200 | - Yoga 201 | - React-Core/RCTWebSocket (0.62.2): 202 | - Folly (= 2018.10.22.00) 203 | - glog 204 | - React-Core/Default (= 0.62.2) 205 | - React-cxxreact (= 0.62.2) 206 | - React-jsi (= 0.62.2) 207 | - React-jsiexecutor (= 0.62.2) 208 | - Yoga 209 | - React-CoreModules (0.62.2): 210 | - FBReactNativeSpec (= 0.62.2) 211 | - Folly (= 2018.10.22.00) 212 | - RCTTypeSafety (= 0.62.2) 213 | - React-Core/CoreModulesHeaders (= 0.62.2) 214 | - React-RCTImage (= 0.62.2) 215 | - ReactCommon/turbomodule/core (= 0.62.2) 216 | - React-cxxreact (0.62.2): 217 | - boost-for-react-native (= 1.63.0) 218 | - DoubleConversion 219 | - Folly (= 2018.10.22.00) 220 | - glog 221 | - React-jsinspector (= 0.62.2) 222 | - React-jsi (0.62.2): 223 | - boost-for-react-native (= 1.63.0) 224 | - DoubleConversion 225 | - Folly (= 2018.10.22.00) 226 | - glog 227 | - React-jsi/Default (= 0.62.2) 228 | - React-jsi/Default (0.62.2): 229 | - boost-for-react-native (= 1.63.0) 230 | - DoubleConversion 231 | - Folly (= 2018.10.22.00) 232 | - glog 233 | - React-jsiexecutor (0.62.2): 234 | - DoubleConversion 235 | - Folly (= 2018.10.22.00) 236 | - glog 237 | - React-cxxreact (= 0.62.2) 238 | - React-jsi (= 0.62.2) 239 | - React-jsinspector (0.62.2) 240 | - React-RCTActionSheet (0.62.2): 241 | - React-Core/RCTActionSheetHeaders (= 0.62.2) 242 | - React-RCTAnimation (0.62.2): 243 | - FBReactNativeSpec (= 0.62.2) 244 | - Folly (= 2018.10.22.00) 245 | - RCTTypeSafety (= 0.62.2) 246 | - React-Core/RCTAnimationHeaders (= 0.62.2) 247 | - ReactCommon/turbomodule/core (= 0.62.2) 248 | - React-RCTBlob (0.62.2): 249 | - FBReactNativeSpec (= 0.62.2) 250 | - Folly (= 2018.10.22.00) 251 | - React-Core/RCTBlobHeaders (= 0.62.2) 252 | - React-Core/RCTWebSocket (= 0.62.2) 253 | - React-jsi (= 0.62.2) 254 | - React-RCTNetwork (= 0.62.2) 255 | - ReactCommon/turbomodule/core (= 0.62.2) 256 | - React-RCTImage (0.62.2): 257 | - FBReactNativeSpec (= 0.62.2) 258 | - Folly (= 2018.10.22.00) 259 | - RCTTypeSafety (= 0.62.2) 260 | - React-Core/RCTImageHeaders (= 0.62.2) 261 | - React-RCTNetwork (= 0.62.2) 262 | - ReactCommon/turbomodule/core (= 0.62.2) 263 | - React-RCTLinking (0.62.2): 264 | - FBReactNativeSpec (= 0.62.2) 265 | - React-Core/RCTLinkingHeaders (= 0.62.2) 266 | - ReactCommon/turbomodule/core (= 0.62.2) 267 | - React-RCTNetwork (0.62.2): 268 | - FBReactNativeSpec (= 0.62.2) 269 | - Folly (= 2018.10.22.00) 270 | - RCTTypeSafety (= 0.62.2) 271 | - React-Core/RCTNetworkHeaders (= 0.62.2) 272 | - ReactCommon/turbomodule/core (= 0.62.2) 273 | - React-RCTSettings (0.62.2): 274 | - FBReactNativeSpec (= 0.62.2) 275 | - Folly (= 2018.10.22.00) 276 | - RCTTypeSafety (= 0.62.2) 277 | - React-Core/RCTSettingsHeaders (= 0.62.2) 278 | - ReactCommon/turbomodule/core (= 0.62.2) 279 | - React-RCTText (0.62.2): 280 | - React-Core/RCTTextHeaders (= 0.62.2) 281 | - React-RCTVibration (0.62.2): 282 | - FBReactNativeSpec (= 0.62.2) 283 | - Folly (= 2018.10.22.00) 284 | - React-Core/RCTVibrationHeaders (= 0.62.2) 285 | - ReactCommon/turbomodule/core (= 0.62.2) 286 | - ReactCommon/callinvoker (0.62.2): 287 | - DoubleConversion 288 | - Folly (= 2018.10.22.00) 289 | - glog 290 | - React-cxxreact (= 0.62.2) 291 | - ReactCommon/turbomodule/core (0.62.2): 292 | - DoubleConversion 293 | - Folly (= 2018.10.22.00) 294 | - glog 295 | - React-Core (= 0.62.2) 296 | - React-cxxreact (= 0.62.2) 297 | - React-jsi (= 0.62.2) 298 | - ReactCommon/callinvoker (= 0.62.2) 299 | - Yoga (1.14.0) 300 | - YogaKit (1.18.1): 301 | - Yoga (~> 1.14) 302 | 303 | DEPENDENCIES: 304 | - bcrypt-react-native (from `../..`) 305 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 306 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 307 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 308 | - FlipperKit (~> 0.33.1) 309 | - FlipperKit/FlipperKitLayoutPlugin (~> 0.33.1) 310 | - FlipperKit/FlipperKitReactPlugin (~> 0.33.1) 311 | - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.33.1) 312 | - FlipperKit/SKIOSNetworkPlugin (~> 0.33.1) 313 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 314 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 315 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 316 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 317 | - React (from `../node_modules/react-native/`) 318 | - React-Core (from `../node_modules/react-native/`) 319 | - React-Core/DevSupport (from `../node_modules/react-native/`) 320 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 321 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 322 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 323 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 324 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 325 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 326 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 327 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 328 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 329 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 330 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 331 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 332 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 333 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 334 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 335 | - ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`) 336 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 337 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 338 | 339 | SPEC REPOS: 340 | trunk: 341 | - BCrypt 342 | - boost-for-react-native 343 | - CocoaAsyncSocket 344 | - CocoaLibEvent 345 | - Flipper 346 | - Flipper-DoubleConversion 347 | - Flipper-Folly 348 | - Flipper-Glog 349 | - Flipper-PeerTalk 350 | - Flipper-RSocket 351 | - FlipperKit 352 | - OpenSSL-Universal 353 | - YogaKit 354 | 355 | EXTERNAL SOURCES: 356 | bcrypt-react-native: 357 | :path: "../.." 358 | DoubleConversion: 359 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 360 | FBLazyVector: 361 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 362 | FBReactNativeSpec: 363 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 364 | Folly: 365 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 366 | glog: 367 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 368 | RCTRequired: 369 | :path: "../node_modules/react-native/Libraries/RCTRequired" 370 | RCTTypeSafety: 371 | :path: "../node_modules/react-native/Libraries/TypeSafety" 372 | React: 373 | :path: "../node_modules/react-native/" 374 | React-Core: 375 | :path: "../node_modules/react-native/" 376 | React-CoreModules: 377 | :path: "../node_modules/react-native/React/CoreModules" 378 | React-cxxreact: 379 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 380 | React-jsi: 381 | :path: "../node_modules/react-native/ReactCommon/jsi" 382 | React-jsiexecutor: 383 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 384 | React-jsinspector: 385 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 386 | React-RCTActionSheet: 387 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 388 | React-RCTAnimation: 389 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 390 | React-RCTBlob: 391 | :path: "../node_modules/react-native/Libraries/Blob" 392 | React-RCTImage: 393 | :path: "../node_modules/react-native/Libraries/Image" 394 | React-RCTLinking: 395 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 396 | React-RCTNetwork: 397 | :path: "../node_modules/react-native/Libraries/Network" 398 | React-RCTSettings: 399 | :path: "../node_modules/react-native/Libraries/Settings" 400 | React-RCTText: 401 | :path: "../node_modules/react-native/Libraries/Text" 402 | React-RCTVibration: 403 | :path: "../node_modules/react-native/Libraries/Vibration" 404 | ReactCommon: 405 | :path: "../node_modules/react-native/ReactCommon" 406 | Yoga: 407 | :path: "../node_modules/react-native/ReactCommon/yoga" 408 | 409 | SPEC CHECKSUMS: 410 | BCrypt: 712b656110e5020d319c547e4d8f3053ded82b2a 411 | bcrypt-react-native: c5468f850df627b769ffefa9086aab0524750d9c 412 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 413 | CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 414 | CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f 415 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 416 | FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245 417 | FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e 418 | Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69 419 | Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 420 | Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 421 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 422 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 423 | Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 424 | FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e 425 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 426 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28 427 | OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 428 | RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035 429 | RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce 430 | React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3 431 | React-Core: b12bffb3f567fdf99510acb716ef1abd426e0e05 432 | React-CoreModules: 4a9b87bbe669d6c3173c0132c3328e3b000783d0 433 | React-cxxreact: e65f9c2ba0ac5be946f53548c1aaaee5873a8103 434 | React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161 435 | React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da 436 | React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493 437 | React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c 438 | React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0 439 | React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71 440 | React-RCTImage: e70be9b9c74fe4e42d0005f42cace7981c994ac3 441 | React-RCTLinking: c1b9739a88d56ecbec23b7f63650e44672ab2ad2 442 | React-RCTNetwork: 73138b6f45e5a2768ad93f3d57873c2a18d14b44 443 | React-RCTSettings: 6e3738a87e21b39a8cb08d627e68c44acf1e325a 444 | React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d 445 | React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256 446 | ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3 447 | Yoga: 3ebccbdd559724312790e7742142d062476b698e 448 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 449 | 450 | PODFILE CHECKSUM: 419883f28c9897919e5b9adfc01e0e6769e16c1d 451 | 452 | COCOAPODS: 1.9.3 453 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const blacklist = require('metro-config/src/defaults/blacklist'); 3 | const escape = require('escape-string-regexp'); 4 | const pak = require('../package.json'); 5 | 6 | const root = path.resolve(__dirname, '..'); 7 | 8 | const modules = Object.keys({ 9 | ...pak.peerDependencies, 10 | }); 11 | 12 | module.exports = { 13 | projectRoot: __dirname, 14 | watchFolders: [root], 15 | 16 | // We need to make sure that only one version is loaded for peerDependencies 17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules 18 | resolver: { 19 | blacklistRE: blacklist( 20 | modules.map( 21 | (m) => 22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) 23 | ) 24 | ), 25 | 26 | extraNodeModules: modules.reduce((acc, name) => { 27 | acc[name] = path.join(__dirname, 'node_modules', name); 28 | return acc; 29 | }, {}), 30 | }, 31 | 32 | transformer: { 33 | getTransformOptions: async () => ({ 34 | transform: { 35 | experimentalImportSupport: false, 36 | inlineRequires: true, 37 | }, 38 | }), 39 | }, 40 | }; 41 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bcrypt-react-native-example", 3 | "description": "Example app for bcrypt-react-native", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "android": "react-native run-android", 8 | "ios": "react-native run-ios", 9 | "start": "react-native start" 10 | }, 11 | "dependencies": { 12 | "react": "16.11.0", 13 | "react-native": "0.62.2" 14 | }, 15 | "devDependencies": { 16 | "@babel/core": "^7.9.6", 17 | "@babel/runtime": "^7.9.6", 18 | "babel-plugin-module-resolver": "^4.0.0", 19 | "metro-react-native-babel-preset": "^0.59.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import BcryptReactNative from 'bcrypt-react-native'; 3 | import { StyleSheet, View, Button, Alert } from 'react-native'; 4 | 5 | export default function App() { 6 | const _genSalt = async () => { 7 | try { 8 | const salt = await BcryptReactNative.getSalt(10); 9 | console.log({ salt }); 10 | Alert.alert('Salt', salt); 11 | } catch (e) { 12 | console.log({ e }); 13 | } 14 | }; 15 | 16 | const _hash = async () => { 17 | try { 18 | const salt = await BcryptReactNative.getSalt(10); 19 | const hash = await BcryptReactNative.hash(salt, 'password'); 20 | console.log({ hash }); 21 | Alert.alert('Hash', hash); 22 | } catch (e) { 23 | console.log({ e }); 24 | } 25 | }; 26 | 27 | return ( 28 | 29 |