Skip to content

Commit

Permalink
Merge develop to master for release 5.0.1 (#1026)
Browse files Browse the repository at this point in the history
* fix Crashes typing

* Fix CVE-2017-16137 (#1018)

* Add dataResidencyRegion option for sending to portal (#1013)

* Add data-residency-region parameter

* Update TestApp and DemoApp

* Update versions and prepare TestApp for testing

* Fix versions

---------

Co-authored-by: Dmitriy Kirakosyan <v-dmkira@microsoft.com>

* Fix crash in TestApp on clicking a modal selector (#1020)

* [CI] Migrate Maven-Release to ESRP-Release task (#1022)

* Migrate AppCenterReactNativeShared to MavenPublication

* Update URL

* Correct numeration

---------

Co-authored-by: Dmitriy Kirakosyan <v-dmkira@microsoft.com>

* Bump SDK versions (#1023)

* Update CHANGELOG.md (#1025)

---------

Co-authored-by: Mikhail Suendukov <v-msuendukov@microsoft.com>
Co-authored-by: Dima <v-dmkira@microsoft.com>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent b9778f8 commit 0ee0754
Show file tree
Hide file tree
Showing 35 changed files with 247 additions and 156 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AppCenterReactNativeShared'
s.version = '5.0.0'
s.version = '5.0.1'
s.summary = 'React Native plugin for Visual Studio App Center'
s.license = { :type => 'MIT', :file => 'AppCenterReactNativeShared/LICENSE' }
s.homepage = 'https://github.com/microsoft/appcenter-sdk-react-native'
Expand All @@ -10,5 +10,5 @@ Pod::Spec.new do |s|
s.platform = :ios, '11.0'
s.requires_arc = true
s.vendored_frameworks = 'AppCenterReactNativeShared/AppCenterReactNativeShared.xcframework'
s.dependency 'AppCenter/Core', '5.0.3'
s.dependency 'AppCenter/Core', '5.0.4'
end
4 changes: 2 additions & 2 deletions AppCenterReactNativeShared/Products/local.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Pod::Spec.new do |s|
s.name = 'AppCenterReactNativeShared'
s.version = '5.0.0'
s.version = '5.0.1'
s.summary = 'React Native plugin for Visual Studio App Center'
s.license = { :type => 'MIT', :file => 'AppCenterReactNativeShared/LICENSE' }
s.homepage = 'https://github.com/microsoft/appcenter-sdk-react-native'
Expand All @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.platform = :ios, '11.0'
s.requires_arc = true
s.vendored_frameworks = 'AppCenterReactNativeShared/AppCenterReactNativeShared.xcframework'
s.dependency 'AppCenter/Core', '5.0.3'
s.dependency 'AppCenter/Core', '5.0.4'
end
119 changes: 52 additions & 67 deletions AppCenterReactNativeShared/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,89 +5,74 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:4.2.1'
}
}

repositories {
google()
mavenCentral()
}

apply from: 'publish.gradle'
apply from: 'version.gradle'

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.android.library'

def wasSigned = false

allprojects {
repositories {
google()
mavenCentral()
jcenter {
content {
// https://youtrack.jetbrains.com/issue/IDEA-261387
includeModule("org.jetbrains.trove4j", "trove4j")
}
def ext = rootProject.ext

// Setup signing values.
ext."signing.keyId" = ext.mavenSigningKeyId
ext."signing.secretKeyRingFile" = ext.mavenSecretKeyPath
ext."signing.password" = ext.mavenPublicKeyPassword

android {
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 67
versionName '5.0.1'
group groupId
version versionName
buildConfigField 'String', "SDK_NAME", "\"appcenter.react-native\""
buildConfigField 'String', 'VERSION_NAME', "\"${ext.versionName}\""

ndk {
abiFilters "armeabi-v7a", "x86"
}
consumerProguardFiles 'proguard-rules.pro'
}
}

def ext = rootProject.ext

// Setup signing values.
ext."signing.keyId" = ext.mavenSigningKeyId
ext."signing.secretKeyRingFile" = ext.mavenSecretKeyPath
ext."signing.password" = ext.mavenPublicKeyPassword

android {
compileSdkVersion 29
buildToolsVersion '29.0.2'

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 65
versionName '5.0.0'
group groupId
version versionName
buildConfigField 'String', "SDK_NAME", "\"appcenter.react-native\""

ndk {
abiFilters "armeabi-v7a", "x86"
}
consumerProguardFiles 'proguard-rules.pro'
}
task sourcesJar(type: Jar) {
afterEvaluate {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
}

task sourcesJar(type: Jar) {
afterEvaluate {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
publishing {
repositories {
maven {
url = uri("${System.env.BUILD_DIR}")
}
}


afterEvaluate {
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment ->
// workaround to prevent the script from failing because of double uploading of pom files
// related issue: https://github.com/gradle/gradle/issues/3003
if (!wasSigned) {
signing.signPom(deployment)
wasSigned = true
}
}

repository(url: ext.mavenRepoUrl) {
authentication(userName: ext.mavenUser, password: ext.mavenKey)
}
afterEvaluate { project ->
publications {
maven(MavenPublication) {
from components.release

pom.project {
artifact sourcesJar

// Set base information about assemble.
pom {
packaging = 'aar'
name = project.name
description = sdkDescription
Expand Down Expand Up @@ -127,14 +112,14 @@ allprojects {
}

dependencies {
api 'com.microsoft.appcenter:appcenter:5.0.2'
api 'com.microsoft.appcenter:appcenter:5.0.4'
}

artifacts {
archives sourcesJar
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
5 changes: 5 additions & 0 deletions AppCenterReactNativeShared/android/version.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Bintray constants

ext {
versionName = '5.0.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ + (NSString *)getAppSecret {

+ (void)configureAppCenter {
if (!wrapperSdk) {
MSACWrapperSdk *wrapperSdk = [[MSACWrapperSdk alloc] initWithWrapperSdkVersion:@"5.0.0"
MSACWrapperSdk *wrapperSdk = [[MSACWrapperSdk alloc] initWithWrapperSdkVersion:@"5.0.1"
wrapperSdkName:@"appcenter.react-native"
wrapperRuntimeVersion:nil
liveUpdateReleaseLabel:nil
Expand Down
2 changes: 1 addition & 1 deletion AppCenterReactNativeShared/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ target 'AppCenterReactNativeShared' do
use_frameworks!

# Pods for AppCenterReactNativeShared
pod 'AppCenter', '5.0.3'
pod 'AppCenter', '5.0.4'

end
20 changes: 10 additions & 10 deletions AppCenterReactNativeShared/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
PODS:
- AppCenter (5.0.3):
- AppCenter/Analytics (= 5.0.3)
- AppCenter/Crashes (= 5.0.3)
- AppCenter/Analytics (5.0.3):
- AppCenter (5.0.4):
- AppCenter/Analytics (= 5.0.4)
- AppCenter/Crashes (= 5.0.4)
- AppCenter/Analytics (5.0.4):
- AppCenter/Core
- AppCenter/Core (5.0.3)
- AppCenter/Crashes (5.0.3):
- AppCenter/Core (5.0.4)
- AppCenter/Crashes (5.0.4):
- AppCenter/Core

DEPENDENCIES:
- AppCenter (= 5.0.3)
- AppCenter (= 5.0.4)

SPEC REPOS:
trunk:
- AppCenter

SPEC CHECKSUMS:
AppCenter: a4070ec3d4418b5539067a51f57155012e486ebd
AppCenter: 85c92db0759d2792a65eb61d6842d2e86611a49a

PODFILE CHECKSUM: 98b2521b82f9ee3dca6f88b635ef371216c02b85
PODFILE CHECKSUM: 69989a70468a0621e600e50ec2d32be4b77147d0

COCOAPODS: 1.12.1
COCOAPODS: 1.11.3
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# App Center SDK for React Native Change Log

## Version 5.0.1

### App Center

* **[Fix]** Fix Regular Expression Denial of Service in debug vulnerability issue (https://github.com/advisories/GHSA-gxpj-cx7g-858c).

### App Center Crashes

* **[Fix]** Fix the typing contract for the Crashes class.

#### Android/iOS

* **[Internal] Add dataResidencyRegion option.
___

## Version 5.0.0

#### Android
Expand Down
30 changes: 29 additions & 1 deletion DemoApp/app/screens/AppCenterScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SharedStyles from '../SharedStyles';
import DialsTabBarIcon from '../assets/dials.png';

const USER_ID_KEY = 'USER_ID_KEY';
const DATA_RESIDENCY_KEY = 'DATA_RESIDENCY_KEY';

const SecretStrings = {
ios: {
Expand Down Expand Up @@ -71,7 +72,8 @@ export default class AppCenterScreen extends Component {
installId: '',
sdkVersion: AppCenter.getSdkVersion(),
startupMode: StartupModes[0],
userId: ''
userId: '',
dataResidencyRegion: ''
}

async componentDidMount() {
Expand All @@ -94,6 +96,15 @@ export default class AppCenterScreen extends Component {
refreshAppCenterScreen: this.refreshUI.bind(this)
});

const dataResidencyRegion = await AsyncStorage.getItem(DATA_RESIDENCY_KEY);
if (dataResidencyRegion !== null) {
this.state.dataResidencyRegion = dataResidencyRegion;
await AppCenter.setDataResidencyRegion(dataResidencyRegion);
}
this.props.navigation.setParams({
refreshAppCenterScreen: this.refreshUI.bind(this)
});

await AppCenter.setLogLevel(AppCenter.LogLevel.VERBOSE);
}

Expand Down Expand Up @@ -233,6 +244,23 @@ export default class AppCenterScreen extends Component {
}
await AppCenter.setUserId(userId);
}
},
{
title: 'Data Residency Region',
value: 'dataResidencyRegion',
onChange: async (dataResidencyRegion) => {
this.setState({ dataResidencyRegion });
},
onSubmit: async () => {
// We use empty text in UI to delete Data Residency Region (null for AppCenter API).
const dataResidencyRegion = this.state.dataResidencyRegion.length === 0 ? null : this.state.dataResidencyRegion;
if (dataResidencyRegion !== null) {
await AsyncStorage.setItem(DATA_RESIDENCY_KEY, dataResidencyRegion);
} else {
await AsyncStorage.removeItem(DATA_RESIDENCY_KEY);
}
await AppCenter.setDataResidencyRegion(dataResidencyRegion);
}
}
],
renderItem: valueRenderItem
Expand Down
3 changes: 2 additions & 1 deletion DemoApp/app/screens/CrashesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default class CrashesScreen extends Component {
memoryWarning: '',
textAttachment: '',
binaryAttachment: '',
userId: ''
userId: '',
dataResidencyRegion: ''
}

async componentDidMount() {
Expand Down
2 changes: 1 addition & 1 deletion TestApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import com.android.build.OutputFile

project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down
22 changes: 15 additions & 7 deletions TestApp/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,23 @@ def readFromLocalProperties(propertyName) {
return null
}

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
repositories {
maven {
credentials {
username = readFromLocalProperties('AZURE_USERNAME')
password = readFromLocalProperties('AZURE_PASSWORD')
}
url "https://msmobilecenter.pkgs.visualstudio.com/_packaging/AppCenter/maven/v1/"
configurations.all {
resolutionStrategy {
// Remove this override in 0.66, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
// maven {
// credentials {
// username = readFromLocalProperties('AZURE_USERNAME')
// password = readFromLocalProperties('AZURE_PASSWORD')
// }
// url "https://msmobilecenter.pkgs.visualstudio.com/_packaging/AppCenter/maven/v1/"
// }
mavenLocal()
google()
jcenter()
Expand Down
Loading

0 comments on commit 0ee0754

Please sign in to comment.