@appcircle/react-native-code-push 0.0.1-alpha.1
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/.config/CredScanSuppressions.json +14 -0
- package/AlertAdapter.js +24 -0
- package/CONTRIBUTING.md +134 -0
- package/CodePush.js +671 -0
- package/CodePush.podspec +27 -0
- package/LICENSE.md +13 -0
- package/README.md +439 -0
- package/SECURITY.md +41 -0
- package/android/build.gradle +50 -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 +25 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePush.java +434 -0
- package/android/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +37 -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 +848 -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 +20 -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/docs/api-android.md +81 -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 +103 -0
- package/docs/setup-ios.md +109 -0
- package/docs/setup-windows.md +121 -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 +90 -0
- package/react-native.config.js +11 -0
- package/request-fetch-adapter.js +52 -0
- package/scripts/check-package.mjs +11 -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/CodePush.def +3 -0
- package/windows/CodePush/CodePush.vcxproj +198 -0
- package/windows/CodePush/CodePush.vcxproj.filters +91 -0
- package/windows/CodePush/CodePushConfig.cpp +104 -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
|
@@ -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}/@appcircle/react-native-code-push"
|
|
73
|
+
} else {
|
|
74
|
+
nodeModulesPath = findNodeModulePath(projectDir, "@appcircle/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,25 @@
|
|
|
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
|
+
# Can't find referenced class org.bouncycastle.**
|
|
25
|
+
-dontwarn com.nimbusds.jose.**
|