Coder Social home page Coder Social logo

trezor-android's Introduction

trezor-android

Build Status gitter

Trezor Communication Library for Android

Trezor Manager app is now obsolete!

Using the library

You can add the library via jitpack. Add to jitpack as a repository:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
        ...
    }
}

Then you can add the dependency like this:

dependencies {
    compile 'com.github.trezor.trezor-android:trezor-lib:<current_version>'
    ...
}

You can see what to best use for <current_version> in the jitpack badge on the top.

Please consider using gradle witness to improve security.

Requirements

Trezor has to be connected to Android by OTG cable. The Android device needs to support such connections.

trezor-android's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trezor-android's Issues

Add EthereumSignMessage

I would like to use message signing in the app, but it seems like it is not yet supported by the android sdk.

Does not work with TREZOR 1 anymore

While investigating walleth/walleth#255 - I noticed that even the stock TREZOR manager does not work with TREZOR 1 anymore - Model T works

PS: I do not run the latest firmware 1.6.1 on the TREZOR one - perhaps this is part of the problem - but I also currently do not want to update in case this has anything to do with the errors

New logo/icon proposal

Good day sir. I am a graphic designer and i am interested in designing a logo for your good project. I will be doing it as a gift for free. I just need your permission first before I begin my design. Hoping for your positive feedback. Thanks

Can't perform ETH transaction on Android / blank screen on trezor device (model T)

Hi team
I'm trying to perform an ETH transaction using a trezor model T and getting a blank screen on the trezor when trying to sign a transaction, am I passing the params correctly? Previously the trezor would return "failed safety check" however since manually converting the to address to a byte[] (see the initial for loop) the device screen is just blank....

                String toMinusZerox = to.substring(2, to.length());

                int len = toMinusZerox.length();
                byte[] data = new byte[len / 2];
                for (int i = 0; i < len; i += 2) {
                    data[i / 2] = (byte) ((Character.digit(toMinusZerox.charAt(i), 16) << 4)
                            + Character.digit(toMinusZerox.charAt(i+1), 16));
                }


                BigDecimal weiValue = Convert.toWei(amount, Convert.Unit.ETHER);
                ByteString toByteString = ByteString.copyFrom(data);
                ByteString weiValueByteString = ByteString.copyFrom(weiValue.toBigInteger().toByteArray());
                ByteString gasPriceByteString = ByteString.copyFrom(GAS_PRICE.toByteArray());  //BigInteger.valueOf(2500)
                ByteString gasLimitByteString = ByteString.copyFrom(GAS_LIMIT.toByteArray());  //BigInteger.valueOf(21000)
                ByteString noOnceByteString = ByteString.copyFrom(noOnce.toByteArray());

                TrezorMessage.EthereumSignTx.Builder builder = TrezorMessage.EthereumSignTx.newBuilder();
                builder.clear();


                TrezorMessage.EthereumSignTx ethReq2 = builder
                        .setTo(toByteString)
                        .setValue(weiValueByteString)
                        .setGasLimit(gasLimitByteString)
                        .setGasPrice(gasPriceByteString)
                        .setNonce(noOnceByteString)
                        .setChainId(4) //rinkerby
                        .setDataInitialChunk(ByteString.EMPTY)
                        .setDataLength(0)
                        .setTxType(1)
                        .build();

                Message result = trezorDevice.sendMessage(ethReq2);

                new android.support.v7.app.AlertDialog.Builder(this).setTitle("Success")
                        .setMessage(result.toByteString().toStringUtf8().concat(" something concat-ed"))
                        .create()
                        .show();```

Wrong firmware header when trying to install firmware onto Trezor One

It happens only with Trezor One, no issues with Trezor T.

Steps to reproduce:

  1. Plug in the device with no firmware installed
  2. Click on INSTALL FIRMWARE in the app
  3. It seems like the installation process is starting - "Preparing" is displayed on device
  4. The process results with a "Wrong firmware header" error

2019-09-13 17 43 18

Add to FDroid

can be assigned to me - will make the PR for FDroid

error

I downloaded the latest version trezor-android,But still can`t build.
error

Protocol buffers not released

Without the protocol buffer source, it's not really possible to do pretty much anything without this library.

I started copy&pasting this library into my own test project (because this project doesn't work at all in Android Studio and it's not really anything you can import as a java lib), and it's not even possible to fetch keys from testnet, only a numeric counter of keys.

I'd like to extend this a little bit, but with generated classes only, it's pretty much impossible

Set u2f counter after recovery

Set U2F counter after recovery.

This is how I do it in mytrezor in beta

setU2FCounter(session: TrezorJsSession): Promise<any> {
    if (this.supports('u2f')) {
        const timestamp: number = Math.floor(Date.now() / 1000);
        return session.setU2FCounter(timestamp);
    } else {
        return Promise.resolve();
    }                                                                                                          
}

setU2FCounter calls the message SetU2FCounter.

App gets into inconsistent state

App gets into inconsistent state with these steps:

  1. start app, connect device
  2. turn passphrase on (or off, if it's on)
  3. disconnect the device
  4. the device is still showing up as connected, even when it's connected
  5. clicking on any action shows up "loading" animation, which never stops

Interestingly, there is no way to stop this animation. Even when I uninstall and re-install the app (!!!), the loading is still showing. The only way to stop it is to reboot the phone.

Similar way to get to the same state (doesn't work 100% always) is:

  1. start app, connect device
  2. exit from the app by tapping "home" button
  3. disconnect device (without the app on screen)
  4. go back to the app, the device is showing as connected
  5. clicking on any action shows up "loading" animation, which never stops

My phone is Lenovo P70. I couldn't reproduce the bug on a different Samsung phone. But the first sequence of steps always reproduces the error on my Lenovo.

Trezor is working fine with MyCelium on the same phone, but I haven't tested it as thoroughly as this app.

option to create wallet with 256 bits master key, and SLIP39

It seems with Trezor Manager I can only create a wallet with just 12 words, so 128 bits master key.
Not adequate for a long term HODL.

Ideally I want to be able to choose the master key size myself (between 128 and 256), and I'd also want to be able to create a SLIP39 setup from the Android app.

Solve backward compatibility problems

currently as far as I see it is hard to be backward compatible (e.g. caused by trezor/trezor-firmware#136 - but it seems there where also other changes)

So should the library only target one version of the TREZOR? I guess some people hesitate updating their TREZOR and there are old versions around. Wonder if satoshi labs has some analytics/insights on what versions people use?

Anyone has ideas on how to work around this? Would really love the library to be compatible with as much TREZOR versions as possible - but all solutions I can currently imagine to achieve this look are ugly and come with drawbacks.

gradle sync failed

I download the latest version from github, then open project with android studio 3.2.1, occure error at during rebuild project.
error log: No dependency for integrity assertion 'com.android.tools.analytics-library:protos:26.1.2:protos-26.1.2.jar:52672a0b42b572a06aecc3535d5068eb46c0e15d129b9f1085d3c16a1da5cdbb'

Do I have to install anything else, please guide me, many thanks

[REQ] Please publish version Trezor Manager v2.1.1 to the play store (or to releases)

Looks like there are some major changes to how the bootloader does flashing since the last release of this app. Trezors with current bootloaders cannot perform flash operations:

Steps to reproduce:

  1. On a PC perform trezorctl firmware-update
  2. On a PC perform trezorctl wipe-device --bootloader
  3. On Android launch Trezor Manager v2.10.0
  4. Connect Trezor to Android and attempt to flash firmware

Observe failure.

Add some Ethereum logos for homescreen

Currently you have a lot of Options for using the Bitcoin-Logo on the HomeScreen.
I would like to see some options with the Ethereum logo here - as I rarely use Bitcoin lately and will use the TREZOR mainly in the Ethereum context ;-)
I think at some point there will be more users using TREZOR in combination with Ethereum than with Bitcoin..

Cannot resolve symbol 'TrezorMessage'

I complie project Ok, but in MainActivity.java file occure Cannot reslove symbol 'TrezorMessage', what should I do, help me , many Thanks

my build.gradle file
buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath files('libs/gradle-witness.jar')
}

}

allprojects {
repositories {
google()
jcenter()
}

project.ext {
    support_version = "27.0.2"
    sdk = 27
    minsdk = 15
}

}

task clean(type: Delete) {
delete rootProject.buildDir
}

Maven repository

Can you please publish both snapshots and releases on Maven repository?
Either create Maven repository in branch here on Github or publish into Maven Central.

TREZOR Manager steals the session from Mycelium?

I can't use Mycelium with TREZOR since I installed TREZOR Manager app.

When I connect TREZOR to my phone, TREZOR Manager asks: "Open TREZOR Manager when this USB device is connected?". If I press OK, it opens the manager app. If I press Cancel, nothing happens.

In any case, when I run Mycelium, it doesn't ask me if I want to use the USB device in Mycelium and I can't force Mycelium to "search" for it in any way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.