@swyng/react-native-code-push 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AlertAdapter.js +24 -0
- package/CLAUDE.md +57 -0
- package/CONTRIBUTING.md +134 -0
- package/CodePush.js +671 -0
- package/CodePush.podspec +28 -0
- package/LICENSE.md +13 -0
- package/README.md +323 -0
- package/SECURITY.md +24 -0
- package/android/app/build.gradle +48 -0
- package/android/app/proguard-rules.pro +33 -0
- package/android/app/src/main/AndroidManifest.xml +5 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePush.java +426 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushConstants.java +35 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushDialog.java +102 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushInstallMode.java +16 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushInvalidPublicKeyException.java +12 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushInvalidUpdateException.java +7 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushMalformedDataException.java +12 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushNativeModule.java +781 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushNotInitializedException.java +12 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushTelemetryManager.java +175 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushUnknownException.java +12 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushUpdateManager.java +383 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushUpdateState.java +15 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushUpdateUtils.java +275 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/CodePushUtils.java +238 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/DownloadProgress.java +30 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/DownloadProgressCallback.java +5 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/FileUtils.java +203 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/ReactHostHolder.java +11 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/SettingsManager.java +173 -0
- package/android/app/src/main/java/com/swyngpush/codepush/react/TLSSocketFactory.java +72 -0
- package/android/build.gradle +23 -0
- package/android/codepush.gradle +162 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +18 -0
- package/android/gradlew +164 -0
- package/android/gradlew.bat +90 -0
- package/android/settings.gradle +2 -0
- package/docs/LOAD_BUNDLE_DELAY_ANALYSIS.md +68 -0
- package/docs/api-android.md +52 -0
- package/docs/api-ios.md +31 -0
- package/docs/api-js.md +592 -0
- package/docs/multi-deployment-testing-android.md +55 -0
- package/docs/multi-deployment-testing-ios.md +59 -0
- package/docs/setup-android.md +121 -0
- package/docs/setup-ios.md +141 -0
- package/docs/setup-windows.md +121 -0
- package/expo.js +347 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +34 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +252 -0
- package/ios/CodePush/Base64/README.md +47 -0
- package/ios/CodePush/CodePush.h +235 -0
- package/ios/CodePush/CodePush.m +1131 -0
- package/ios/CodePush/CodePushConfig.m +115 -0
- package/ios/CodePush/CodePushDownloadHandler.m +130 -0
- package/ios/CodePush/CodePushErrorUtils.m +20 -0
- package/ios/CodePush/CodePushPackage.m +602 -0
- package/ios/CodePush/CodePushTelemetryManager.m +175 -0
- package/ios/CodePush/CodePushUpdateUtils.m +376 -0
- package/ios/CodePush/CodePushUtils.m +9 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +69 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +16 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +51 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +15 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +55 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +24 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +41 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +28 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +205 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +103 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +322 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +37 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +145 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +35 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +551 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +23 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +43 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +230 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +31 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +113 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +38 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +500 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +214 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +23 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +29 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +19 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +68 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +72 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +67 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +111 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +119 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +307 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +94 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +619 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +164 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +514 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +24 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +11 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +52 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +5 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +28 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +70 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +22 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +34 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +73 -0
- package/ios/CodePush/JWT/LICENSE +19 -0
- package/ios/CodePush/JWT/README.md +489 -0
- package/ios/CodePush/RCTConvert+CodePushInstallMode.m +20 -0
- package/ios/CodePush/RCTConvert+CodePushUpdateState.m +20 -0
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +178 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1496 -0
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +1052 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/logging.js +6 -0
- package/package-mixins.js +68 -0
- package/package.json +91 -0
- package/react-native.config.js +11 -0
- package/request-fetch-adapter.js +52 -0
- package/scripts/generateBundledResourcesHash.js +125 -0
- package/scripts/getFilesInFolder.js +19 -0
- package/scripts/postlink/android/postlink.js +87 -0
- package/scripts/postlink/ios/postlink.js +116 -0
- package/scripts/postlink/run.js +11 -0
- package/scripts/postunlink/android/postunlink.js +74 -0
- package/scripts/postunlink/ios/postunlink.js +87 -0
- package/scripts/postunlink/run.js +11 -0
- package/scripts/recordFilesBeforeBundleCommand.js +41 -0
- package/scripts/tools/linkToolsAndroid.js +57 -0
- package/scripts/tools/linkToolsIos.js +130 -0
- package/tsconfig.json +17 -0
- package/tslint.json +32 -0
- package/typings/react-native-code-push.d.ts +455 -0
- package/windows/CodePush/.!12419!CodePushNativeModule.h +154 -0
- package/windows/CodePush/.!12440!CodePushNativeModule.h +154 -0
- package/windows/CodePush/CodePush.def +3 -0
- package/windows/CodePush/CodePush.vcxproj +198 -0
- package/windows/CodePush/CodePush.vcxproj.filters +91 -0
- package/windows/CodePush/CodePushConfig.cpp +99 -0
- package/windows/CodePush/CodePushConfig.h +66 -0
- package/windows/CodePush/CodePushConfig.idl +12 -0
- package/windows/CodePush/CodePushDownloadHandler.cpp +73 -0
- package/windows/CodePush/CodePushDownloadHandler.h +32 -0
- package/windows/CodePush/CodePushNativeModule.cpp +934 -0
- package/windows/CodePush/CodePushNativeModule.h +247 -0
- package/windows/CodePush/CodePushPackage.cpp +456 -0
- package/windows/CodePush/CodePushPackage.h +49 -0
- package/windows/CodePush/CodePushTelemetryManager.cpp +213 -0
- package/windows/CodePush/CodePushTelemetryManager.h +29 -0
- package/windows/CodePush/CodePushUpdateUtils.cpp +86 -0
- package/windows/CodePush/CodePushUpdateUtils.h +38 -0
- package/windows/CodePush/CodePushUtils.cpp +29 -0
- package/windows/CodePush/CodePushUtils.h +18 -0
- package/windows/CodePush/FileUtils.cpp +131 -0
- package/windows/CodePush/FileUtils.h +28 -0
- package/windows/CodePush/PropertySheet.props +16 -0
- package/windows/CodePush/ReactPackageProvider.cpp +15 -0
- package/windows/CodePush/ReactPackageProvider.h +22 -0
- package/windows/CodePush/ReactPackageProvider.idl +9 -0
- package/windows/CodePush/miniz/LICENSE +22 -0
- package/windows/CodePush/miniz/miniz.c +7657 -0
- package/windows/CodePush/miniz/miniz.h +1338 -0
- package/windows/CodePush/miniz/readme.md +37 -0
- package/windows/CodePush/packages.config +4 -0
- package/windows/CodePush/pch.cpp +1 -0
- package/windows/CodePush/pch.h +4 -0
- package/windows-legacy/CodePush/CodePush.csproj +128 -0
- package/windows-legacy/CodePush/CodePushUtils.cs +47 -0
- package/windows-legacy/CodePush/FileUtils.cs +40 -0
- package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +29 -0
- package/windows-legacy/CodePush/Properties/CodePush.rd.xml +33 -0
- package/windows-legacy/CodePush/UpdateManager.cs +305 -0
- package/windows-legacy/CodePush/UpdateUtils.cs +46 -0
- package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +28 -0
- package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +106 -0
- package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +103 -0
- package/windows-legacy/CodePush.Net46/CodePushUtils.cs +158 -0
- package/windows-legacy/CodePush.Net46/FileUtils.cs +55 -0
- package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +36 -0
- package/windows-legacy/CodePush.Net46/UpdateManager.cs +330 -0
- package/windows-legacy/CodePush.Net46/UpdateUtils.cs +70 -0
- package/windows-legacy/CodePush.Net46/packages.config +5 -0
- package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +105 -0
- package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +137 -0
- package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +36 -0
- package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +117 -0
- package/windows-legacy/CodePush.Net46.Test/app.config +11 -0
- package/windows-legacy/CodePush.Net46.Test/packages.config +4 -0
- package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +22 -0
- package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +13 -0
- package/windows-legacy/CodePush.Shared/CodePushConstants.cs +35 -0
- package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +329 -0
- package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +235 -0
- package/windows-legacy/CodePush.Shared/CodePushUtils.cs +70 -0
- package/windows-legacy/CodePush.Shared/InstallMode.cs +9 -0
- package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +44 -0
- package/windows-legacy/CodePush.Shared/SettingsManager.cs +148 -0
- package/windows-legacy/CodePush.Shared/TelemetryManager.cs +250 -0
- package/windows-legacy/CodePush.Shared/UpdateState.cs +9 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
SwyngPush React Native Plugin
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Swyng
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
#### [Sign up with SwyngPush](https://swyngpush.site) to use CodePush
|
|
2
|
+
|
|
3
|
+
# React Native Module for SwyngPush
|
|
4
|
+
|
|
5
|
+
This plugin provides client-side integration for the [SwyngPush service](https://swyngpush.site), allowing you to easily add over-the-air updates to your React Native app(s).
|
|
6
|
+
|
|
7
|
+
- [How does it work?](#how-does-it-work)
|
|
8
|
+
- [Supported React Native Platforms](#supported-react-native-platforms)
|
|
9
|
+
- [Supported Components](#supported-components)
|
|
10
|
+
- [Getting Started](#getting-started)
|
|
11
|
+
- [iOS Setup](docs/setup-ios.md)
|
|
12
|
+
- [Android Setup](docs/setup-android.md)
|
|
13
|
+
- [Windows Setup](docs/setup-windows.md)
|
|
14
|
+
- [Plugin Usage](#plugin-usage)
|
|
15
|
+
- [Store Guideline Compliance](#store-guideline-compliance)
|
|
16
|
+
- [Releasing Updates](#releasing-updates)
|
|
17
|
+
- [Multi-Deployment Testing](#multi-deployment-testing)
|
|
18
|
+
- [Android](docs/multi-deployment-testing-android.md)
|
|
19
|
+
- [iOS](docs/multi-deployment-testing-ios.md)
|
|
20
|
+
- [Dynamic Deployment Assignment](#dynamic-deployment-assignment)
|
|
21
|
+
- [API Reference](#api-reference)
|
|
22
|
+
- [JavaScript API](docs/api-js.md)
|
|
23
|
+
- [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
24
|
+
- [Java API Reference (Android)](docs/api-android.md)
|
|
25
|
+
- [Debugging / Troubleshooting](#debugging--troubleshooting)
|
|
26
|
+
- [Example Apps / Starters](#example-apps--starters)
|
|
27
|
+
- [TypeScript Consumption](#typescript-consumption)
|
|
28
|
+
|
|
29
|
+
## How does it work?
|
|
30
|
+
|
|
31
|
+
A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.
|
|
32
|
+
|
|
33
|
+
The SwyngPush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the SwyngPush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available.
|
|
34
|
+
|
|
35
|
+
In order to ensure that your end users always have a functioning version of your app, the SwyngPush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server.
|
|
36
|
+
|
|
37
|
+
_Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s)._
|
|
38
|
+
|
|
39
|
+
## Supported React Native platforms
|
|
40
|
+
|
|
41
|
+
- iOS (7+)
|
|
42
|
+
- Android (4.1+) on TLS 1.2 compatible devices
|
|
43
|
+
|
|
44
|
+
We try our best to maintain backwards compatibility of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the CodePush plugin in order to support the exact version of React Native you are using. The following table outlines which CodePush plugin versions officially support the respective React Native versions:
|
|
45
|
+
|
|
46
|
+
| React Native version(s) | Supporting CodePush version(s) |
|
|
47
|
+
| ------------------------ | ------------------------------------------------- |
|
|
48
|
+
| v0.76, v0.77, 0.78, 0.79 | v1.0+ _(Old/New Architecture)_ |
|
|
49
|
+
| v0.80 | v1.0+ _(Old/New Architecture)_ |
|
|
50
|
+
| v0.81+ | v1.0+ _(Old/New Architecture)_ |
|
|
51
|
+
| v0.82+ | v1.0+ _(New Architecture)_ |
|
|
52
|
+
|
|
53
|
+
### Supported Components
|
|
54
|
+
|
|
55
|
+
When using the React Native assets system (i.e. using the `require("./foo.png")` syntax), the following list represents the set of core components (and props) that support having their referenced images and videos updated via CodePush:
|
|
56
|
+
|
|
57
|
+
| Component | Prop(s) |
|
|
58
|
+
| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
|
|
59
|
+
| `Image` | `source` |
|
|
60
|
+
| `MapView.Marker` <br />_(Requires [react-native-maps](https://github.com/lelandrichardson/react-native-maps) `>=O.3.2`)_ | `image` |
|
|
61
|
+
| `ProgressViewIOS` | `progressImage`, `trackImage` |
|
|
62
|
+
| `TabBarIOS.Item` | `icon`, `selectedIcon` |
|
|
63
|
+
| `ToolbarAndroid` <br />_(React Native 0.21.0+)_ | `actions[].icon`, `logo`, `overflowIcon` |
|
|
64
|
+
| `Video` | `source` |
|
|
65
|
+
|
|
66
|
+
_Note: CodePush only works with Video components when using `require` in the source prop. For example:_
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
<Video source={require("./foo.mp4")} />
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Getting Started
|
|
73
|
+
|
|
74
|
+
Once you've followed the general-purpose ["getting started"](https://console.swyngpush.site/docs) instructions for setting up your SwyngPush account, you can start CodePush-ifying your React Native app by running the following command from within your app's root directory:
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
yarn add @swyng/react-native-code-push
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
As with all other React Native plugins, the integration experience is different for iOS and Android, so perform the following setup steps depending on which platform(s) you are targeting. Note, if you are targeting both platforms it is recommended to create separate CodePush applications for each platform.
|
|
81
|
+
|
|
82
|
+
Then continue with installing the native module:
|
|
83
|
+
|
|
84
|
+
- [iOS Setup](docs/setup-ios.md)
|
|
85
|
+
- [Android Setup](docs/setup-android.md)
|
|
86
|
+
- [Windows Setup](docs/setup-windows.md)
|
|
87
|
+
|
|
88
|
+
## Plugin Usage
|
|
89
|
+
|
|
90
|
+
With the CodePush plugin downloaded and linked, and your app asking CodePush where to get the right JS bundle from, the only thing left is to add the necessary code to your app to control the following policies:
|
|
91
|
+
|
|
92
|
+
1. When (and how often) to check for an update? (for example app start, in response to clicking a button in a settings page, periodically at some fixed interval)
|
|
93
|
+
|
|
94
|
+
2. When an update is available, how to present it to the end user?
|
|
95
|
+
|
|
96
|
+
The simplest way to do this is to "CodePush-ify" your app's root component. To do so, you can choose one of the following two options:
|
|
97
|
+
|
|
98
|
+
- **Option 1: Wrap your root component with the `codePush` higher-order component:**
|
|
99
|
+
|
|
100
|
+
- For class component
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
import codePush from "@swyng/react-native-code-push";
|
|
104
|
+
|
|
105
|
+
class MyApp extends Component {}
|
|
106
|
+
|
|
107
|
+
MyApp = codePush(MyApp);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- For functional component
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
import codePush from "@swyng/react-native-code-push";
|
|
114
|
+
|
|
115
|
+
let MyApp: () => React$Node = () => {};
|
|
116
|
+
|
|
117
|
+
MyApp = codePush(MyApp);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- **Option 2: Use the [ES7 decorator](https://github.com/wycats/javascript-decorators) syntax:**
|
|
121
|
+
|
|
122
|
+
_NOTE: Decorators are not yet supported in Babel 6.x pending proposal update._ You may need to enable it by installing and using [babel-preset-react-native-stage-0](https://github.com/skevy/babel-preset-react-native-stage-0#babel-preset-react-native-stage-0).
|
|
123
|
+
|
|
124
|
+
- For class component
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
import codePush from "@swyng/react-native-code-push";
|
|
128
|
+
|
|
129
|
+
@codePush
|
|
130
|
+
class MyApp extends Component {}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
- For functional component
|
|
134
|
+
|
|
135
|
+
```javascript
|
|
136
|
+
import codePush from "@swyng/react-native-code-push";
|
|
137
|
+
|
|
138
|
+
const MyApp: () => React$Node = () => {};
|
|
139
|
+
|
|
140
|
+
export default codePush(MyApp);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
By default, CodePush will check for updates on every app start. If an update is available, it will be silently downloaded, and installed the next time the app is restarted (either explicitly by the end user or by the OS), which ensures the least invasive experience for your end users. If an available update is mandatory, then it will be installed immediately, ensuring that the end user gets it as soon as possible.
|
|
144
|
+
|
|
145
|
+
If you would like your app to discover updates more quickly, you can also choose to sync up with the CodePush server every time the app resumes from the background.
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
let codePushOptions = {
|
|
149
|
+
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
let MyApp: () => React$Node = () => {};
|
|
153
|
+
|
|
154
|
+
MyApp = codePush(codePushOptions)(MyApp);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), you can call [`CodePush.sync()`](docs/api-js.md#codepushsync) at any time with your desired `SyncOptions`, and optionally turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
|
|
161
|
+
|
|
162
|
+
class MyApp extends Component {
|
|
163
|
+
onButtonPress() {
|
|
164
|
+
codePush.sync({
|
|
165
|
+
updateDialog: true,
|
|
166
|
+
installMode: codePush.InstallMode.IMMEDIATE,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
render() {
|
|
171
|
+
return (
|
|
172
|
+
<View>
|
|
173
|
+
<TouchableOpacity onPress={this.onButtonPress}>
|
|
174
|
+
<Text>Check for updates</Text>
|
|
175
|
+
</TouchableOpacity>
|
|
176
|
+
</View>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
MyApp = codePush(codePushOptions)(MyApp);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`codePush()`](docs/api-js.md#codepush) API reference for information on how to tweak this default behavior.
|
|
185
|
+
|
|
186
|
+
### For Expo users with CNG (Continuous Native Generation)
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
// app.json
|
|
190
|
+
{
|
|
191
|
+
"expo": {
|
|
192
|
+
"plugins": [
|
|
193
|
+
[
|
|
194
|
+
"@swyng/react-native-code-push/expo",
|
|
195
|
+
{
|
|
196
|
+
"ios": {
|
|
197
|
+
"CodePushDeploymentKey": "your-deployment-key",
|
|
198
|
+
"CodePushServerURL": "https://bl-prod-2-ap-south-1.swyng.site"
|
|
199
|
+
},
|
|
200
|
+
"android": {
|
|
201
|
+
"CodePushDeploymentKey": "your-deployment-key",
|
|
202
|
+
"CodePushServerURL": "https://bl-prod-2-ap-south-1.swyng.site"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Currently, the SwyngPush CLI doesn't support expo-cli build. To make it work, you need to customize metro.config.js in the root directory:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
npx expo customize metro.config.js
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Store Guideline Compliance
|
|
218
|
+
|
|
219
|
+
Android Google Play and iOS App Store have corresponding guidelines that have rules you should be aware of before integrating the CodePush solution within your application.
|
|
220
|
+
|
|
221
|
+
#### Google Play
|
|
222
|
+
|
|
223
|
+
Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describes that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating JavaScript bundles.
|
|
224
|
+
|
|
225
|
+
> This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
|
|
226
|
+
|
|
227
|
+
That fully allows CodePush as it updates just JS bundles and can't update native code.
|
|
228
|
+
|
|
229
|
+
#### App Store
|
|
230
|
+
|
|
231
|
+
Paragraph **3.3.2** of the [Apple Developer Program License Agreement](https://developer.apple.com/terms/) fully allows performing over-the-air updates of JavaScript and assets:
|
|
232
|
+
|
|
233
|
+
> Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
|
|
234
|
+
|
|
235
|
+
CodePush allows you to follow these rules in full compliance so long as the update you push does not significantly deviate your product from its original App Store approved intent.
|
|
236
|
+
|
|
237
|
+
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
|
|
238
|
+
|
|
239
|
+
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
|
|
240
|
+
|
|
241
|
+
This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
|
|
242
|
+
|
|
243
|
+
## Releasing Updates
|
|
244
|
+
|
|
245
|
+
Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them. The recommended way to release them is using the `create_bundle` command in the SwyngPush CLI, which will bundle your JavaScript files, asset files, and release the update to the SwyngPush server.
|
|
246
|
+
|
|
247
|
+
*NOTE: Before you can start releasing updates, please log into [SwyngPush](https://swyngpush.site) by running the `npx @swyng/cli login -u <username> -p <password>` command.*
|
|
248
|
+
|
|
249
|
+
In its most basic form, this command only requires some parameters:
|
|
250
|
+
|
|
251
|
+
```shell
|
|
252
|
+
npx @swyng/cli create_bundle -t <TargetVersion> -n <AppName> -d <deployment>
|
|
253
|
+
|
|
254
|
+
npx @swyng/cli create_bundle -t 1.0.0 -n Demo1 -d Staging
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
The `create_bundle` command enables such a simple workflow because it provides many sensible defaults (like generating a release bundle, assuming your app's entry file on iOS is either `index.ios.js` or `index.js`). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a good fit for most scenarios.
|
|
258
|
+
|
|
259
|
+
The CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end user downloads.
|
|
260
|
+
|
|
261
|
+
For more details about how the `create_bundle` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://console.swyngpush.site/docs).
|
|
262
|
+
|
|
263
|
+
### Dynamic Deployment Assignment
|
|
264
|
+
|
|
265
|
+
The above section illustrated how you can leverage multiple CodePush deployments in order to effectively test your updates before broadly releasing them to your end users. However, since that workflow statically embeds the deployment assignment into the actual binary, a staging or production build will only ever sync updates from that deployment. In many cases, this is sufficient, since you only want your team, customers, stakeholders, etc. to sync with your pre-production releases, and therefore, only they need a build that knows how to sync with staging. However, if you want to be able to perform A/B tests, or provide early access of your app to certain users, it can prove very useful to be able to dynamically place specific users (or audiences) into specific deployments at runtime.
|
|
266
|
+
|
|
267
|
+
In order to achieve this kind of workflow, all you need to do is specify the deployment key you want the current user to synchronize with when calling the `codePush` method. When specified, this key will override the "default" one that was provided in your app's `Info.plist` (iOS) or `MainActivity.java` (Android) files. This allows you to produce a build for staging or production, that is also capable of being dynamically "redirected" as needed.
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
// Imagine that "userProfile" is a prop that this component received
|
|
271
|
+
// which includes the deployment key that the current user should use.
|
|
272
|
+
codePush.sync({ deploymentKey: userProfile.CODEPUSH_KEY });
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
With that change in place, now it's just a matter of choosing how your app determines the right deployment key for the current user. In practice, there are typically two solutions for this:
|
|
276
|
+
|
|
277
|
+
1. Expose a user-visible mechanism for changing deployments at any time. For example, your settings page could have a toggle for enabling "beta" access.
|
|
278
|
+
|
|
279
|
+
2. Annotate the server-side profile of your users with an additional piece of metadata that indicates the deployment they should sync with. By default, your app could just use the binary-embedded key, but after a user has authenticated, your server can choose to "redirect" them to a different deployment.
|
|
280
|
+
|
|
281
|
+
```javascript
|
|
282
|
+
// #1) Create your new deployment to hold releases of a specific app variant
|
|
283
|
+
npx @swyng/cli app create_deployment -n <AppName> -dn <DeploymentName>
|
|
284
|
+
|
|
285
|
+
// #2) Target any new releases at that custom deployment
|
|
286
|
+
npx @swyng/cli create_bundle -t <TargetVersion> -n <AppName> -d <deployment>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## API Reference
|
|
292
|
+
|
|
293
|
+
- [JavaScript API](docs/api-js.md)
|
|
294
|
+
- [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
295
|
+
- [Java API Reference (Android)](docs/api-android.md)
|
|
296
|
+
|
|
297
|
+
### Debugging / Troubleshooting
|
|
298
|
+
|
|
299
|
+
The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc.
|
|
300
|
+
|
|
301
|
+
The simplest way to view these logs is to add the flag `--debug` for each command. This will output a log stream that is filtered to just CodePush messages. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs.
|
|
302
|
+
|
|
303
|
+
Additionally, you can also use any of the platform-specific tools to view the CodePush logs. Start up the Chrome DevTools Console, the Xcode Console (iOS), and/or ADB logcat (Android), and look for messages which are prefixed with `[CodePush]`.
|
|
304
|
+
|
|
305
|
+
| Issue / Symptom | Possible Solution |
|
|
306
|
+
|-----------------|-------------------|
|
|
307
|
+
| Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. |
|
|
308
|
+
| Network timeout / hang when calling `sync` or `checkForUpdate` in the iOS Simulator | Try resetting the simulator by selecting the `Simulator -> Reset Content and Settings..` menu item, and then re-running your app. |
|
|
309
|
+
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `npx @swyng/cli app ls_deployment -n <AppName> -k` to view the correct keys for your app deployments. |
|
|
310
|
+
| Update not being discovered | Double-check that the version of your running app (like `1.0.0`) matches the version you specified when releasing the update to CodePush. Additionally, make sure that you are releasing to the same deployment that your app is configured to sync with. |
|
|
311
|
+
| Update not being displayed after restart | If you're not calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyApplicationReady` on app start, otherwise, the plugin will think your update failed and roll it back. |
|
|
312
|
+
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different deployment keys for each platform in order to receive updates correctly. |
|
|
313
|
+
| I've released new update but changes are not reflected | Be sure that you are running app in modes other than Debug. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply. |
|
|
314
|
+
|
|
315
|
+
### TypeScript Consumption
|
|
316
|
+
|
|
317
|
+
This module ships its `*.d.ts` file as part of its NPM package, which allows you to simply `import` it, and receive intellisense in supporting editors (like Visual Studio Code), as well as compile-time type checking if you're using TypeScript. For the most part, this behavior should just work out of the box, however, if you've specified `es6` as the value for either the `target` or `module` [compiler option](http://www.typescriptlang.org/docs/handbook/compiler-options.html) in your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file, then just make sure that you also set the `moduleResolution` option to `node`. This ensures that the TypeScript compiler will look within the `node_modules` for the type definitions of imported modules.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT - See [LICENSE.md](LICENSE.md)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
If you believe you have found a security vulnerability in this repository, please report it responsibly.
|
|
6
|
+
|
|
7
|
+
**Please do NOT report security vulnerabilities through public GitHub issues.**
|
|
8
|
+
|
|
9
|
+
Instead, please send an email to [security@swyngpush.site](mailto:security@swyngpush.site).
|
|
10
|
+
|
|
11
|
+
You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
|
|
12
|
+
|
|
13
|
+
Please include the following information in your report:
|
|
14
|
+
- Type of issue (e.g., buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
15
|
+
- Full paths of source file(s) related to the manifestation of the issue
|
|
16
|
+
- The location of the affected source code (tag/branch/commit or direct URL)
|
|
17
|
+
- Any special configuration required to reproduce the issue
|
|
18
|
+
- Step-by-step instructions to reproduce the issue
|
|
19
|
+
- Proof-of-concept or exploit code (if possible)
|
|
20
|
+
- Impact of the issue, including how an attacker might exploit it
|
|
21
|
+
|
|
22
|
+
## Preferred Languages
|
|
23
|
+
|
|
24
|
+
We prefer all communications to be in English.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
apply plugin: "com.android.library"
|
|
2
|
+
|
|
3
|
+
def isNewArchitectureEnabled() {
|
|
4
|
+
// To opt-in for the New Architecture, you can either:
|
|
5
|
+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
|
6
|
+
// - Invoke gradle with `-newArchEnabled=true`
|
|
7
|
+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
|
8
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled()
|
|
12
|
+
|
|
13
|
+
def DEFAULT_COMPILE_SDK_VERSION = 26
|
|
14
|
+
def DEFAULT_BUILD_TOOLS_VERSION = "26.0.3"
|
|
15
|
+
def DEFAULT_TARGET_SDK_VERSION = 26
|
|
16
|
+
def DEFAULT_MIN_SDK_VERSION = 16
|
|
17
|
+
|
|
18
|
+
android {
|
|
19
|
+
namespace "com.swyngpush.codepush.react"
|
|
20
|
+
|
|
21
|
+
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
|
|
22
|
+
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
|
|
23
|
+
|
|
24
|
+
defaultConfig {
|
|
25
|
+
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
|
|
26
|
+
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
|
27
|
+
versionCode 1
|
|
28
|
+
versionName "1.0"
|
|
29
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", IS_NEW_ARCHITECTURE_ENABLED.toString()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
lintOptions {
|
|
33
|
+
abortOnError false
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
defaultConfig {
|
|
37
|
+
consumerProguardFiles 'proguard-rules.pro'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
buildFeatures {
|
|
41
|
+
buildConfig true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
dependencies {
|
|
46
|
+
implementation 'com.facebook.react:react-android:0.82.1'
|
|
47
|
+
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3'
|
|
48
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
12
|
+
# If your project uses WebView with JS, uncomment the following
|
|
13
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
14
|
+
# class:
|
|
15
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
16
|
+
# public *;
|
|
17
|
+
#}
|
|
18
|
+
|
|
19
|
+
# Invoked via reflection, when setting js bundle.
|
|
20
|
+
-keepclassmembers class com.facebook.react.ReactInstanceManager {
|
|
21
|
+
private final ** mBundleLoader;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
-keepclassmembers class com.facebook.react.runtime.ReactHostImpl {
|
|
25
|
+
private final ** mReactHostDelegate;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
-keep interface com.facebook.react.runtime.ReactHostDelegate { *; }
|
|
29
|
+
|
|
30
|
+
-keep class * implements com.facebook.react.runtime.ReactHostDelegate { *; }
|
|
31
|
+
|
|
32
|
+
# Can't find referenced class org.bouncycastle.**
|
|
33
|
+
-dontwarn com.nimbusds.jose.**
|