@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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>NSPrivacyTracking</key>
|
|
6
|
+
<false />
|
|
7
|
+
<key>NSPrivacyCollectedDataTypes</key>
|
|
8
|
+
<array />
|
|
9
|
+
<key>NSPrivacyTrackingDomains</key>
|
|
10
|
+
<array />
|
|
11
|
+
<key>NSPrivacyAccessedAPITypes</key>
|
|
12
|
+
<array>
|
|
13
|
+
<dict>
|
|
14
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
15
|
+
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
16
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
17
|
+
<array>
|
|
18
|
+
<string>0A2A.1</string>
|
|
19
|
+
</array>
|
|
20
|
+
</dict>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
23
|
+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
24
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
25
|
+
<array>
|
|
26
|
+
<string>CA92.1</string>
|
|
27
|
+
</array>
|
|
28
|
+
</dict>
|
|
29
|
+
</array>
|
|
30
|
+
</dict>
|
|
31
|
+
</plist>
|
package/logging.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NativeEventEmitter } from "react-native";
|
|
2
|
+
import log from "./logging";
|
|
3
|
+
|
|
4
|
+
// This function is used to augment remote and local
|
|
5
|
+
// package objects with additional functionality/properties
|
|
6
|
+
// beyond what is included in the metadata sent by the server.
|
|
7
|
+
module.exports = (NativeCodePush) => {
|
|
8
|
+
const remote = (reportStatusDownload) => {
|
|
9
|
+
return {
|
|
10
|
+
async download(downloadProgressCallback) {
|
|
11
|
+
if (!this.downloadUrl) {
|
|
12
|
+
throw new Error("Cannot download an update without a download url");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let downloadProgressSubscription;
|
|
16
|
+
if (downloadProgressCallback) {
|
|
17
|
+
const codePushEventEmitter = new NativeEventEmitter(NativeCodePush);
|
|
18
|
+
// Use event subscription to obtain download progress.
|
|
19
|
+
downloadProgressSubscription = codePushEventEmitter.addListener(
|
|
20
|
+
"CodePushDownloadProgress",
|
|
21
|
+
downloadProgressCallback
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Use the downloaded package info. Native code will save the package info
|
|
26
|
+
// so that the client knows what the current package version is.
|
|
27
|
+
try {
|
|
28
|
+
const updatePackageCopy = Object.assign({}, this);
|
|
29
|
+
Object.keys(updatePackageCopy).forEach((key) => (typeof updatePackageCopy[key] === 'function') && delete updatePackageCopy[key]);
|
|
30
|
+
|
|
31
|
+
const downloadedPackage = await NativeCodePush.downloadUpdate(updatePackageCopy, !!downloadProgressCallback);
|
|
32
|
+
|
|
33
|
+
if (reportStatusDownload) {
|
|
34
|
+
reportStatusDownload(this)
|
|
35
|
+
.catch((err) => {
|
|
36
|
+
log(`Report download status failed: ${err}`);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return { ...downloadedPackage, ...local };
|
|
41
|
+
} finally {
|
|
42
|
+
downloadProgressSubscription && downloadProgressSubscription.remove();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
isPending: false // A remote package could never be in a pending state
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const local = {
|
|
51
|
+
async install(installMode = NativeCodePush.codePushInstallModeOnNextRestart, minimumBackgroundDuration = 0, updateInstalledCallback) {
|
|
52
|
+
const localPackage = this;
|
|
53
|
+
const localPackageCopy = Object.assign({}, localPackage); // In dev mode, React Native deep freezes any object queued over the bridge
|
|
54
|
+
await NativeCodePush.installUpdate(localPackageCopy, installMode, minimumBackgroundDuration);
|
|
55
|
+
updateInstalledCallback && updateInstalledCallback();
|
|
56
|
+
if (installMode == NativeCodePush.codePushInstallModeImmediate) {
|
|
57
|
+
NativeCodePush.restartApp(false);
|
|
58
|
+
} else {
|
|
59
|
+
NativeCodePush.clearPendingRestart();
|
|
60
|
+
localPackage.isPending = true; // Mark the package as pending since it hasn't been applied yet
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
isPending: false // A local package wouldn't be pending until it was installed
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return { local, remote };
|
|
68
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@novacraft-engineering/pulsar-code-push",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Pulsar OTA client for React Native — over-the-air JavaScript updates. A CodePush-compatible client (RevoPush lineage) pointed at Pulsar.",
|
|
5
|
+
"main": "CodePush.js",
|
|
6
|
+
"typings": "typings/react-native-code-push.d.ts",
|
|
7
|
+
"homepage": "https://pulsar.novacraft.africa",
|
|
8
|
+
"keywords": ["react-native", "code-push", "codepush", "pulsar", "ota", "over-the-air", "hot-update"],
|
|
9
|
+
"author": "Novacraft Engineering",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/Novacraft-Africa/pulsar-code-push.git"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {"access": "public"},
|
|
16
|
+
"files": [
|
|
17
|
+
"CodePush.js",
|
|
18
|
+
"AlertAdapter.js",
|
|
19
|
+
"logging.js",
|
|
20
|
+
"package-mixins.js",
|
|
21
|
+
"request-fetch-adapter.js",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"CodePush.podspec",
|
|
24
|
+
"android",
|
|
25
|
+
"ios",
|
|
26
|
+
"typings",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"code-push": "4.2.3",
|
|
32
|
+
"glob": "^7.1.7",
|
|
33
|
+
"hoist-non-react-statics": "^3.3.2",
|
|
34
|
+
"inquirer": "^8.1.5",
|
|
35
|
+
"plist": "^3.0.4",
|
|
36
|
+
"semver": "^7.3.5",
|
|
37
|
+
"xcode": "3.0.1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": ">=18.0.0",
|
|
41
|
+
"react-native": ">=0.70.0"
|
|
42
|
+
},
|
|
43
|
+
"rnpm": {
|
|
44
|
+
"android": {
|
|
45
|
+
"packageInstance": "new CodePush(getResources().getString(R.string.CodePushDeploymentKey), getApplicationContext(), BuildConfig.DEBUG)"
|
|
46
|
+
},
|
|
47
|
+
"ios": {
|
|
48
|
+
"sharedLibraries": ["libz"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const packageJson = require("./package.json");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async request(verb, url, requestBody, callback) {
|
|
5
|
+
if (typeof requestBody === "function") {
|
|
6
|
+
callback = requestBody;
|
|
7
|
+
requestBody = null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const headers = {
|
|
11
|
+
"Accept": "application/json",
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
"X-CodePush-Plugin-Name": packageJson.name,
|
|
14
|
+
"X-CodePush-Plugin-Version": packageJson.version,
|
|
15
|
+
"X-CodePush-SDK-Version": packageJson.dependencies["code-push"]
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
if (requestBody && typeof requestBody === "object") {
|
|
19
|
+
requestBody = JSON.stringify(requestBody);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const response = await fetch(url, {
|
|
24
|
+
method: getHttpMethodName(verb),
|
|
25
|
+
headers: headers,
|
|
26
|
+
body: requestBody
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const statusCode = response.status;
|
|
30
|
+
const body = await response.text();
|
|
31
|
+
callback(null, { statusCode, body });
|
|
32
|
+
} catch (err) {
|
|
33
|
+
callback(err);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function getHttpMethodName(verb) {
|
|
39
|
+
// Note: This should stay in sync with the enum definition in
|
|
40
|
+
// https://github.com/microsoft/code-push/blob/master/sdk/script/acquisition-sdk.ts#L6
|
|
41
|
+
return [
|
|
42
|
+
"GET",
|
|
43
|
+
"HEAD",
|
|
44
|
+
"POST",
|
|
45
|
+
"PUT",
|
|
46
|
+
"DELETE",
|
|
47
|
+
"TRACE",
|
|
48
|
+
"OPTIONS",
|
|
49
|
+
"CONNECT",
|
|
50
|
+
"PATCH"
|
|
51
|
+
][verb];
|
|
52
|
+
}
|