@algocare/react-native-code-push 12.6.4 → 13.0.0-rc.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/CodePush.podspec +6 -8
- package/README.md +343 -586
- package/android/app/build.gradle +2 -1
- package/android/app/proguard-rules.pro +14 -0
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/android/app/src/main/AndroidManifest.xml +1 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
- package/android/build.gradle +3 -0
- package/app.plugin.js +1 -0
- package/bin/code-push.js +6 -0
- package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
- package/cli/commands/bundleCommand/index.ts +34 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
- package/cli/commands/createHistoryCommand/index.ts +44 -0
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
- package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
- package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
- package/cli/commands/getPackageHashCommand/index.ts +45 -0
- package/cli/commands/initCommand/index.ts +14 -0
- package/cli/commands/initCommand/initAndroid.ts +91 -0
- package/cli/commands/initCommand/initIos.ts +123 -0
- package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
- package/cli/commands/initCommand/test/initIos.test.ts +99 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
- package/cli/commands/releaseCommand/index.ts +90 -0
- package/cli/commands/releaseCommand/release.ts +105 -0
- package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
- package/cli/commands/showHistoryCommand/index.ts +31 -0
- package/cli/commands/updateHistoryCommand/index.ts +55 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
- package/cli/constant.ts +4 -0
- package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
- package/cli/dist/commands/bundleCommand/index.js +15 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
- package/cli/dist/commands/createHistoryCommand/index.js +20 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
- package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
- package/cli/dist/commands/initCommand/index.js +12 -0
- package/cli/dist/commands/initCommand/initAndroid.js +73 -0
- package/cli/dist/commands/initCommand/initIos.js +108 -0
- package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
- package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
- package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
- package/cli/dist/commands/releaseCommand/index.js +45 -0
- package/cli/dist/commands/releaseCommand/release.js +62 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
- package/cli/dist/commands/showHistoryCommand/index.js +15 -0
- package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
- package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
- package/cli/dist/constant.js +4 -0
- package/cli/dist/functions/getReactTempDir.js +10 -0
- package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
- package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
- package/cli/dist/functions/runExpoBundleCommand.js +35 -0
- package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
- package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
- package/cli/dist/index.js +54 -0
- package/cli/dist/utils/datetime.js +17 -0
- package/cli/dist/utils/file-utils.js +19 -0
- package/cli/dist/utils/fsUtils.js +44 -0
- package/cli/{utils → dist/utils}/hash-utils.js +19 -130
- package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
- package/cli/dist/utils/showLogo.js +21 -0
- package/cli/dist/utils/unzip.js +41 -0
- package/cli/{utils → dist/utils}/zip.js +15 -51
- package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
- package/cli/functions/makeCodePushBundle.ts +26 -0
- package/cli/functions/prepareToBundleJS.ts +10 -0
- package/cli/functions/runExpoBundleCommand.ts +45 -0
- package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
- package/cli/functions/runReactNativeBundleCommand.ts +67 -0
- package/cli/index.ts +68 -0
- package/cli/package.json +35 -0
- package/cli/utils/datetime.ts +19 -0
- package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
- package/cli/utils/fsUtils.ts +50 -0
- package/cli/utils/hash-utils.ts +143 -0
- package/cli/utils/promisfied-fs.ts +19 -0
- package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
- package/cli/utils/unzip.ts +46 -0
- package/cli/utils/zip.ts +65 -0
- package/expo/plugin/withCodePush.js +14 -0
- package/expo/plugin/withCodePushAndroid.js +92 -0
- package/expo/plugin/withCodePushIos.js +143 -0
- package/ios/CodePush/CodePush.h +0 -16
- package/ios/CodePush/CodePush.m +30 -20
- package/ios/CodePush/CodePushConfig.m +1 -11
- package/ios/CodePush/CodePushPackage.m +12 -69
- package/ios/CodePush/CodePushUpdateUtils.m +1 -91
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
- 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 +244 -453
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/package.json +68 -42
- package/react-native.config.js +1 -1
- package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
- package/src/CodePush.js +947 -0
- package/{package-mixins.js → src/package-mixins.js} +1 -1
- package/{versioning → src/versioning}/BaseVersioning.js +12 -1
- package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
- package/typings/react-native-code-push.d.ts +559 -495
- package/.claude/commands/release.md +0 -78
- package/.claude/skills/npm-release/SKILL.md +0 -89
- package/CLAUDE.md +0 -83
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -972
- package/SECURITY.md +0 -41
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
- package/android/codepush.gradle +0 -162
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/babel.config.js +0 -3
- package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
- package/cli/commands/bundleCommand/index.js +0 -55
- package/cli/commands/common.js +0 -245
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
- package/cli/commands/createHistoryCommand/index.js +0 -95
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
- package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
- package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
- package/cli/commands/getPackageHashCommand/index.js +0 -42
- package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
- package/cli/commands/releaseCommand/index.js +0 -151
- package/cli/commands/releaseCommand/release.js +0 -121
- package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
- package/cli/commands/showHistoryCommand/index.js +0 -88
- package/cli/commands/updateHistoryCommand/index.js +0 -123
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
- package/cli/constant.js +0 -8
- package/cli/index.js +0 -63
- package/cli/utils/datetime.js +0 -22
- package/cli/utils/fsUtils.js +0 -64
- package/cli/utils/version.js +0 -26
- package/code-push.config.example.supabase.ts +0 -114
- package/code-push.config.js +0 -229
- package/code-push.config.ts +0 -175
- package/docs/api-android.md +0 -83
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -482
- package/docs/setup-ios.md +0 -280
- package/eslint.config.mjs +0 -32
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Common.h +0 -81
- package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
- package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
- package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
- package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
- package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
- package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
- package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
- package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
- package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
- package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
- package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
- package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
- package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
- package/scripts/generateBundledResourcesHash.js +0 -125
- package/scripts/getFilesInFolder.js +0 -19
- package/scripts/recordFilesBeforeBundleCommand.js +0 -41
- package/scripts/release.sh +0 -86
- package/tsconfig.json +0 -20
- package/tslint.json +0 -32
- /package/{logging.js → src/logging.js} +0 -0
- /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
- /package/{versioning → src/versioning}/index.js +0 -0
package/code-push.config.js
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
S3Client,
|
|
6
|
-
PutObjectCommand,
|
|
7
|
-
DeleteObjectCommand,
|
|
8
|
-
} = require('@aws-sdk/client-s3')
|
|
9
|
-
const fs = require('fs')
|
|
10
|
-
const axios = require('axios')
|
|
11
|
-
require('dotenv').config()
|
|
12
|
-
|
|
13
|
-
// CLI 인자에서 identifier 추출 (패키지 버그 workaround)
|
|
14
|
-
function getIdentifierFromArgs() {
|
|
15
|
-
const args = process.argv
|
|
16
|
-
const identifierIndex = args.findIndex(arg => arg === '-i' || arg === '--identifier')
|
|
17
|
-
if (identifierIndex !== -1 && args[identifierIndex + 1]) {
|
|
18
|
-
return args[identifierIndex + 1]
|
|
19
|
-
}
|
|
20
|
-
// --identifier=prd 형태 처리
|
|
21
|
-
const identifierArg = args.find(arg => arg.startsWith('--identifier='))
|
|
22
|
-
if (identifierArg) {
|
|
23
|
-
return identifierArg.split('=')[1]
|
|
24
|
-
}
|
|
25
|
-
return 'stg' // 기본값
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const s3Client = new S3Client({
|
|
29
|
-
region: process.env.AWS_REGION || 'ap-northeast-2',
|
|
30
|
-
credentials: {
|
|
31
|
-
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
32
|
-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
function getBucketName(identifier) {
|
|
37
|
-
// Legacy support: AWS_S3_BUCKET (단일 버킷)
|
|
38
|
-
if (process.env.AWS_S3_BUCKET) {
|
|
39
|
-
return process.env.AWS_S3_BUCKET
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
43
|
-
return actualIdentifier === 'prd'
|
|
44
|
-
? process.env.AWS_S3_BUCKET_PRD || 'a-algocare-c-prd'
|
|
45
|
-
: process.env.AWS_S3_BUCKET_STG || 'a-algocare-b-stg'
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function getCDNUrl(identifier) {
|
|
49
|
-
// Legacy support: CDN_URL (단일 CDN)
|
|
50
|
-
if (process.env.CDN_URL) {
|
|
51
|
-
return process.env.CDN_URL
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
55
|
-
return actualIdentifier === 'prd'
|
|
56
|
-
? process.env.CDN_URL_PRD || 'https://contents.algocare.link'
|
|
57
|
-
: process.env.CDN_URL_STG || 'https://contents-stg.algocare.link'
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function historyJsonFileRemotePath(app, platform, binaryVersion) {
|
|
61
|
-
return `histories/${app}/${platform}/${binaryVersion}.json`
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function bundleFileRemotePath(app, platform, fileName) {
|
|
65
|
-
return `bundles/${app}/${platform}/${fileName}`
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const Config = {
|
|
69
|
-
bundleUploader: async (source, app, platform, identifier) => {
|
|
70
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
71
|
-
const fileName = source.split('/').pop()
|
|
72
|
-
const fileContent = fs.readFileSync(source)
|
|
73
|
-
const remotePath = bundleFileRemotePath(app, platform, fileName)
|
|
74
|
-
const BUCKET_NAME = getBucketName(actualIdentifier)
|
|
75
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
76
|
-
|
|
77
|
-
console.log(`🔧 S3 업로드 설정:`)
|
|
78
|
-
console.log(` - Identifier: ${actualIdentifier}`)
|
|
79
|
-
console.log(` - Bucket: ${BUCKET_NAME}`)
|
|
80
|
-
console.log(` - Region: ${process.env.AWS_REGION || 'ap-northeast-2'}`)
|
|
81
|
-
console.log(` - Remote Path: ${remotePath}`)
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
await s3Client.send(
|
|
85
|
-
new PutObjectCommand({
|
|
86
|
-
Bucket: BUCKET_NAME,
|
|
87
|
-
Key: remotePath,
|
|
88
|
-
Body: fileContent,
|
|
89
|
-
ContentType: 'application/zip',
|
|
90
|
-
})
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
console.log('Bundle File uploaded:', `${CDN_URL}/${remotePath}`)
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
downloadUrl: `${CDN_URL}/${remotePath}`,
|
|
97
|
-
}
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.error('Error uploading bundle:', error)
|
|
100
|
-
throw error
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
getReleaseHistory: async (app, targetBinaryVersion, platform, identifier) => {
|
|
104
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
105
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
106
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
107
|
-
app,
|
|
108
|
-
platform,
|
|
109
|
-
targetBinaryVersion
|
|
110
|
-
)
|
|
111
|
-
const { data } = await axios.get(`${CDN_URL}/${remoteJsonPath}`)
|
|
112
|
-
return data
|
|
113
|
-
},
|
|
114
|
-
setReleaseHistory: async (
|
|
115
|
-
targetBinaryVersion,
|
|
116
|
-
jsonFilePath,
|
|
117
|
-
releaseInfo,
|
|
118
|
-
app,
|
|
119
|
-
platform,
|
|
120
|
-
identifier
|
|
121
|
-
) => {
|
|
122
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
123
|
-
const BUCKET_NAME = getBucketName(actualIdentifier)
|
|
124
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
125
|
-
const fileContent = fs.readFileSync(jsonFilePath, 'utf8')
|
|
126
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
127
|
-
app,
|
|
128
|
-
platform,
|
|
129
|
-
targetBinaryVersion
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
await s3Client.send(
|
|
134
|
-
new PutObjectCommand({
|
|
135
|
-
Bucket: BUCKET_NAME,
|
|
136
|
-
Key: remoteJsonPath,
|
|
137
|
-
Body: fileContent,
|
|
138
|
-
ContentType: 'application/json',
|
|
139
|
-
CacheControl: 'max-age=5',
|
|
140
|
-
})
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
console.log(
|
|
144
|
-
'Release history File uploaded:',
|
|
145
|
-
`${CDN_URL}/${remoteJsonPath}`
|
|
146
|
-
)
|
|
147
|
-
} catch (error) {
|
|
148
|
-
console.error('Error uploading release history:', error)
|
|
149
|
-
throw error
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
getBinaryVersionList: async (app, platform, identifier) => {
|
|
153
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
154
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
155
|
-
const remoteJsonPath = `histories/${app}/${platform}/list.json`
|
|
156
|
-
let currentList = {}
|
|
157
|
-
try {
|
|
158
|
-
console.log('Getting existing version list file')
|
|
159
|
-
const { data } = await axios.get(`${CDN_URL}/${remoteJsonPath}`)
|
|
160
|
-
currentList = { ...data }
|
|
161
|
-
} catch (error) {
|
|
162
|
-
console.error(
|
|
163
|
-
'Error occurred while getting existing version list file, maybe it is not exist.',
|
|
164
|
-
error.status
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
return currentList
|
|
168
|
-
},
|
|
169
|
-
setBinaryVersionList: async (targetVersion, jsonFilePath, app, platform, identifier) => {
|
|
170
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
171
|
-
const BUCKET_NAME = getBucketName(actualIdentifier)
|
|
172
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
173
|
-
const remoteJsonPath = `histories/${app}/${platform}/list.json`
|
|
174
|
-
|
|
175
|
-
const currentList = JSON.parse(fs.readFileSync(jsonFilePath, 'utf8'))
|
|
176
|
-
const targetVersionPath = historyJsonFileRemotePath(
|
|
177
|
-
app,
|
|
178
|
-
platform,
|
|
179
|
-
targetVersion
|
|
180
|
-
)
|
|
181
|
-
currentList[targetVersion] = `${CDN_URL}/${targetVersionPath}`
|
|
182
|
-
|
|
183
|
-
try {
|
|
184
|
-
await s3Client.send(
|
|
185
|
-
new PutObjectCommand({
|
|
186
|
-
Bucket: BUCKET_NAME,
|
|
187
|
-
Key: remoteJsonPath,
|
|
188
|
-
Body: JSON.stringify(currentList),
|
|
189
|
-
ContentType: 'application/json',
|
|
190
|
-
CacheControl: 'max-age=5',
|
|
191
|
-
})
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
console.log(
|
|
195
|
-
'Binary version list uploaded:',
|
|
196
|
-
`${CDN_URL}/${remoteJsonPath}`,
|
|
197
|
-
'\nContent:',
|
|
198
|
-
JSON.stringify(currentList, null, 2)
|
|
199
|
-
)
|
|
200
|
-
} catch (error) {
|
|
201
|
-
console.error('Error uploading binary version list:', error)
|
|
202
|
-
throw error
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
removeReleaseHistory: async (app, targetBinaryVersion, platform, identifier) => {
|
|
206
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
207
|
-
const BUCKET_NAME = getBucketName(actualIdentifier)
|
|
208
|
-
const CDN_URL = getCDNUrl(actualIdentifier)
|
|
209
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
210
|
-
app,
|
|
211
|
-
platform,
|
|
212
|
-
targetBinaryVersion
|
|
213
|
-
)
|
|
214
|
-
try {
|
|
215
|
-
await s3Client.send(
|
|
216
|
-
new DeleteObjectCommand({
|
|
217
|
-
Bucket: BUCKET_NAME,
|
|
218
|
-
Key: remoteJsonPath,
|
|
219
|
-
})
|
|
220
|
-
)
|
|
221
|
-
|
|
222
|
-
console.log('Release history removed:', `${CDN_URL}/${remoteJsonPath}`)
|
|
223
|
-
} catch (error) {
|
|
224
|
-
console.error('Error removing release history:', error)
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
module.exports = Config
|
package/code-push.config.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
CliConfigInterface,
|
|
6
|
-
ReleaseHistoryInterface,
|
|
7
|
-
} from '@algocare/react-native-code-push'
|
|
8
|
-
import * as fs from 'fs'
|
|
9
|
-
import axios from 'axios'
|
|
10
|
-
import { S3Client, PutObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3'
|
|
11
|
-
import * as dotenv from 'dotenv'
|
|
12
|
-
dotenv.config()
|
|
13
|
-
|
|
14
|
-
// CLI 인자에서 identifier 추출 (패키지 버그 workaround)
|
|
15
|
-
function getIdentifierFromArgs(): 'stg' | 'prd' {
|
|
16
|
-
const args = process.argv
|
|
17
|
-
const identifierIndex = args.findIndex(arg => arg === '-i' || arg === '--identifier')
|
|
18
|
-
if (identifierIndex !== -1 && args[identifierIndex + 1]) {
|
|
19
|
-
return args[identifierIndex + 1] as 'stg' | 'prd'
|
|
20
|
-
}
|
|
21
|
-
// --identifier=prd 형태 처리
|
|
22
|
-
const identifierArg = args.find(arg => arg.startsWith('--identifier='))
|
|
23
|
-
if (identifierArg) {
|
|
24
|
-
return identifierArg.split('=')[1] as 'stg' | 'prd'
|
|
25
|
-
}
|
|
26
|
-
return 'stg' // 기본값
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const s3Client = new S3Client({
|
|
30
|
-
region: process.env.AWS_REGION || 'ap-northeast-2',
|
|
31
|
-
credentials: {
|
|
32
|
-
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
33
|
-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
function getBucketName(identifier?: 'stg' | 'prd') {
|
|
38
|
-
// Legacy support: AWS_S3_BUCKET (단일 버킷)
|
|
39
|
-
if (process.env.AWS_S3_BUCKET) {
|
|
40
|
-
return process.env.AWS_S3_BUCKET
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
44
|
-
return actualIdentifier === 'prd'
|
|
45
|
-
? process.env.AWS_S3_BUCKET_PRD || 'a-algocare-c-prd'
|
|
46
|
-
: process.env.AWS_S3_BUCKET_STG || 'a-algocare-b-stg'
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getCDNUrl(identifier?: 'stg' | 'prd') {
|
|
50
|
-
// Legacy support: CDN_URL (단일 CDN)
|
|
51
|
-
if (process.env.CDN_URL) {
|
|
52
|
-
return process.env.CDN_URL
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const actualIdentifier = identifier || getIdentifierFromArgs()
|
|
56
|
-
return actualIdentifier === 'prd'
|
|
57
|
-
? process.env.CDN_URL_PRD || 'https://contents.algocare.link'
|
|
58
|
-
: process.env.CDN_URL_STG || 'https://contents-stg.algocare.link'
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function historyJsonFileRemotePath(
|
|
62
|
-
app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
|
|
63
|
-
platform: 'ios' | 'android',
|
|
64
|
-
binaryVersion: string
|
|
65
|
-
) {
|
|
66
|
-
// home-mobile은 platform 구분 없이 단일 경로 사용
|
|
67
|
-
if (app === 'home-mobile') {
|
|
68
|
-
return `histories/${app}/${binaryVersion}.json`
|
|
69
|
-
}
|
|
70
|
-
return `histories/${app}/${platform}/${binaryVersion}.json`
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function bundleFileRemotePath(
|
|
74
|
-
app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
|
|
75
|
-
platform: 'ios' | 'android',
|
|
76
|
-
fileName: string
|
|
77
|
-
) {
|
|
78
|
-
// home-mobile은 platform 구분 없이 단일 경로 사용
|
|
79
|
-
if (app === 'home-mobile') {
|
|
80
|
-
return `bundles/${app}/${fileName}`
|
|
81
|
-
}
|
|
82
|
-
return `bundles/${app}/${platform}/${fileName}`
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const Config: CliConfigInterface = {
|
|
86
|
-
bundleUploader: async (
|
|
87
|
-
source: string,
|
|
88
|
-
app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
|
|
89
|
-
platform: 'ios' | 'android',
|
|
90
|
-
identifier: 'stg' | 'prd'
|
|
91
|
-
): Promise<{ downloadUrl: string }> => {
|
|
92
|
-
const fileName = source.split('/').pop()
|
|
93
|
-
const fileContent = fs.readFileSync(source)
|
|
94
|
-
const remotePath = bundleFileRemotePath(app, platform, fileName!)
|
|
95
|
-
const BUCKET_NAME = getBucketName(identifier)
|
|
96
|
-
const CDN_URL = getCDNUrl(identifier)
|
|
97
|
-
|
|
98
|
-
try {
|
|
99
|
-
await s3Client.send(
|
|
100
|
-
new PutObjectCommand({
|
|
101
|
-
Bucket: BUCKET_NAME,
|
|
102
|
-
Key: remotePath,
|
|
103
|
-
Body: fileContent,
|
|
104
|
-
ContentType: 'application/zip',
|
|
105
|
-
})
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
console.log('Bundle File uploaded:', `${CDN_URL}/${remotePath}`)
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
downloadUrl: `${CDN_URL}/${remotePath}`,
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
console.error('Error uploading bundle:', error)
|
|
115
|
-
throw error
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
getReleaseHistory: async (
|
|
120
|
-
app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
|
|
121
|
-
targetBinaryVersion: string,
|
|
122
|
-
platform: 'ios' | 'android',
|
|
123
|
-
identifier: 'stg' | 'prd'
|
|
124
|
-
): Promise<ReleaseHistoryInterface> => {
|
|
125
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
126
|
-
app,
|
|
127
|
-
platform,
|
|
128
|
-
targetBinaryVersion
|
|
129
|
-
)
|
|
130
|
-
const CDN_URL = getCDNUrl(identifier)
|
|
131
|
-
|
|
132
|
-
const { data } = await axios.get(`${CDN_URL}/${remoteJsonPath}`)
|
|
133
|
-
return data as ReleaseHistoryInterface
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
setReleaseHistory: async (
|
|
137
|
-
targetBinaryVersion: string,
|
|
138
|
-
jsonFilePath: string,
|
|
139
|
-
releaseInfo: ReleaseHistoryInterface,
|
|
140
|
-
app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
|
|
141
|
-
platform: 'ios' | 'android',
|
|
142
|
-
identifier: 'stg' | 'prd'
|
|
143
|
-
): Promise<void> => {
|
|
144
|
-
const fileContent = fs.readFileSync(jsonFilePath, 'utf8')
|
|
145
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
146
|
-
app,
|
|
147
|
-
platform,
|
|
148
|
-
targetBinaryVersion
|
|
149
|
-
)
|
|
150
|
-
const BUCKET_NAME = getBucketName(identifier)
|
|
151
|
-
const CDN_URL = getCDNUrl(identifier)
|
|
152
|
-
|
|
153
|
-
try {
|
|
154
|
-
await s3Client.send(
|
|
155
|
-
new PutObjectCommand({
|
|
156
|
-
Bucket: BUCKET_NAME,
|
|
157
|
-
Key: remoteJsonPath,
|
|
158
|
-
Body: fileContent,
|
|
159
|
-
ContentType: 'application/json',
|
|
160
|
-
CacheControl: 'max-age=5',
|
|
161
|
-
})
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
console.log(
|
|
165
|
-
'Release history File uploaded:',
|
|
166
|
-
`${CDN_URL}/${remoteJsonPath}`
|
|
167
|
-
)
|
|
168
|
-
} catch (error) {
|
|
169
|
-
console.error('Error uploading release history:', error)
|
|
170
|
-
throw error
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
module.exports = Config
|
package/docs/api-android.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
### Java API Reference (Android)
|
|
2
|
-
|
|
3
|
-
### API for React Native 0.60 version and above
|
|
4
|
-
|
|
5
|
-
Since `autolinking` uses `react-native.config.js` to link plugins, constructors are specified in that file. But you can override custom variables to manage the CodePush plugin by placing these values in string resources.
|
|
6
|
-
|
|
7
|
-
* __Public Key__ - used for bundle verification in the Code Signing Feature. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
|
|
8
|
-
To set the public key, you should add the content of the public key to `strings.xml` with name `CodePushPublicKey`. CodePush automatically gets this property and enables the Code Signing feature. For example:
|
|
9
|
-
```xml
|
|
10
|
-
<string moduleConfig="true" name="CodePushPublicKey">your-public-key</string>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
* __Server Url__ - used for specifying CodePush Server Url.
|
|
14
|
-
The Default value: "https://codepush.appcenter.ms/" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example:
|
|
15
|
-
```xml
|
|
16
|
-
<string moduleConfig="true" name="CodePushServerUrl">https://yourcodepush.server.com</string>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### API for React Native lower than 0.60
|
|
20
|
-
|
|
21
|
-
The Java API is made available by importing the `com.microsoft.codepush.react.CodePush` class into your `MainActivity.java` file, and consists of a single public class named `CodePush`.
|
|
22
|
-
|
|
23
|
-
#### CodePush
|
|
24
|
-
|
|
25
|
-
Constructs the CodePush client runtime and represents the `ReactPackage` instance that you add to you app's list of packages.
|
|
26
|
-
|
|
27
|
-
##### Constructors
|
|
28
|
-
|
|
29
|
-
- __CodePush(String deploymentKey, Activity mainActivity)__ - Creates a new instance of the CodePush runtime, that will be used to query the service for updates via the provided deployment key. The `mainActivity` parameter should always be set to `this` when configuring your React packages list inside the `MainActivity` class. This constructor puts the CodePush runtime into "release mode", so if you want to enable debugging behavior, use the following constructor instead.
|
|
30
|
-
|
|
31
|
-
- __CodePush(String deploymentKey, Activity mainActivity, bool isDebugMode)__ - Equivalent to the previous constructor but allows you to specify whether you want the CodePush runtime to be in debug mode or not. When using this constructor, the `isDebugMode` parameter should always be set to `BuildConfig.DEBUG` in order to stay synchronized with your build type. When putting CodePush into debug mode, the following behaviors are enabled:
|
|
32
|
-
|
|
33
|
-
1. Old CodePush updates aren't deleted from storage whenever a new binary is deployed to the emulator/device. This behavior enables you to deploy new binaries, without bumping the version during development, and without continuously getting the same update every time your app calls `sync`.
|
|
34
|
-
|
|
35
|
-
2. The local cache that the React Native runtime maintains in debug mode is deleted whenever a CodePush update is installed. This ensures that when the app is restarted after an update is applied, you will see the expected changes. As soon as [this PR](https://github.com/facebook/react-native/pull/4738) is merged, we won't need to do this anymore.
|
|
36
|
-
|
|
37
|
-
- __CodePush(String deploymentKey, Context context, boolean isDebugMode, Integer publicKeyResourceDescriptor)__ - Equivalent to the previous constructor, but allows you to specify the public key resource descriptor needed to read public key content. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
|
|
38
|
-
|
|
39
|
-
- __CodePush(String deploymentKey, Context context, boolean isDebugMode, String serverUrl)__ Constructor allows you to specify CodePush Server Url. The Default value: `"https://codepush.appcenter.ms/"` is overridden by value specified in `serverUrl`.
|
|
40
|
-
|
|
41
|
-
##### Builder
|
|
42
|
-
|
|
43
|
-
As an alternative to constructors *you can also use `CodePushBuilder`* to setup a CodePush instance configured with *only parameters you want*.
|
|
44
|
-
|
|
45
|
-
```java
|
|
46
|
-
@Override
|
|
47
|
-
protected List<ReactPackage> getPackages() {
|
|
48
|
-
return Arrays.<ReactPackage>asList(
|
|
49
|
-
new MainReactPackage(),
|
|
50
|
-
new CodePushBuilder("deployment-key-here",getApplicationContext())
|
|
51
|
-
.setIsDebugMode(BuildConfig.DEBUG)
|
|
52
|
-
.setPublicKeyResourceDescriptor(R.string.publicKey)
|
|
53
|
-
.setServerUrl("https://yourcodepush.server.com")
|
|
54
|
-
.build() //return configured CodePush instance
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
`CodePushBuilder` methods:
|
|
60
|
-
|
|
61
|
-
* __public CodePushBuilder(String deploymentKey, Context context)__ - setup same parameters as via __CodePush(String deploymentKey, Activity mainActivity)__
|
|
62
|
-
|
|
63
|
-
* __public CodePushBuilder setIsDebugMode(boolean isDebugMode)__ - allows you to specify whether you want the CodePush runtime to be in debug mode or not. Default value: `false`.
|
|
64
|
-
|
|
65
|
-
* __public CodePushBuilder setServerUrl(String serverUrl)__ - allows you to specify CodePush Server Url. Default value: `"https://codepush.appcenter.ms/"`.
|
|
66
|
-
|
|
67
|
-
* __public CodePushBuilder setPublicKeyResourceDescriptor(int publicKeyResourceDescriptor)__ - allows you to specify Public Key resource descriptor which will be used for reading Public Key content for `strings.xml` file. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more detailed information about purpose of this parameter.
|
|
68
|
-
|
|
69
|
-
* __public CodePush build()__ - return configured `CodePush` instance.
|
|
70
|
-
|
|
71
|
-
##### Public Methods
|
|
72
|
-
|
|
73
|
-
- __setDeploymentKey(String deploymentKey)__ - Sets the deployment key that the app should use when querying for updates. This is a dynamic alternative to setting the deployment key in Codepush constructor/builder and/or specifying a deployment key in JS when calling `checkForUpdate` or `sync`.
|
|
74
|
-
|
|
75
|
-
##### Static Methods
|
|
76
|
-
|
|
77
|
-
- __getBundleUrl()__ - Returns the path to the most recent version of your app's JS bundle file, assuming that the resource name is `index.android.bundle`. If your app is using a different bundle name, then use the overloaded version of this method which allows specifying it. This method has the same resolution behavior as the Objective-C equivalent described above.
|
|
78
|
-
|
|
79
|
-
- __getBundleUrl(String bundleName)__ - Returns the path to the most recent version of your app's JS bundle file, using the specified resource name (like `index.android.bundle`). This method has the same resolution behavior as the Objective-C equivalent described above.
|
|
80
|
-
|
|
81
|
-
- __getPackageFolder()__ - Returns the path to the current update folder.
|
|
82
|
-
|
|
83
|
-
- __overrideAppVersion(String appVersionOverride)__ - Sets the version of the application's binary interface, which would otherwise default to the Play Store version specified as the `versionName` in the `build.gradle`. This should be called a single time, before the CodePush instance is constructed.
|
package/docs/api-ios.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
### Objective-C API Reference (iOS)
|
|
2
|
-
|
|
3
|
-
The Objective-C API is made available by importing the `CodePush.h` header into your `AppDelegate.m` file, and consists of a single public class named `CodePush`.
|
|
4
|
-
|
|
5
|
-
#### CodePush
|
|
6
|
-
|
|
7
|
-
Contains static methods for retreiving the `NSURL` that represents the most recent JavaScript bundle file, and can be passed to the `RCTRootView`'s `initWithBundleURL` method when bootstrapping your app in the `AppDelegate.m` file.
|
|
8
|
-
|
|
9
|
-
The `CodePush` class' methods can be thought of as composite resolvers which always load the appropriate bundle, in order to accommodate the following scenarios:
|
|
10
|
-
|
|
11
|
-
1. When an end-user installs your app from the store (like `1.0.0`), they will get the JS bundle that is contained within the binary. This is the behavior you would get without using CodePush, but we make sure it doesn't break :)
|
|
12
|
-
|
|
13
|
-
2. As soon as you begin releasing CodePush updates, your end-users will get the JS bundle that represents the latest release for the configured deployment. This is the behavior that allows you to iterate beyond what you shipped to the store.
|
|
14
|
-
|
|
15
|
-
3. As soon as you release an update to the app store (like `1.1.0`), and your end-users update it, they will once again get the JS bundle that is contained within the binary. This behavior ensures that CodePush updates that targetted a previous binary version aren't used (since we don't know if they would work), and your end-users always have a working version of your app.
|
|
16
|
-
|
|
17
|
-
4. Repeat #2 and #3 as the CodePush releases and app store releases continue on into infinity (and beyond?)
|
|
18
|
-
|
|
19
|
-
Because of this behavior, you can safely deploy updates to both the app store(s) and CodePush as necesary, and rest assured that your end-users will always get the most recent version.
|
|
20
|
-
|
|
21
|
-
##### Methods
|
|
22
|
-
|
|
23
|
-
- __(NSURL \*)bundleURL__ - Returns the most recent JS bundle `NSURL` as described above. This method assumes that the name of the JS bundle contained within your app binary is `main.jsbundle`.
|
|
24
|
-
|
|
25
|
-
- __(NSURL \*)bundleURLForResource:(NSString \*)resourceName__ - Equivalent to the `bundleURL` method, but also allows customizing the name of the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `main` (which is the default convention). This method assumes that the JS bundle's extension is `*.jsbundle`.
|
|
26
|
-
|
|
27
|
-
- __(NSURL \*)bundleURLForResource:(NSString \*)resourceName withExtension:(NSString \*)resourceExtension__: Equivalent to the `bundleURLForResource:` method, but also allows customizing the extension used by the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `*.jsbundle` (which is the default convention).
|
|
28
|
-
|
|
29
|
-
- __(void)overrideAppVersion:(NSString \*)appVersionOverride__ - Sets the version of the application's binary interface, which would otherwise default to the App Store version specified as the `CFBundleShortVersionString` in the `Info.plist`. This should be called a single time, before the bundle URL is loaded.
|
|
30
|
-
|
|
31
|
-
- __(void)setDeploymentKey:(NSString \*)deploymentKey__ - Sets the deployment key that the app should use when querying for updates. This is a dynamic alternative to setting the deployment key in your `Info.plist` and/or specifying a deployment key in JS when calling `checkForUpdate` or `sync`.
|