{"_id":"@3swallet/jsc-android","_rev":"1-c78094ebd8cf5abab1a87ca0f2ac6c03","name":"@3swallet/jsc-android","dist-tags":{"latest":"294992.0.2"},"versions":{"294992.0.1":{"name":"@3swallet/jsc-android","version":"294992.0.1","description":"Pre-build version of JavaScriptCore to be used by React Native apps","repository":{"type":"git","url":"git+https://github.com/BHONetwork/jsc-android-buildscripts.git"},"keywords":["react-native","android","jsc"],"license":"BSD-2-Clause","bugs":{"url":"https://github.com/BHONetwork/jsc-android-buildscripts"},"homepage":"https://github.com/BHONetwork/jsc-android-buildscripts#readme","publishConfig":{"access":"public"},"scripts":{"clean":"rm -rf dist; rm -rf build","info":"./scripts/info.sh","download":"./scripts/download.sh","start":"./scripts/start.sh"},"config":{"webkitGTK":"2.36.3","chromiumICUCommit":"85814e1af52482199a13d284545623ffbc9eef83"},"devDependencies":{"commander":"^4.0.1","rimraf":"^3.0.0","semver":"^6.3.0"},"licenseText":"BSD 2-Clause License\n\nCopyright (c) 2017, Software Mansion Sp. z o. o. Sp. k. AND 650 Industries, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","_id":"@3swallet/jsc-android@294992.0.1","dist":{"shasum":"fcbd8198b3f3eb0bd9d17257269f66e3e3875090","integrity":"sha512-A8u/V0Bv/PfCgt/OlBCu/rTHmg/JHbirR4EplSqRUZKV/3zWZFpasr1qcDLw1VApKAXgXY9G6t0MWNEiJy6F6A==","tarball":"https://registry.npmjs.org/@3swallet/jsc-android/-/jsc-android-294992.0.1.tgz","fileCount":763,"unpackedSize":32754227,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6fZ2f4JMz/1Fej3z5SgqX8eD2JFg7cbx+f0KQ5vYSaQIhAM9sHiVjWULor3LLWKhemFxPOCuutP3Qp8lHGaUrRp6C"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlDD9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMnA//WSZ5bnljb90DzMJUNVRFcD2MSky4EyKR9r9DH9hSOkecgaY6\r\nAFH/02ACzrSbg7k5QzLl4dPKUK2yxax0jH8nnnhpW5dFrhqbxEl8l0sWsWmz\r\n5QpmNaxIWPZRilROrph82AV8mvPeUMR5AvK/zCQ0SM2T7JaHIdiboq6OThIQ\r\n4KuPBw7VeJgYnIrJK7pmkySDAjX3dRmmMwWP3WSpmqiOkQwWeCPSy2dmEuXS\r\nVROx/WnbePuEk6pCJgmkgNGh93yaqsuKfEVC1vkfuRv7+HfAtYzKgw6K/9t/\r\nltnDICe1ERsWps8fqPJvywpNaY7oXTrfTWbM/TSyKK2pri5dzS9xnD6AKXjT\r\nrw1bB3tojUCJpAu5iEuajy5Ka8EUQQRv3o4vxyReWSHjgOpzp5C+pPTztdRw\r\n0VBhl5ushDRR2cEKHYtOpT8/nhIvasu8X2fsf6yNMC0sd32PVmguAmdEM/y8\r\nbZ/67aotwaYzJm7IEtg56ALkSQxp2DXlZftCvBS3nEi6vECrCjok3mTUGi4D\r\nAUR/HF4UHQABaj7NwoCrmVkM0rnL+vuhSXiO7qc7moIDnw38b0wtUOKTHyhX\r\nSm3zdbtJzD2UQK2yXBzskoppqhnP94YPtvueCWZZqquyP+Rr/ToN2riJFmic\r\nZXSx7/KWA8mzxSdaKB2pe73OcxiF1KKw9LQ=\r\n=dJn0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"knbho","email":"khoa.nguyen@bho.network"},"directories":{},"maintainers":[{"name":"knbho","email":"khoa.nguyen@bho.network"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-android_294992.0.1_1670656252580_0.6049949427102326"},"_hasShrinkwrap":false},"294992.0.2":{"name":"@3swallet/jsc-android","version":"294992.0.2","description":"Pre-build version of JavaScriptCore to be used by React Native apps","repository":{"type":"git","url":"git+https://github.com/BHONetwork/jsc-android-buildscripts.git"},"keywords":["react-native","android","jsc"],"license":"BSD-2-Clause","bugs":{"url":"https://github.com/BHONetwork/jsc-android-buildscripts"},"homepage":"https://github.com/BHONetwork/jsc-android-buildscripts#readme","publishConfig":{"access":"public"},"scripts":{"clean":"rm -rf dist; rm -rf build","info":"./scripts/info.sh","download":"./scripts/download.sh","start":"./scripts/start.sh"},"config":{"webkitGTK":"2.36.3","chromiumICUCommit":"85814e1af52482199a13d284545623ffbc9eef83"},"devDependencies":{"commander":"^4.0.1","rimraf":"^3.0.0","semver":"^6.3.0"},"licenseText":"BSD 2-Clause License\n\nCopyright (c) 2017, Software Mansion Sp. z o. o. Sp. k. AND 650 Industries, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","_id":"@3swallet/jsc-android@294992.0.2","dist":{"shasum":"dce06ea45d8a15d66dfb759466d0ed3ddd354335","integrity":"sha512-Yyg05eqUCwfT05UQH/JKZjAfQw0hUkLCQMQVYluDoVQk4Os1xO8PsVY7pc4ZMk/ITPw4+3jgIxdklhrqyiGWGQ==","tarball":"https://registry.npmjs.org/@3swallet/jsc-android/-/jsc-android-294992.0.2.tgz","fileCount":763,"unpackedSize":30406044,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1EekkTjWXyzhX6TaN8BMwskthbsFvkS26OZ8eW95EZAIgJQ4S7OIgWw4QPQ+Ffu9+U+7/WeBscGKM0D0OYvL4fxQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjlEvcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpALhAAnOLgKhu5Ev7wYWPeqXYT1MnT5J6cD9r0V7Fsfh4bFZm/bn0v\r\no01epbvIMauGO2i4w9TMEn5i6+oHOa3o5Ub61nB5/EeBB+m8ZE4o0BiSH2sV\r\nBq80gkuXFFRL02BpuFmDUiRWeKcYCBBSgmxuaQK1SQobnww4lPDHELmBb3li\r\nYqf0hpGNmKKb1fHD4XYG+F75hutSj7HY5/e5AX8YAghWCvzvwz2a4fg49SC0\r\nCZbK9VssIQv/jblQSEdJVXbNMFdQugExkaXUa5FZQqz5BRaH5Qw0aaWj0XSo\r\nFd6SSmqgqq8oM9uGElGpql0ZrA1c6LaOI9SUX5Y4dCOdV4al8awFHf+Fl2Mp\r\nsRp4F9aVE0Ag5ufU3dP/l3xAmDWQQFliCK0rYEZJ9aBAa371Dp/N9mQd4JZo\r\nsxWTm36VYtloRCpFVwlJLkcXyBvY15vuJY0vWvVpdghOjBT/Ej9pPGto4zc5\r\nJHTNetLdD/zyq8R5CQk4ZF5ibLWqXKGDgEgB3KZH6AJgxQNsZlTbQx9oJaYw\r\nRuv7tFgOqtIWKGPEEsMrpICBVaTR0wmwPNpJhlPezVroB6UGN2mdai8eGRh9\r\nTBcOjvIrJKspBFdTK1QnKKhC1i9xZSim3aBvgge+Kjacqd8Rc/kvmPkYeCzn\r\nJyapba22PGJHebjHGf8GDvfvk887zfYrDVE=\r\n=/UEm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"knbho","email":"khoa.nguyen@bho.network"},"directories":{},"maintainers":[{"name":"knbho","email":"khoa.nguyen@bho.network"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsc-android_294992.0.2_1670663131381_0.040766982666874396"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-10T07:10:52.516Z","294992.0.1":"2022-12-10T07:10:53.294Z","modified":"2022-12-10T09:05:32.317Z","294992.0.2":"2022-12-10T09:05:32.051Z"},"maintainers":[{"name":"knbho","email":"khoa.nguyen@bho.network"}],"description":"Pre-build version of JavaScriptCore to be used by React Native apps","homepage":"https://github.com/BHONetwork/jsc-android-buildscripts#readme","keywords":["react-native","android","jsc"],"repository":{"type":"git","url":"git+https://github.com/BHONetwork/jsc-android-buildscripts.git"},"bugs":{"url":"https://github.com/BHONetwork/jsc-android-buildscripts"},"license":"BSD-2-Clause","readme":"[![npm version](https://badge.fury.io/js/jsc-android.svg)](https://badge.fury.io/js/jsc-android)\n![GitHub Actions CI](https://github.com/react-native-community/jsc-android-buildscripts/workflows/Build%20jsc-android%20and%20test/badge.svg)\n\n# JSC build scripts for Android\n\nThe aim of this project is to provide maintainable build scripts for the [JavaScriptCore](https://www.webkit.org) JavaScript engine and allow the [React Native](https://github.com/facebook/react-native) project to incorporate up-to-date releases of JSC into the framework on Android.\n\nThis project is based on [facebook/android-jsc](https://github.com/facebook/android-jsc) but instead of rewriting JSC's build scripts into BUCK files, it relies on CMake build scripts maintained in a GTK branch of WebKit maintained by the WebKitGTK team (great work btw!). Thanks to that, with just a small amount of work we should be able to build not only current but also future releases of JSC. An obvious benefit for everyone using React Native is that this will allow us to update JSC for React Native on Android much more often than before (note that [facebook/android-jsc](https://github.com/facebook/android-jsc) uses JSC version from Nov 2014), which is especially helpful since React Native on iOS uses the built-in copy of JSC that is updated with each major iOS release (see [this](https://opensource.apple.com/) as a reference).\n\n## Requirements\n\n* Homebrew (https://brew.sh/)\n* GNU coreutils `brew install coreutils`\n* Node `brew install node`\n* Java 8: `brew tap caskroom/versions && brew cask install java8`\n* Android SDK: `brew cask install android-sdk`\n  * Run `sdkmanager --list` and install all platforms, tools, buildtool v28.0.3, cmake (android images are not needed)\n  * Set `$ANDROID_HOME` to the correct path (in ~/.bashrc or similar)\n  * Set `export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin`\n* Android NDK r19c: download from [NDK Archives](https://developer.android.com/ndk/downloads/older_releases.html)\n  * Set `export ANDROID_NDK=/path/to/android-ndk-r19c`\n* Make sure you have Ruby (>2.3), Python (>2.7), Git, SVN, gperf\n\n## Build instructions\n\n1. Clone this repo\n2. `npm run clean` will clean everything (artifacts, downloaded sources)\n3. Update the version in package.json. The version will be printed by JSC lib as soon as it loads.\n3. Update the config section under `package.json` to the desired build configuration\n4. Update patches if needed (don't forget to update the `printVersion` patch in jsc.patch)\n5. `npm run download`: downloads all needed sources\n6. `npm run start`: builds jsc (this might take some time...)\n\nThe zipfile containing the android-jsc AAR will be available at `/dist`.\nThe library is packaged as a local Maven repository containing AAR files that include the binaries.\n\n## Distribution\n\nJSC library built using this project is distributed over npm: [npm/jsc-android](https://www.npmjs.com/package/jsc-android).\nThe library is packaged as a local Maven repository containing AAR files that include the binaries.\nPlease refer to the section below in order to learn how your app can consume this format.\n\nOn load, JSC prints the version out to logcat, under \"JavaScriptCore.Version\" tag.\n\n## How to use it with my React Native app\n\nFollow steps below in order for your React Native app to use new version of JSC VM on android:\n\n### For React Native version 0.60 and newer\n\n1. Update `jsc-android`:\n\n```\nyarn add jsc-android\n\n# Or if you would like to try latest version\n# yarn add 'jsc-android@next'\n\n```\n\n2. You're done, rebuild your app and enjoy updated version of JSC on android!\n\n### For React Native version 0.59\n\n1. Add `jsc-android`:\n\n```\nyarn add jsc-android\n\n# Or if you would like to try latest version\n# yarn add 'jsc-android@next'\n\n```\n\n2. Modify `android/build.gradle` file to add the new local maven repository packaged in the `jsc-android` package to the search path:\n```diff\nallprojects {\n    repositories {\n        mavenLocal()\n        jcenter()\n        maven {\n            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n            url \"$rootDir/../node_modules/react-native/android\"\n        }\n+       maven {\n+           // Local Maven repo containing AARs with JSC library built for Android\n+           url \"$rootDir/../node_modules/jsc-android/dist\"\n+       }\n    }\n}\n```\n\n3. Update your app's `build.gradle` file located in `android/app/build.gradle` to add the JSC dependency.  Please make sure the dependency is before the React Native dependency.\n\n```diff\n\ndependencies {\n+   // Make sure to put android-jsc at the top\n+   implementation \"org.webkit:android-jsc:+\"\n+\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation \"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}\"\n    implementation \"com.facebook.react:react-native:+\"  // From node_modules\n}\n```\n\n4. Update your app's `build.gradle` file located in `android/app/build.gradle` to use first matched JSC library.\n\n```diff\nandroid {\n    // ...\n+   packagingOptions {\n+       pickFirst '**/libjsc.so'\n+       pickFirst '**/libc++_shared.so'\n+    }\n}\n```\n\n5. You're done - rebuild your app and enjoy the updated version of JSC on Android!\n\n### For React Native version 0.58 below\n\n1. Add `jsc-android`:\n\n```\nyarn add jsc-android\n\n# Or if you would like to try latest version\n# yarn add 'jsc-android@next'\n\n```\n\n2. Modify `android/build.gradle` file to add new local maven repository packaged in the `jsc-android` package to the search path:\n```diff\nallprojects {\n    repositories {\n        mavenLocal()\n        jcenter()\n        maven {\n            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n            url \"$rootDir/../node_modules/react-native/android\"\n        }\n+       maven {\n+           // Local Maven repo containing AARs with JSC library built for Android\n+           url \"$rootDir/../node_modules/jsc-android/dist\"\n+       }\n    }\n}\n```\n\n3. Update your app's `build.gradle` file located in `android/app/build.gradle` to force app builds to use new version of the JSC library as opposed to the version specified in [react-native gradle module as a dependency](https://github.com/facebook/react-native/blob/e8df8d9fd579ff14224cacdb816f9ff07eef978d/ReactAndroid/build.gradle#L289):\n\n```diff\n}\n\n+configurations.all {\n+    resolutionStrategy {\n+        force 'org.webkit:android-jsc:+'\n+    }\n+}\n\ndependencies {\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n+   // ...\n+   implementation 'org.webkit:android-jsc-cppruntime:+'\n+   // For even older gradle\n+   // compile 'org.webkit:android-jsc-cppruntime:+'\n```\n\n4. You're done, rebuild your app and enjoy updated version of JSC on android!\n\n### International variant\nInternational variant includes ICU i18n library and necessary data allowing to use e.g. Date.toLocaleString and String.localeCompare that give correct results when using with locales other than en-US. Note that this variant is about 6MiB larger per architecture than default.\n\nTo use this variant instead replace the third installation step with:\n\nFor React Native version 0.60 and newer, your build.gradle should have a flag to enable this feature.\n\n```diff\n  /**\n   * Use the international variant of JavaScriptCore\n   * This variant includes the ICU i18n library to make APIs like `Date.toLocaleString`\n   * and `String.localeCompare` work when using with locales other than en-US.\n   * Note that this variant is about 6MiB larger per architecture than the default.\n   */\n-  def useIntlJsc = false\n+  def useIntlJsc = true\n```\n\nFor React Native version 0.59, replace original artifact id with `android-jsc-intl`\n\n```diff\n\ndependencies {\n+   // Make sure to put android-jsc at the the first\n+   implementation \"org.webkit:android-jsc-intl:+\"\n+\n    compile fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation \"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}\"\n    implementation \"com.facebook.react:react-native:+\"  // From node_modules\n}\n```\n\nFor React Native version 0.58 below, replace original `resolutionStrategy` with this.\n\n```diff\n+configurations.all {\n+    resolutionStrategy {\n+        eachDependency { DependencyResolveDetails details ->\n+            if (details.requested.name == 'android-jsc') {\n+                details.useTarget group: details.requested.group, name: 'android-jsc-intl', version: 'r241213'\n+            }\n+        }\n+    }\n+}\n```\n\n## Testing\n\nSee **[Measurements](/measure)** page that contains synthetic perf test results for the most notable versions of JSC we have tried.\n\n## Troubleshooting\n\nCompile errors of the sort:\n```shell\nMore than one file was found with OS independent path 'lib/armeabi-v7a/libgnustl_shared.so'\n```\n\nAdd the following to your `app/build.gradle`, under `android`:\n\n```groovy\npackagingOptions {\n    pickFirst '**/libgnustl_shared.so'\n}\n```\n\n## Resources\n- [WebkitGTK Sources](https://svn.webkit.org/repository/webkit/releases/WebKitGTK/)\n- [ICU Sources](https://android.googlesource.com/platform/external/icu/)\n- [Info about Webkit Revisions](https://trac.webkit.org/browser/webkit/releases/WebKitGTK)\n- [Info about JSC version used on iOS](https://trac.webkit.org/browser/webkit/releases/WebKitGTK/webkit-2.18.2/Source/WebCore/Configurations/Version.xcconfig)\n\n## Credits\n\nCheck [the list of contributors here](https://github.com/react-community/jsc-android-buildscripts/graphs/contributors). This project is supported by:\n\n\n[![expo](https://avatars2.githubusercontent.com/u/12504344?v=3&s=100 \"Expo.io\")](https://expo.io)\n[Expo.io](https://expo.io)\n\n\n[![swm](https://avatars1.githubusercontent.com/u/6952717?v=3&s=100 \"Software Mansion\")](https://swmansion.com)\n[Software Mansion](https://swmansion.com)\n\n\n[![wix](https://avatars3.githubusercontent.com/u/686511?s=200&v=4&s=100 \"Wix\")](https://www.wix.engineering)\n[Wix](https://www.wix.engineering)\n","readmeFilename":"README.md"}