Skip to content

Commit b9fa369

Browse files
Slesarews3kritTriplEight
authored
major: Ios native port (#791)
* fix: update metadata * docs: created issue for stock metadata updates * docs: lint * feat: add generalized metadata storage mwp * feat: metadata info on network details page (early stub) * feat: invalid metadata message * feat: built-in metadata loaded in constants feat: metadata versions added to constants * fix!: metadata is actuallty loaded; removed som non-essential networks due to metadata loading issues * fix: annoying hooks warning about updating component from another component fixed * fix: smoother metadata loading; initiation moved to separate from fetching block * ref: merged networkscontext and registriescontext * fix: remove process race on init and small fixes * fix: infinite useEffect cycle in payload card; probably there is more * feat: show list of available metadata packages for given network * feat: choose metadata from network settings submenu * test: fix typos in unit tests * test: fix tests and some lint/type errors * feat: Metadata management scanner (#749) * feat: MWP fast Rust-processed QR scanner frontend * build: temporarily switch dependency rust-native to side branch * feat: implement rust code for fountain parsing. Saving point for partial dependencies upgrade attempts * feat: add metadata through fountain QR codes! (go to network settings>"network name">ManageMetadata>Fast Qr Scanner) * fix: lint and types * fix: typo in constants * fix: multiple minor bugs * refactor: return rust native libs where they belong (#751) * ref: return rust native libs where they belong * docs: lost gitignore * refactor: move reference animated qr code generator to external repository * build: move header files in ios build part * build: add more memory for ios node build * build: add more memory for ios node build in a different way * build: revert ios build changes, modify bitrise script to allocate less memory * build: duplicate headers for ios * fix: Transaction parser (#754) * feat: parse generic transaction. Ugly but now works. * test: increase e2e timeout * fix: lint * feat: automatically generate built-in metadata (#755) * feat: add rust code to automatically fetch and generate built-in metadata constants * test: add extra paths for linter to ignore * feat: automatically update constants/networkSpecs.ts with new metadata info * fix: add blake2 hash to metadata handles; use it as ID if no spec_name or spec_version is available * fix: blake2 hash in networkSpecs constants * fix: add hashes for centrifuge and edgeware * fix: metadata autogeneration lint * build: update failure_derive to 1.8.0 * build: convenience reminder in build script * fix: multiple fixes to allow versionless metadata * test: fix unit tests to recognize versioned metadata * refactor: faster metadata queries (#759) * perf: moved metadata handle generator to rust * refactor: lint and types * build: try ti disable flipper * fix: update metadata * test: increase alert timeout * test: typo in consts * fix: merged last commit that was dropped from last squash for some reason * feat: Metadata management page (#760) * build: bump polkadot/api version to latest * fix: red boxes on registering networks * build: mess with upgrades and lint * feat: can delete unused metadata (except for built-in probably) * build: Upgrade polkadot-js 4 7 2 (#761) * upgrade polkadot and react-native * test: disabled failing tests temporarily * test: restore tests * fix: lint * test: fix ts-ignore updated rule * fix: lint and types * test: bump nodejs version * test: bump wasm-crypto needed for tests * fix: update metadata * build: bump node version for e2e * build: bump node version in bitrise.yml * test: teach signing test to scroll down * test: fix addNewNetwork signing test with scrolling * test: forgot to import scrolling tap everywhere it's needed * fix: update westend metadata * build: build rust for detox * build: try to fix comment in macro build issue for zeroize_derive * fix: typu in NetworkContext file * build: update synstructure rust dep * build: disable 32-bit ios targets * build: remoce macro proc so that cross-compile works * build: very ugly hack to address ios inability to build dynamic libs and rust-lang/cargo#4881 * fix: update metadata * feat: loading screen stub * lint * fix: import react to splashscreen tab * fix: metadata qr alignment error * test: increase e2e timeout * feat: loaded metadata preview screen * test: switch ios and android e2e tests order * test: add waiting for loading in beforeall e2e * fix: lint * test: typo * fix: update metadata * test: preparing for new e2e tests * docs: bump license year in ts * docs: bump license year in ios * docs: bump version year in rust * fix: gracefully fail to parse transaction if no metadata is available * test: fix gradle api for detox * test: remove waiting for alerts * fix: lint * feat: slightly prettier loading screen * fix: lint * fix: properly handle networks with unset metadata on loading * fix: #767 and some lint * fix: lint and types * feat: slightly prettier transaction parser * fix: types and lint * test: attempt to run e2e on bitrise * test: bump node version on bitrise * test: swap ios and android testing again * build: automatically set NDK_HOME with other variables * test: download last reasonable config from bitrise * test: increase verbosity in e2e test * test: increase verbosity for e2e ci test on github * test: wait for chooser screen after account creation in e2e * test: this will be reverted - check that ios really clears memory between tests * fix: lint and ios build * test: preparing for new tests * build: ios version fix attempt * build: fixing ios build * build: rename xcode folders * build: update some deps * build: remove ios/SubstrateSignTests * fix: reverse ios module renaming mess * build: ios folder cleanup * build: move swift-bridge header around * fix: Bridging header location * fix: libsigner.a location * build: try different places for static ios rust lib * build: remove ndk address and some file duplicates * build: ios linking * test: some unfinished test specs added * chore: update meta_reading * chore: bump metadata reading version * fix: gitignore * fix: gitignore * feat: rust transaction parser mwp demo * fix: accept V13 metadata * feat: stub for rust transaction parser call * feat: mwp rust transaction parse demo (stub vor visualization) * feat: add more cards to transaction renderer * fix: lint and make some things prettier * build: manually return linking lines to ios project file * feat: migrate metadata db to insecure storage * fix: accept V13 metadata * chore: update metadata * feat: add templates for cards: loading and error in transaction * feat: add error messages cards generation and some refactor * feat!: remove ethereum support, direct connection to transaction parser. Can't sign at the moment. * refactor: tidy up transaction parser code * feat: active SIGN button in details screen and some sanitation to remove legacy * feat: prepare data transfer for signature and signing pin screen * feat: signing is back! and with all 3 crypto algorithms as well! * fix: show error messages on pin entry * fix: remove silly testing message from really hard to find place * feat: proper pin code error messages and start of rust storage testing (sled vs sqlite?) * chore: update metadata * fix: invalid payload screen crashing * fix: temporarilty disable mortality check until upstream conforms * fix: data to sign format correction * feat: payload details look * test: remove decoders test from RN suite (moved to Rust tests) * test: remove units conversion test from RN suite (moved to Rust tests) * fix: choose sled as db * fix: lint * fix: some types, lint and legacy removal * fix: purge ethereum * fix: ios support and more legacy purging * ci: Rework Gitlab (#782) * tighten up build scripts * rewrite gitlab * add signing * fix * enable * update gitlab-ci.yml * become unstuck * fix * add debug output * fix * fix * fix * add artifact * feat: move all storage to rust (#780) * FEAT: MFP sled database for android * feat: network db handling utils * docs: signing and parsing modules documentation * fix: gitignore to ignore temporary db files in db handling tests * refactor: move network specs constants to rust side * fix: gitignore typo * fix: gitignoring properly * test: cleanup db tests locations * feat: part of bridge to access new network specs storage from RN * refactor: organize all cards and errors in transaction parsing into enums * feat: network selector queries db. And some cleanup. * test: add test feature to show all payload info cards * feat: MWP metadata signing app example * feat: MWP fetch and show derivations for given seed and network * feat: removed RN data storages; app loads and fetches some data - MWP * feat: prepare fetched metadata for signing and save to db instead of plaintext * feat: account creation in db and signed metadata checks * feat: generate metadata qr codes; also bridge Rust to RN * feat: load type specs and some refactor * feat: add hw backed key generation section to android * fix: gitignore * feat: automatic fetch chainspecs * fix: create new seed * fix: mwp address list screen * feat: replace ethsign with XSalsa20Poly1305; just to save this state - this will be reverted * feat: native credential-only unlock screen for Android (defunct) * fix: unhang app on auth * feat: HW keys for android (auth screen freezes thread, WIP) * fix: proper thread locks for biometric prompt (Android) * fix: fetch all seed names * feat: add seed button * feat: POC identity cards render * fix: recover seed now works similar to create seed * feat: general look for identity cards * feat: bells and whistles on identity screen * feat: send public key to UI on fetching relevant identities * chore: remove some unused java deps * chore: remove some unused polkadot js deps * feat: export public account (uos step 1) * chore: cleanup obsolete screens * chore: more cleanup * feat: derivation checker and identity creation backend * ci: Gitlab build (#784) * tighten up build scripts * rewrite gitlab * add signing * fix * enable * update gitlab-ci.yml * become unstuck * fix * add debug output * fix * fix * fix * add artifact * remove test branch * feat: expose identity creation functions * feat: expose identity creation functions in RN; handle address collisions * feat: add new identity * feat: n+1 feature * feat: backend to delete identities and suggest their names * feat: delete identity * major: tools for creating full signed offline QR updates * feat: move prepopulated db to assets to copy on init * feat: remove global context; make TOCnPP condition to populate db; app factory reset should work through deletion of app data now * refactor: remove old rust code, some general cleanup * fix: screen refresh on addition of account * fix: refresh on address deletion * refactor: RN cleanup * feat: nice suggestions for seed names * lint: RN lint and cleanup * refactor: some types and more cleanup * feat: automatic TOFU metadata, types and network specs import, fixed signing * lint: cleanup meta_reading * fix: signing and upgrading screens fixes * feat: populate cold database from hot one (and some more cleanup) * refactor: move all screens to one place * feat: network settings screen * feat: remove metadata, remove network * CI: rework * CI: poke the pipeline * CI: metadata * CI: make it work * fix: network removal call properly * fix: empty metadata does not crash; also some refactor and backend for listing all addresses * fix: rn build android (#785) * fix: disable broken minification with proguard * revert: cat in ci * docs: readme for db_handling * fix: .h header for ios build * fix: remove obsolete meta handle generator * fix: cargo.toml cleanup for main module * feat: use anyhow to propagate errors to ios * feat: anyhow all rust code * refactor: decrease code redundancy by helpers * fix: rust ios return seedphrase on successful creation * major: native ios wip dump * feat: add rust-identicon dependency just to test build * major: ios account management UI * ci: remove yarn calls from e2e; should add tests later * ci: remove ts lint types and unit tests * ci: ga build script fix * refactor: cleanup of junk files * fix: simplify data model and fix some memory leaks and threading * ci: scheme in actions * feat: better rust qr parser and PC implementation as devtool * feat: try to send svg string to ios * fix: QR parser succeeds 1 frame sooner * test: 1-frame multiframe decode unit test * feat: transaction parsing and preview sketch * feat: history backend * feat: seed and network settings screens, TC and PP * feat: bindings for history ios * feat: ios history ui stub * refactor: tidy up history in transaction parsing * feat: rust QR code png renderer * refactor: consolidate qr constants * feat: integrate QR code generation into signing * feat: ios history and hard types in tx and history ui cards * fix: seriously, output is supposed to be binary-encoded hex symbols?! * feat: new export pubkey qr code generator * feat: identicons stub, faster qr videos * feat: show identities for all seeds * feat: show all seeds and minor UI fixes * chore: cleanup RN * docs: remove ETH, explain legacy situation * docs: some tutorials * docs: reference to uos * fix: signing db checksum mismatch bugfix * docs: mark how releases are tagged Co-authored-by: Martin Pugh <[email protected]> Co-authored-by: Martin Pugh <[email protected]> Co-authored-by: Denis P <[email protected]>
1 parent c6b30f5 commit b9fa369

File tree

599 files changed

+33181
-32944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

599 files changed

+33181
-32944
lines changed

.buckconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[android]
3-
target = Google Inc.:Google APIs:23
3+
target = Google Inc.:Google APIs:30
44

55
[maven_repositories]
66
central = https://repo1.maven.org/maven2

.eslintrc.js

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

.github/workflows/actions.yml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,14 @@ jobs:
1818
- name: Checkout submodules
1919
shell: bash
2020
run: git submodule update --init --recursive
21-
- name: Install NodeJS
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: '13.x'
25-
- name: Cache Npm
26-
uses: actions/cache@v1
27-
with:
28-
path: ~/.npm
29-
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
30-
restore-keys: |
31-
${{ runner.os }}-node-
32-
- name: Get yarn cache directory path
33-
id: yarn-cache-dir-path
34-
run: echo "::set-output name=dir::$(yarn cache dir)"
35-
- name: Cache Yarn
36-
uses: actions/cache@v1
37-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
38-
with:
39-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
41-
restore-keys: |
42-
${{ runner.os }}-yarn-
43-
- name: Cache Pods
44-
uses: actions/cache@v1
45-
with:
46-
path: ios/Pods
47-
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-pods-
5021
- name: Install dependencies
5122
run: |
5223
brew tap wix/brew
5324
brew install applesimutils
54-
npm install -g yarn
55-
npm install -g react-native-cli
56-
npm install -g detox-cli
57-
gem install xcpretty
58-
yarn
59-
- name: Build CocoaPods
60-
run: cd ios && pod install && cd ..
25+
gem install xcpretty
26+
- name: Rust build
27+
shell: bash
28+
run: cd scripts && ./build.sh ios && cd ..
6129
- name: Detox biuld
62-
run: yarn build-e2e:ci
63-
- name: Detox test
64-
run: yarn test-e2e:ci
30+
run: xcodebuild -workspace ios/NativeSigner.xcodeproj/project.xcworkspace -scheme NativeSigner -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build/NativeSigner -UseModernBuildSystem=YES | xcpretty -t && exit ${PIPESTATUS[0]}
6531

.github/workflows/yarn-tools.yml

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

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,9 @@ fastlane/screenshots
8484
android/.project
8585
android/app/.project
8686
android/app/bin
87+
88+
# rust
89+
rust/*/target
90+
rust/db_handling/signer_database
91+
rust/db_handling/tests
92+
rust/meta_reading/tests

.gitlab-ci.yml

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,39 @@
1+
# .gitlab-ci.yml
2+
#
3+
# parity-signer
4+
#
5+
# pipelines can be triggered manually in the web
6+
17
stages:
2-
- test
38
- build
4-
variables:
5-
GIT_DEPTH: "3"
6-
SIMPLECOV: "true"
7-
RUST_BACKTRACE: "1"
8-
RUSTFLAGS: ""
9-
CARGOFLAGS: ""
10-
cache:
11-
untracked: true
129

10+
variables:
11+
GIT_STRATEGY: fetch
12+
GIT_DEPTH: 100
1313

14+
default:
15+
cache: {}
1416

15-
android-test:
16-
stage: test
17-
image: parity/android-sdk
18-
only:
19-
- master
20-
- /^[0-9]+$/
21-
# testing Android build on this branch
22-
- tbaut-without-version
23-
script:
24-
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
25-
- apt-get install -y nodejs
26-
- npm install -g yarn
27-
- npm install
28-
- npm run test
29-
tags:
30-
- linux-docker
17+
workflow:
18+
rules:
19+
- if: $CI_COMMIT_TAG
20+
- if: $CI_COMMIT_BRANCH
3121

32-
android-build:
33-
stage: build
34-
image: parity/android-sdk
35-
only:
36-
- beta
37-
- tags
38-
- stable
39-
- triggers
40-
- master
22+
android-build-release:
23+
stage: build
24+
image: paritytech/parity-signer:latest
25+
rules:
26+
- if: $CI_PIPELINE_SOURCE == "web"
27+
- if: $CI_PIPELINE_SOURCE == "schedule"
28+
- if: $CI_COMMIT_REF_NAME == "master"
29+
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
30+
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
31+
artifacts:
32+
paths:
33+
- signer-app-release-signed.apk
4134
script:
42-
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
43-
- apt-get install -y nodejs
44-
- echo "ndk.dir=/usr/local/android-ndk-r16b" > android/local.properties
45-
- echo "sdk.dir=/opt/android-sdk" >> android/local.properties
46-
- npm install -g yarn
47-
- bash ./setup_linux.sh
48-
- bash ./gen_key.sh
49-
- cd android && ./gradlew assembleRelease
50-
- pwd
51-
- ls
35+
- cat "$KEYSTORE_DATA" | base64 -d > /tmp/gitlab-ci.keystore
36+
- wc /tmp/gitlab-ci.keystore
37+
- ./scripts/build-release.sh /tmp/gitlab-ci.keystore "$KEYSTORE_ALIAS" "$KEYSTORE_PASS"
5238
tags:
5339
- linux-docker
54-
artifacts:
55-
paths:
56-
- ./android/app/build/outputs/apk/release/app-release.apk
57-

.prettierrc

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

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,47 @@
88

99
![Parity Signer](./docs/tutorials/images/logo-parity-signer.jpg)
1010

11+
**Please read instructions in [Getting started](#getting-started) before building or using the Signer**
12+
1113
Parity Signer is a mobile application that allows any smartphone to act as an air-gapped crypto wallet. This is also known as "cold storage".
1214

13-
You can create Substrate and Ethereum accounts, sign messages/transactions, and transfer funds to and from these accounts without any sort of connectivity enabled on the device.
15+
You can create accounts in Substrate-based networks, sign messages/transactions, and transfer funds to and from these accounts without any sort of connectivity enabled on the device.
1416

15-
You must turn off or even physically remove the smartphone's Wifi, Mobile Network, and Bluetooth to ensure that the mobile phone containing these accounts will not be exposed to any online threat.
17+
You must turn off or even physically remove the smartphone's Wifi, Mobile Network, and Bluetooth to ensure that the mobile phone containing these accounts will not be exposed to any online threat. Switching to airplane mode suffices in many cases.
1618

1719
**Disabling the mobile phone's networking abilities is a requirement for the app to be used as intended, check our [wiki](./docs/wiki/Security-And-Privacy.md) for more details.**
1820

19-
Have a look at the tutorial on our wiki to learn how to use [Parity Signer together with Polkadot-js app](./docs/tutorials/Kusama-tutorial.md), or [MyCrypto app](./docs/tutorials/MyCrypto-tutorial.md) and [Parity Fether](./docs/tutorials/Fether-tutorial.md) for Ethereum.
21+
Have a look at the tutorial on our wiki to learn how to use [Parity Signer together with Polkadot-js app](./docs/tutorials/Kusama-tutorial.md).
22+
23+
Any data transfer from or to the app happens using QR code. By doing so, the most sensitive piece of information, the private keys, will never leave the phone. The Parity Signer mobile app can be used to store any Substrate account, this includes Polkadot (DOT) and Kusama (KSM) networks.
24+
25+
## Key features
26+
27+
- This is not a complete cryptowallet in itself. The Signer does not sync with blockchain, so it does not know your account balance, whether transactions were successful or even if the account exists! This is a **cold wallet** app only stores keys, reads and signs messages. It should always be used with **hot wallet** like [polkadot.js](https://polkadot.js.org/apps)
28+
- The Signer alone does not make your accounts secure. **You must maintain security yourself**. Airgap should be only part of your security protocol, improper use of Signer could still lead to loss of funds and/or secrets.
29+
- When properly used, Signer provides best achievable security with Substrate networks to-date.
30+
31+
## System requirements
32+
33+
Currently Signer is available only for iOS. Android version is coming soon.
34+
35+
## Getting Started
2036

21-
Any data transfer from or to the app happens using QR code. By doing so, the most sensitive piece of information, the private keys, will never leave the phone. The Parity Signer mobile app can be used to store any Polkadot or Ethereum account, this includes KSM, ETH, ETC as well as Ether from various testnets (Kovan, Ropsten...).
37+
**These tutorials and docs are heavily outdated at the moment, please use them as references or help improving**
2238

23-
## Getting Start
39+
The `master` branch contains development code; for stable releases and release candidates please use [Release](https://github.com/paritytech/parity-signer/tree/release) branch or fetch tagged commits.
40+
41+
If you are upgrading from older version of Signer, please see [changelog](./docs/wiki/Changelog.md) and [upgrading Signer](./docs/wiki/Upgrading.md)
42+
43+
Please note that the Signer app is an advanced tool designed for maximum security and complex features. In many use cases, more user-friendly tools would be sufficient.
44+
45+
[Getting started guide](./docs/tutorials/Start.md)
2446

2547
### Tutorials
2648

2749
- [Signing with Pokadot.js Apps](./docs/tutorials/Kusama-tutorial.md)
2850
- [Recover Account from Polkadot.js Apps](./docs/tutorials/Recover-Account-Polkadotjs.md)
2951
- [Manage Accounts on Parity Signer](./docs/tutorials/Hierarchical-Deterministic-Key-Derivation.md)
30-
- [Signing with MyCrypto](./docs/tutorials/MyCrypto-tutorial.md)
31-
- [Signing with Fether](./docs/tutorials/Fether-tutorial.md)
3252
- [Update New Network](./docs/tutorials/New-Network.md)
3353

3454
### Wiki
@@ -39,8 +59,18 @@ Any data transfer from or to the app happens using QR code. By doing so, the mos
3959
- [Testing](./docs/wiki/Test.md)
4060
- [Troubleshooting](./docs/wiki/Troubleshooting.md)
4161
- [QA Check List](./docs/wiki/QA.md)
42-
- [HDKD Feature](./docs/wiki/HDKD.md)
62+
- [Key derivations](https://substrate.dev/docs/en/knowledgebase/integrate/subkey)
4363
- [Changelog](./docs/wiki/Changelog.md)
64+
- [QR encoding definition](https://github.com/maciejhirsz/uos)
65+
66+
### Legacy versions
67+
68+
Older versions of this app could be useful for development, however, they are not safe for use in production. They are available at following branches:
69+
70+
- [Last public release with React Native](https://github.com/paritytech/parity-signer/tree/legacy-4.5.3)
71+
- [Non-ascii characters fix and some transaction parsing](https://github.com/paritytech/parity-signer/tree/legacy-4.6.2)
72+
- [Metadata types import and message parsing in RN](https://github.com/paritytech/parity-signer/tree/legacy-metadataRN)
73+
- [Rust backend with RN frontend](https://github.com/paritytech/parity-signer/tree/legacy-rust)
4474

4575
## License
4676

ReactotronConfig.js

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

0 commit comments

Comments
 (0)