Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-signer
Commits
da508a88
Unverified
Commit
da508a88
authored
May 02, 2018
by
Marek Kotewicz
Committed by
GitHub
May 02, 2018
Browse files
Merge pull request #102 from paritytech/react-update
[WIP] React and toolchain upgrade
parents
5b1fe47a
04a852b3
Changes
56
Show whitespace changes
Inline
Side-by-side
.babelrc
View file @
da508a88
{
"presets": ["react-native"]
"presets": ["react-native"]
}
.flowconfig
View file @
da508a88
...
...
@@ -12,33 +12,43 @@
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
; Ignore polyfills
.*/Libraries/polyfills/.*
; Ignore metro
.*/node_modules/metro/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow
/
node_modules/react-native/flow
/
node_modules/react-native/flow-github
/
[options]
mo
dule.system=hast
e
e
mo
ji=tru
e
experimental.strict_type_args=tru
e
module.system=hast
e
munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(
>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]
\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(
>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]
\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(
<VERSION>
\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(
<VERSION>
\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
unsafe.enable_getters_and_setters=true
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.
3
6.0
^0.6
7
.0
.gitignore
View file @
da508a88
yarn-error.log
# NDK
NDK/
rust/.cargo
...
...
@@ -64,3 +66,4 @@ fastlane/screenshots
# vim
*.swp
.vscode
__tests__/index.ios.js
deleted
100644 → 0
View file @
5b1fe47a
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import
React
from
'
react
'
import
'
react-native
'
import
App
from
'
../src/components/App
'
// Note: test renderer must be required after react-native.
import
renderer
from
'
react-test-renderer
'
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
App
/>
)
expect
(
tree
).
toBeTruthy
()
})
android/app/BUCK
View file @
da508a88
import
re
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
...
...
@@ -11,8 +9,9 @@ import re
#
lib_deps
=
[]
for
jarfile
in
glob
([
'libs/*.jar'
]):
name
=
'jars__'
+
re
.
sub
(
r
'^.*/([^/]+)\.jar$'
,
r
'\1'
,
jarfile
)
name
=
'jars__'
+
jarfile
[
jarfile
.
rindex
(
'/'
)
+
1
:
jarfile
.
rindex
(
'.jar'
)]
lib_deps
.
append
(
':'
+
name
)
prebuilt_jar
(
name
=
name
,
...
...
@@ -20,7 +19,7 @@ for jarfile in glob(['libs/*.jar']):
)
for
aarfile
in
glob
([
'libs/*.aar'
]):
name
=
'aars__'
+
re
.
sub
(
r
'^.*/([^/]+)\.aar$'
,
r
'\1'
,
aarfile
)
name
=
'aars__'
+
aarfile
[
aarfile
.
rindex
(
'/'
)
+
1
:
aarfile
.
rindex
(
'.aar'
)]
lib_deps
.
append
(
':'
+
name
)
android_prebuilt_aar
(
name
=
name
,
...
...
@@ -28,39 +27,39 @@ for aarfile in glob(['libs/*.aar']):
)
android_library
(
name
=
'
all-libs
'
,
exported_deps
=
lib_deps
name
=
"
all-libs
"
,
exported_deps
=
lib_deps
,
)
android_library
(
name
=
'
app-code
'
,
name
=
"
app-code
"
,
srcs
=
glob
([
'
src/main/java/**/*.java
'
,
"
src/main/java/**/*.java
"
,
]),
deps
=
[
'
:all-libs
'
,
'
:build_config
'
,
'
:res
'
,
"
:all-libs
"
,
"
:build_config
"
,
"
:res
"
,
],
)
android_build_config
(
name
=
'
build_config
'
,
package
=
'
com.nativesigner
'
,
name
=
"
build_config
"
,
package
=
"
com.nativesigner
"
,
)
android_resource
(
name
=
'
res
'
,
res
=
'src/main/res'
,
package
=
'com.nativesigner'
,
name
=
"
res
"
,
package
=
"com.nativesigner"
,
res
=
"src/main/res"
,
)
android_binary
(
name
=
'
app
'
,
package_type
=
'
debug
'
,
manifest
=
'
src/main/AndroidManifest.xml
'
,
keystore
=
'//android/keystores:
debug
'
,
name
=
"
app
"
,
keystore
=
"//android/keystores:
debug
"
,
manifest
=
"
src/main/AndroidManifest.xml
"
,
package_type
=
"
debug
"
,
deps
=
[
'
:app-code
'
,
"
:app-code
"
,
],
)
android/app/build.gradle
View file @
da508a88
...
...
@@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
...
...
@@ -58,13 +65,17 @@ import com.android.build.OutputFile
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
* nodeExecutableAndArgs: ["node"]
,
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project
.
ext
.
react
=
[
entryFile:
"index.js"
]
apply
from:
"../../node_modules/react-native/react.gradle"
/**
...
...
@@ -83,29 +94,18 @@ def enableSeparateBuildPerCPUArchitecture = false
def
enableProguardInReleaseBuilds
=
false
android
{
compileSdkVersion
23
buildToolsVersion
"23.0.1"
compileSdkVersion
26
defaultConfig
{
applicationId
"com.nativesigner"
minSdkVersion
16
targetSdkVersion
22
versionCode
1
4
versionName
"1.0
b
"
versionCode
1
versionName
"1.0"
ndk
{
abiFilters
"armeabi-v7a"
,
"x86"
}
}
signingConfigs
{
release
{
if
(
project
.
hasProperty
(
'MYAPP_RELEASE_STORE_FILE'
))
{
storeFile
file
(
MYAPP_RELEASE_STORE_FILE
)
storePassword
MYAPP_RELEASE_STORE_PASSWORD
keyAlias
MYAPP_RELEASE_KEY_ALIAS
keyPassword
MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits
{
abi
{
reset
()
...
...
@@ -118,7 +118,6 @@ android {
release
{
minifyEnabled
enableProguardInReleaseBuilds
proguardFiles
getDefaultProguardFile
(
"proguard-android.txt"
),
"proguard-rules.pro"
signingConfig
signingConfigs
.
release
}
}
// applicationVariants are e.g. debug, release
...
...
@@ -126,7 +125,7 @@ android {
variant
.
outputs
.
each
{
output
->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def
versionCodes
=
[
"armeabi-v7a"
:
1
,
"x86"
:
2
]
def
versionCodes
=
[
"armeabi-v7a"
:
1
,
"x86"
:
2
]
def
abi
=
output
.
getFilter
(
OutputFile
.
ABI
)
if
(
abi
!=
null
)
{
// null for the universal-debug, universal-release variants
output
.
versionCodeOverride
=
...
...
@@ -134,12 +133,6 @@ android {
}
}
}
externalNativeBuild
{
ndkBuild
{
path
'src/main/jniLibs/Android.mk'
}
}
}
dependencies
{
...
...
@@ -150,13 +143,6 @@ dependencies {
compile
"com.facebook.react:react-native:+"
// From node_modules
}
// TODO: set env variables
//task compileRust(type: Exec) {
// commandLine "make", '-C', '../../rust/signer', 'android'
//}
//
//preBuild.dependsOn compileRust
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task
copyDownloadableDepsToLibs
(
type:
Copy
)
{
...
...
android/app/proguard-rules.pro
View file @
da508a88
...
...
@@ -50,6 +50,10 @@
-
dontwarn
com
.
facebook
.
react
.
**
#
TextLayoutBuilder
uses
a
non
-
public
Android
constructor
within
StaticLayout
.
#
See
libs
/
proxy
/
src
/
main
/
java
/
com
/
facebook
/
fbui
/
textlayoutbuilder
/
proxy
for
details
.
-
dontwarn
android
.
text
.
StaticLayout
#
okhttp
-
keepattributes
Signature
...
...
android/app/src/main/AndroidManifest.xml
View file @
da508a88
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.nativesigner"
android:versionCode=
"1"
android:versionName=
"1.0"
>
package=
"com.nativesigner"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-sdk
android:minSdkVersion=
"16"
android:targetSdkVersion=
"22"
/>
<application
android:name=
".MainApplication"
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:icon=
"@mipmap/ic_launcher"
android:allowBackup=
"false"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
android:label=
"@string/app_name"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
>
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
...
android/app/src/main/java/com/nativesigner/MainActivity.java
View file @
da508a88
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
package
com.nativesigner
;
import
com.facebook.react.ReactActivity
;
...
...
android/app/src/main/java/com/nativesigner/MainApplication.java
View file @
da508a88
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
package
com.nativesigner
;
import
android.app.Application
;
import
android.util.Log
;
import
com.facebook.react.ReactApplication
;
import
com.reactlibrary.RNSecureStoragePackage
;
import
com.lwansbrough.RCTCamera.RCTCameraPackage
;
import
com.facebook.react.ReactInstanceManager
;
import
com.facebook.react.ReactNativeHost
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.shell.MainReactPackage
;
...
...
@@ -35,7 +17,7 @@ public class MainApplication extends Application implements ReactApplication {
private
final
ReactNativeHost
mReactNativeHost
=
new
ReactNativeHost
(
this
)
{
@Override
p
rotected
boolean
getUseDeveloperSupport
()
{
p
ublic
boolean
getUseDeveloperSupport
()
{
return
BuildConfig
.
DEBUG
;
}
...
...
@@ -44,10 +26,14 @@ public class MainApplication extends Application implements ReactApplication {
return
Arrays
.<
ReactPackage
>
asList
(
new
MainReactPackage
(),
new
RNSecureStoragePackage
(),
new
RCTCameraPackage
(),
new
EthkeyBridgePackage
()
new
RCTCameraPackage
()
);
}
@Override
protected
String
getJSMainModuleName
()
{
return
"index"
;
}
};
@Override
...
...
android/app/src/main/jniLibs/Android.mk
deleted
100644 → 0
View file @
5b1fe47a
LOCAL_PATH
:=
$(
call
my-dir
)
include
$(CLEAR_VARS)
LOCAL_MODULE
:=
libsigner
LOCAL_SRC_FILES
:=
$(TARGET_ARCH_ABI)
/libsigner.so
include
$(PREBUILT_SHARED_LIBRARY)
\ No newline at end of file
android/app/src/main/res/values/strings.xml
View file @
da508a88
<resources>
<string
name=
"app_name"
>
Parity
Signer
</string>
<string
name=
"app_name"
>
Native
Signer
</string>
</resources>
android/build.gradle
View file @
da508a88
...
...
@@ -3,9 +3,10 @@
buildscript
{
repositories
{
jcenter
()
google
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:
2.2.3
'
classpath
'com.android.tools.build:gradle:
3.1.0
'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
...
...
@@ -16,9 +17,22 @@ allprojects {
repositories
{
mavenLocal
()
jcenter
()
google
()
maven
{
url
"https://jitpack.io"
}
maven
{
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url
"$rootDir/../node_modules/react-native/android"
}
}
}
subprojects
{
project
.
configurations
.
all
{
resolutionStrategy
.
eachDependency
{
details
->
if
(
details
.
requested
.
group
==
'com.android.support'
&&
!
details
.
requested
.
name
.
contains
(
'multidex'
)
)
{
details
.
useVersion
"26.1.0"
}
}
}
}
android/gradle/wrapper/gradle-wrapper.properties
View file @
da508a88
#Mon Mar 06 10:46:53 CET 2017
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
2.14.1
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
4.4
-all.zip
app.json
0 → 100644
View file @
da508a88
{
"name"
:
"NativeSigner"
,
"displayName"
:
"NativeSigner"
}
\ No newline at end of file
index.android.js
View file @
da508a88
...
...
@@ -20,7 +20,8 @@
* @flow
*/
import
{
AppRegistry
}
from
'
react-native
'
import
{
AppRegistry
,
YellowBox
}
from
'
react-native
'
import
App
from
'
./src/components/App
'
YellowBox
.
ignoreWarnings
([
'
Warning: isMounted(...) is deprecated
'
,
'
Module RCTImageLoader
'
])
AppRegistry
.
registerComponent
(
'
NativeSigner
'
,
()
=>
App
)
index.ios.js
View file @
da508a88
...
...
@@ -20,7 +20,8 @@
* @flow
*/
import
{
AppRegistry
}
from
'
react-native
'
import
{
AppRegistry
,
YellowBox
}
from
'
react-native
'
import
App
from
'
./src/components/App
'
YellowBox
.
ignoreWarnings
([
'
Warning: isMounted(...) is deprecated
'
,
'
Module RCTImageLoader
'
])
AppRegistry
.
registerComponent
(
'
NativeSigner
'
,
()
=>
App
)
ios/EthkeyBridge.swift
→
ios/EthkeyBridge.
1.
swift
View file @
da508a88
File moved
ios/NativeSigner-tvOS/Info.plist
0 → 100644
View file @
da508a88
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<key>
CFBundleExecutable
</key>
<string>
$(EXECUTABLE_NAME)
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
$(PRODUCT_NAME)
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
1
</string>
<key>
LSRequiresIPhoneOS
</key>
<true/>
<key>
UILaunchStoryboardName
</key>
<string>
LaunchScreen
</string>
<key>
UIRequiredDeviceCapabilities
</key>
<array>
<string>
armv7
</string>
</array>
<key>
UISupportedInterfaceOrientations
</key>
<array>
<string>
UIInterfaceOrientationPortrait
</string>
<string>
UIInterfaceOrientationLandscapeLeft
</string>
<string>
UIInterfaceOrientationLandscapeRight
</string>
</array>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
NSLocationWhenInUseUsageDescription
</key>
<string></string>
<key>
NSAppTransportSecurity
</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>
NSExceptionDomains
</key>
<dict>
<key>
localhost
</key>
<dict>
<key>
NSExceptionAllowsInsecureHTTPLoads
</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>
ios/NativeSigner-tvOSTests/Info.plist
0 → 100644
View file @
da508a88
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
en
</string>
<key>
CFBundleExecutable
</key>
<string>
$(EXECUTABLE_NAME)
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
$(PRODUCT_NAME)
</string>
<key>
CFBundlePackageType
</key>
<string>
BNDL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
1
</string>
</dict>
</plist>
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment