Giter Club home page Giter Club logo

ethdroid's Introduction

Ethdroid : Easy-to-use Ethereum Geth wrapper for Android

⚠️ This project isn't maintained anymore, this is why it is read-only.
If you are interested to work on it, feel free to contact us at 
[email protected], we will be happy to help you.

Build Status Coverity Status

Why using Ethdroid

If you think that smartphone is future of blockchain, Ethdroid is here to help you building amazing decentralized smartphone apps.

This project was born as soon as the Geth community built the first android archive. Our needs was to allow an Android App communicate with an inproc Geth node.

Thanks to our hard work, we've reached our goals and built 3 differents use-cases of decentralized smartphone apps :

  • decentralized car sharing
  • voting through blockchain
  • location of peoples all arround the world

Contact us for more informations on our works.

With Ethereum-android it becomes easier to :

  • instanciate an Ethereum go-ethereum inproc node,
  • manage accounts,
  • get nodes information,
  • send Ether
  • and also call smart-contracts.

Futhermore Rx-java 1 and its extensions simplify control of asynchronous flows and background processes.

This package can be used on Android 22+ and with Geth 1.6.2+.

Download Ethdroid and set Geth version

Ethdroid and Geth stable versions are distribued throught jCenter.

Because Geth project evolves independently of Ethdroid library. That's why you are free to set the latest compatible Geth version as dependency.

repositories {
    jCenter()
}
dependencies {
    compile 'io.ethmobile:ethdroid:2.0.0-m2'
    compile 'org.ethereum:geth:1.6.5'
}

For current develop version of Ethdroid, you can download via :

repositories {
    jCenter()
    maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
}
dependencies {
    compile 'io.ethmobile:ethdroid:2.0.0-m3-SNAPSHOT'
    compile 'org.ethereum:geth:1.6.5'
}

Getting Started

Start a Geth node

With Ethdroid you can easly connect a smartphone to an Ethereum blockchain.

You can connect to :

  • Main network
  • test network
  • private network

Thanks to the Ethdroid.Builder class, you can customize your node.

First of all, to create a Builder you have to provide the directory path where blockchain data files will be saved.

Then, provide the chain configuration, or use the default ones.

Optionally, reference a Key Manager if you have already built it. It's mandatory in order to use account related node functions, but you can reference it later.

Optionally, reference a Go Context to use as default when making calls to node (See golang doc). Default is backgroundContext.

Finally, build to get the node reference and start communication with it.

on main network

new EthDroid.Builder(datadir)  //Whatever directory path where blockchain files must be saved.
    .onMainnet()
    .build()
    .start();

on test network

new EthDroid.Builder(datadir)  //Whatever directory path where blockchain files must be saved.
    .onTestnet()
    .build()
    .start();

on private network

Private network is a little bit trickier because you have to provide more information.

  • the genesis : String (standard genesis json file)
  • the network id : long (you can find it in your genesis)
  • peer node url : String (at least one. It can be a bootnode or any other node of the private network. Format is : "enode://${id}@${ip}:${port}?discport:${port}+1)

You can find an example at EthdroidBuilderTest

EthDroid ethdroid = EthDroid.Builder(datadir) //Whatever directory path where blockchain files must be saved.
    .withChainConfig(new ChainConfig.Builder(networkID, genesis, bootnode).build())
    .build()
    .start();

Accounts management

//TODO

Send Ether

//TODO

Interact with a smart-contract

Instanciate the smart-contract interface

From the following Solidity smart-contract source code:

    contract ContractExample {

        event e(bool);
        event multipleEvent(bool,bool,bool);

        void foo(){
            [...]
        }

        uint bar(int a){
            [...]
        }
        
        event eventOutputMatrix(int[3][3]){
            [...]
        }
        
        function functionOutputMatrix() returns(uint8[2][8]){
            [...]
        }
        
        function functionInputMatrix(uint8[3]){
            [...]
        }
        
        function functionOutputMultiple() returns(bool,uint8[2][3]){
            [...]
        }
    }    
  1. Create the related Java interface :
    interface ContractExample extends ContractType{
       
       SolidityEvent<SBool> e();
       
       SolidityEvent3<SBool,SBool,SBool> multipleEvent();
          
       SolidityFunction foo();
       
       SolidityFunction bar(SInt.SInt256 a);
     
  
       @SolidityElement.ReturnParameters({@SArray.Size({3,3})}) 
       SolidityEvent<SArray<SArray<SInt.SInt256>>> eventOutputMatrix();
       
       @SolidityElement.ReturnParameters({@SArray.Size({2,8})})
       SolidityFunction<SArray<SArray<SUInt.SUInt8>>> functionOutputMatrix();
      
       SolidityFunction functionInputMatrix(@SArray.Size({3}) SArray<SUInt.SUInt8> a);
       
       @SolidityElement.ReturnParameters({@SArray.Size(),@SArray.Size({2,3})})
       SolidityFunction2<SBool,SArray<SArray<SUInt.SUInt8>>> functionOutputMultiple();
       
    }

When an input/output parameter of a function/event is an array, you have to specify its size with the annotation : @SArray.Size.

Its parameter is an array of integers like @SArray.Size{2,3,4} (its equivalent to an array of a size type[2][3][4])

When your function/event returns an array, to specify its length you have to use the annotation @SolidityElement.ReturnParameters({}) which takes an array of @SArray.Size annotations as value.

When your function returns multiple types, you have to specify the related SolidityFunction. For exemple, if your function returns 2 booleans you must use return SolidityFunction2<SBool,SBool>

Table of multiple return type elements and their related wrapper :

Number of Returns Function Event Output
0 SolidityFunction SolidityEvent SType
1 SolidityFunction<T> SolidityEvent<T> SingleReturn<T>
2 SolidityFunction2<T1,T2> SolidityEvent2<T1,T2> PairReturn<T1,T2>
3 SolidityFunction3<T1,T2,T3> SolidityEvent3<T1,T2,T3> TripleReturn<T1,T2,T3>
  1. Instanciate the smart-contract available on the blockchain at the given address

    //TODO

Make a local then reverted call to a smart-contract function

    PairReturn<SBool,SArray<SArray<SUInt.SUInt8>>> result = contract.functionOutputMultiple().call();
    
    SBool resultSBool = result.getElement1();
    
    SArray<SArray<SUInt.SUInt8>> resultMatrix = result.getElement2();

Make a persistent call to a smart-contract function and be notified when it's mined

//TODO

Listen to smart-contract events

From Android app, subscribe to Solidity events in a background process and be notified in main thread to update the view.

    contract.e.listen()
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(booleanAnswer -> doWhenEventTriggered());
    
    /*
        doWhenEventTriggered is a local method called when event is triggered by the deployed smart-contract
        booleanAnswer is the parameter returned by the triggered event. 
        You can directly update your app view
    */

Project Architecture

//TODO

Contribute

//TODO

Add code style to Android Studio

  • For IntelliJ 13+ :

    1. Edit -> Macros -> Start Macro Recording
    2. Code -> Reformat Code
    3. File -> Save all
    4. Edit -> Macros -> Stop Macro Recording
    5. Name the macro (something like "formatted save")
    6. File -> Settings -> Keymap
    7. Right click on the macro. Add Keyboard Shortcut. Set the keyboard shortcut to Control + S.
    8. IntelliJ will inform you of a hotkey conflict. Select "remove" to remove other assignments.
  • For previous versions click here

Authors and contributors

  • Guillaume Nicolas
  • Damien Lecan
  • Kevin Biger
  • Alice Le Bars
  • Mickael Came

Licencing

Ethdroid is released under the MIT License (MIT), see Licence.

Ethdroid depends on libraries with different licenses:

  • Geth: LGPL-3.0
  • RxJava : Apache 2.0
  • Google Gson: Apache 2.0
  • Squareup Okio: Apache 2.0

Please respect terms and conditions of each licenses.

ethdroid's People

Contributors

alebars avatar dlecan avatar kbiger avatar mikael-came avatar nigui avatar

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

Watchers

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

ethdroid's Issues

NoSuchMethodError with rxjava and lambda

Context :

When Ethdroid catches a Solidity event and starts to decode it.

Doesn't work ( from SolidityEvent ):

Filter.newLogFilter(eth, options)
    .map(log -> {
        if (returns.size() == 0) {
            return null;
        } else {
            return SCoder.decodeParams(ByteString.of(log.getData()).hex(), returns);
        }
    });

Full error on pastebin
Zoom on error message :

Pending exception java.lang.NoSuchMethodError thrown by 'unknown throw location'
java.lang.NoSuchMethodError: No static method lambda$createFilterAndDecode$0(Lio/ethmobile/ethdroid/solidity/element/event/SolidityEvent;Lorg/ethereum/geth/Log;)[Lio/ethmobile/ethdroid/solidity/types/SType; in class Lio/ethmobile/ethdroid/solidity/element/event/SolidityEvent; or its super classes (declaration of 'io.ethmobile.ethdroid.solidity.element.event.SolidityEvent' appears in /data/app/io.ethmobile.ethdroidsample-2/split_lib_slice_9_apk.apk)
  at java.lang.Object io.ethmobile.ethdroid.solidity.element.event.SolidityEvent$$Lambda$1.call(java.lang.Object) ((null):0)
  at void rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(java.lang.Object) (OnSubscribeMap.java:69)
  at void rx.internal.operators.OperatorSubscribeOn$1$1.onNext(java.lang.Object) (OperatorSubscribeOn.java:53)
  at void io.ethmobile.ethdroid.model.Filter$LogListener.onFilterLogs(org.ethereum.geth.Log) (Filter.java:127)

Works :

Filter.newLogFilter(eth, options)
    .map(new Func1<Log, SType[]>() {
        @Override
        public SType[] call(Log log) {
            if (returns.size() == 0) {
                return null;
            } else {
                return SCoder.decodeParams(ByteString.of(log.getData()).hex(), returns);
            }
        }
     });

Verify geth dependency version at runtime

Ethdroid must verify at runtime the geth dependency version set by user, to prevent unreadable thrown exception.

  • Fork go-ethereum and add the 'GetVersion' method in mobile directory.
  • Submit a pull-request
  • Update Ethdroid dependency to latest geth version
  • Make the verification in Ethdroid

Define and adopt good practices for testing

Currently, tests don't follow good practices.

Good practices can be found in the list bellow (which can be updated with comments) :

  • Use @Before and @After as much as possible (instead of calling same methods every where)
  • Remove multiple tests in single assertion (using &&)
  • Use assertThat(...) instead of assertTrue(...)

Value configuration for smart-contract calls (local and persistant)

Currently, to call (local and persistant) a smart-contract you must do this :

contract.function(/*parameters*/).sendWithNotification();
// or
contract.function(/*parameters*/).send();
// or
contract.function(/*parameters*/).call();

Currently it's not possible to configure value attached to the call. By default value is 0 (see).

Some smart-contract functions require attached value to be valid (ones with payable in signature).

Value must be configurable for these three types of calls.

Maven: compileOnly dependencies are missing from pom.xml

Geth, configured as a "compileOnly" dependency, is missing from generated Maven pom.xml file.

It should be declared as:

    <dependency>
      <groupId>org.ethereum</groupId>
      <artifactId>geth</artifactId>
      <version>1.6.3</version>
      <scope>compile</scope>
    </dependency>

Issue probably comes from Android Maven Gradle Plugin, which configures only "compile" scope dependencies (see https://github.com/dcendents/android-maven-gradle-plugin/blob/master/src/main/java/org/gradle/api/plugins/AndroidMavenPlugin.java#L189)

Enable Verbosity setting

To modify verbosity of node logs, you have to call Geth.setVerbosity(ID_VERBOSITY).
Maybe we can integrate it direclty into the library with the use of an enum in order to document every level of verbosity.

  • verify if Geth.setVerbosity() must be called before node starts
  • add a method to call Geth.setVerbosity()
  • add an enum as input of the method
  • document the method and enum

First call on contract method throws Exception

D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: data == null
I/Choreographer: Skipped 30 frames!  The application may be doing too much work on its main thread.
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: 0
I/Choreographer: Skipped 35 frames!  The application may be doing too much work on its main thread.
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: 0
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
I/art: Background partial concurrent mark sweep GC freed 205398(7MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 18MB/31MB, paused 2.410ms total 122.833ms
D/ETHDROID_SAMPLE: 0

Logs from ethdroid-sample
When calling a smart-contract from UI, the first attempt fails.
But next attempts return the expected behaviour ( the value 0 ).

Complete README

  • Mention the project follows semantic versionning
  • Authors (all) a1d4038
  • Add use cases
  • More explanations on Dapp
  • Update architecture diagram (IPC, Geth 1.4)

Gas configuration for smart-contract calls (local and persistent)

Currently, to call (local and persistant) a smart-contract you must do this :

contract.function(/*parameters*/).sendWithNotification();
// or
contract.function(/*parameters*/).send();
// or
contract.function(/*parameters*/).call();

It's not possible to configure gas. Gas amount sent with the call is a default value

Gas amount and price must be configurable for these three types of calls.

Invalid Sender when sending transaction

When node starts already synced and before it receives new blocs, an exception is thrown by keystore.signTx saying : Invalid sender.

It's an issue related to go-ethereum implementation which can be seen here.

The fix has been merged in geth 1.6.6, but issue is still in Ethdroid.

May be the way we sign transaction is wrong.

Must be investigated.

Automatic snapshot publication from travis

We have to add a task in travis script to automate snapshots publication on oss.jfrog.

Snapshots are based on master branch.

  • Add encrypted keys into .travis.yml
  • add artifactoryPublish in .travis.yml
  • restrict artifactoryPublish to master branch
  • restrict artifactoryPublish to manual commits (not those from Gradle Release Plugin)

Fresh checkout doesn't build

After a fresh checkout of branch geth_1.6, ./gradlew build fails:

$ ./gradlew build
Configuration 'compile' in project ':ethdroid' is deprecated. Use 'implementation' instead.
Configuration 'androidTestCompile' in project ':ethdroid' is deprecated. Use 'androidTestImplementation' instead.
Configuration 'testCompile' in project ':ethdroid' is deprecated. Use 'testImplementation' instead.

FAILURE: Build failed with an exception.

* Where:
Script '/ethdroid/ethdroid/bintray.gradle' line: 34

* What went wrong:
A problem occurred evaluating script.
> /ethdroid/local.properties (No such file or directory)

It works with a local.properties file.

Ethdroid crashes with OutOfBoundsException

Ethdroid throws an OutOfBoundsException when creating an instance of Ethdroid with a referenced but empty key manager.

The reason is that, by default Ethdroid's Builder sets as main account the first account of the key manager (if referenced). But it doesn't verify if referenced key manager has accounts.

How to send ether using ethdroid

I would like to send ether from 1 account to other account using ethdroid api but I couldn't find api to do it.

Could you please tell me steps for sending ether api flow?

Adopt an exception management strategy

Lot of JNI calls throw Exceptions.
For now, management is in charge of the library user.
Maybe we can find a way to manage them for the user :

  • Throw RuntimeException for each Exception thrown ?
  • Throw Custom Exception for each Exception thrown, depending on its message.
    ex. : Exception("not enought gas") --> OutOfGasException()

Cleanup warnings

/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:10: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:11: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Context;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:12: error: package org.ethereum.geth does not exist
import org.ethereum.geth.EthereumClient;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:13: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:14: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Header;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Node;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:16: error: package org.ethereum.geth does not exist
import org.ethereum.geth.SyncProgress;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:18: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:27: error: cannot find symbol
    private Context mainContext;
            ^
  symbol:   class Context
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:28: error: cannot find symbol
    private Node node;
            ^
  symbol:   class Node
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Enodes;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.NodeConfig;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:30: error: cannot find symbol
    private EthereumClient client;
            ^
  symbol:   class EthereumClient
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:6: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Accounts;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.KeyStore;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:32: error: cannot find symbol
    private Account mainAccount;
            ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Address;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:9: error: package org.ethereum.geth does not exist
import org.ethereum.geth.BigInt;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:10: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Block;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:11: error: package org.ethereum.geth does not exist
import org.ethereum.geth.CallMsg;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:12: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Context;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:13: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:14: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.KeyStore;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:17: error: package okio does not exist
import okio.ByteString;
           ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:18: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:56: error: cannot find symbol
    public Observable<Header> newHeadFilter(){
           ^
  symbol:   class Observable
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:56: error: cannot find symbol
    public Observable<Header> newHeadFilter(){
                      ^
  symbol:   class Header
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:64: error: cannot find symbol
    public Balance getBalanceOf(Account account) throws Exception {
                                ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:167: error: cannot find symbol
    public Context getMainContext() {
           ^
  symbol:   class Context
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:170: error: cannot find symbol
    public EthereumClient getClient() {
           ^
  symbol:   class EthereumClient
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:176: error: cannot find symbol
    public Account getMainAccount() {
           ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:189: error: cannot find symbol
    private static void setMainAccount(EthDroid eth,Account mainAccount){
                                                    ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:205: error: cannot find symbol
    public void setMainAccount(Account mainAccount) {
                               ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:28: error: cannot find symbol
    NodeConfig nodeConfig;
    ^
  symbol:   class NodeConfig
  location: class ChainConfig
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:20: error: cannot find symbol
    private KeyStore keystore;
            ^
  symbol:   class KeyStore
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:33: error: cannot find symbol
    public Account newAccount(String passphrase) throws Exception {
           ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:37: error: cannot find symbol
    public Account newUnlockedAccount(String passphrase) throws Exception{
           ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:43: error: cannot find symbol
    public List<Account> getAccounts() throws Exception{
                ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:52: error: cannot find symbol
    public boolean accountExists(Account account){
                                 ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:57: error: cannot find symbol
    public boolean accountIsLocked(Account account){
                                   ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:67: error: cannot find symbol
    public void lockAccount(Account account) throws Exception {
                            ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:71: error: cannot find symbol
    public void unlockAccount(Account account,String passphrase) throws Exception{
                              ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:75: error: cannot find symbol
    public void unlockAccountDuring(Account account,String passphrase,long seconds) throws Exception {
                                    ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:79: error: cannot find symbol
    public void deleteAccount(Account account,String passphrase) throws Exception{
                              ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:83: error: cannot find symbol
    public void updateAccountPassphrase(Account account,String passphrase,String newPassphrase) throws Exception{
                                        ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:87: error: cannot find symbol
    public byte[] signString(Account account,String toSign) throws Exception{
                             ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:92: error: cannot find symbol
    public byte[] unlockAndsignString(Account account,String password,String toSign) throws Exception{
                                      ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:97: error: cannot find symbol
    public KeyStore getKeystore() {
           ^
  symbol:   class KeyStore
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:38: error: cannot find symbol
    private Address to;
            ^
  symbol:   class Address
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:39: error: cannot find symbol
    private Account from;
            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:41: error: cannot find symbol
    private BigInt value;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:42: error: cannot find symbol
    private BigInt gas;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:43: error: cannot find symbol
    private BigInt gasPrice;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:46: error: cannot find symbol
    private Context txContext;
            ^
  symbol:   class Context
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:78: error: cannot find symbol
    public Transaction to(Address account){
                          ^
  symbol:   class Address
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:86: error: cannot find symbol
    public Transaction from(Account account, String passphrase){
                            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:92: error: cannot find symbol
    public Transaction from(Account account){
                            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:98: error: cannot find symbol
    public Transaction value(BigInt value){
                             ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:105: error: cannot find symbol
    public Transaction gasAmount(BigInt gas){
                                 ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:109: error: cannot find symbol
    public Transaction gasPrice(BigInt gasPrice){
                                ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:129: error: cannot find symbol
    public Transaction context(Context context){
                               ^
  symbol:   class Context
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:145: error: package org.ethereum.geth does not exist
    public org.ethereum.geth.Transaction getRawTransaction() throws Exception {
                            ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:150: error: package org.ethereum.geth does not exist
    private org.ethereum.geth.Transaction sign() throws Exception{
                             ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:161: error: cannot find symbol
    private CallMsg toCallMessage() throws Exception{
            ^
  symbol:   class CallMsg
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:178: error: cannot find symbol
    public Hash send() throws Exception{
           ^
  symbol:   class Hash
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:184: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception{
           ^
  symbol:   class Observable
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:184: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception{
                      ^
  symbol:   class Block
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:148: error: cannot find symbol
        public Builder withMainAccount(Account mainAccount){
                                       ^
  symbol:   class Account
  location: class Builder
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:221: error: cannot find symbol
        private static Enodes listToEnodes(List<String> enodesList){
                       ^
  symbol:   class Enodes
  location: class Builder
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Transactions;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:193: error: cannot find symbol
    public static boolean transactionListContains(Transactions transactions, Hash txHash) throws Exception {
                                                  ^
  symbol:   class Transactions
  location: class Utils
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:193: error: cannot find symbol
    public static boolean transactionListContains(Transactions transactions, Hash txHash) throws Exception {
                                                                             ^
  symbol:   class Hash
  location: class Utils
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:18: error: package okio does not exist
import okio.ByteString;
           ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:19: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Address;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Addresses;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.FilterQuery;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:6: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hashes;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Topics;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:44: error: cannot find symbol
    Observable<SType[]> createFilterAndDecode() throws Exception {
    ^
  symbol:   class Observable
  location: class SolidityEvent<T>
  where T is a type-variable:
    T extends SType declared in class SolidityEvent
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:55: error: cannot find symbol
    public Observable<SingleReturn<T>> listen() throws Exception {
           ^
  symbol:   class Observable
  location: class SolidityEvent<T>
  where T is a type-variable:
    T extends SType declared in class SolidityEvent
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:17: error: cannot find symbol
    FilterQuery query;
    ^
  symbol:   class FilterQuery
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:32: error: cannot find symbol
    public FilterOptions addAddress(Address address){
                                    ^
  symbol:   class Address
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:53: error: cannot find symbol
    public FilterQuery getQuery() {
           ^
  symbol:   class FilterQuery
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:57: error: cannot find symbol
    private static Hashes fromListToHashes(List<String> list) throws Exception {
                   ^
  symbol:   class Hashes
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Block;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:16: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:25: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:72: error: cannot find symbol
    public Hash send() throws Exception {
           ^
  symbol:   class Hash
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:75: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception {
           ^
  symbol:   class Observable
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:75: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception {
                      ^
  symbol:   class Block
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/SolidityUtils.java:4: error: package com.google.gson does not exist
import com.google.gson.JsonArray;
                      ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/SolidityUtils.java:5: error: package com.google.gson does not exist
import com.google.gson.JsonObject;
100 warnings

Refactor build process

Android specs:

  • level Android 21 / 5.0

Project specs:

  • Java 8 syntax
  • Instrumented test on Android 22
  • Clear release process (based on a Gradle plugin ?)
  • Publishing:
    • Use io.ethmobile.ethdroid Maven groupId
    • Snapshots -> Jitpack
    • Release -> JCenter (through SQLI Bintray account)
    • process : build -> bintrayUpload
  • Refactor package names: com.sqli.* -> io.ethmobile.*

Consider relicensing to LGPL or GPL

Ethereum-android used to communicate with Geth through network (IPC or HTTP/RPC), so LGPL/GPL licenses of Geth were not viral.

But Ethdroid now communicates with Geth through JNI, which is known to be viral:

So Ethdroid should probably be relicensing to LGPL/GPL. This issue to check that.
@Nigui Ethdroid can't be distributed (any!) without solving this issue.

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.