Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ What actually happens?

### Reproducible Demo

* Download https://github.com/microsoft/react-native-code-push/archive/master.zip and unzip. From `Examples` folder run `node create-app.js appName react-native@0.71.19 react-native-code-push@9.0.1` command to generate plain CodePushified React Native app. Please see description on top of `create-app.js` file content if needed
* Download https://github.com/codemagic-ci-cd/react-native-code-push/archive/master.zip and unzip. From `Examples` folder run `node create-app.js appName react-native@0.71.19 react-native-code-push@9.0.1` command to generate plain CodePushified React Native app. Please see description on top of `create-app.js` file content if needed
* If you can't reproduce the bug on it, provide us as much info as possible about your project

### Environment
Expand Down
2 changes: 1 addition & 1 deletion CodePush.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.author = package['author']
s.license = package['license']
s.homepage = package['homepage']
s.source = { :git => 'https://github.com/CodePushNext/react-native-code-push.git', :tag => "v#{s.version}"}
s.source = { :git => 'https://github.com/codemagic-ci-cd/react-native-code-push.git', :tag => "v#{s.version}"}
s.ios.deployment_target = '15.5'
s.tvos.deployment_target = '15.5'
s.preserve_paths = '*.js'
Expand Down
8 changes: 3 additions & 5 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Microsoft CodePush Plugin for React Native
Copyright (c) Microsoft Corporation.

Copyright (c) Microsoft Corporation

All rights reserved.
Additional modifications copyright (c) Codemagic.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65 changes: 13 additions & 52 deletions README.md

Large diffs are not rendered by default.

42 changes: 5 additions & 37 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
# Security Policy

## Security
## Reporting a Vulnerability

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you discover a security vulnerability in this project, please report it through GitHub's private vulnerability reporting:

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
**https://github.com/codemagic-ci-cd/react-native-code-push/security/advisories/new**

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
Please do not open a public issue for security vulnerabilities.
8 changes: 4 additions & 4 deletions code-push-plugin-testing-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/microsoft/code-push.git"
"url": "git+https://github.com/codemagic-ci-cd/react-native-code-push.git"
},
"author": {
"name": "Microsoft Corporation"
"name": "Codemagic"
},
"license": "MIT",
"homepage": "https://microsoft.github.io/code-push",
"homepage": "https://github.com/codemagic-ci-cd/react-native-code-push",
"dependencies": {
"@types/uuid": "^8.3.1",
"base-64": "^1.0.0",
Expand All @@ -27,7 +27,7 @@
"uuid": "^8.3.2"
},
"bugs": {
"url": "https://github.com/microsoft/code-push/issues"
"url": "https://github.com/codemagic-ci-cd/react-native-code-push/issues"
},
"readme": "ERROR: No README data found!",
"_id": "code-push-plugin-testing-framework@0.0.1",
Expand Down
4 changes: 2 additions & 2 deletions docs/api-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Since `autolinking` uses `react-native.config.js` to link plugins, constructors
```

- **Server Url** - used for specifying CodePush Server Url.
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:
The default server URL is configurable and can be 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:
```xml
<string moduleConfig="true" name="CodePushServerUrl">https://yourcodepush.server.com</string>
```
Expand All @@ -35,7 +35,7 @@ Constructs the CodePush client runtime and represents the `ReactPackage` instanc

- **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.

- **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`.
- **CodePush(String deploymentKey, Context context, boolean isDebugMode, String serverUrl)** Constructor allows you to specify CodePush Server Url. The default server URL is configurable and is overridden by value specified in `serverUrl`.

##### Public Methods

Expand Down
2 changes: 1 addition & 1 deletion docs/api-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The `codePush` decorator accepts an "options" object that allows you to customiz

* __minimumBackgroundDuration__ *(Number)* - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.

* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/microsoft/react-native-code-push#app-store).
* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/codemagic-ci-cd/react-native-code-push#app-store).

The following list represents the available options and their defaults:

Expand Down
4 changes: 2 additions & 2 deletions docs/multi-deployment-testing-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

> NOTE
>
> Complete demo configured with "multi-deployment testing" feature is [here](https://github.com/microsoft/react-native-code-push/files/1314118/rncp1004.zip).
> Complete demo configured with "multi-deployment testing" feature is [here](https://github.com/codemagic-ci-cd/react-native-code-push/files/1314118/rncp1004.zip).

The [Android Gradle plugin](https://google.github.io/android-gradle-dsl/current/index.html) allows you to define custom config settings for each "build type" (like debug, release). This mechanism allows you to easily configure your debug builds to use your CodePush staging deployment key and your release builds to use your CodePush production deployment key.

*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` from your terminal.*
*NOTE: As a reminder, you can retrieve these keys using your CodePush CLI.*

To set this up, perform the following steps:

Expand Down
8 changes: 4 additions & 4 deletions docs/multi-deployment-testing-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
> NOTE
>
> Complete demos configured with "multi-deployment testing" feature are [here]:
> * **without using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1259957/rncp976.copy.zip)
> * **using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1172217/rncp893.copy.zip)
> * **without using cocoa pods**: [link](https://github.com/codemagic-ci-cd/react-native-code-push/files/1259957/rncp976.copy.zip)
> * **using cocoa pods**: [link](https://github.com/codemagic-ci-cd/react-native-code-push/files/1172217/rncp893.copy.zip)

Xcode allows you to define custom build settings for each "configuration" (like debug, release), which can then be referenced as the value of keys within the `Info.plist` file (like the `CodePushDeploymentKey` setting). This mechanism allows you to easily configure your builds to produce binaries, which are configured to synchronize with different CodePush deployments.

Expand Down Expand Up @@ -44,7 +44,7 @@ To set this up, perform the following steps:

![Setting Keys](https://cloud.githubusercontent.com/assets/8598682/16821919/fc1eac4a-490d-11e6-9b11-128129c24b80.png)

*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` from your terminal.*
*NOTE: As a reminder, you can retrieve these keys using your CodePush CLI.*

9. Open your project's `Info.plist` file and change the value of your `CodePushDeploymentKey` entry to `$(CODEPUSH_KEY)`

Expand All @@ -54,6 +54,6 @@ And that's it! Now when you run or build your app, your staging builds will auto

*NOTE: CocoaPods users may need to run `pod install` before building with their new release configuration.*

*Note: If you encounter the error message `ld: library not found for ...`, please consult [this issue](https://github.com/microsoft/react-native-code-push/issues/426) for a possible solution.*
*Note: If you encounter the error message `ld: library not found for ...`, please consult [this issue](https://github.com/codemagic-ci-cd/react-native-code-push/issues/426) for a possible solution.*

Additionally, if you want to give them seperate names and/or icons, you can modify the `Product Bundle Identifier`, `Product Name` and `Asset Catalog App Icon Set Name` build settings, which will allow your staging builds to be distinguishable from release builds when installed on the same device.
6 changes: 3 additions & 3 deletions docs/setup-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ In order to integrate CodePush into your Android project, please perform the fol

3. Add the Deployment key to `strings.xml`:

To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.
To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value using your CodePush CLI (deployment keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.

![Deployment list](https://cloud.githubusercontent.com/assets/116461/11601733/13011d5e-9a8a-11e5-9ce2-b100498ffb34.png)

Expand All @@ -98,7 +98,7 @@ In order to effectively make use of the `Staging` and `Production` deployments t

### Code Signing setup

Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to [relevant code-push documentation section](https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing). In order to use Public Key for Code Signing you need to do following steps:
Starting with CLI version **2.1.0** you can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to the relevant code-push documentation. In order to use Public Key for Code Signing you need to do following steps:

Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`. It may looks like this:

Expand All @@ -118,6 +118,6 @@ zwIDAQAB
```

### Expo Integration
1. A pure expo react-native is not supported yet. We are planning to look into this after a while. See https://github.com/CodePushNext/react-native-code-push/issues/5
1. A pure expo react-native is not supported yet. We are planning to look into this after a while. See https://github.com/codemagic-ci-cd/react-native-code-push/issues/5
2. A bare react-native app with expo sdk is supported, but you have to initialize rn app without `ReactNativeHostWrapper` of expo. It seems `ReactNativeHostWrapper` overrides `getJsBundleFile` internally, which prevents `CodePush` from being configured correctly.
https://github.com/expo/expo/issues/25865
Loading