Skip to content

Commit b8dc1f1

Browse files
Merge pull request #719 from BranchMetrics/audit-fix
SDK-1401 : Fix NPM Vulnerabilities Audit fix
2 parents 461f2b8 + 3f27b2d commit b8dc1f1

File tree

12 files changed

+33749
-6432
lines changed

12 files changed

+33749
-6432
lines changed

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
env: {
3+
'jest/globals': true,
4+
},
5+
root: true,
6+
extends: ['@react-native-community'],
7+
plugins: ['jest'],
8+
rules: {
9+
"array-bracket-spacing": 0,
10+
"no-console": 0,
11+
'comma-dangle': 0,
12+
'object-curly-spacing': 0,
13+
'no-unused-vars': 2,
14+
"semi": 0,
15+
"quotes": [2, "single", "avoid-escape"],
16+
"eqeqeq": 0,
17+
"keyword-spacing": 0,
18+
"no-extra-semi": 0,
19+
"one-line": 0,
20+
"curly": 0,
21+
"no-shadow": 0,
22+
"prettier/prettier": 0,
23+
"no-trailing-spaces": 0,
24+
"dot-notation": 0
25+
}
26+
}

.eslintrc.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

android/build.gradle

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
apply plugin: 'com.android.library'
22
import groovy.json.JsonSlurper
33

4+
def DEFAULT_COMPILE_SDK_VERSION = 29
5+
def DEFAULT_MIN_SDK_VERSION = 16
6+
def DEFAULT_TARGET_SDK_VERSION = 29
7+
48
def getNpmVersion() {
59
def packageJsonFile = file('../package.json')
610
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
711
return packageJson.version
812
}
913

1014
repositories {
15+
mavenLocal()
1116
mavenCentral()
17+
maven {
18+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
19+
url "$rootDir/../node_modules/react-native/android"
20+
}
21+
maven {
22+
// Android JSC is installed from npm
23+
url "$rootDir/../node_modules/jsc-android/dist"
24+
}
25+
google()
1226
}
1327

1428
def safeExtGet(prop, fallback) {
1529
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
1630
}
31+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1732

18-
android {
19-
compileSdkVersion safeExtGet('compileSdkVersion', 26)
33+
android {
34+
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
2035

21-
defaultConfig {
22-
minSdkVersion safeExtGet('minSdkVersion', 16)
23-
targetSdkVersion safeExtGet('targetSdkVersion', 26)
36+
defaultConfig {
37+
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
38+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
2439

25-
versionCode 1
26-
versionName "1.0"
40+
versionCode 1
41+
versionName "1.0"
2742

28-
buildConfigField("String", "RNBRANCH_VERSION", "\"${getNpmVersion()}\"")
43+
buildConfigField("String", "RNBRANCH_VERSION", "\"${getNpmVersion()}\"")
44+
}
2945
}
30-
}
3146

32-
dependencies {
33-
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
34-
implementation 'com.facebook.react:react-native:+' // From node_modules
35-
api 'io.branch.sdk.android:library:5.1.5'
36-
}
47+
dependencies {
48+
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
49+
implementation 'com.facebook.react:react-native:+' // From node_modules
50+
api 'io.branch.sdk.android:library:5.1.5'
51+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9+
</dependencies>
10+
<scenes>
11+
<!--View Controller-->
12+
<scene sceneID="EHf-IW-A2E">
13+
<objects>
14+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
20+
<rect key="frame" x="0.0" y="647" width="375" height="0.0"/>
21+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
22+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
23+
<nil key="highlightedColor"/>
24+
</label>
25+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RNBranch" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
26+
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
27+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
29+
<nil key="highlightedColor"/>
30+
</label>
31+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
32+
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
33+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
34+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
35+
<nil key="highlightedColor"/>
36+
</label>
37+
</subviews>
38+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
39+
<constraints>
40+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
41+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
42+
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
43+
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="SfN-ll-jLj"/>
44+
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
45+
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
46+
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
47+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
48+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
49+
</constraints>
50+
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
51+
</view>
52+
</viewController>
53+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
54+
</objects>
55+
<point key="canvasLocation" x="52.173913043478265" y="375"/>
56+
</scene>
57+
</scenes>
58+
</document>

native-tests/android/app/build.gradle

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import com.android.build.OutputFile
1515
* // the name of the generated asset file containing your JS bundle
1616
* bundleAssetName: "index.android.bundle",
1717
*
18-
* // the entry file for bundle generation
18+
* // the entry file for bundle generation. If none specified and
19+
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
20+
* // default. Can be overridden with ENTRY_FILE environment variable.
1921
* entryFile: "index.android.js",
2022
*
21-
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
23+
* // https://reactnative.dev/docs/performance#enable-the-ram-format
2224
* bundleCommand: "ram-bundle",
2325
*
2426
* // whether to bundle JS and assets in debug mode
@@ -156,7 +158,7 @@ android {
156158
}
157159
release {
158160
// Caution! In production, you need to generate your own keystore file.
159-
// see https://facebook.github.io/react-native/docs/signed-apk-android.
161+
// see https://reactnative.dev/docs/signed-apk-android.
160162
signingConfig signingConfigs.debug
161163
minifyEnabled enableProguardInReleaseBuilds
162164
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
@@ -176,27 +178,19 @@ android {
176178

177179
}
178180
}
179-
180-
packagingOptions {
181-
pickFirst '**/armeabi-v7a/libc++_shared.so'
182-
pickFirst '**/x86/libc++_shared.so'
183-
pickFirst '**/arm64-v8a/libc++_shared.so'
184-
pickFirst '**/x86_64/libc++_shared.so'
185-
pickFirst '**/x86/libjsc.so'
186-
pickFirst '**/armeabi-v7a/libjsc.so'
187-
}
188181
}
189182

190183
dependencies {
191184
implementation fileTree(dir: "libs", include: ["*.jar"])
185+
//noinspection GradleDynamicVersion
192186
implementation "com.facebook.react:react-native:+" // From node_modules
193187

194188
if (enableHermes) {
195-
def hermesPath = "../../node_modules/hermesvm/android/";
196-
debugImplementation files(hermesPath + "hermes-debug.aar")
197-
releaseImplementation files(hermesPath + "hermes-release.aar")
189+
def hermesPath = "../../node_modules/hermes-engine/android/";
190+
debugImplementation files(hermesPath + "hermes-debug.aar")
191+
releaseImplementation files(hermesPath + "hermes-release.aar")
198192
} else {
199-
implementation jscFlavor
193+
implementation jscFlavor
200194
}
201195
}
202196

native-tests/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
5+
buildToolsVersion = "29.0.2"
66
minSdkVersion = 16
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
7+
compileSdkVersion = 29
8+
targetSdkVersion = 29
99
supportLibVersion = "28.0.0"
1010
}
1111
repositories {

native-tests/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

0 commit comments

Comments
 (0)