Skip to content

Commit

Permalink
feat: db atomization and certificates logic (#844)
Browse files Browse the repository at this point in the history
* feat: db atomization and certificates logic

* fix: make main rust lib buildable

* feat: FFI for db initialization (on signer reset)

* fix: remove address name collision check

* feat: remove address name from export qr

* feat: more keys for generate_message, signing tests, db update and bootable android

* feat: expose self-signing functions

* refactor: cargo workspace

* fix: ios build script

* feat: collate docs to related object in tx cards

* fix: FFI for ios

* fix: ios linking script

* test: auto rust tests

* test: move rust test to linux machine

* test: remove camera-dependant crate from workspace to avoid auto build

* fix: start fixing history cards according ot rust defs

* fix: temporarily disable clear history feature

* fix: conform validator between history and tx cards

* test: add data required for tests

* fix: transaction and history cards fixes

* fix: prevent history erasing on new event

* feat: nicer networks menu

* test: parsing and signing tests, minor prettifying

* fix: return proper ios background color

* feat: warning flag, history cards test, identity conflict hotfix

* fix: index counter ob1 in tx cards

* fix: simplity general_verifier_set history card format

* fix: comply iOS cards to backend

* fix: some cleanup and test stubs on iOS FFI

* feat: jailbreak

* feat: active alert indicator with memory and whistles

* feat: show general verifier in settings

* fix: safely encode docs

* feat: some place to show all address info

* feat: small UI improvements

* fix: apply UI feedback changes

* feat: add real default general verifier and fix pasword logging

* fix: docs modal behavior and seed name keyboard focus

* fix: rename signing action in UI to confirm to backend

* feat: remove useless pallet docs, neater pallet and call cards, minor history bug

* fix: delete correct seed

* fix: make android buildable again

* feat: nice bottom panel and navigation in android

* fix: android pares history cards

* feat: history details stub and newkey redesign

* feat: standalone transaction parser

* feat: android MWP again

* fix: android signing

* fix: android light theme hotfix

* build: automatically copy database to native space

* refactor: remove os-specific copies of Database

* chore: manually remove gitignored files

* build: warn user to select os in build.sh

* fix: ios build script cp keys

* build: ios cp syntax

* build: ios bash in build.sh

* chore: update app db

* fix: ios db refresh

* feat: use standalone parser in Signer

* fix: auth and seedphrase issues

* feat: seed word guesser, history paging backend

* fix: signing error

* refactor: use more of upstream multisigning

* chore: update android compose libs

* fix: hash long transactions before signing

* refactor: remove main.rs used for development from libs

* feat: parse system:remark as string

* feat: android: minimal history cards render

* feat: android: remark as string

* feat: ios: remark as string

* fix: change ios cards

* fix: ios: nameversion card

* feat: backend for recalling transactions

* refactor: merge text and message card types

* ci: gitignore android artefacts

* fix: annoying freeze on first boot

* chore: upgrade android sdk

* fix: nicer scanner and lint

* feat: android: minor UI improvements, styles

* build: prepare for testable builds

* feat: fonts and colors

* feat: vertical only layout

* refactor: android: separate SignerDataModel into several files

* ci: Revive android building (#879)

* new android build job

* update signing

* Add retry failed CI jobs twice (#878)

* add test branch

* fix build.sh and add pruning to dockerfile

* do it ourselves

* dockerfile fixes

* fix signing

* test

* Revert "test"

This reverts commit c020d0d.

* separate build and sign jobs

* fix script path

* chore: remove temporary CI branches for testing

* bump ndk

Co-authored-by: Sergejs Kostjucenko <85877331+sergejparity@users.noreply.github.com>

* fix: disable strongbox check in ancient os

* fix: auth errors on older androids

Co-authored-by: Martin Pugh <martin@parity.io>
Co-authored-by: Sergejs Kostjucenko <85877331+sergejparity@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 22, 2021
1 parent d734dc5 commit e5dd21d
Show file tree
Hide file tree
Showing 380 changed files with 12,005 additions and 25,188 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Rust backend test

on:
pull_request:
push:
branches:
- master
- stable
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 50
- name: Checkout submodules
shell: bash
run: git submodule update --init --recursive
- name: Rust build
shell: bash
run: cd rust && cargo test && cd ..

27 changes: 14 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
yarn-error.log
*.log

# typescript output directory
dist/

# jest cache
test/.jest/

Expand All @@ -21,9 +18,6 @@ rust/.cargo
#
.DS_Store

# CocoaPods
/ios/Pods/

# Xcode
#
build/
Expand Down Expand Up @@ -54,11 +48,6 @@ gen/
*.hprof
!debug.keystore

# node.js
#
node_modules/
npm-debug.log

# BUCK
buck-out/
\.buckd/
Expand All @@ -85,9 +74,21 @@ android/.project
android/app/.project
android/app/bin
android/app/src/main/jniLibs
android/app/src/main/assets/Database/*
android/app/release
android/app/debug

# iOS
ios/NativeSigner/Database/Database/*

# rust
rust/target
rust/*/target
rust/db_handling/signer_database
rust/db_handling/tests
rust/meta_reading/tests
rust/qrcode_static/*.png
rust/files/for_signing/*
rust/files/signed/*
# development mess
rust/transaction_parsing/src/main.rs
rust/transaction_signing/src/main.rs

36 changes: 24 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,38 @@ default:
- unknown_failure
- api_failure

workflow:
# workflow:
# rules:
# - if: $CI_COMMIT_TAG
# - if: $CI_COMMIT_BRANCH

android-build:
stage: build
image: paritytech/signer-android-builder:latest
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
artifacts:
paths:
- android/app/build/outputs/apk/release/app-release-unsigned.apk
script:
- ./scripts/build.sh android
- cd android; ./gradlew assembleRelease
tags:
- linux-docker

android-build-release:
stage: build
image: paritytech/parity-signer:latest
android-build-and-sign:
stage: build
image: paritytech/signer-android-builder:latest
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
artifacts:
paths:
- signer-app-release-signed.apk
- signer-ci-build.apk
script:
- cat "$KEYSTORE_DATA" | base64 -d > /tmp/gitlab-ci.keystore
- wc /tmp/gitlab-ci.keystore
- ./scripts/build-release.sh /tmp/gitlab-ci.keystore "$KEYSTORE_ALIAS" "$KEYSTORE_PASS"
- ./scripts/build.sh android
- cd android; ./gradlew assembleRelease; cd ..
- ./scripts/sign_android.sh /tmp/gitlab-ci.keystore "$KEYSTORE_PASS"
tags:
- linux-docker
26 changes: 12 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ android {
defaultConfig {
applicationId "io.parity.signer"
minSdk 23
targetSdk 30
versionCode 4604
versionName "5.0.0-alpha"
targetSdk 31
versionCode 46600
versionName "4.6.6"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
Expand Down Expand Up @@ -41,7 +41,6 @@ android {
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion '1.5.21'
}
packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
Expand All @@ -59,23 +58,22 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation 'androidx.compose.material:material:1.0.5'
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation 'androidx.navigation:navigation-compose:2.4.0-alpha04'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation 'androidx.compose.runtime:runtime-livedata:1.0.5'
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha03'
implementation 'androidx.camera:camera-core:1.0.1'
implementation 'androidx.camera:camera-lifecycle:1.0.1'
implementation 'androidx.camera:camera-view:1.0.0-alpha28'
implementation 'androidx.camera:camera-camera2:1.0.1'
implementation 'androidx.camera:camera-core:1.0.2'
implementation 'androidx.camera:camera-lifecycle:1.0.2'
implementation 'androidx.camera:camera-view:1.0.0-alpha30'
implementation 'androidx.camera:camera-camera2:1.0.2'
implementation 'com.google.mlkit:barcode-scanning:17.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.ParitySigner.NoActionBar">
android:theme="@style/Theme.ParitySigner.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Binary file removed android/app/src/main/assets/Database/blobs/268232
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268248
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268264
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268280
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268296
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268312
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/268328
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511854
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511870
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511886
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511902
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511918
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511934
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511950
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511966
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/blobs/511982
Binary file not shown.
Binary file removed android/app/src/main/assets/Database/db
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e5dd21d

Please sign in to comment.