@novacraft-engineering/pulsar-code-push 1.5.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/CodePush.js +671 -0
- package/CodePush.podspec +28 -0
- package/LICENSE +23 -0
- package/README.md +70 -0
- package/android/build.gradle +61 -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 +20 -0
- package/android/gradlew +164 -0
- package/android/gradlew.bat +90 -0
- package/android/proguard-rules.pro +33 -0
- package/android/src/debug/AndroidManifest.xml +9 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePush.java +444 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +35 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +102 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +16 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +12 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +7 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +12 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +862 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +12 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +175 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +12 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +383 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +15 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +275 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +238 -0
- package/android/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +30 -0
- package/android/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +5 -0
- package/android/src/main/java/com/microsoft/codepush/react/FileUtils.java +203 -0
- package/android/src/main/java/com/microsoft/codepush/react/ReactHostHolder.java +11 -0
- package/android/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +17 -0
- package/android/src/main/java/com/microsoft/codepush/react/SettingsManager.java +173 -0
- package/android/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +72 -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 +1122 -0
- package/ios/CodePush/CodePushConfig.m +116 -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 +51 -0
- package/react-native.config.js +11 -0
- package/request-fetch-adapter.js +52 -0
- package/typings/react-native-code-push.d.ts +455 -0
package/CodePush.podspec
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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 = 'CodePush'
|
|
7
|
+
s.version = package['version'].gsub(/v|-beta/, '')
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.author = package['author']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.homepage = package['homepage']
|
|
12
|
+
s.source = { :git => 'https://github.com/revopush/react-native-code-push.git', :tag => "v#{s.version}"}
|
|
13
|
+
s.ios.deployment_target = '15.5'
|
|
14
|
+
s.tvos.deployment_target = '15.5'
|
|
15
|
+
s.preserve_paths = '*.js'
|
|
16
|
+
s.library = 'z'
|
|
17
|
+
s.source_files = 'ios/CodePush/*.{h,m}'
|
|
18
|
+
s.public_header_files = ['ios/CodePush/CodePush.h']
|
|
19
|
+
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
|
|
20
|
+
|
|
21
|
+
# Note: Even though there are copy/pasted versions of some of these dependencies in the repo,
|
|
22
|
+
# we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and
|
|
23
|
+
# linked properly at a parent workspace level.
|
|
24
|
+
s.dependency 'React-Core'
|
|
25
|
+
s.dependency 'SSZipArchive', '~> 2.5.5'
|
|
26
|
+
s.dependency 'JWT', '~> 3.0.0-beta.12'
|
|
27
|
+
s.dependency 'Base64', '~> 1.1'
|
|
28
|
+
end
|
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Original CodePush client Copyright (c) Microsoft Corporation.
|
|
4
|
+
RevoPush fork Copyright (c) Revopush.
|
|
5
|
+
Pulsar distribution Copyright (c) 2026 Novacraft Engineering.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @novacraft-engineering/pulsar-code-push
|
|
2
|
+
|
|
3
|
+
The React Native client for [Pulsar](https://pulsar.novacraft.africa) — over-the-air JavaScript updates for your app, no app-store review.
|
|
4
|
+
|
|
5
|
+
This is a full CodePush client (native iOS + Android modules), not a wrapper. It is a fork of
|
|
6
|
+
[`@revopush/react-native-code-push`](https://github.com/revopush/react-native-code-push) — itself the
|
|
7
|
+
New-Architecture-maintained continuation of Microsoft's original
|
|
8
|
+
[`react-native-code-push`](https://github.com/microsoft/react-native-code-push) (archived March 2025).
|
|
9
|
+
It speaks the CodePush protocol, so it works against any CodePush-compatible server; it defaults to Pulsar.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @novacraft-engineering/pulsar-code-push
|
|
15
|
+
cd ios && pod install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Autolinking registers the native module on both platforms (RN 0.70+, New Architecture supported).
|
|
19
|
+
|
|
20
|
+
## Point it at Pulsar
|
|
21
|
+
|
|
22
|
+
**iOS** — `ios/<App>/Info.plist`:
|
|
23
|
+
|
|
24
|
+
```xml
|
|
25
|
+
<key>CodePushDeploymentKey</key>
|
|
26
|
+
<string>YOUR_DEPLOYMENT_KEY</string>
|
|
27
|
+
<key>CodePushServerURL</key>
|
|
28
|
+
<string>https://api.pulsar.novacraft.africa</string>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Android** — `android/app/src/main/res/values/strings.xml`:
|
|
32
|
+
|
|
33
|
+
```xml
|
|
34
|
+
<resources>
|
|
35
|
+
<string moduleConfig="true" name="CodePushDeploymentKey">YOUR_DEPLOYMENT_KEY</string>
|
|
36
|
+
<string moduleConfig="true" name="CodePushServerURL">https://api.pulsar.novacraft.africa</string>
|
|
37
|
+
</resources>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Deployment keys are shown per app in the Pulsar dashboard.
|
|
41
|
+
|
|
42
|
+
## Wrap your root component
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import codePush from '@novacraft-engineering/pulsar-code-push';
|
|
46
|
+
|
|
47
|
+
function App() { /* … */ }
|
|
48
|
+
|
|
49
|
+
export default codePush({
|
|
50
|
+
checkFrequency: codePush.CheckFrequency.MANUAL,
|
|
51
|
+
installMode: codePush.InstallMode.ON_NEXT_RESTART,
|
|
52
|
+
})(App);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The full CodePush API is available — `codePush.sync()`, `codePush.checkForUpdate()`, `SyncStatus`,
|
|
56
|
+
`InstallMode`, `CheckFrequency`, `notifyAppReady()`, rollout %, mandatory updates, binary-version
|
|
57
|
+
targeting, differential updates, automatic rollback, and download/install telemetry (reported to Pulsar).
|
|
58
|
+
|
|
59
|
+
## Releasing
|
|
60
|
+
|
|
61
|
+
Use the Pulsar CLI ([`@novacraft-engineering/pulsar-cli`](https://github.com/Novacraft-Africa/pulsar-cli)):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx pulsar release MyApp Staging --platform ios --target 1.0.0
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT. Original CodePush © Microsoft; RevoPush fork © Revopush; this Pulsar distribution © Novacraft Engineering.
|
|
70
|
+
See LICENSE.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
dependencies {
|
|
7
|
+
classpath 'com.android.tools.build:gradle:1.3.0'
|
|
8
|
+
|
|
9
|
+
// NOTE: Do not place your application dependencies here; they belong
|
|
10
|
+
// in the individual module build.gradle files
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
apply plugin: "com.android.library"
|
|
15
|
+
|
|
16
|
+
def isNewArchitectureEnabled() {
|
|
17
|
+
// To opt-in for the New Architecture, you can either:
|
|
18
|
+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
|
19
|
+
// - Invoke gradle with `-newArchEnabled=true`
|
|
20
|
+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
|
21
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled()
|
|
25
|
+
|
|
26
|
+
if (IS_NEW_ARCHITECTURE_ENABLED) {
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def DEFAULT_COMPILE_SDK_VERSION = 26
|
|
31
|
+
def DEFAULT_BUILD_TOOLS_VERSION = "26.0.3"
|
|
32
|
+
def DEFAULT_TARGET_SDK_VERSION = 26
|
|
33
|
+
def DEFAULT_MIN_SDK_VERSION = 16
|
|
34
|
+
|
|
35
|
+
android {
|
|
36
|
+
namespace "com.microsoft.codepush.react"
|
|
37
|
+
|
|
38
|
+
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
|
|
39
|
+
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
|
|
40
|
+
|
|
41
|
+
defaultConfig {
|
|
42
|
+
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
|
|
43
|
+
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
|
44
|
+
versionCode 1
|
|
45
|
+
versionName "1.0"
|
|
46
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", IS_NEW_ARCHITECTURE_ENABLED.toString()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
lintOptions {
|
|
50
|
+
abortOnError false
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
defaultConfig {
|
|
54
|
+
consumerProguardFiles 'proguard-rules.pro'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
dependencies {
|
|
59
|
+
implementation "com.facebook.react:react-native:+"
|
|
60
|
+
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3'
|
|
61
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Adapted from https://raw.githubusercontent.com/facebook/react-native/d16ff3bd8b92fa84a9007bf5ebedd8153e4c089d/react.gradle
|
|
2
|
+
|
|
3
|
+
import java.nio.file.Paths;
|
|
4
|
+
|
|
5
|
+
def config = project.extensions.findByName("react") ?: [:]
|
|
6
|
+
def bundleAssetName = config.bundleAssetName ? config.bundleAssetName.get() : "index.android.bundle"
|
|
7
|
+
|
|
8
|
+
// because elvis operator
|
|
9
|
+
def elvisFile(thing) {
|
|
10
|
+
return thing ? file(thing) : null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
void runBefore(String dependentTaskName, Task task) {
|
|
14
|
+
Task dependentTask = tasks.findByPath(dependentTaskName);
|
|
15
|
+
if (dependentTask != null) {
|
|
16
|
+
dependentTask.dependsOn task
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Finds the path of the installed npm package with the given name using Node's
|
|
22
|
+
* module resolution algorithm, which searches "node_modules" directories up to
|
|
23
|
+
* the file system root. This handles various cases, including:
|
|
24
|
+
*
|
|
25
|
+
* - Working in the open-source RN repo:
|
|
26
|
+
* Gradle: /path/to/react-native/ReactAndroid
|
|
27
|
+
* Node module: /path/to/react-native/node_modules/[package]
|
|
28
|
+
*
|
|
29
|
+
* - Installing RN as a dependency of an app and searching for hoisted
|
|
30
|
+
* dependencies:
|
|
31
|
+
* Gradle: /path/to/app/node_modules/react-native/ReactAndroid
|
|
32
|
+
* Node module: /path/to/app/node_modules/[package]
|
|
33
|
+
*
|
|
34
|
+
* - Working in a larger repo (e.g., Facebook) that contains RN:
|
|
35
|
+
* Gradle: /path/to/repo/path/to/react-native/ReactAndroid
|
|
36
|
+
* Node module: /path/to/repo/node_modules/[package]
|
|
37
|
+
*
|
|
38
|
+
* The search begins at the given base directory (a File object). The returned
|
|
39
|
+
* path is a string.
|
|
40
|
+
*/
|
|
41
|
+
static def findNodeModulePath(baseDir, packageName) {
|
|
42
|
+
def basePath = baseDir.toPath().normalize()
|
|
43
|
+
// Node's module resolution algorithm searches up to the root directory,
|
|
44
|
+
// after which the base path will be null
|
|
45
|
+
while (basePath) {
|
|
46
|
+
def candidatePath = Paths.get(basePath.toString(), "node_modules", packageName)
|
|
47
|
+
if (candidatePath.toFile().exists()) {
|
|
48
|
+
return candidatePath.toString()
|
|
49
|
+
}
|
|
50
|
+
basePath = basePath.getParent()
|
|
51
|
+
}
|
|
52
|
+
return null
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
android.buildTypes.each { buildType ->
|
|
56
|
+
// to prevent incorrect long value restoration from strings.xml we need to wrap it with double quotes
|
|
57
|
+
// https://github.com/microsoft/cordova-plugin-code-push/issues/264
|
|
58
|
+
buildType.resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
gradle.projectsEvaluated {
|
|
62
|
+
def debuggableVariants = config.debuggableVariants ? config.debuggableVariants.get() : ['debug']
|
|
63
|
+
|
|
64
|
+
android.applicationVariants.all { variant ->
|
|
65
|
+
// No code push for debuggable variants
|
|
66
|
+
if (debuggableVariants.contains(variant.name)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
def nodeModulesPath;
|
|
71
|
+
if (project.hasProperty('nodeModulesPath')) {
|
|
72
|
+
nodeModulesPath = "${project.nodeModulesPath}/@revopush/react-native-code-push"
|
|
73
|
+
} else {
|
|
74
|
+
nodeModulesPath = findNodeModulePath(projectDir, "@revopush/react-native-code-push")
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
def targetName = variant.name.capitalize()
|
|
78
|
+
def targetPath = variant.dirName
|
|
79
|
+
|
|
80
|
+
def jsBundleDir;
|
|
81
|
+
def resourcesDir;
|
|
82
|
+
def jsBundleFile;
|
|
83
|
+
|
|
84
|
+
// Additional node commandline arguments
|
|
85
|
+
def nodeExecutableAndArgs = config.nodeExecutableAndArgs ? config.nodeExecutableAndArgs.get(): ["node"]
|
|
86
|
+
def extraPackagerArgs = config.extraPackagerArgs ? config.extraPackagerArgs.get() : []
|
|
87
|
+
|
|
88
|
+
// Make this task run right after the bundle task
|
|
89
|
+
def generateBundledResourcesHash;
|
|
90
|
+
|
|
91
|
+
def reactBundleTask = tasks.findByName("createBundle${targetName}JsAndAssets")
|
|
92
|
+
if (reactBundleTask) {
|
|
93
|
+
jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
|
|
94
|
+
resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()
|
|
95
|
+
|
|
96
|
+
// mitigates Resource and asset merger: Duplicate resources error
|
|
97
|
+
project.delete(files("${jsBundleDir}"))
|
|
98
|
+
|
|
99
|
+
jsBundleDir.mkdirs()
|
|
100
|
+
resourcesDir.mkdirs()
|
|
101
|
+
|
|
102
|
+
jsBundleFile = file("$jsBundleDir/$bundleAssetName")
|
|
103
|
+
|
|
104
|
+
generateBundledResourcesHash = tasks.create(
|
|
105
|
+
name: "generateBundledResourcesHash${targetName}",
|
|
106
|
+
type: Exec) {
|
|
107
|
+
commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
|
|
108
|
+
|
|
109
|
+
enabled !debuggableVariants.contains(variant.name) ?: targetName.toLowerCase().contains("release")
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
runBefore("merge${targetName}Resources", generateBundledResourcesHash)
|
|
113
|
+
runBefore("merge${targetName}Assets", generateBundledResourcesHash)
|
|
114
|
+
} else {
|
|
115
|
+
def jsBundleDirConfigName = "jsBundleDir${targetName}"
|
|
116
|
+
jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ? elvisFile(config."$jsBundleDirConfigName").get():
|
|
117
|
+
file("$buildDir/intermediates/assets/${targetPath}")
|
|
118
|
+
|
|
119
|
+
def resourcesDirConfigName = "resourcesDir${targetName}"
|
|
120
|
+
resourcesDir = elvisFile(config."${resourcesDirConfigName}") ? elvisFile(config."${resourcesDirConfigName}").get():
|
|
121
|
+
file("$buildDir/intermediates/res/merged/${targetPath}")
|
|
122
|
+
|
|
123
|
+
// In case version of 'Android Plugin for Gradle'' is lower than 1.3.0
|
|
124
|
+
// '$buildDir' has slightly different structure - 'merged' folder
|
|
125
|
+
// does not exists so '${targetPath}' folder contains directly in 'res' folder.
|
|
126
|
+
if (!resourcesDir.exists() && file("$buildDir/intermediates/res/${targetPath}").exists()) {
|
|
127
|
+
resourcesDir = file("$buildDir/intermediates/res/${targetPath}")
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
jsBundleFile = file("$jsBundleDir/$bundleAssetName")
|
|
131
|
+
|
|
132
|
+
def resourcesMapTempFileName = "CodePushResourcesMap-" + java.util.UUID.randomUUID().toString().substring(0,8) + ".json"
|
|
133
|
+
|
|
134
|
+
generateBundledResourcesHash = tasks.create(
|
|
135
|
+
name: "generateBundledResourcesHash${targetName}",
|
|
136
|
+
type: Exec) {
|
|
137
|
+
commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Make this task run right before the bundle task
|
|
141
|
+
def recordFilesBeforeBundleCommand = tasks.create(
|
|
142
|
+
name: "recordFilesBeforeBundleCommand${targetName}",
|
|
143
|
+
type: Exec) {
|
|
144
|
+
commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/scripts/recordFilesBeforeBundleCommand.js", resourcesDir, resourcesMapTempFileName)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
recordFilesBeforeBundleCommand.dependsOn("merge${targetName}Resources")
|
|
148
|
+
recordFilesBeforeBundleCommand.dependsOn("merge${targetName}Assets")
|
|
149
|
+
runBefore("bundle${targetName}JsAndAssets", recordFilesBeforeBundleCommand)
|
|
150
|
+
|
|
151
|
+
// We need to generate and record the resources map, but we use it to generate the bundle hash
|
|
152
|
+
generateBundledResourcesHash.dependsOn("recordFilesBeforeBundleCommand${targetName}")
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
generateBundledResourcesHash.dependsOn("createBundle${targetName}JsAndAssets")
|
|
156
|
+
|
|
157
|
+
runBefore("processArmeabi-v7a${targetName}Resources", generateBundledResourcesHash)
|
|
158
|
+
runBefore("processX86${targetName}Resources", generateBundledResourcesHash)
|
|
159
|
+
runBefore("processUniversal${targetName}Resources", generateBundledResourcesHash)
|
|
160
|
+
runBefore("process${targetName}Resources", generateBundledResourcesHash)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
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.useDeprecatedNdk=true
|
package/android/gradlew
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
##
|
|
5
|
+
## Gradle start up script for UN*X
|
|
6
|
+
##
|
|
7
|
+
##############################################################################
|
|
8
|
+
|
|
9
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
10
|
+
DEFAULT_JVM_OPTS=""
|
|
11
|
+
|
|
12
|
+
APP_NAME="Gradle"
|
|
13
|
+
APP_BASE_NAME=`basename "$0"`
|
|
14
|
+
|
|
15
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
16
|
+
MAX_FD="maximum"
|
|
17
|
+
|
|
18
|
+
warn ( ) {
|
|
19
|
+
echo "$*"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
die ( ) {
|
|
23
|
+
echo
|
|
24
|
+
echo "$*"
|
|
25
|
+
echo
|
|
26
|
+
exit 1
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# OS specific support (must be 'true' or 'false').
|
|
30
|
+
cygwin=false
|
|
31
|
+
msys=false
|
|
32
|
+
darwin=false
|
|
33
|
+
case "`uname`" in
|
|
34
|
+
CYGWIN* )
|
|
35
|
+
cygwin=true
|
|
36
|
+
;;
|
|
37
|
+
Darwin* )
|
|
38
|
+
darwin=true
|
|
39
|
+
;;
|
|
40
|
+
MINGW* )
|
|
41
|
+
msys=true
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
|
|
45
|
+
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
|
46
|
+
if $cygwin ; then
|
|
47
|
+
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Attempt to set APP_HOME
|
|
51
|
+
# Resolve links: $0 may be a link
|
|
52
|
+
PRG="$0"
|
|
53
|
+
# Need this for relative symlinks.
|
|
54
|
+
while [ -h "$PRG" ] ; do
|
|
55
|
+
ls=`ls -ld "$PRG"`
|
|
56
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
57
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
58
|
+
PRG="$link"
|
|
59
|
+
else
|
|
60
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
61
|
+
fi
|
|
62
|
+
done
|
|
63
|
+
SAVED="`pwd`"
|
|
64
|
+
cd "`dirname \"$PRG\"`/" >&-
|
|
65
|
+
APP_HOME="`pwd -P`"
|
|
66
|
+
cd "$SAVED" >&-
|
|
67
|
+
|
|
68
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
69
|
+
|
|
70
|
+
# Determine the Java command to use to start the JVM.
|
|
71
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
72
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
73
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
74
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
75
|
+
else
|
|
76
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
77
|
+
fi
|
|
78
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
79
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
80
|
+
|
|
81
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
82
|
+
location of your Java installation."
|
|
83
|
+
fi
|
|
84
|
+
else
|
|
85
|
+
JAVACMD="java"
|
|
86
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
87
|
+
|
|
88
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
89
|
+
location of your Java installation."
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
# Increase the maximum file descriptors if we can.
|
|
93
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
|
94
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
95
|
+
if [ $? -eq 0 ] ; then
|
|
96
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
97
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
98
|
+
fi
|
|
99
|
+
ulimit -n $MAX_FD
|
|
100
|
+
if [ $? -ne 0 ] ; then
|
|
101
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
102
|
+
fi
|
|
103
|
+
else
|
|
104
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
105
|
+
fi
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
109
|
+
if $darwin; then
|
|
110
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# For Cygwin, switch paths to Windows format before running java
|
|
114
|
+
if $cygwin ; then
|
|
115
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
116
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
117
|
+
|
|
118
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
119
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
120
|
+
SEP=""
|
|
121
|
+
for dir in $ROOTDIRSRAW ; do
|
|
122
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
123
|
+
SEP="|"
|
|
124
|
+
done
|
|
125
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
126
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
127
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
128
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
129
|
+
fi
|
|
130
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
131
|
+
i=0
|
|
132
|
+
for arg in "$@" ; do
|
|
133
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
134
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
135
|
+
|
|
136
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
137
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
138
|
+
else
|
|
139
|
+
eval `echo args$i`="\"$arg\""
|
|
140
|
+
fi
|
|
141
|
+
i=$((i+1))
|
|
142
|
+
done
|
|
143
|
+
case $i in
|
|
144
|
+
(0) set -- ;;
|
|
145
|
+
(1) set -- "$args0" ;;
|
|
146
|
+
(2) set -- "$args0" "$args1" ;;
|
|
147
|
+
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
148
|
+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
149
|
+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
150
|
+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
151
|
+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
152
|
+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
153
|
+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
154
|
+
esac
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
|
158
|
+
function splitJvmOpts() {
|
|
159
|
+
JVM_OPTS=("$@")
|
|
160
|
+
}
|
|
161
|
+
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
|
162
|
+
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
163
|
+
|
|
164
|
+
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@if "%DEBUG%" == "" @echo off
|
|
2
|
+
@rem ##########################################################################
|
|
3
|
+
@rem
|
|
4
|
+
@rem Gradle startup script for Windows
|
|
5
|
+
@rem
|
|
6
|
+
@rem ##########################################################################
|
|
7
|
+
|
|
8
|
+
@rem Set local scope for the variables with windows NT shell
|
|
9
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
10
|
+
|
|
11
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
12
|
+
set DEFAULT_JVM_OPTS=
|
|
13
|
+
|
|
14
|
+
set DIRNAME=%~dp0
|
|
15
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
16
|
+
set APP_BASE_NAME=%~n0
|
|
17
|
+
set APP_HOME=%DIRNAME%
|
|
18
|
+
|
|
19
|
+
@rem Find java.exe
|
|
20
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
21
|
+
|
|
22
|
+
set JAVA_EXE=java.exe
|
|
23
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
24
|
+
if "%ERRORLEVEL%" == "0" goto init
|
|
25
|
+
|
|
26
|
+
echo.
|
|
27
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
28
|
+
echo.
|
|
29
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
30
|
+
echo location of your Java installation.
|
|
31
|
+
|
|
32
|
+
goto fail
|
|
33
|
+
|
|
34
|
+
:findJavaFromJavaHome
|
|
35
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
36
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
37
|
+
|
|
38
|
+
if exist "%JAVA_EXE%" goto init
|
|
39
|
+
|
|
40
|
+
echo.
|
|
41
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
42
|
+
echo.
|
|
43
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
44
|
+
echo location of your Java installation.
|
|
45
|
+
|
|
46
|
+
goto fail
|
|
47
|
+
|
|
48
|
+
:init
|
|
49
|
+
@rem Get command-line arguments, handling Windowz variants
|
|
50
|
+
|
|
51
|
+
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
52
|
+
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
53
|
+
|
|
54
|
+
:win9xME_args
|
|
55
|
+
@rem Slurp the command line arguments.
|
|
56
|
+
set CMD_LINE_ARGS=
|
|
57
|
+
set _SKIP=2
|
|
58
|
+
|
|
59
|
+
:win9xME_args_slurp
|
|
60
|
+
if "x%~1" == "x" goto execute
|
|
61
|
+
|
|
62
|
+
set CMD_LINE_ARGS=%*
|
|
63
|
+
goto execute
|
|
64
|
+
|
|
65
|
+
:4NT_args
|
|
66
|
+
@rem Get arguments from the 4NT Shell from JP Software
|
|
67
|
+
set CMD_LINE_ARGS=%$
|
|
68
|
+
|
|
69
|
+
:execute
|
|
70
|
+
@rem Setup the command line
|
|
71
|
+
|
|
72
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
73
|
+
|
|
74
|
+
@rem Execute Gradle
|
|
75
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
76
|
+
|
|
77
|
+
:end
|
|
78
|
+
@rem End local scope for the variables with windows NT shell
|
|
79
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
80
|
+
|
|
81
|
+
:fail
|
|
82
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
83
|
+
rem the _cmd.exe /c_ return code!
|
|
84
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
85
|
+
exit /b 1
|
|
86
|
+
|
|
87
|
+
:mainEnd
|
|
88
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
89
|
+
|
|
90
|
+
:omega
|
|
@@ -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 ** reactHostDelegate;
|
|
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.**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
|
|
3
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
+
|
|
5
|
+
<application>
|
|
6
|
+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
7
|
+
</application>
|
|
8
|
+
|
|
9
|
+
</manifest>
|