Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
94abeb4
Fix netwallet-fx mainClassName to match recent refactoring
msgilligan Oct 19, 2019
811f6ef
Bump BA JLink Plugin to 2.16.1
msgilligan Oct 20, 2019
9ee85b1
Upgrade to Gradle 6.0-rc-1 and BA Jlink 2.16.2
msgilligan Oct 20, 2019
2df70e2
Bump BA Jlink Plugin to 2.16.2
msgilligan Oct 20, 2019
f57bd97
Merge pull request #6 from ConsensusJ/msgilligan-gradle-6
msgilligan Oct 20, 2019
7f801d5
Github Actions: Add JDK 13 to the matrix
msgilligan Oct 20, 2019
cf76cd5
Github Actions: Remove JDK 12 build now that 13 works
msgilligan Oct 20, 2019
28ca5ca
Rough cut of QrSigningView/Controller
msgilligan Oct 21, 2019
6c95da4
Bump to JavaFX 13.0.1
msgilligan Oct 22, 2019
bfaa169
Bump SLF4J to 1.7.28
msgilligan Oct 22, 2019
5082930
Global JavaFX version string in gradle.properties
msgilligan Oct 22, 2019
e7ab972
Bump BA Jlink to 2.16.2 in omnij-wallet
msgilligan Oct 22, 2019
001e9e2
Improve appearance of QR Signing View
msgilligan Oct 23, 2019
1b26790
More FXML layout tweaks, minor code cleanup.
msgilligan Oct 23, 2019
028292d
Prepare 0.1.5 Release
msgilligan Oct 23, 2019
1d1532c
Update release process document
msgilligan Oct 23, 2019
afc12cc
Start work on 0.1.6-SNAPSHOT
msgilligan Oct 23, 2019
5338f1e
WIP Signing Wallet
msgilligan Oct 27, 2019
c7182e7
Workaround for Windows jpackage build not working
msgilligan Oct 27, 2019
c7327fe
Remove unused Guava dependency from airgap lib
msgilligan Oct 27, 2019
4f714dd
Run unit tests in airgaplib on class path
msgilligan Oct 27, 2019
5b5e50e
Use Gradle Java Modules Plugin 1.6.0 in airgaplib
msgilligan Oct 27, 2019
b41ade2
Fix bugs, reduce assumptions of address type, etc.
msgilligan Oct 27, 2019
14f47cf
Cleanup/refactor Signing Wallet
msgilligan Oct 28, 2019
9355553
Move airgapfx + signwalletfx back to JDK 9
msgilligan Oct 28, 2019
4dc951e
Release 0.1.6 published to Bintray
msgilligan Oct 29, 2019
1ecf111
0.1.7 release — airgaplib is now JDK 8 compatible
msgilligan Oct 29, 2019
5aaae46
Github Actions: “download.jpackage” fix for Windows build
msgilligan Oct 29, 2019
8b5f4e8
Bump to Gradle 6.0-rc-2
msgilligan Nov 3, 2019
2319589
Bump Jackson to version 2.9.10
msgilligan Nov 4, 2019
fef9d76
Upgrade to Gradle 6.0 RC3
msgilligan Nov 5, 2019
a43f0cb
Improve jpackage build script functionality
msgilligan Nov 14, 2019
be40d50
Further downloadJPackage cleanup
msgilligan Nov 14, 2019
8e44fd5
Update Groovy to 2.5.9 and SLF4J to 1.7.30
msgilligan Jan 17, 2020
c30eb74
Upgrade to Gradle 6.1.1
msgilligan Jan 31, 2020
0a9a864
Upgrade jpackage tool to JDK 14 EA 34
msgilligan Jan 31, 2020
7dad9cf
Upgrade to JavaFX 13.0.2
msgilligan Feb 3, 2020
5ef2ddd
Minor build cleanup
msgilligan Feb 3, 2020
7fa01d9
buildJpackages target, macOS code signing support
msgilligan Feb 7, 2020
9088dbf
Upgrade to Gradle 6.2
msgilligan Feb 17, 2020
b7e2cca
Use a boolean signJPackageImages in rootProject.ext
msgilligan Feb 17, 2020
38a0ded
Update SupernautFX to 0.0.5 & Micronaut to 1.3.1
msgilligan Feb 18, 2020
aa47ee4
Gitlab CI: Upgrade OpenJDK to 13
msgilligan Mar 9, 2020
b97f039
Gitlab CI: Update artifact paths
msgilligan Mar 9, 2020
7208e1d
Bump airgaplib back to Java 9 with module-info
msgilligan Mar 11, 2020
27047d4
Dependency upgrades, JavaFX 14, Supernaut 0.0.6, etc
msgilligan Mar 11, 2020
baf5faf
Upgrade to Gradle 6.3 (release version)
msgilligan Mar 25, 2020
5d51f33
Github Actions: Build with JDK 11 & 14
msgilligan Mar 25, 2020
752eee0
More concise BipStandardKeyChainGroupStructure
msgilligan Apr 21, 2020
48cb3df
Github Actions: Verify Wrapper, rename workflow
msgilligan Apr 27, 2020
6a4aabc
Upgrade to BA JLink 2.17.3
msgilligan Aug 7, 2020
291f668
Fix Gradle deprecation (testCompile -> testImplementation)
msgilligan Aug 7, 2020
8baef98
Update to JavaFX Plugin 0.0.9-SNAPSHOT & Module Plugin 1.6.0
msgilligan Oct 22, 2019
fa81d27
Upgrade GitLab Build to AdoptOpenJDK 14
msgilligan Aug 7, 2020
362c8a8
Bump JavaFX to JavaFX 15
msgilligan Sep 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: Gradle Build

on: [push, pull_request]

Expand All @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
java: [ '11', '12' ]
java: [ '11', '14' ]
fail-fast: false
name: ${{ matrix.os }} JDK ${{ matrix.java }}
steps:
Expand All @@ -17,8 +17,10 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
run: ./gradlew -Ddownload.jpackage=true buildCI consensusj-netwallet-fx:jpackage --info --stacktrace
run: ./gradlew -D"download.jpackage"=true buildCI consensusj-netwallet-fx:jpackage --info --stacktrace
- name: Upload jpackage directory as artifact
uses: actions/upload-artifact@master
with:
Expand Down
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ variables:
before_script:
- apt-get update
- apt-get -y upgrade
- apt-get -y install openjdk-11-jdk curl rpm fakeroot wget gnupg2 software-properties-common
# Install AdoptOpenJDK 12 following instructions from here: https://adoptopenjdk.net/installation.html
- apt-get -y install openjdk-11-jdk binutils curl rpm fakeroot wget gnupg2 software-properties-common
# Install AdoptOpenJDK 14
- wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
- add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
- apt-get -y install adoptopenjdk-12-hotspot
- apt-get -y install adoptopenjdk-14-hotspot

build:
script:
Expand All @@ -19,8 +19,8 @@ build:
- ./gradlew -Ddownload.jpackage=true buildCI consensusj-netwallet-fx:jpackage --stacktrace
artifacts:
paths:
- airgapfx-wallet/build/jpackage
- airgapfx-wallet/build/libs
- consensusj-netwallet-fx/build/jpackage
- consensusj-signwallet-fx/build/jpackage

# Note: You can test changes to this file locally with:
# gitlab-runner exec docker --docker-privileged build
31 changes: 31 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@

A high-level view of the changes in each wallet-framework binary release.

== v0.1.8-SNAPSHOT

Released: Not yet

* Upgrade to Gradle 6.3

== v0.1.7

Released: 2019.10.28

* `airgaplib` now is JDK 8+ with automatic module name

== v0.1.6

Released: 2019.10.28

* Libraries published to Bintray
* Other changes, to be documented

== v0.1.5

Released: 2019.10.23

* Put Unsigned Transaction QR and QR Scanner window in same pop-up view
* Transaction list view is now populated with (minimal) transaction information
* `airgapfx-wallet` subproject is now `consensusj-netwallet-fx`
* Airgap Wallet rebranded with ConsensusJ name and logo
* Update Gradle to 6.0-rc-1 (so we can build with JDK 13)
* Several dependency updates
* Support for CI builds with Github Actions

== v0.1.4

Released: 2019.08.20
Expand Down
7 changes: 5 additions & 2 deletions airgapfx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ plugins {
id 'java-library'
id 'maven'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'org.javamodularity.moduleplugin' version "1.5.0"
id 'org.openjfx.javafxplugin' version '0.0.9'
}

sourceCompatibility = 9
targetCompatibility = 9

dependencies {
implementation project(':airgaplib')

Expand All @@ -26,6 +28,7 @@ dependencies {
}

javafx {
version = javaFxVersion
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing' ]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.util.function.Consumer;

Expand All @@ -57,7 +58,7 @@ public CameraService(Webcam camera, WebcamResolution resolution) {
camera.setViewSize(resolution.getSize());
if (logViewSizes) {
log.info("Camera supports the following sizes:");
for (var size : camera.getViewSizes()) {
for (Dimension size : camera.getViewSizes()) {
log.info(size.toString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Window;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -37,7 +36,8 @@
*/
public class QrCaptureView extends BorderPane {
private static final Logger log = LoggerFactory.getLogger(QrCaptureView.class);
private final Consumer<String> listener;
private final Consumer<String> scanListener;
private final Consumer<Object> closeListener;
private final CameraView cameraView;
private final CameraService service;
private TextArea previewText;
Expand All @@ -46,11 +46,19 @@ public class QrCaptureView extends BorderPane {
private Button acceptButton;

private String previewResult;

public QrCaptureView(CameraService cameraService, Consumer<String> listener) {

/**
* JavaFX View with UI for a WebCam-based QR Code Scanner
*
* @param cameraService QR Code Capturing Camera Service
* @param scanListener Listener called when QR code is accepted (accept button)
* @param closeListener Listener called when view is closed (cancel or accept button)
*/
public QrCaptureView(CameraService cameraService, Consumer<String> scanListener, Consumer<Object> closeListener) {
service = cameraService;
cameraView = new CameraView(cameraService);
this.listener = listener;
this.scanListener = scanListener;
this.closeListener = closeListener;

setCenter(cameraView);

Expand Down Expand Up @@ -94,15 +102,12 @@ private HBox buttonBox() {
}

private void acceptAction(ActionEvent actionEvent) {
listener.accept(previewResult);
closeParentWindow();
scanListener.accept(previewResult);
closeParent();
}

private void cancelAction(ActionEvent actionEvent) {
if (service.isRunning()) {
service.cancel();
}
closeParentWindow();
closeParent();
}

private void rescanAction(ActionEvent e) {
Expand Down Expand Up @@ -131,11 +136,15 @@ private void scan() {
rescanButton.setDisable(true);
}

private void closeParentWindow() {
Window stage = this.getScene().getWindow();
if (stage != null) {
stage.hide();
private void stopCameraService() {
if (service.isRunning()) {
service.cancel();
}
}

private void closeParent() {
stopCameraService();
closeListener.accept(null);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class DemoQRScannerApplication extends Application {
private static final Logger log = LoggerFactory.getLogger(DemoQRScannerApplication.class);

private CameraService cameraService;
private Stage primaryStage;

@Override
public void init() {
Expand All @@ -42,7 +43,8 @@ public void init() {

@Override
public void start(Stage primaryStage) {
QrCaptureView captureView = new QrCaptureView(cameraService, this::scanListener);
this.primaryStage = primaryStage;
QrCaptureView captureView = new QrCaptureView(cameraService, this::scanListener, this::closeListener);

Scene scene = new Scene(captureView);
primaryStage.setScene(scene);
Expand All @@ -53,6 +55,11 @@ private void scanListener(String result) {
System.out.println("Result: " + result);
}

private void closeListener(Object result) {
if (primaryStage != null) {
primaryStage.hide();
}
}

public static void main(String[] args) {
launch(args);
Expand Down

This file was deleted.

28 changes: 16 additions & 12 deletions airgaplib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
plugins {
id 'java'
id 'groovy'
id 'java-library'
id 'groovy'
id 'maven'
id 'eclipse'
id 'org.javamodularity.moduleplugin' version "1.5.0"
id 'org.javamodularity.moduleplugin' version "1.7.0"
}

def jacksonVersion = '2.9.8'

/*
* TODO: This module should really be JDK 8 compatible, perhaps a multi-release jar
* Currently the only feature we're using that requires 9 is the module header
/**
* Java 9 compatibility (We may switch back to Java 8 for use on Android)
*/
sourceCompatibility = 9
targetCompatibility = 9

dependencies {
api "${bitcoinjGroup}:${bitcoinjArtifact}:${bitcoinjVersion}"

implementation 'com.google.guava:guava:27.1-android'


implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"

implementation "org.slf4j:slf4j-api:${slf4jVersion}"

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'com.msgilligan:bitcoinj-dsl:0.4.0'
testCompile 'com.msgilligan:bitcoinj-dsl:0.5.0'
}

ext.moduleName = 'org.consensusj.airgap'

jar {
inputs.property('moduleName', moduleName)
manifest {
attributes 'Automatic-Module-Name': moduleName,
'Implementation-Version': archiveVersion
}
}
8 changes: 3 additions & 5 deletions airgaplib/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/**
*
* Java Platform Module System dependencies and exports for airgaplib.
* Note: We may backport this library to Java 8 and eliminate this file.
*/
module org.consensusj.airgap {
requires org.bitcoinj.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.core;
requires jackson.annotations;
requires org.slf4j;

requires com.google.common;


exports org.consensusj.airgap;
exports org.consensusj.airgap.json;
exports org.consensusj.airgap.keychain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.LegacyAddress;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Sha256Hash;
import org.bitcoinj.core.Transaction;
Expand Down Expand Up @@ -98,6 +97,18 @@ public TransactionSignatureResponse signatureResponseFromSigningRequest(Transact
return response;
}

/**
* Create a signature response Json string (without display or confirmation) for a signing request Json string
*
* @param requestJsonString Request Json string
* @return Signed response Json string
*/
public String signatureResponseFromSigningRequestJson(String requestJsonString) {
TransactionSigningRequest request = parseSigningRequestJson(requestJsonString);
TransactionSignatureResponse response = signatureResponseFromSigningRequest(request);
return serializeResponse(response);
}

/**
* Create an {@code InputSignature} for transaction input
*
Expand Down Expand Up @@ -139,10 +150,12 @@ public Transaction signTransaction(TransactionSigningRequest request) {
TransactionOutPoint outPoint = new TransactionOutPoint(netParams,
input.getIndex(),
Sha256Hash.wrap(input.getTxHash()));
Address fromAddr = LegacyAddress.fromBase58(netParams, input.getSender());
Address fromAddr = Address.fromString(netParams, input.getSender());
DeterministicKey fromKey = keyChain.findKeyFromPubHash(fromAddr.getHash());
tx.addSignedInput(outPoint, ScriptBuilder.createOutputScript(fromAddr), fromKey);
}
return tx;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.bitcoinj.script.Script;
import org.bitcoinj.wallet.KeyChainGroupStructure;

import java.util.Collections;

/**
* KeyChainGroupStructure that supports BIP44, etc. This should be part of bitcoinj.
*/
Expand All @@ -25,8 +23,8 @@ public class BipStandardKeyChainGroupStructure implements KeyChainGroupStructure
public static ChildNumber CHANGE_RECEIVING = new ChildNumber(0, false);
public static ChildNumber CHANGE_CHANGE = new ChildNumber(1, false);

private static final HDPath BIP44_PARENT = new HDPath(true, Collections.singletonList(PURPOSE_BIP44));
private static final HDPath BIP84_PARENT = new HDPath(true, Collections.singletonList(PURPOSE_BIP84));
private static final HDPath BIP44_PARENT = HDPath.m(PURPOSE_BIP44);
private static final HDPath BIP84_PARENT = HDPath.m(PURPOSE_BIP84);

public BipStandardKeyChainGroupStructure(NetworkParameters networkParameters) {
if (networkParameters.getId().equals(NetworkParameters.ID_MAINNET)) {
Expand Down
Loading