Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gary-rowe/hid4java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: develop
Choose a base ref
...
head repository: Multibit-Legacy/hid4java-bob
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 7 commits
  • 2 files changed
  • 3 contributors

Commits on Jul 8, 2016

  1. Reverted dropReportIdZero hack.

    The hack was never necessary, but just worked around a bug in the
    Trezor/Keepkey implementation of the hardware wallet.  It caused
    other problems later, see #13 and #36.
    jhoenicke committed Jul 8, 2016
    Copy the full SHA
    32546e4 View commit details

Commits on Sep 22, 2016

  1. Merge pull request #1 from jhoenicke/develop

    Reverted dropReportIdZero hack.
    kliyer authored Sep 22, 2016
    Copy the full SHA
    31b0a71 View commit details
  2. Changes to the pom to support this fork.

    keepkey-builder committed Sep 22, 2016
    Copy the full SHA
    988763b View commit details
  3. [maven-release-plugin] prepare release 0.4.0-bob-0.1.0

    keepkey-builder committed Sep 22, 2016
    Copy the full SHA
    2dd0d14 View commit details
  4. Copy the full SHA
    add3dab View commit details
  5. [maven-release-plugin] prepare release 0.4.0-bob-0.1.0

    keepkey-builder committed Sep 22, 2016
    Copy the full SHA
    cdf59dd View commit details
  6. [maven-release-plugin] prepare for next development iteration

    keepkey-builder committed Sep 22, 2016
    Copy the full SHA
    56fe021 View commit details
Showing with 75 additions and 49 deletions.
  1. +70 −14 pom.xml
  2. +5 −35 src/main/java/org/hid4java/jna/HidApi.java
84 changes: 70 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -3,18 +3,18 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.hid4java</groupId>
<artifactId>hid4java</artifactId>
<artifactId>hid4java-bob</artifactId>
<version>develop-SNAPSHOT</version>

<name>hid4java</name>
<description>A cross-platform Java Native Access (JNA) wrapper for the signal11/hidapi library</description>
<name>hid4java-bob</name>
<description>A fork of the hid4java project (https://github.com/gary-rowe/hid4java)</description>

<url>http://github.com/gary-rowe/hid4java</url>
<url>http://github.com/keepkey/hid4java-bob</url>
<inceptionYear>2014</inceptionYear>

<organization>
<name>Bitcoin Solutions Ltd</name>
<url>http://bitcoin-solutions.co.uk</url>
<name>KeepKey</name>
<url>https://www.keepkey.com/</url>
</organization>

<developers>
@@ -26,6 +26,15 @@
<name>Jim Burton</name>
<email>jim.burton@bitcoin-solutions.co.uk</email>
</developer>
<developer>
<name>Kenneth Heutmaker</name>
<email>ken@keepkey.com</email>
</developer>
<developer>
<name>Kartik Iyer</name>
<email>kartik@keepkey.com</email>
</developer>

</developers>

<licenses>
@@ -39,9 +48,28 @@

<issueManagement>
<system>GitHub</system>
<url>https://github.com/gary-rowe/hid4java/issues</url>
<url>http://github.com/keepkey/hid4java-bob/issues</url>
</issueManagement>

<repositories>
<!-- Define the MultiBit staging repository for releases and snapshots -->
<!-- Use https://raw.github.com to provide a consistent result -->
<repository>
<id>mbhd-maven-release</id>
<url>https://raw.github.com/keepkey/mbhd-maven/master/releases</url>
<releases />
</repository>
<repository>
<id>mbhd-maven-snapshot</id>
<url>https://raw.github.com/keepkey/mbhd-maven/master/snapshots</url>
<!-- These artifacts change frequently during development iterations -->
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<!--
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
@@ -55,11 +83,12 @@
</repository>
<downloadUrl>https://oss.sonatype.org/content/groups/public/org/hid4java</downloadUrl>
</distributionManagement>
-->

<scm>
<connection>scm:git:git@github.com:gary-rowe/hid4java.git</connection>
<developerConnection>scm:git:git@github.com:gary-rowe/hid4java.git</developerConnection>
<url>git@github.com:gary-rowe/hid4java.git</url>
<connection>scm:git:git@github.com:keepkey/hid4java-bob.git</connection>
<developerConnection>scm:git:git@github.com:keepkey/hid4java-bob.git</developerConnection>
<url>git@github.com:keepkey/hid4java-bob.git</url>
<tag>HEAD</tag>
</scm>

@@ -84,21 +113,48 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<homedir>${gpg.homedir}</homedir>
<defaultKeyring>false</defaultKeyring>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<gpg.homedir>/Volumes/GPG/.gnupg</gpg.homedir>
</properties>
</profile>

</profiles>

<build>
@@ -132,7 +188,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -147,7 +203,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<mavenExecutorId>forked-path</mavenExecutorId>
40 changes: 5 additions & 35 deletions src/main/java/org/hid4java/jna/HidApi.java
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@

package org.hid4java.jna;

import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.WString;

@@ -72,23 +71,6 @@ public class HidApi {
*/
public static boolean dropReportIdZero = false;

static {

// Determine a suitable starting value for the drop report ID flag
// so that downstream code can expect the same behaviour as in earlier
// versions by default, with a bug fix for Windows 7
if (Platform.isWindows()) {
// Report ID 0x00 problems have been seen on Windows 8, 10 only so far
String osVersion = System.getProperty("os.version");
if ("6.2".equals(osVersion) ||
"6.3".equals(osVersion)) {
// Windows 8, 10
dropReportIdZero = true;
}
}

}

/**
* <p>Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number</p>
*
@@ -422,23 +404,11 @@ public static int write(HidDeviceStructure device, byte[] data, int len, byte re

final WideStringBuffer report;

if (dropReportIdZero && reportId == 0) {
// Use the alternative buffer representation that does
// not include report ID 0x00
// This overcomes "The parameter is incorrect" errors on
// Windows 8 and 10
// See the commentary on the dropReportIdZero flag for more info
report = new WideStringBuffer(len);
if (len > 1) {
System.arraycopy(data, 0, report.buffer, 0, len);
}
} else {
// Put report ID into position 0 and fill out buffer
report = new WideStringBuffer(len + 1);
report.buffer[0] = reportId;
if (len > 1) {
System.arraycopy(data, 0, report.buffer, 1, len);
}
// Put report ID into position 0 and fill out buffer
report = new WideStringBuffer(len + 1);
report.buffer[0] = reportId;
if (len > 1) {
System.arraycopy(data, 0, report.buffer, 1, len);
}
return hidApiLibrary.hid_write(device.ptr(), report, report.buffer.length);